launch dict browser from tap on dict rather than contextual menu on it.

This commit is contained in:
Andy2 2011-11-02 05:06:53 -07:00
parent 050a68ce42
commit 8704acfbf1
3 changed files with 11 additions and 16 deletions

View file

@ -7,7 +7,4 @@
<item android:id="@+id/dicts_item_select"
android:title="@string/dicts_item_select"
/>
<item android:id="@+id/dicts_item_details"
android:title="@string/dicts_item_details"
/>
</menu>

View file

@ -242,10 +242,6 @@
key_default_dict and key_default_robodict.) -->
<string name="dicts_item_select">Make default</string>
<!-- Title of contextual menu item. If chosen brings up a
scrolling list of all the selected wordlists's words. -->
<string name="dicts_item_details">Browse</string>
<!-- text of confirmation dialog posted when the delete 'X' button
beside the listing of a wordlist is tapped. The name of the
wordlist is substituted for %s. Sometimes one of the two

View file

@ -1,6 +1,6 @@
/* -*- compile-command: "cd ../../../../../; ant install"; -*- */
/*
* Copyright 2009-2010 by Eric House (xwords@eehouse.org). All
* Copyright 2009 - 2011 by Eric House (xwords@eehouse.org). All
* rights reserved.
*
* This program is free software; you can redistribute it and/or
@ -153,6 +153,7 @@ public class DictsActivity extends ExpandableListActivity
}
addToCache( groupPosition, childPosition, view );
view.setOnClickListener( DictsActivity.this );
}
return view;
}
@ -455,9 +456,16 @@ public class DictsActivity extends ExpandableListActivity
super.onStop();
}
public void onClick( View v )
public void onClick( View view )
{
askStartDownload( 0, null );
if ( view instanceof Button ) {
askStartDownload( 0, null );
} else {
XWListItem item = (XWListItem)view;
Intent intent = new Intent( this, DictBrowseActivity.class );
intent.putExtra( DictBrowseActivity.DICT_NAME, item.getText() );
startActivity( intent );
}
}
@Override
@ -516,12 +524,6 @@ public class DictsActivity extends ExpandableListActivity
case R.id.dicts_item_select:
showDialog( SET_DEFAULT );
break;
case R.id.dicts_item_details:
Intent intent = new Intent( this, DictBrowseActivity.class );
XWListItem view = (XWListItem)info.targetView;
intent.putExtra( DictBrowseActivity.DICT_NAME, view.getText() );
startActivity( intent );
break;
}
return handled;