Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2014-09-15 17:25:46 +02:00
commit 7c7e2ad47a
6 changed files with 29 additions and 15 deletions

View file

@ -64,7 +64,10 @@ public abstract class OsmandExpandableListFragment extends SherlockFragment impl
public ExpandableListView getExpandableListView() { return listView; }
public void setListView(ExpandableListView listView) { this.listView = listView;}
public void setListView(ExpandableListView listView) {
this.listView = listView;
listView.setOnChildClickListener(this);
}
public MenuItem createMenuItem(Menu m, int id, int titleRes, int iconLight, int iconDark, int menuItemType) {
int r = isLightActionBar() ? iconLight : iconDark;

View file

@ -376,5 +376,8 @@ public class DownloadActivity extends SherlockFragmentActivity {
return items;
}
public boolean isLightActionBar() {
return ((OsmandApplication) getApplication()).getSettings().isLightActionBar();
}
}

View file

@ -236,12 +236,6 @@ public class DownloadIndexAdapter extends OsmandBaseExpandableListAdapter implem
v = inflater.inflate(net.osmand.plus.R.layout.download_index_list_item, parent, false);
}
final View row = v;
row.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
downloadFragment.onChildClick(downloadFragment.getExpandableListView(), row, groupPosition, childPosition, getChildId(groupPosition, childPosition));
}
});
TextView item = (TextView) row.findViewById(R.id.download_item);
TextView description = (TextView) row.findViewById(R.id.download_descr);
IndexItem e = (IndexItem) getChild(groupPosition, childPosition);

View file

@ -45,11 +45,11 @@ import com.actionbarsherlock.view.SubMenu;
public class DownloadIndexFragment extends OsmandExpandableListFragment {
/** menus **/
private static final int MORE_ID = 10;
private static final int RELOAD_ID = 0;
private static final int SELECT_ALL_ID = 1;
private static final int DESELECT_ALL_ID = 2;
private static final int FILTER_EXISTING_REGIONS = 3;
public static final int MORE_ID = 10;
public static final int RELOAD_ID = 0;
public static final int SELECT_ALL_ID = 1;
public static final int DESELECT_ALL_ID = 2;
public static final int FILTER_EXISTING_REGIONS = 3;
private TextWatcher textWatcher ;
private EditText filterText;
@ -67,7 +67,6 @@ public class DownloadIndexFragment extends OsmandExpandableListFragment {
listView.setAdapter(listAdapter);
setListView(listView);
getDownloadActivity().getSupportActionBar().setTitle(R.string.local_index_download);
// recreation upon rotation is pgetaprevented in manifest file
@ -253,6 +252,7 @@ public class DownloadIndexFragment extends OsmandExpandableListFragment {
}
return super.onOptionsItemSelected(item);
}
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
ActionBar actionBar = getDownloadActivity().getSupportActionBar();
@ -273,7 +273,6 @@ public class DownloadIndexFragment extends OsmandExpandableListFragment {
if (getMyApplication().getAppCustomization().showDownloadExtraActions()) {
SubMenu s = menu.addSubMenu(0, MORE_ID, 0, R.string.default_buttons_other_actions);
s.add(0, RELOAD_ID, 0, R.string.update_downlod_list);
s.add(0, FILTER_EXISTING_REGIONS, 0, R.string.filter_existing_indexes);
s.add(0, SELECT_ALL_ID, 0, R.string.select_all);
s.add(0, DESELECT_ALL_ID, 0, R.string.deselect_all);

View file

@ -861,7 +861,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment {
}
@Override
public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) {
public View getChildView(final int groupPosition, final int childPosition, boolean isLastChild, View convertView, ViewGroup parent) {
View v = convertView;
final LocalIndexInfo child = (LocalIndexInfo) getChild(groupPosition, childPosition);
if (v == null ) {

View file

@ -10,6 +10,7 @@ import com.actionbarsherlock.app.ActionBar;
import com.actionbarsherlock.app.SherlockListFragment;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuInflater;
import com.actionbarsherlock.view.SubMenu;
import net.osmand.map.OsmandRegions;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
@ -119,7 +120,21 @@ public class UpdatesIndexFragment extends SherlockListFragment {
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
ActionBar actionBar = getDownloadActivity().getSupportActionBar();
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
if (getMyApplication().getAppCustomization().showDownloadExtraActions()) {
SubMenu s = menu.addSubMenu(0, DownloadIndexFragment.MORE_ID, 0, R.string.default_buttons_other_actions);
s.add(0, DownloadIndexFragment.RELOAD_ID, 0, R.string.update_downlod_list);
s.add(0, DownloadIndexFragment.SELECT_ALL_ID, 0, R.string.select_all);
s.add(0, DownloadIndexFragment.DESELECT_ALL_ID, 0, R.string.deselect_all);
s.setIcon(isLightActionBar() ? R.drawable.abs__ic_menu_moreoverflow_holo_light
: R.drawable.abs__ic_menu_moreoverflow_holo_dark);
}
}
public OsmandApplication getMyApplication() { return getDownloadActivity().getMyApplication(); }
public boolean isLightActionBar() {
return ((OsmandApplication) getActivity().getApplication()).getSettings().isLightActionBar();
}
}