Merge pull request #1065 from Bars107/master

Styles update and favorite description fixes.
This commit is contained in:
vshcherb 2015-02-06 18:42:11 +01:00
commit c2c531f25a
20 changed files with 285 additions and 204 deletions

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<EditText
android:layout_marginTop="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:id="@android:id/edit"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>

View file

@ -1,39 +1,37 @@
<?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:paddingTop="1dp"
android:paddingBottom="1dp"
android:paddingRight="@dimen/list_content_padding"
android:paddingLeft="@dimen/list_content_padding">
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">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="fill_parent">
<CheckBox
android:id="@+id/check_download_item"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="false"
android:layout_gravity="center_vertical"/>
<CheckBox
android:id="@+id/check_download_item"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:focusable="false" />
</LinearLayout>
<TextView
android:id="@+id/download_item"
style="@style/ListText.Small"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="center_vertical"
tools:text="@string/lorem_ipsum"
android:maxLines="7"/>
<TextView
android:id="@+id/download_item"
android:gravity="center_vertical"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:maxLines="7"
android:layout_weight="1"
style="@style/ListText.Small" />
<TextView
android:id="@+id/download_descr"
android:layout_marginLeft="3dp"
android:gravity="right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/ListText.Small" />
<TextView
android:id="@+id/download_descr"
style="@style/ListText.Small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"
android:gravity="right"/>
</LinearLayout>

View file

@ -1,43 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="5dp"
android:paddingLeft="@dimen/list_content_padding"
android:paddingRight="@dimen/list_content_padding"
android:paddingTop="5dp">
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">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<CheckBox
android:id="@+id/check_item"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="false"
android:gravity="center_vertical"
android:visibility="gone"/>
<CheckBox
android:id="@+id/check_item"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:focusable="false"
android:visibility="gone" />
</LinearLayout>
<ImageView
android:id="@+id/favourite_icon"
android:layout_width="25dp"
android:paddingRight="2dp"
android:paddingTop="2dp"
android:layout_height="fill_parent" />
<ImageView
android:id="@+id/favourite_icon"
android:layout_width="25dp"
android:layout_height="fill_parent"
android:paddingRight="2dp"
android:paddingTop="2dp"/>
<TextView
android:id="@+id/favourite_label"
android:layout_width="wrap_content"
android:layout_marginLeft="10dp"
android:textColor="?android:textColorPrimary"
android:layout_height="wrap_content"
android:maxLines="1"
<TextView
android:id="@+id/favourite_label"
style="@style/ListText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:ellipsize="end"
tools:text="@string/lorem_ipsum"
style="@style/ListText" />
android:maxLines="1"
android:textColor="?android:textColorPrimary"
tools:text="@string/lorem_ipsum"/>
</LinearLayout>

View file

@ -1,56 +1,63 @@
<?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:orientation="vertical"
android:paddingBottom="4dp"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:paddingTop="4dp">
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">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp">
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="3dp">
<ImageView
android:id="@+id/icon"
android:layout_width="25dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="2dp" />
<ImageView
android:id="@+id/icon"
android:layout_width="25dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="2dp"/>
<TextView
android:id="@+id/additional"
style="@style/ListText.Small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginRight="3dp"
android:layout_marginLeft="2dp"></TextView>
</FrameLayout>
<TextView
android:id="@+id/additional"
style="@style/ListText.Small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
tools:text="@string/lorem_ipsum"
android:maxLines="2"
android:layout_marginLeft="2dp"
android:layout_marginRight="3dp"
android:textSize="@dimen/dashFavNameTextSize"/>
</FrameLayout>
<TextView
android:id="@+id/name"
style="@style/ListText.Small"
android:layout_width="0dp"
android:paddingTop="2dp"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_weight="1"
android:layout_gravity="center_vertical"></TextView>
</LinearLayout>
<TextView
android:id="@+id/name"
style="@style/ListText.Small"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
tools:text="@string/lorem_ipsum"
android:layout_marginLeft="5dp"
android:textSize="@dimen/dashFavNameTextSize"
android:layout_weight="1"
android:paddingTop="2dp"/>
</LinearLayout>
<TextView
android:id="@+id/description"
style="@style/ListText.Small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:maxLines="25"></TextView>
<TextView
android:id="@+id/description"
style="@style/ListText.Small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:textSize="@dimen/dashFavNameTextSize"
android:maxLines="25"/>
</LinearLayout>

