diff --git a/OsmAnd/res/layout/add_gpx_point_dialog.xml b/OsmAnd/res/layout/add_gpx_point_dialog.xml
new file mode 100644
index 0000000000..7663cfa0fc
--- /dev/null
+++ b/OsmAnd/res/layout/add_gpx_point_dialog.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/layout/download_index_list_item.xml b/OsmAnd/res/layout/download_index_list_item.xml
index 3fbe8fc0f0..1382796356 100644
--- a/OsmAnd/res/layout/download_index_list_item.xml
+++ b/OsmAnd/res/layout/download_index_list_item.xml
@@ -1,39 +1,37 @@
+ xmlns:tools="http://schemas.android.com/tools"
+ android:background="?attr/expandable_list_item_background"
+ android:layout_width="fill_parent"
+ android:layout_height="@dimen/list_item_height"
+ android:paddingBottom="1dp"
+ android:paddingLeft="@dimen/list_content_padding"
+ android:paddingRight="@dimen/list_content_padding"
+ android:paddingTop="1dp">
-
+
-
-
+
-
-
-
+
diff --git a/OsmAnd/res/layout/favourites_list_item.xml b/OsmAnd/res/layout/favourites_list_item.xml
index 680507d7a8..5bd1a9b983 100644
--- a/OsmAnd/res/layout/favourites_list_item.xml
+++ b/OsmAnd/res/layout/favourites_list_item.xml
@@ -1,43 +1,41 @@
+ android:layout_width="fill_parent"
+ android:layout_height="@dimen/list_item_height"
+ android:orientation="horizontal"
+ android:paddingBottom="5dp"
+ android:paddingLeft="@dimen/list_content_padding"
+ android:paddingRight="@dimen/list_content_padding"
+ android:background="?attr/expandable_list_item_background"
+ android:paddingTop="5dp">
-
+
-
-
-
+
-
+ android:maxLines="1"
+ android:textColor="?android:textColorPrimary"
+ tools:text="@string/lorem_ipsum"/>
\ No newline at end of file
diff --git a/OsmAnd/res/layout/gpx_item_list_item.xml b/OsmAnd/res/layout/gpx_item_list_item.xml
index 1b20a3f4ea..5937203ba6 100644
--- a/OsmAnd/res/layout/gpx_item_list_item.xml
+++ b/OsmAnd/res/layout/gpx_item_list_item.xml
@@ -1,56 +1,63 @@
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="fill_parent"
+ android:layout_height="@dimen/list_item_height"
+ android:orientation="vertical"
+ android:background="?attr/expandable_list_item_background"
+ android:paddingLeft="8dp"
+ android:paddingRight="8dp">
-
+
-
+
-
+
-
-
+
+
-
-
+
+
-
+
\ No newline at end of file
diff --git a/OsmAnd/res/layout/help_activity.xml b/OsmAnd/res/layout/help_activity.xml
index 586defd3cc..8ae5922aa6 100644
--- a/OsmAnd/res/layout/help_activity.xml
+++ b/OsmAnd/res/layout/help_activity.xml
@@ -12,6 +12,7 @@
\ No newline at end of file
diff --git a/OsmAnd/res/layout/local_index_list_item.xml b/OsmAnd/res/layout/local_index_list_item.xml
index 8820cfba9f..e9907cc3ba 100644
--- a/OsmAnd/res/layout/local_index_list_item.xml
+++ b/OsmAnd/res/layout/local_index_list_item.xml
@@ -1,52 +1,66 @@
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="fill_parent"
+ android:layout_height="@dimen/list_item_height"
+ android:orientation="horizontal"
+ android:paddingBottom="4dp"
+ android:paddingLeft="@dimen/list_content_padding"
+ android:paddingRight="@dimen/list_content_padding"
+ android:background="?attr/expandable_list_item_background"
+ android:paddingTop="4dp">
-
+
-
+
-
-
+
-
+
+
-
-
+
+
+
+
+
+
+
+
-
\ No newline at end of file
diff --git a/OsmAnd/res/values/attrs.xml b/OsmAnd/res/values/attrs.xml
index 631128dba2..3f6266e4d8 100644
--- a/OsmAnd/res/values/attrs.xml
+++ b/OsmAnd/res/values/attrs.xml
@@ -30,6 +30,7 @@
+
diff --git a/OsmAnd/res/values/colors.xml b/OsmAnd/res/values/colors.xml
index fcd50798a3..a065c2a553 100644
--- a/OsmAnd/res/values/colors.xml
+++ b/OsmAnd/res/values/colors.xml
@@ -1,5 +1,8 @@
+ #292f33
+ @color/color_white
+
#39464d
#CC080B0D
#ff8f00
diff --git a/OsmAnd/res/values/sizes.xml b/OsmAnd/res/values/sizes.xml
index 1379f13e29..85288eaa29 100644
--- a/OsmAnd/res/values/sizes.xml
+++ b/OsmAnd/res/values/sizes.xml
@@ -25,6 +25,7 @@
16dp
8dp
48dp
+ 48dp
12sp
diff --git a/OsmAnd/res/values/styles.xml b/OsmAnd/res/values/styles.xml
index 4072ee9e66..33f958587e 100644
--- a/OsmAnd/res/values/styles.xml
+++ b/OsmAnd/res/values/styles.xml
@@ -95,10 +95,6 @@
- true
-
-
+ - @color/expandable_list_item_light
+
-
-
+
+
+
+
+
+
+
+
diff --git a/OsmAnd/src/net/osmand/plus/FavouritesDbHelper.java b/OsmAnd/src/net/osmand/plus/FavouritesDbHelper.java
index 0a65c049d6..6c2c5a1d6b 100644
--- a/OsmAnd/src/net/osmand/plus/FavouritesDbHelper.java
+++ b/OsmAnd/src/net/osmand/plus/FavouritesDbHelper.java
@@ -256,10 +256,11 @@ public class FavouritesDbHelper {
return builder.toString();
}
- public boolean editFavouriteName(FavouritePoint p, String newName, String category) {
+ public boolean editFavouriteName(FavouritePoint p, String newName, String category, String descr) {
String oldCategory = p.getCategory();
p.setName(newName);
p.setCategory(category);
+ p.setDescription(descr);
if (!oldCategory.equals(category)) {
FavoriteGroup old = flatGroups.get(oldCategory);
if (old != null) {
diff --git a/OsmAnd/src/net/osmand/plus/OsmandApplication.java b/OsmAnd/src/net/osmand/plus/OsmandApplication.java
index 0055b30849..ea7a0d108a 100644
--- a/OsmAnd/src/net/osmand/plus/OsmandApplication.java
+++ b/OsmAnd/src/net/osmand/plus/OsmandApplication.java
@@ -795,14 +795,12 @@ public class OsmandApplication extends Application {
}
public void applyTheme(Context c) {
- int t = R.style.OsmandLightDarkActionBarTheme;
+ int t = R.style.OsmandDarkTheme;
boolean mainmenu = c instanceof MainMenuActivity;
if (osmandSettings.OSMAND_THEME.get() == OsmandSettings.OSMAND_DARK_THEME) {
t = mainmenu ? R.style.DashboardDarkTheme : R.style.OsmandDarkTheme;
} else if (osmandSettings.OSMAND_THEME.get() == OsmandSettings.OSMAND_LIGHT_THEME) {
t = mainmenu ? R.style.DashboardLightTheme : R.style.OsmandLightTheme;
- } else if (osmandSettings.OSMAND_THEME.get() == OsmandSettings.OSMAND_LIGHT_DARK_ACTIONBAR_THEME) {
- t = R.style.OsmandLightDarkActionBarTheme;
}
setLanguage(c);
c.setTheme(t);
diff --git a/OsmAnd/src/net/osmand/plus/activities/AvailableGPXFragment.java b/OsmAnd/src/net/osmand/plus/activities/AvailableGPXFragment.java
index 759eae8b63..1beafdead4 100644
--- a/OsmAnd/src/net/osmand/plus/activities/AvailableGPXFragment.java
+++ b/OsmAnd/src/net/osmand/plus/activities/AvailableGPXFragment.java
@@ -13,6 +13,7 @@ import java.util.Map;
import java.util.Set;
import android.content.pm.ActivityInfo;
+import android.os.Handler;
import android.support.v4.view.MenuItemCompat;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.view.ActionMode;
@@ -154,6 +155,23 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
return true;
}
});
+ MenuItemCompat.setOnActionExpandListener(mi, new MenuItemCompat.OnActionExpandListener() {
+ @Override
+ public boolean onMenuItemActionExpand(MenuItem item) {
+ return true;
+ }
+
+ @Override
+ public boolean onMenuItemActionCollapse(MenuItem item) {
+ // Needed to hide intermediate progress bar after closing action mode
+ new Handler().postDelayed(new Runnable() {
+ public void run() {
+ hideProgressBar();
+ }
+ }, 100);
+ return true;
+ }
+ });
if (ScreenOrientationHelper.isOrientationPortrait(getActivity())) {
menu = ((FavoritesActivity) getActivity()).getClearToolbar(true).getMenu();
@@ -765,7 +783,7 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
v = inflater.inflate(net.osmand.plus.R.layout.expandable_list_item_category, parent, false);
}
StringBuilder t = new StringBuilder(group);
- adjustIndicator(groupPosition, isExpanded, v);
+ adjustIndicator(groupPosition, isExpanded, v, getMyApplication().getSettings().isLightContent());
TextView nameView = ((TextView) v.findViewById(R.id.category_name));
List list = data.get(group);
int size = 0;
diff --git a/OsmAnd/src/net/osmand/plus/activities/FavoritesActivity.java b/OsmAnd/src/net/osmand/plus/activities/FavoritesActivity.java
index c90f76fc4e..9e9a64b54c 100644
--- a/OsmAnd/src/net/osmand/plus/activities/FavoritesActivity.java
+++ b/OsmAnd/src/net/osmand/plus/activities/FavoritesActivity.java
@@ -5,13 +5,18 @@ package net.osmand.plus.activities;
import java.io.File;
import java.lang.ref.WeakReference;
+import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import android.app.Activity;
import android.content.Intent;
+import android.graphics.drawable.Drawable;
import android.support.v7.widget.SearchView;
import android.support.v7.widget.Toolbar;
+import android.text.Spannable;
+import android.text.SpannableStringBuilder;
+import android.text.style.ImageSpan;
import android.view.MenuItem;
import net.osmand.plus.GpxSelectionHelper;
import net.osmand.plus.OsmandApplication;
@@ -168,18 +173,27 @@ public class FavoritesActivity extends TabActivity {
public static void updateSearchView(Activity activity, SearchView searchView) {
//do not ever do like this
- OsmandApplication app = (OsmandApplication)activity.getApplication();
- if (app.getSettings().isLightContent()){
- try {
- ImageView cancelIcon = (ImageView) searchView.findViewById(R.id.search_close_btn);
- cancelIcon.setImageResource(R.drawable.ic_action_gremove_dark);
- ImageView searchIcon = (ImageView) searchView.findViewById(R.id.search_voice_btn);
- searchIcon.setImageResource(R.drawable.ic_action_search_dark);
- SearchView.SearchAutoComplete searchBadge = (SearchView.SearchAutoComplete) searchView.findViewById(R.id.search_src_text);
- searchBadge.setTextColor(activity.getResources().getColor(R.color.color_white));
- } catch (NullPointerException e){
+ OsmandApplication app = (OsmandApplication) activity.getApplication();
+ if (!app.getSettings().isLightContent()) {
+ return;
+ }
+ try {
+ ImageView cancelIcon = (ImageView) searchView.findViewById(R.id.search_close_btn);
+ cancelIcon.setImageResource(R.drawable.ic_action_gremove_dark);
+ //styling search hint icon and text
+ SearchView.SearchAutoComplete searchEdit = (SearchView.SearchAutoComplete) searchView.findViewById(R.id.search_src_text);
+ searchEdit.setTextColor(activity.getResources().getColor(R.color.color_white));
+ SpannableStringBuilder stopHint = new SpannableStringBuilder(" ");
+ Float rawTextSize = searchEdit.getTextSize();
+ int textSize = (int) (rawTextSize * 1.25);
+
+ //setting icon as spannable
+ Drawable searchIcon = activity.getResources().getDrawable(R.drawable.ic_action_search_dark);
+ searchIcon.setBounds(0,0, textSize, textSize);
+ stopHint.setSpan(new ImageSpan(searchIcon), 1, 2, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
+ searchEdit.setHint(stopHint);
+ } catch (Exception e) {
- }
}
}
}
diff --git a/OsmAnd/src/net/osmand/plus/activities/FavoritesTreeFragment.java b/OsmAnd/src/net/osmand/plus/activities/FavoritesTreeFragment.java
index 097dae5d45..511944fa47 100644
--- a/OsmAnd/src/net/osmand/plus/activities/FavoritesTreeFragment.java
+++ b/OsmAnd/src/net/osmand/plus/activities/FavoritesTreeFragment.java
@@ -1,6 +1,7 @@
package net.osmand.plus.activities;
import android.content.pm.ActivityInfo;
+import android.os.Handler;
import android.support.v4.view.MenuItemCompat;
import android.support.v7.view.ActionMode;
import android.support.v7.widget.SearchView;
@@ -200,8 +201,10 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
getExpandableListView(), false);
final AutoCompleteTextView cat = (AutoCompleteTextView) v.findViewById(R.id.Category);
final EditText editText = (EditText) v.findViewById(R.id.Name);
+ final EditText editDescr = (EditText) v.findViewById(R.id.descr);
builder.setView(v);
editText.setText(point.getName());
+ editDescr.setText(point.getDescription());
cat.setText(point.getCategory());
cat.setThreshold(1);
List gs = helper.getFavoriteGroups();
@@ -215,7 +218,7 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
@Override
public void onClick(DialogInterface dialog, int which) {
boolean edited = helper.editFavouriteName(point, editText.getText().toString().trim(), cat.getText()
- .toString());
+ .toString(), editDescr.getText().toString());
if (edited) {
favouritesAdapter.synchronizeGroups();
}
@@ -329,7 +332,12 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
favouritesAdapter.setFilterResults(null);
favouritesAdapter.synchronizeGroups();
favouritesAdapter.notifyDataSetChanged();
- hideProgressBar();
+ // Needed to hide intermediate progress bar after closing action mode
+ new Handler().postDelayed(new Runnable() {
+ public void run() {
+ hideProgressBar();
+ }
+ }, 100);
return true;
}
});
@@ -700,7 +708,7 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
R.layout.expandable_list_item_category_btn, parent, false);
fixBackgroundRepeat(row);
}
- adjustIndicator(groupPosition, isExpanded, row);
+ adjustIndicator(groupPosition, isExpanded, row, getMyApplication().getSettings().isLightContent());
TextView label = (TextView) row.findViewById(R.id.category_name);
final FavoriteGroup model = getGroup(groupPosition);
label.setText(model.name.length() == 0? getString(R.string.favourites_activity) : model.name);
diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java
index e27a04a252..f5d55dee58 100644
--- a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java
+++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java
@@ -131,12 +131,9 @@ public class MapActivityActions implements DialogProvider {
private Dialog createAddWaypointDialog(final Bundle args) {
Builder builder = new AlertDialog.Builder(mapActivity);
builder.setTitle(R.string.add_waypoint_dialog_title);
- FrameLayout parent = new FrameLayout(mapActivity);
- final EditText editText = new EditText(mapActivity);
- editText.setId(android.R.id.edit);
- parent.setPadding(15, 0, 15, 0);
- parent.addView(editText);
- builder.setView(parent);
+ View view = mapActivity.getLayoutInflater().inflate(R.layout.add_gpx_point_dialog, null);
+ final EditText editText = (EditText) view.findViewById(android.R.id.edit);
+ builder.setView(view);
builder.setNegativeButton(R.string.default_buttons_cancel, null);
builder.setPositiveButton(R.string.default_buttons_add, new DialogInterface.OnClickListener() {
@Override
diff --git a/OsmAnd/src/net/osmand/plus/activities/OsmandBaseExpandableListAdapter.java b/OsmAnd/src/net/osmand/plus/activities/OsmandBaseExpandableListAdapter.java
index f07869b109..86a77a8efd 100644
--- a/OsmAnd/src/net/osmand/plus/activities/OsmandBaseExpandableListAdapter.java
+++ b/OsmAnd/src/net/osmand/plus/activities/OsmandBaseExpandableListAdapter.java
@@ -7,16 +7,16 @@ import android.widget.ImageView;
public abstract class OsmandBaseExpandableListAdapter extends BaseExpandableListAdapter {
- protected void adjustIndicator(int groupPosition, boolean isExpanded, View row) {
+ protected void adjustIndicator(int groupPosition, boolean isExpanded, View row, boolean light) {
ImageView indicator = (ImageView) row.findViewById(R.id.explist_indicator);
if (!isExpanded) {
if (getChildrenCount(groupPosition) == 0) {
- indicator.setImageResource(R.drawable.expandable_category_empty);
+ indicator.setImageResource(light ? R.drawable.expandable_category_empty_light : R.drawable.expandable_category_empty_dark);
} else {
- indicator.setImageResource(R.drawable.expandable_category_unpushed);
+ indicator.setImageResource(light ? R.drawable.expandable_category_unpushed_light : R.drawable.expandable_category_unpushed_dark);
}
} else {
- indicator.setImageResource(R.drawable.expandable_category_pushed);
+ indicator.setImageResource(light ? R.drawable.expandable_category_pushed_light : R.drawable.expandable_category_pushed_dark);
}
}
diff --git a/OsmAnd/src/net/osmand/plus/activities/SelectedGPXFragment.java b/OsmAnd/src/net/osmand/plus/activities/SelectedGPXFragment.java
index 7c3cef8928..99736c982e 100644
--- a/OsmAnd/src/net/osmand/plus/activities/SelectedGPXFragment.java
+++ b/OsmAnd/src/net/osmand/plus/activities/SelectedGPXFragment.java
@@ -522,7 +522,7 @@ public class SelectedGPXFragment extends OsmandExpandableListFragment {
if(isArgumentTrue(ARG_TO_EXPAND_TRACK_INFO)) {
row.findViewById(R.id.explist_indicator).setVisibility(View.GONE);
} else {
- adjustIndicator(groupPosition, isExpanded, row);
+ adjustIndicator(groupPosition, isExpanded, row, app.getSettings().isLightContent());
}
TextView label = (TextView) row.findViewById(R.id.category_name);
final GpxDisplayGroup model = getGroup(groupPosition);
diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadIndexAdapter.java b/OsmAnd/src/net/osmand/plus/download/DownloadIndexAdapter.java
index 936ab46a8b..1bd65d4fb0 100644
--- a/OsmAnd/src/net/osmand/plus/download/DownloadIndexAdapter.java
+++ b/OsmAnd/src/net/osmand/plus/download/DownloadIndexAdapter.java
@@ -221,7 +221,7 @@ public class DownloadIndexAdapter extends OsmandBaseExpandableListAdapter implem
TextView item = (TextView) row.findViewById(R.id.category_name);
item.setText(group.name);
item.setLinkTextColor(Color.YELLOW);
- adjustIndicator(groupPosition, isExpanded, v);
+ adjustIndicator(groupPosition, isExpanded, v, app.getSettings().isLightContent());
return row;
}
diff --git a/OsmAnd/src/net/osmand/plus/osmo/OsMoGroupsActivity.java b/OsmAnd/src/net/osmand/plus/osmo/OsMoGroupsActivity.java
index 681b8e78f0..4b0ada2871 100644
--- a/OsmAnd/src/net/osmand/plus/osmo/OsMoGroupsActivity.java
+++ b/OsmAnd/src/net/osmand/plus/osmo/OsMoGroupsActivity.java
@@ -1142,8 +1142,8 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
row = inflater.inflate(R.layout.osmo_group_item, parent, false);
//fixBackgroundRepeat(row);
}
-
- adjustIndicator(groupPosition, isExpanded, row);
+ boolean light = getMyApplication().getSettings().isLightContent();
+ adjustIndicator(groupPosition, isExpanded, row, light);
TextView label = (TextView) row.findViewById(R.id.category_name);
final OsMoGroup model = getGroup(groupPosition);
if(selectedObject == model) {
@@ -1161,7 +1161,7 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
if(model.isMainGroup()) {
v.setVisibility(View.GONE);
} else {
- if (getMyApplication().getSettings().isLightContent()){
+ if (light){
v.setImageResource(R.drawable.ic_action_settings_enabled_light);
} else {
v.setImageResource(R.drawable.ic_action_settings_enabled_dark);