mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-04 23:02:02 +01:00
add and use fragment for dicts list view
This commit is contained in:
parent
1ed9dc7c9d
commit
d26a215f34
4 changed files with 43 additions and 8 deletions
|
@ -44,11 +44,4 @@ public class DictsActivity extends XWActivity {
|
|||
m_dlgt = new DictsDelegate( this, savedInstanceState );
|
||||
super.onCreate( savedInstanceState, m_dlgt );
|
||||
} // onCreate
|
||||
|
||||
public static void start( Context context )
|
||||
{
|
||||
Intent intent = new Intent( context, DictsActivity.class );
|
||||
context.startActivity( intent );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1446,4 +1446,15 @@ public class DictsDelegate extends ListDelegateBase
|
|||
cancel( true );
|
||||
}
|
||||
} // class FetchListTask
|
||||
|
||||
public static void start( Delegator delegator )
|
||||
{
|
||||
if ( delegator.inDPMode() ) {
|
||||
delegator.addFragment( new DictsFrag(), null );
|
||||
} else {
|
||||
Activity activity = delegator.getActivity();
|
||||
Intent intent = new Intent( activity, DictsActivity.class );
|
||||
activity.startActivity( intent );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
/* -*- compile-command: "find-and-ant.sh debug install"; -*- */
|
||||
/*
|
||||
* Copyright 2016 by Eric House (xwords@eehouse.org). All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
package org.eehouse.android.xw4;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
public class DictsFrag extends XWFragment {
|
||||
|
||||
@Override
|
||||
public void onCreate( Bundle sis )
|
||||
{
|
||||
super.onCreate( new DictsDelegate( this, sis ), sis, true );
|
||||
}
|
||||
}
|
|
@ -1455,7 +1455,7 @@ public class GamesListDelegate extends ListDelegateBase
|
|||
break;
|
||||
|
||||
case R.id.games_menu_dicts:
|
||||
DictsActivity.start( m_activity );
|
||||
DictsDelegate.start( getDelegator() );
|
||||
break;
|
||||
|
||||
case R.id.games_menu_checkmoves:
|
||||
|
|
Loading…
Reference in a new issue