View file

@ -12,6 +12,7 @@
<net.osmand.plus.activities.search.toolbar.SplitToolbar
android:orientation="horizontal"
android:id="@+id/bottomControls"
android:background="?attr/bottomToolBarColor"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
</LinearLayout>

View file

@ -1,52 +1,66 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:orientation="vertical"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/list_content_padding"
android:paddingRight="@dimen/list_content_padding"
android:paddingTop="4dp"
android:paddingBottom="4dp">
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">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="fill_parent">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<CheckBox
android:id="@+id/check_local_index"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:focusable="false" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="fill_parent">
<TextView
android:id="@+id/local_index_name"
android:gravity="center_vertical"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
style="@style/ListText.Small"/>
<CheckBox
android:id="@+id/check_local_index"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="false"
android:gravity="center_vertical"/>
</LinearLayout>
<TextView
android:id="@+id/local_index_size"
android:layout_marginLeft="3dp"
android:gravity="right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/ListText.Small"/>
</LinearLayout>
<TextView
android:id="@+id/local_index_name"
style="@style/ListText.Small"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:maxLines="1"
tools:text="@string/lorem_ipsum"/>
<TextView
android:id="@+id/local_index_size"
style="@style/ListText.Small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"
android:gravity="right"/>
</LinearLayout>
<TextView
android:id="@+id/local_index_descr"
style="@style/ListText.Small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:maxLines="25"
tools:text="@string/lorem_ipsum"/>
</LinearLayout>
<TextView
android:id="@+id/local_index_descr"
android:gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="25"
style="@style/ListText.Small"/>
</LinearLayout>

View file

@ -30,6 +30,7 @@
<attr name="plugin_details_install_header_bg" format="color|reference" />
<attr name="ic_world_globe" format="reference" />
<attr name="plugin_description_header_text_color" format="color|reference" />
<attr name="expandable_list_item_background" format="color"/>
</declare-styleable>
<declare-styleable name="PagerSlidingTabStrip">

View file

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="expandable_list_item_dark">#292f33</color>
<color name="expandable_list_item_light">@color/color_white</color>
<color name="actionbar_dark_color">#39464d</color>
<color name="tool_bar_color_dark">#CC080B0D</color>
<color name="actionbar_light_color">#ff8f00</color>

View file

@ -25,6 +25,7 @@
<dimen name="list_content_padding">16dp</dimen>
<dimen name="list_header_padding">8dp</dimen>
<dimen name="tab_height">48dp</dimen>
<dimen name="list_item_height">48dp</dimen>
<!-- TextSizes -->
<dimen name="showAllButtonTextSize">12sp</dimen>

View file

