diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DictsActivity.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DictsActivity.java index 5b1a9a112..3c637c666 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DictsActivity.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DictsActivity.java @@ -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 ); - } - } diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DictsDelegate.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DictsDelegate.java index 7dfb65c60..236c352ce 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DictsDelegate.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DictsDelegate.java @@ -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 ); + } + } } diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DictsFrag.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DictsFrag.java new file mode 100644 index 000000000..5a49b6b7b --- /dev/null +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DictsFrag.java @@ -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 ); + } +} diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesListDelegate.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesListDelegate.java index 9fcdc32af..0b3b0bc65 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesListDelegate.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesListDelegate.java @@ -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: