Remove list styles
This commit is contained in:
parent
5e7a5374d2
commit
f9f2618920
11 changed files with 69 additions and 51 deletions
|
@ -13,7 +13,6 @@
|
|||
|
||||
<ListView
|
||||
android:id="@android:id/list"
|
||||
style="@style/OsmandListView"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"></ListView>
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:background="?attr/expandable_list_item_background"
|
||||
android:minHeight="@dimen/dashListItemHeight"
|
||||
android:focusable="yes"
|
||||
android:focusable="true"
|
||||
android:orientation="vertical">
|
||||
|
||||
<View
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
android:id="@+id/name"
|
||||
style="@style/ListText.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="@string/lorem_ipsum"/>
|
||||
|
||||
|
@ -35,17 +36,16 @@
|
|||
android:orientation="horizontal">
|
||||
<TextView
|
||||
android:id="@+id/download_descr"
|
||||
style="@style/ListText.Small"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:maxLines="1"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="@dimen/download_descr_text_size"
|
||||
tools:text="@string/app_version"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/update_descr"
|
||||
style="@style/ListText.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/color_distance"
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
style="@style/ListText.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
tools:text="@string/app_version"/>
|
||||
|
||||
|
||||
|
@ -51,6 +52,9 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="7dp"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="@dimen/download_descr_text_size"
|
||||
|
||||
tools:text="@string/app_version"/>
|
||||
|
||||
<TextView
|
||||
|
@ -58,7 +62,8 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:maxLines="25"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="@dimen/download_descr_text_size"
|
||||
tools:text="@string/app_mode_aircraft"/>
|
||||
</LinearLayout>
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:custom="http://schemas.android.com/apk/res-auto"
|
||||
android:background="?attr/expandable_list_item_background"
|
||||
android:paddingLeft="@dimen/list_content_padding"
|
||||
android:paddingRight="@dimen/list_content_padding"
|
||||
android:layout_width="fill_parent"
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
|
||||
<ListView
|
||||
android:id="@android:id/list"
|
||||
style="@style/OsmandListView"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginLeft="0dp"
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
android:id="@+id/download_item"
|
||||
style="@style/ListText.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:layout_height="match_parent"
|
||||
tools:text="@string/app_version"
|
||||
android:maxLines="7"/>
|
||||
|
@ -37,12 +38,12 @@
|
|||
android:orientation="horizontal">
|
||||
<TextView
|
||||
android:id="@+id/download_descr"
|
||||
style="@style/ListText.Small"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="@dimen/download_descr_text_size"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:maxLines="1"
|
||||
android:textSize="@dimen/download_descr_text_size"
|
||||
tools:text="@string/app_version"/>
|
||||
|
||||
<TextView
|
||||
|
|
|
@ -86,7 +86,6 @@
|
|||
</style>
|
||||
|
||||
<style name="OsmandListView" parent="@android:style/Widget.ListView">
|
||||
<item name="android:divider">@drawable/tab_text_separator</item>
|
||||
</style>
|
||||
|
||||
<style name="MainMenuActionBar" parent="Theme.AppCompat.Light.DarkActionBar">
|
||||
|
|
|
@ -387,6 +387,7 @@ public class AppInitializer implements IProgress {
|
|||
notifyEvent(InitEvents.NATIVE_INITIALIZED);
|
||||
|
||||
initPoiTypes();
|
||||
app.poiFilters.reloadAllPoiFilters();
|
||||
notifyEvent(InitEvents.POI_TYPES_INITIALIZED);
|
||||
indexRegionsBoundaries(false);
|
||||
notifyEvent(InitEvents.INDEX_REGION_BOUNDARIES);
|
||||
|
|
|
@ -443,11 +443,12 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment {
|
|||
|
||||
@Override
|
||||
public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) {
|
||||
LocalIndexInfo child = listAdapter.getChild(groupPosition, childPosition);
|
||||
if (!selectionMode){
|
||||
openPopUpMenu(v, child);
|
||||
return true;
|
||||
}
|
||||
LocalIndexInfo item = listAdapter.getChild(groupPosition, childPosition);
|
||||
selectedItems.add(item);
|
||||
selectedItems.add(child);
|
||||
listAdapter.notifyDataSetInvalidated();
|
||||
return true;
|
||||
}
|
||||
|
@ -1000,46 +1001,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment {
|
|||
return v;
|
||||
}
|
||||
|
||||
private void openPopUpMenu(View v, final LocalIndexInfo info) {
|
||||
boolean light = getMyApplication().getSettings().isLightContent();
|
||||
final PopupMenu optionsMenu = new PopupMenu(getActivity(), v);
|
||||
DirectionsDialogs.setupPopUpMenuIcon(optionsMenu);
|
||||
final boolean restore = info.isBackupedData();
|
||||
MenuItem item;
|
||||
if (info.getType() == LocalIndexType.MAP_DATA) {
|
||||
item = optionsMenu.getMenu().add(restore? R.string.local_index_mi_restore : R.string.local_index_mi_backup)
|
||||
.setIcon(backup);
|
||||
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
|
||||
@Override
|
||||
public boolean onMenuItemClick(MenuItem item) {
|
||||
performBasicOperation(restore ? R.string.local_index_mi_restore : R.string.local_index_mi_backup, info);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
item = optionsMenu.getMenu().add(R.string.local_index_mi_rename)
|
||||
.setIcon(light ? R.drawable.ic_action_edit_light : R.drawable.ic_action_edit_dark);
|
||||
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
|
||||
@Override
|
||||
public boolean onMenuItemClick(MenuItem item) {
|
||||
performBasicOperation(R.string.local_index_mi_rename, info);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
item = optionsMenu.getMenu().add(R.string.edit_filter_delete_menu_item)
|
||||
.setIcon(light ? R.drawable.ic_action_delete_light : R.drawable.ic_action_delete_dark);
|
||||
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
|
||||
@Override
|
||||
public boolean onMenuItemClick(MenuItem item) {
|
||||
performBasicOperation(R.string.local_index_mi_delete, info);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
optionsMenu.show();
|
||||
}
|
||||
|
||||
|
||||
private String getNameToDisplay(LocalIndexInfo child) {
|
||||
String mapDescr = getMapDescription(child.getFileName());
|
||||
String mapName = FileNameTranslationHelper.getFileName(ctx,
|
||||
|
@ -1148,6 +1110,47 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment {
|
|||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
private void openPopUpMenu(View v, final LocalIndexInfo info) {
|
||||
boolean light = getMyApplication().getSettings().isLightContent();
|
||||
final PopupMenu optionsMenu = new PopupMenu(getActivity(), v);
|
||||
DirectionsDialogs.setupPopUpMenuIcon(optionsMenu);
|
||||
final boolean restore = info.isBackupedData();
|
||||
MenuItem item;
|
||||
if (info.getType() == LocalIndexType.MAP_DATA) {
|
||||
item = optionsMenu.getMenu().add(restore? R.string.local_index_mi_restore : R.string.local_index_mi_backup)
|
||||
.setIcon(backup);
|
||||
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
|
||||
@Override
|
||||
public boolean onMenuItemClick(MenuItem item) {
|
||||
performBasicOperation(restore ? R.string.local_index_mi_restore : R.string.local_index_mi_backup, info);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
item = optionsMenu.getMenu().add(R.string.local_index_mi_rename)
|
||||
.setIcon(light ? R.drawable.ic_action_edit_light : R.drawable.ic_action_edit_dark);
|
||||
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
|
||||
@Override
|
||||
public boolean onMenuItemClick(MenuItem item) {
|
||||
performBasicOperation(R.string.local_index_mi_rename, info);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
item = optionsMenu.getMenu().add(R.string.edit_filter_delete_menu_item)
|
||||
.setIcon(light ? R.drawable.ic_action_delete_light : R.drawable.ic_action_delete_dark);
|
||||
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
|
||||
@Override
|
||||
public boolean onMenuItemClick(MenuItem item) {
|
||||
performBasicOperation(R.string.local_index_mi_delete, info);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
optionsMenu.show();
|
||||
}
|
||||
|
||||
|
||||
private DownloadActivity getDownloadActivity(){ return (DownloadActivity)getActivity();}
|
||||
}
|
||||
|
|
|
@ -173,6 +173,16 @@ public class PoiFiltersHelper {
|
|||
return types;
|
||||
}
|
||||
|
||||
public void reloadAllPoiFilters() {
|
||||
cacheOsmDefinedFilters = null;
|
||||
cacheTopStandardFilters = null;
|
||||
cacheUserDefinedFilters = null;
|
||||
getUserDefinedPoiFilters();
|
||||
getTopStandardFilters();
|
||||
getOsmDefinedPoiFilters();
|
||||
|
||||
}
|
||||
|
||||
|
||||
public List<PoiLegacyFilter> getUserDefinedPoiFilters(){
|
||||
if(cacheUserDefinedFilters == null){
|
||||
|
|
Loading…
Reference in a new issue