@ -95,10 +95,6 @@
<!-- Support library compatibility -->
<item name="windowActionBarOverlay">true</item>
</style>
<style name="SpinnerItemLight" parent="@android:style/Widget.TextView.SpinnerItem">
<item name="android:textColor">#FFFFFF</item>
</style>
<style name="SettingsLightTheme" parent="Theme.AppCompat.Light">
<item name="actionBarStyle">@style/Widget.Styled.ActionBarLight</item>
@ -128,7 +124,6 @@
<item name="bottomToolBarColor">@color/tool_bar_color_light</item>
<item name="downloadButtonBackground">@drawable/download_light</item>
<item name="pstsTabBackground">@color/actionbar_light_color</item>
<item name="pstsUnderlineColor">@color/actionbar_light_color</item>
<item name="pstsIndicatorColor">@color/color_white</item>
<item name="pstsTextColor">@color/color_white</item>
@ -165,7 +160,8 @@
<item name="plugin_details_install_header_bg">@color/plugin_details_install_header_bg_light</item>
<item name="ic_world_globe">@drawable/ic_world_globe_light</item>
<item name="plugin_description_header_text_color">#727272</item>
</style>
<item name="expandable_list_item_background">@color/expandable_list_item_light</item>
</style>
<style name="OsmandDarkTheme" parent="Theme.AppCompat">
<item name="reset_image">@drawable/ic_action_delete_dark</item> <!-- @drawable/a_1_navigation_cancel_dark -->
@ -202,16 +198,7 @@
<item name="plugin_details_install_header_bg">@color/plugin_details_install_header_bg_dark</item>
<item name="ic_world_globe">@drawable/ic_world_globe_dark</item>
<item name="plugin_description_header_text_color">#70818c</item>
</style>
<style name="OsmandLightDarkActionBarTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="reset_image">@drawable/ic_action_delete_light</item> <!-- @drawable/a_1_navigation_cancel_light -->
<item name="expandable_category_color">@color/group_background</item>
<item name="bottomToolBarColor">@color/tool_bar_color_dark</item>
<item name="pstsTabBackground">@color/actionbar_dark_color</item>
<item name="pstsIndicatorColor">@color/actionbar_light_color</item>
<item name="actionBarStyle">@style/Widget.Styled.ActionBarDark</item>
<item name="android:actionBarStyle">@style/Widget.Styled.ActionBarDark</item>
<item name="expandable_list_item_background">@color/expandable_list_item_dark</item>
</style>
<style name="Widget.Styled.ActionBarDark" parent="Widget.AppCompat.Light.ActionBar.Solid.Inverse">
@ -222,11 +209,14 @@
<style name="Widget.Styled.ActionBarLight" parent="Widget.AppCompat.Light.ActionBar.Solid">
<item name="background">@color/actionbar_light_color</item>
<item name="android:background">@color/actionbar_light_color</item>
<item name="android:spinnerDropDownItemStyle">@style/SpinnerItemLight</item>
<item name="android:titleTextStyle">@style/Widget.Styled.LightActionBarHeader</item>
<item name="titleTextStyle">@style/Widget.Styled.LightActionBarHeader</item>
<item name="android:subtitleTextStyle">@style/Widget.Styled.LightActionBarHeader</item>
<item name="subtitleTextStyle">@style/Widget.Styled.LightActionBarHeader</item>
<item name="android:actionDropDownStyle">@style/ActionBarDropDownLight</item>
<item name="actionDropDownStyle">@style/ActionBarDropDownLight</item>
<item name="android:actionBarWidgetTheme">@style/ActionBarWidgetLight</item>
<item name="actionBarWidgetTheme">@style/ActionBarWidgetLight</item>
</style>
<style name="Widget.Styled.LightActionBarHeader" parent="@android:style/TextAppearance">
@ -242,6 +232,24 @@
<item name="android:textColor">@color/color_white</item>
</style>
<style name="ActionBarWidgetLight" parent="@style/Theme.AppCompat">
<item name="android:spinnerDropDownItemStyle">@style/ActionBarDropDownSpinnerLight</item>
</style>
<style name="ActionBarDropDownLight" parent="@style/Widget.AppCompat.Spinner.DropDown.ActionBar">
<item name="background">@color/actionbar_light_color</item>
<item name="android:background">@color/actionbar_light_color</item>
<item name="android:popupBackground">@color/actionbar_light_color</item>
</style>
<style name="ActionBarDropDownSpinnerLight" parent="Widget.AppCompat.DropDownItem.Spinner">
<item name="android:textAppearance">@style/ActionBarDropDownTextLight</item>
</style>
<style name="ActionBarDropDownTextLight" parent="TextAppearance.AppCompat.Widget.DropDownItem">
<item name="android:textColor">@color/color_white</item>
</style>
<!-- Dialog popup -->
<style name="Animations" />
<!-- PopDownMenu -->

View file

@ -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) {

View file

@ -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);

View file

@ -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<GpxInfo> list = data.get(group);
int size = 0;

View file

@ -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) {
}
}
}
}

View file

@ -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<FavoriteGroup> 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);

View file

@ -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

View file

@ -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);
}
}

View file

@ -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);

View file

@ -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;
}

View file

@ -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);