mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-28 09:58:30 +01:00
remove redundant code
This commit is contained in:
parent
4d08c7cef9
commit
62ecd00971
3 changed files with 3 additions and 44 deletions
|
@ -137,47 +137,6 @@ public class DictsActivity extends ExpandableListActivity {
|
|||
|| super.onOptionsItemSelected( item );
|
||||
}
|
||||
|
||||
private static Intent mkDownloadIntent( Context context, String dict_url )
|
||||
{
|
||||
Uri uri = Uri.parse( dict_url );
|
||||
Intent intent = new Intent( Intent.ACTION_VIEW, uri );
|
||||
intent.setFlags( Intent.FLAG_ACTIVITY_NEW_TASK );
|
||||
return intent;
|
||||
}
|
||||
|
||||
private static Intent mkDownloadIntent( Context context,
|
||||
int lang, String dict )
|
||||
{
|
||||
String dict_url = Utils.makeDictUrl( context, lang, dict );
|
||||
return mkDownloadIntent( context, dict_url );
|
||||
}
|
||||
|
||||
public static void launchAndDownload( Activity activity, int lang,
|
||||
String name )
|
||||
{
|
||||
Intent intent = new Intent( activity, DictsActivity.class );
|
||||
intent.putExtra( DictsDelegate.DICT_DOLAUNCH, true );
|
||||
if ( lang > 0 ) {
|
||||
intent.putExtra( DictsDelegate.DICT_LANG_EXTRA, lang );
|
||||
}
|
||||
if ( null != name ) {
|
||||
Assert.assertTrue( lang != 0 );
|
||||
intent.putExtra( DictsDelegate.DICT_NAME_EXTRA, name );
|
||||
}
|
||||
|
||||
activity.startActivity( intent );
|
||||
}
|
||||
|
||||
public static void launchAndDownload( Activity activity, int lang )
|
||||
{
|
||||
launchAndDownload( activity, lang, null );
|
||||
}
|
||||
|
||||
public static void launchAndDownload( Activity activity )
|
||||
{
|
||||
launchAndDownload( activity, 0, null );
|
||||
}
|
||||
|
||||
private static class SafePopupImpl implements SafePopup {
|
||||
public void doPopup( final Context context, View button,
|
||||
String curDict ) {
|
||||
|
|
|
@ -746,7 +746,7 @@ public class GameConfigDelegate extends DelegateBase
|
|||
(String)parentView.getItemAtPosition( position );
|
||||
|
||||
if ( chosen.equals( m_browseText ) ) {
|
||||
DictsActivity.launchAndDownload( m_activity,
|
||||
DictsDelegate.launchAndDownload( m_activity,
|
||||
m_gi.dictLang );
|
||||
}
|
||||
}
|
||||
|
@ -772,7 +772,7 @@ public class GameConfigDelegate extends DelegateBase
|
|||
String chosen =
|
||||
(String)parentView.getItemAtPosition( position );
|
||||
if ( chosen.equals( m_browseText ) ) {
|
||||
DictsActivity.launchAndDownload( m_activity );
|
||||
DictsDelegate.launchAndDownload( m_activity );
|
||||
} else {
|
||||
m_gi.setLang( DictLangCache.
|
||||
getLangLangCode( m_activity,
|
||||
|
|
|
@ -144,7 +144,7 @@ public class GamesListDelegate extends DelegateBase
|
|||
public void onClick( DialogInterface dlg, int item ) {
|
||||
// no name, so user must pick
|
||||
if ( null == m_missingDictName ) {
|
||||
DictsActivity
|
||||
DictsDelegate
|
||||
.launchAndDownload( m_activity,
|
||||
m_missingDictLang );
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue