fine tuning UI for favorites activity
After Width: | Height: | Size: 698 B |
BIN
OsmAnd/res/drawable-hdpi/list_activities_dot_marker1_empty.9.png
Normal file
After Width: | Height: | Size: 531 B |
After Width: | Height: | Size: 524 B |
Before Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 538 B |
Before Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 510 B |
Before Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.9 KiB |
|
@ -2,10 +2,10 @@
|
|||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<!-- checked -->
|
||||
<item android:drawable="@drawable/list_activities_dot_marker1_pressed" android:state_expanded="true"/>
|
||||
<!-- unchecked -->
|
||||
<item android:drawable="@drawable/list_activities_dot_marker1_unpressed" android:state_expanded="false"/>
|
||||
<!-- default -->
|
||||
<item android:drawable="@drawable/list_activities_dot_marker1_unpressed"/>
|
||||
<item android:state_expanded="true" android:drawable="@drawable/list_activities_dot_marker1_pressed"/>
|
||||
<!-- unchecked empty -->
|
||||
<item android:state_expanded="false" android:state_empty="false" android:drawable="@drawable/list_activities_dot_marker1_content"/>
|
||||
<!-- unchecked nonempty -->
|
||||
<item android:drawable="@drawable/list_activities_dot_marker1_empty"/>
|
||||
|
||||
</selector>
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 5.1 KiB |
|
@ -58,11 +58,11 @@
|
|||
android:id="@android:id/list"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="3dp"
|
||||
android:layout_marginRight="3dp"
|
||||
android:layout_marginTop="3dp"
|
||||
android:layout_marginLeft="0dp"
|
||||
android:layout_marginRight="0dp"
|
||||
android:layout_marginTop="0dp"
|
||||
android:layout_weight="1"
|
||||
android:groupIndicator="@drawable/indicator_custom_gray"
|
||||
android:groupIndicator="@android:color/transparent"
|
||||
style="@style/OsmandListView">
|
||||
</ExpandableListView>
|
||||
|
||||
|
|
|
@ -1,14 +1,30 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="40dp"
|
||||
android:paddingTop="3dp"
|
||||
android:layout_height="fill_parent"
|
||||
android:background="@drawable/tab_menu_item_small" >
|
||||
|
||||
<LinearLayout
|
||||
<ImageView android:src="@drawable/indicator_custom_gray"
|
||||
android:id="@+id/explist_indicator"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" >
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="10dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:paddingLeft="10dp"
|
||||
android:id="@+id/category_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:textSize="24sp" >
|
||||
</TextView>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="right" >
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/check_item"
|
||||
|
@ -19,12 +35,4 @@
|
|||
android:visibility="gone" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/category_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:textSize="24sp" >
|
||||
</TextView>
|
||||
|
||||
</LinearLayout>
|
|
@ -82,7 +82,7 @@
|
|||
<item name="android:background">@color/activity_background</item>
|
||||
</style>
|
||||
<style name="CustomTitleTheme" parent="OsmandTheme">
|
||||
<item name="android:windowTitleSize">46dp</item>
|
||||
<item name="android:windowTitleSize">52dp</item>
|
||||
<item name="android:windowTitleBackgroundStyle">@style/CustomWindowTitleBackground</item>
|
||||
</style>
|
||||
<style name="CustomTitleTheme.Preference" parent="CustomTitleTheme">
|
||||
|
|
|
@ -59,7 +59,7 @@ public class ContributionVersionActivity extends OsmandListActivity {
|
|||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
CustomTitleBar titleBar = new CustomTitleBar(this, R.string.download_files, R.drawable.tab_favorites_screen_icon);
|
||||
CustomTitleBar titleBar = new CustomTitleBar(this, R.string.download_files, R.drawable.tab_download_screen_icon);
|
||||
setContentView(R.layout.download_builds);
|
||||
titleBar.afterSetContentView();
|
||||
|
||||
|
|
|
@ -194,12 +194,11 @@ public class DownloadIndexActivity extends OsmandExpandableListActivity {
|
|||
|
||||
|
||||
private void updateLoadedFiles() {
|
||||
indexActivatedFileNames = ((OsmandApplication)getApplication()).getResourceManager().getIndexFileNames();
|
||||
indexFileNames = ((OsmandApplication)getApplication()).getResourceManager().getIndexFileNames();
|
||||
((OsmandApplication)getApplication()).getResourceManager().getBackupIndexes(indexFileNames);
|
||||
indexActivatedFileNames = getMyApplication().getResourceManager().getIndexFileNames();
|
||||
indexFileNames = getMyApplication().getResourceManager().getIndexFileNames();
|
||||
getMyApplication().getResourceManager().getBackupIndexes(indexFileNames);
|
||||
}
|
||||
|
||||
|
||||
private void downloadIndexList() {
|
||||
showDialog(DIALOG_PROGRESS_LIST);
|
||||
}
|
||||
|
@ -716,7 +715,7 @@ public class DownloadIndexActivity extends OsmandExpandableListActivity {
|
|||
}
|
||||
// reindex vector maps all at one time
|
||||
if (vectorMapsToReindex) {
|
||||
ResourceManager manager = ((OsmandApplication) getApplication()).getResourceManager();
|
||||
ResourceManager manager = getMyApplication().getResourceManager();
|
||||
List<String> warnings = manager.indexingMaps(progress);
|
||||
if (warnings.isEmpty() && !OsmandSettings.getOsmandSettings(getApplicationContext()).MAP_VECTOR_DATA.get()) {
|
||||
warnings.add(getString(R.string.binary_map_download_success));
|
||||
|
|
|
@ -79,7 +79,8 @@ public class FavouritesActivity extends OsmandExpandableListActivity {
|
|||
setContentView(R.layout.favourites_list);
|
||||
titleBar.afterSetContentView();
|
||||
|
||||
helper = ((OsmandApplication)getApplication()).getFavorites();
|
||||
|
||||
helper = getMyApplication().getFavorites();
|
||||
favouritesAdapter = new FavouritesAdapter();
|
||||
favouritesAdapter.setFavoriteGroups(helper.getFavoriteGroups());
|
||||
getExpandableListView().setAdapter(favouritesAdapter);
|
||||
|
@ -567,11 +568,19 @@ public class FavouritesActivity extends OsmandExpandableListActivity {
|
|||
LayoutInflater inflater = getLayoutInflater();
|
||||
row = inflater.inflate(R.layout.favourites_list_category, parent, false);
|
||||
}
|
||||
ImageView indicator = (ImageView) row.findViewById(R.id.explist_indicator);
|
||||
if (!isExpanded) {
|
||||
if (getChildrenCount(groupPosition) == 0) {
|
||||
indicator.setImageResource(R.drawable.list_activities_dot_marker1_empty);
|
||||
} else {
|
||||
indicator.setImageResource(R.drawable.list_activities_dot_marker1_content);
|
||||
}
|
||||
} else {
|
||||
indicator.setImageResource(R.drawable.list_activities_dot_marker1_pressed);
|
||||
}
|
||||
TextView label = (TextView) row.findViewById(R.id.category_name);
|
||||
final String model = getGroup(groupPosition);
|
||||
List<FavouritePoint> ms = helper.getFavoriteGroups().get(model);
|
||||
int sz = ms != null ? ms.size() : 0;
|
||||
label.setText(model + " [" + sz +"]");
|
||||
label.setText(model);
|
||||
final CheckBox ch = (CheckBox) row.findViewById(R.id.check_item);
|
||||
|
||||
if(selectionMode){
|
||||
|
|
|
@ -162,7 +162,7 @@ public class LocalIndexesActivity extends OsmandExpandableListActivity {
|
|||
OsmandSettings settings = OsmandSettings.getOsmandSettings(LocalIndexesActivity.this);
|
||||
settings.setMapLocationToShow(loc.lat, loc.lon, settings.getLastKnownMapZoom());
|
||||
}
|
||||
((OsmandApplication) getApplication()).setGpxFileToDisplay(info.getGpxFile(), false);
|
||||
getMyApplication().setGpxFileToDisplay(info.getGpxFile(), false);
|
||||
MapActivity.launchMapActivityMoveToTop(LocalIndexesActivity.this);
|
||||
}
|
||||
} else if (resId == R.string.local_index_mi_rename) {
|
||||
|
@ -239,7 +239,7 @@ public class LocalIndexesActivity extends OsmandExpandableListActivity {
|
|||
|
||||
@Override
|
||||
protected List<LocalIndexInfo> doInBackground(Activity... params) {
|
||||
LocalIndexHelper helper = new LocalIndexHelper((OsmandApplication) getApplication());
|
||||
LocalIndexHelper helper = new LocalIndexHelper(getMyApplication());
|
||||
return helper.getAllLocalIndexData(this);
|
||||
}
|
||||
|
||||
|
@ -460,7 +460,7 @@ public class LocalIndexesActivity extends OsmandExpandableListActivity {
|
|||
|
||||
@Override
|
||||
protected LocalIndexInfo[] doInBackground(LocalIndexInfo... params) {
|
||||
LocalIndexHelper helper = new LocalIndexHelper((OsmandApplication) getApplication());
|
||||
LocalIndexHelper helper = new LocalIndexHelper(getMyApplication());
|
||||
for (LocalIndexInfo i : params) {
|
||||
helper.updateDescription(i);
|
||||
}
|
||||
|
@ -713,7 +713,7 @@ public class LocalIndexesActivity extends OsmandExpandableListActivity {
|
|||
}
|
||||
@Override
|
||||
protected List<String> doInBackground(Void... params) {
|
||||
return ((OsmandApplication) getApplication()).getResourceManager().reloadIndexes(IProgress.EMPTY_PROGRESS);
|
||||
return getMyApplication().getResourceManager().reloadIndexes(IProgress.EMPTY_PROGRESS);
|
||||
}
|
||||
|
||||
};
|
||||
|
|
|
@ -261,7 +261,7 @@ public class LocalOpenstreetmapActivity extends OsmandExpandableListActivity {
|
|||
}
|
||||
|
||||
public void delete(OpenstreetmapPoint i) {
|
||||
final AmenityIndexRepositoryOdb repo = ((OsmandApplication) getApplication()).getResourceManager().getUpdatablePoiDb();
|
||||
final AmenityIndexRepositoryOdb repo = getMyApplication().getResourceManager().getUpdatablePoiDb();
|
||||
android.util.Log.d(LogUtil.TAG, "Delete " + i);
|
||||
db.deleteOpenstreetmap(i);
|
||||
String c = i.getType();
|
||||
|
|
|
@ -15,4 +15,8 @@ public abstract class OsmandExpandableListActivity extends
|
|||
view.setCacheColorHint(getResources().getColor(R.color.activity_background));
|
||||
view.setDivider(getResources().getDrawable(R.drawable.tab_text_separator));
|
||||
}
|
||||
|
||||
protected OsmandApplication getMyApplication() {
|
||||
return (OsmandApplication)getApplication();
|
||||
}
|
||||
}
|
||||
|
|