Merge pull request #1064 from Bars107/master

Styles updates.
This commit is contained in:
vshcherb 2015-02-04 17:48:56 +01:00
commit af673a3034
22 changed files with 145 additions and 50 deletions

View file

@ -37,4 +37,5 @@
<string name="app_edition"></string> <string name="app_edition"></string>
<string name="preferred_locale_no_translate">Display language</string> <string name="preferred_locale_no_translate">Display language</string>
<string name="system_locale_no_translate">Device language</string> <string name="system_locale_no_translate">Device language</string>
<string name="osmo">OsMo</string>
</resources> </resources>

View file

@ -66,6 +66,7 @@
android:id="@+id/group_image" android:id="@+id/group_image"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="4dp" android:layout_marginLeft="4dp"
android:src="@drawable/ic_small_group"/> android:src="@drawable/ic_small_group"/>

View file

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal"> android:orientation="horizontal">
@ -14,6 +15,10 @@
<TextView <TextView
android:id="@+id/filter_poi_label" android:id="@+id/filter_poi_label"
style="@style/ListText" style="@style/ListText"
android:textColor="?android:textColorPrimary"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" /> android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
tools:text="@string/lorem_ipsum"/>
</LinearLayout> </LinearLayout>

View file

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:orientation="horizontal"
@ -32,7 +33,11 @@
android:id="@+id/favourite_label" android:id="@+id/favourite_label"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:textColor="?android:textColorPrimary"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:maxLines="1"
android:ellipsize="end"
tools:text="@string/lorem_ipsum"
style="@style/ListText" /> style="@style/ListText" />
</LinearLayout> </LinearLayout>

View file

@ -0,0 +1,17 @@
<?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">
<WebView android:id="@+id/webView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"/>
<net.osmand.plus.activities.search.toolbar.SplitToolbar
android:orientation="horizontal"
android:id="@+id/bottomControls"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
</LinearLayout>

View file

@ -2,5 +2,6 @@
<TextView xmlns:android="http://schemas.android.com/apk/res/android" <TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="?android:textColorPrimary"
android:textSize="20sp" android:textSize="20sp"
android:textStyle="bold"></TextView> android:textStyle="bold"></TextView>

View file

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="?attr/expandable_category_color" android:background="?attr/expandable_category_color"
@ -22,26 +23,25 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:textColor="?android:textColorPrimary"
android:layout_marginLeft="8dp" android:layout_marginLeft="8dp"
android:maxLines="1"
tools:text="@string/lorem_ipsum"
android:layout_marginTop="0dp" android:layout_marginTop="0dp"
android:layout_weight="1" android:layout_weight="1"
android:textSize="18sp" /> android:textSize="18sp" />
<include layout="@layout/check_item_rel" /> <include layout="@layout/check_item_rel" />
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_gravity="center_vertical">
<ImageView <ImageView
android:id="@+id/settings" android:id="@+id/settings"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="4dp" android:layout_marginLeft="4dp"
android:layout_marginRight="1dp" android:layout_marginRight="1dp"
android:focusable="false" android:focusable="false"/>
android:src="@drawable/ic_action_settings_dark" />
</RelativeLayout>
</LinearLayout> </LinearLayout>

View file

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingLeft="@dimen/list_content_padding" android:paddingLeft="@dimen/list_content_padding"
@ -12,6 +13,10 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginRight="3dp" android:layout_marginRight="3dp"
android:textColor="?android:textColorPrimary"
android:maxLines="1"
android:ellipsize="end"
tools:text="@string/lorem_ipsum"
android:layout_weight="1" /> android:layout_weight="1" />
<ImageButton <ImageButton

View file

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <!-- This file is at /res/layout/list.xml --> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:layout_height="fill_parent"
android:orientation="vertical"> android:orientation="vertical">
@ -16,6 +17,8 @@
android:id="@+id/TextView" android:id="@+id/TextView"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="?android:textColorPrimary"
tools:text="@string/lorem_ipsum"
android:text="@string/search_poi_filter" /> android:text="@string/search_poi_filter" />
<EditText <EditText

View file

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:orientation="horizontal"
@ -19,9 +20,12 @@
<TextView <TextView
android:id="@+id/folder_label" android:id="@+id/folder_label"
style="@style/ListText" style="@style/ListText"
android:textColor="?android:textColorPrimary"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" /> android:layout_weight="1"
android:maxLines="1"
tools:text="@string/lorem_ipsum"/>
<ImageView <ImageView
android:id="@+id/folder_edit_icon" android:id="@+id/folder_edit_icon"

View file

@ -9,6 +9,7 @@
3. All your modified/created strings are in the top of the file (to make easier find what\'s translated). 3. All your modified/created strings are in the top of the file (to make easier find what\'s translated).
PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy
--> -->
<string name="edit_group">Edit group</string>
<string name="parking_place">Parking place</string> <string name="parking_place">Parking place</string>
<string name="remove_the_tag">REMOVE THE TAG</string> <string name="remove_the_tag">REMOVE THE TAG</string>
<string name="gps_status">GPS Status</string> <string name="gps_status">GPS Status</string>

View file

@ -100,6 +100,8 @@
<item name="actionBarStyle">@style/Widget.Styled.ActionBarLight</item> <item name="actionBarStyle">@style/Widget.Styled.ActionBarLight</item>
<item name="android:actionBarStyle">@style/Widget.Styled.ActionBarLight</item> <item name="android:actionBarStyle">@style/Widget.Styled.ActionBarLight</item>
<item name="android:listChoiceIndicatorMultiple">@drawable/check_light</item> <item name="android:listChoiceIndicatorMultiple">@drawable/check_light</item>
<item name="android:textColorPrimary">@color/color_black</item>
<item name="android:textColorSecondary">@color/color_black</item>
</style> </style>
<style name="SettingsDarkTheme" parent="Theme.AppCompat"> <style name="SettingsDarkTheme" parent="Theme.AppCompat">
@ -202,6 +204,8 @@
<item name="android:background">@color/actionbar_light_color</item> <item name="android:background">@color/actionbar_light_color</item>
<item name="android:titleTextStyle">@style/Widget.Styled.LightActionBarHeader</item> <item name="android:titleTextStyle">@style/Widget.Styled.LightActionBarHeader</item>
<item name="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>
</style> </style>
<style name="Widget.Styled.LightActionBarHeader" parent="@android:style/TextAppearance"> <style name="Widget.Styled.LightActionBarHeader" parent="@android:style/TextAppearance">

View file

@ -138,6 +138,7 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
R.drawable.ic_action_search_dark, MenuItemCompat.SHOW_AS_ACTION_ALWAYS R.drawable.ic_action_search_dark, MenuItemCompat.SHOW_AS_ACTION_ALWAYS
| MenuItemCompat.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW); | MenuItemCompat.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW);
searchView = new SearchView(getActivity()); searchView = new SearchView(getActivity());
FavoritesActivity.updateSearchView(getActivity(), searchView);
MenuItemCompat.setActionView(mi,searchView); MenuItemCompat.setActionView(mi,searchView);
searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() { searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
@ -154,7 +155,7 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
} }
}); });
if (isOrientationPortrait()) { if (ScreenOrientationHelper.isOrientationPortrait(getActivity())) {
menu = ((FavoritesActivity) getActivity()).getClearToolbar(true).getMenu(); menu = ((FavoritesActivity) getActivity()).getClearToolbar(true).getMenu();
} else { } else {
((FavoritesActivity) getActivity()).getClearToolbar(false); ((FavoritesActivity) getActivity()).getClearToolbar(false);
@ -195,7 +196,7 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
final MenuItem item; final MenuItem item;
item = menu.add(0, optionsMenuAdapter.getElementId(j), j + 1, optionsMenuAdapter.getItemName(j)); item = menu.add(0, optionsMenuAdapter.getElementId(j), j + 1, optionsMenuAdapter.getItemName(j));
MenuItemCompat.setShowAsAction(item, MenuItemCompat.SHOW_AS_ACTION_ALWAYS); MenuItemCompat.setShowAsAction(item, MenuItemCompat.SHOW_AS_ACTION_ALWAYS);
if (isOrientationPortrait()){ if (ScreenOrientationHelper.isOrientationPortrait(getActivity())){
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() { item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override @Override
public boolean onMenuItemClick(MenuItem menuItem) { public boolean onMenuItemClick(MenuItem menuItem) {
@ -211,11 +212,6 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
} }
} }
private boolean isOrientationPortrait() {
int orientation = ScreenOrientationHelper.getScreenOrientation(getActivity());
return orientation == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT ||
orientation == ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT;
}
public void doAction(int actionResId) { public void doAction(int actionResId) {
if (actionResId == R.string.local_index_mi_delete) { if (actionResId == R.string.local_index_mi_delete) {
@ -261,7 +257,7 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
private void enableSelectionMode(boolean selectionMode) { private void enableSelectionMode(boolean selectionMode) {
this.selectionMode = selectionMode; this.selectionMode = selectionMode;
if (isOrientationPortrait()) { if (ScreenOrientationHelper.isOrientationPortrait(getActivity())) {
((FavoritesActivity)getActivity()).setToolbarVisibility(!selectionMode); ((FavoritesActivity)getActivity()).setToolbarVisibility(!selectionMode);
} }
} }

View file

@ -91,7 +91,7 @@ public class EditPOIFilterActivity extends OsmandListActivity {
return super.onCreateOptionsMenu(menu); return super.onCreateOptionsMenu(menu);
} }
createMenuItem(menu, SAVE_FILTER, R.string.edit_filter_save_as_menu_item, createMenuItem(menu, SAVE_FILTER, R.string.edit_filter_save_as_menu_item,
R.drawable.ic_action_gsave_light, R.drawable.ic_action_gsave_dark , R.drawable.ic_action_gsave_dark, R.drawable.ic_action_gsave_dark ,
MenuItemCompat.SHOW_AS_ACTION_IF_ROOM); MenuItemCompat.SHOW_AS_ACTION_IF_ROOM);
createMenuItem(menu, FILTER, R.string.filter_current_poiButton, createMenuItem(menu, FILTER, R.string.filter_current_poiButton,
0, 0, 0, 0,
@ -99,7 +99,7 @@ public class EditPOIFilterActivity extends OsmandListActivity {
MenuItemCompat.SHOW_AS_ACTION_WITH_TEXT | MenuItemCompat.SHOW_AS_ACTION_ALWAYS); MenuItemCompat.SHOW_AS_ACTION_WITH_TEXT | MenuItemCompat.SHOW_AS_ACTION_ALWAYS);
if(!filter.isStandardFilter()){ if(!filter.isStandardFilter()){
createMenuItem(menu, DELETE_FILTER, R.string.edit_filter_delete_menu_item, createMenuItem(menu, DELETE_FILTER, R.string.edit_filter_delete_menu_item,
R.drawable.ic_action_gdiscard_light, R.drawable.ic_action_gdiscard_dark, R.drawable.ic_action_gdiscard_dark, R.drawable.ic_action_gdiscard_dark,
MenuItemCompat.SHOW_AS_ACTION_IF_ROOM); MenuItemCompat.SHOW_AS_ACTION_IF_ROOM);
} }
return super.onCreateOptionsMenu(menu); return super.onCreateOptionsMenu(menu);

View file

@ -8,7 +8,9 @@ import java.lang.ref.WeakReference;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import android.app.Activity;
import android.content.Intent; import android.content.Intent;
import android.support.v7.widget.SearchView;
import android.support.v7.widget.Toolbar; import android.support.v7.widget.Toolbar;
import android.view.MenuItem; import android.view.MenuItem;
import net.osmand.plus.GpxSelectionHelper; import net.osmand.plus.GpxSelectionHelper;
@ -23,6 +25,7 @@ import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager; import android.support.v4.view.ViewPager;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TabHost; import android.widget.TabHost;
import android.widget.TabHost.TabSpec; import android.widget.TabHost.TabSpec;
import android.widget.TabWidget; import android.widget.TabWidget;
@ -162,5 +165,22 @@ public class FavoritesActivity extends TabActivity {
} }
return false; return false;
} }
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){
}
}
}
} }

View file

@ -28,6 +28,7 @@ import net.osmand.plus.FavouritesDbHelper.FavoriteGroup;
import net.osmand.plus.GPXUtilities; import net.osmand.plus.GPXUtilities;
import net.osmand.plus.GPXUtilities.GPXFile; import net.osmand.plus.GPXUtilities.GPXFile;
import net.osmand.plus.OsmAndFormatter; import net.osmand.plus.OsmAndFormatter;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandSettings; import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R; import net.osmand.plus.R;
import net.osmand.plus.TargetPointsHelper; import net.osmand.plus.TargetPointsHelper;
@ -303,6 +304,7 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
MenuItem mi = createMenuItem(menu, SEARCH_ID, R.string.search_poi_filter, R.drawable.ic_action_search_dark, MenuItem mi = createMenuItem(menu, SEARCH_ID, R.string.search_poi_filter, R.drawable.ic_action_search_dark,
R.drawable.ic_action_search_dark, MenuItemCompat.SHOW_AS_ACTION_ALWAYS | MenuItemCompat.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW); R.drawable.ic_action_search_dark, MenuItemCompat.SHOW_AS_ACTION_ALWAYS | MenuItemCompat.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW);
searchView = new SearchView(getActivity()); searchView = new SearchView(getActivity());
FavoritesActivity.updateSearchView(getActivity(), searchView);
MenuItemCompat.setActionView(mi, searchView); MenuItemCompat.setActionView(mi, searchView);
searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() { searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
@Override @Override
@ -356,6 +358,8 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
} }
} }
public void showProgressBar() { public void showProgressBar() {
getActionBarActivity().setSupportProgressBarIndeterminateVisibility(true); getActionBarActivity().setSupportProgressBarIndeterminateVisibility(true);
} }
@ -475,6 +479,7 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
final CheckBox checkBox = (CheckBox) favEdit.findViewById(R.id.Visibility); final CheckBox checkBox = (CheckBox) favEdit.findViewById(R.id.Visibility);
checkBox.setChecked(group.visible); checkBox.setChecked(group.visible);
bld.setTitle(R.string.edit_group);
bld.setView(favEdit); bld.setView(favEdit);
bld.setNegativeButton(R.string.default_buttons_cancel, null); bld.setNegativeButton(R.string.default_buttons_cancel, null);
bld.setPositiveButton(R.string.default_buttons_ok, new DialogInterface.OnClickListener() { bld.setPositiveButton(R.string.default_buttons_ok, new DialogInterface.OnClickListener() {

View file

@ -8,9 +8,12 @@ import java.io.InputStreamReader;
import android.content.pm.ActivityInfo; import android.content.pm.ActivityInfo;
import android.os.Build; import android.os.Build;
import android.support.v4.view.MenuItemCompat; import android.support.v4.view.MenuItemCompat;
import android.support.v7.widget.Toolbar;
import android.view.*; import android.view.*;
import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R; import net.osmand.plus.R;
import net.osmand.plus.helpers.ScreenOrientationHelper;
import android.os.Bundle; import android.os.Bundle;
import android.webkit.WebView; import android.webkit.WebView;
import android.webkit.WebViewClient; import android.webkit.WebViewClient;
@ -35,7 +38,7 @@ public class HelpActivity extends OsmandActionBarActivity {
getWindow().setUiOptions(ActivityInfo.UIOPTION_SPLIT_ACTION_BAR_WHEN_NARROW); getWindow().setUiOptions(ActivityInfo.UIOPTION_SPLIT_ACTION_BAR_WHEN_NARROW);
} }
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
wv = new WebView(this);
String title = getString(R.string.help); String title = getString(R.string.help);
String url = "index.html"; String url = "index.html";
if(getIntent() != null) { if(getIntent() != null) {
@ -49,7 +52,8 @@ public class HelpActivity extends OsmandActionBarActivity {
} }
} }
getSupportActionBar().setTitle(title); getSupportActionBar().setTitle(title);
setContentView(wv); setContentView(R.layout.help_activity);
wv = (WebView) findViewById(R.id.webView);
wv.setFocusable(true); wv.setFocusable(true);
wv.setFocusableInTouchMode(true); wv.setFocusableInTouchMode(true);
wv.requestFocus(View.FOCUS_DOWN); wv.requestFocus(View.FOCUS_DOWN);
@ -101,18 +105,23 @@ public class HelpActivity extends OsmandActionBarActivity {
@Override @Override
public boolean onCreateOptionsMenu(Menu menu) { public boolean onCreateOptionsMenu(Menu menu) {
if (ScreenOrientationHelper.isOrientationPortrait(this)){
menu = getClearToolbar(true).getMenu();
} else {
getClearToolbar(false);
}
createMenuItem(menu, HOME, R.string.home, createMenuItem(menu, HOME, R.string.home,
R.drawable.ic_action_home_dark, R.drawable.ic_action_home_dark, R.drawable.ic_action_home_dark, R.drawable.ic_action_home_dark,
MenuItemCompat.SHOW_AS_ACTION_IF_ROOM ); MenuItemCompat.SHOW_AS_ACTION_ALWAYS);
createMenuItem(menu, BACK, R.string.previous_button, createMenuItem(menu, BACK, R.string.previous_button,
0, 0, //R.drawable.ic_action_home_light, R.drawable.ic_action_home_dark, R.drawable.ic_action_undo_dark, R.drawable.ic_action_undo_dark,
MenuItemCompat.SHOW_AS_ACTION_IF_ROOM ); MenuItemCompat.SHOW_AS_ACTION_ALWAYS );
createMenuItem(menu, FORWARD, R.string.next_button, createMenuItem(menu, FORWARD, R.string.next_button,
0, 0, //R.drawable.ic_action_home_light, R.drawable.ic_action_home_dark, R.drawable.ic_action_redo_dark, R.drawable.ic_action_redo_dark,
MenuItemCompat.SHOW_AS_ACTION_IF_ROOM ); MenuItemCompat.SHOW_AS_ACTION_ALWAYS );
createMenuItem(menu, CLOSE, R.string.close, createMenuItem(menu, CLOSE, R.string.close,
R.drawable.ic_action_ok_dark, R.drawable.ic_action_ok_dark, R.drawable.ic_action_close_dark, R.drawable.ic_action_close_dark,
MenuItemCompat.SHOW_AS_ACTION_IF_ROOM ); MenuItemCompat.SHOW_AS_ACTION_ALWAYS );
return super.onCreateOptionsMenu(menu); return super.onCreateOptionsMenu(menu);
} }
@ -162,4 +171,12 @@ public class HelpActivity extends OsmandActionBarActivity {
public boolean isLightActionBar() { public boolean isLightActionBar() {
return ((OsmandApplication) getApplication()).getSettings().isLightActionBar(); return ((OsmandApplication) getApplication()).getSettings().isLightActionBar();
} }
public Toolbar getClearToolbar(boolean visible) {
final Toolbar tb = (Toolbar) findViewById(R.id.bottomControls);
tb.setTitle(null);
tb.getMenu().clear();
tb.setVisibility(visible? View.VISIBLE : View.GONE);
return tb;
}
} }

View file

@ -97,7 +97,7 @@ public class SearchAddressFragment extends Fragment {
if(getActivity() instanceof SearchAddressActivity) { if(getActivity() instanceof SearchAddressActivity) {
MenuItem menuItem = menu.add(0, SELECT_POINT, 0, ""); MenuItem menuItem = menu.add(0, SELECT_POINT, 0, "");
MenuItemCompat.setShowAsAction(menuItem, MenuItemCompat.SHOW_AS_ACTION_ALWAYS); MenuItemCompat.setShowAsAction(menuItem, MenuItemCompat.SHOW_AS_ACTION_ALWAYS);
menuItem = menuItem.setIcon(light ? R.drawable.ic_action_ok_dark : R.drawable.ic_action_ok_dark); menuItem = menuItem.setIcon(R.drawable.ic_action_ok_dark);
menuItem.setOnMenuItemClickListener(new OnMenuItemClickListener() { menuItem.setOnMenuItemClickListener(new OnMenuItemClickListener() {
@Override @Override
public boolean onMenuItemClick(MenuItem item) { public boolean onMenuItemClick(MenuItem item) {
@ -108,7 +108,7 @@ public class SearchAddressFragment extends Fragment {
} else { } else {
MenuItem menuItem = menu.add(0, NAVIGATE_TO, 0, R.string.context_menu_item_directions_to); MenuItem menuItem = menu.add(0, NAVIGATE_TO, 0, R.string.context_menu_item_directions_to);
MenuItemCompat.setShowAsAction(menuItem, MenuItemCompat.SHOW_AS_ACTION_ALWAYS); MenuItemCompat.setShowAsAction(menuItem, MenuItemCompat.SHOW_AS_ACTION_ALWAYS);
menuItem = menuItem.setIcon(light ? R.drawable.ic_action_gdirections_light : R.drawable.ic_action_gdirections_dark); menuItem = menuItem.setIcon(R.drawable.ic_action_gdirections_dark);
menuItem.setOnMenuItemClickListener(new OnMenuItemClickListener() { menuItem.setOnMenuItemClickListener(new OnMenuItemClickListener() {
@Override @Override
public boolean onMenuItemClick(MenuItem item) { public boolean onMenuItemClick(MenuItem item) {
@ -120,11 +120,11 @@ public class SearchAddressFragment extends Fragment {
if (targets.getPointToNavigate() != null) { if (targets.getPointToNavigate() != null) {
menuItem = menu.add(0, ADD_WAYPOINT, 0, R.string.context_menu_item_intermediate_point); menuItem = menu.add(0, ADD_WAYPOINT, 0, R.string.context_menu_item_intermediate_point);
MenuItemCompat.setShowAsAction(menuItem, MenuItemCompat.SHOW_AS_ACTION_ALWAYS); MenuItemCompat.setShowAsAction(menuItem, MenuItemCompat.SHOW_AS_ACTION_ALWAYS);
menuItem = menuItem.setIcon(light ? R.drawable.ic_action_flage_light : R.drawable.ic_action_flage_dark); menuItem = menuItem.setIcon(R.drawable.ic_action_flage_dark);
} else { } else {
menuItem = menu.add(0, ADD_WAYPOINT, 0, R.string.context_menu_item_destination_point); menuItem = menu.add(0, ADD_WAYPOINT, 0, R.string.context_menu_item_destination_point);
MenuItemCompat.setShowAsAction(menuItem, MenuItemCompat.SHOW_AS_ACTION_ALWAYS); MenuItemCompat.setShowAsAction(menuItem, MenuItemCompat.SHOW_AS_ACTION_ALWAYS);
menuItem = menuItem.setIcon(light ? R.drawable.ic_action_flag_light : R.drawable.ic_action_flag_dark); menuItem = menuItem.setIcon(R.drawable.ic_action_flag_dark);
} }
menuItem.setOnMenuItemClickListener(new OnMenuItemClickListener() { menuItem.setOnMenuItemClickListener(new OnMenuItemClickListener() {
@Override @Override
@ -135,7 +135,7 @@ public class SearchAddressFragment extends Fragment {
}); });
menuItem = menu.add(0, SHOW_ON_MAP, 0, R.string.search_shown_on_map); menuItem = menu.add(0, SHOW_ON_MAP, 0, R.string.search_shown_on_map);
MenuItemCompat.setShowAsAction(menuItem, MenuItemCompat.SHOW_AS_ACTION_ALWAYS); MenuItemCompat.setShowAsAction(menuItem, MenuItemCompat.SHOW_AS_ACTION_ALWAYS);
menuItem = menuItem.setIcon(light ? R.drawable.ic_action_marker_light : R.drawable.ic_action_marker_dark); menuItem = menuItem.setIcon(R.drawable.ic_action_marker_dark);
menuItem.setOnMenuItemClickListener(new OnMenuItemClickListener() { menuItem.setOnMenuItemClickListener(new OnMenuItemClickListener() {
@Override @Override
@ -158,7 +158,7 @@ public class SearchAddressFragment extends Fragment {
}); });
menuItem = menu.add(0, ONLINE_SEARCH, 0, R.string.search_online_address); menuItem = menu.add(0, ONLINE_SEARCH, 0, R.string.search_online_address);
MenuItemCompat.setShowAsAction(menuItem, MenuItemCompat.SHOW_AS_ACTION_ALWAYS); MenuItemCompat.setShowAsAction(menuItem, MenuItemCompat.SHOW_AS_ACTION_ALWAYS);
menuItem = menuItem.setIcon(light ? R.drawable.ic_action_gnext_light : R.drawable.ic_action_gnext_dark); menuItem = menuItem.setIcon(R.drawable.ic_action_gnext_dark);
menuItem.setOnMenuItemClickListener(new OnMenuItemClickListener() { menuItem.setOnMenuItemClickListener(new OnMenuItemClickListener() {
@Override @Override
public boolean onMenuItemClick(MenuItem item) { public boolean onMenuItemClick(MenuItem item) {

View file

@ -59,15 +59,13 @@ public class SearchAddressOnlineFragment extends Fragment implements SearchActiv
@Override @Override
public void onCreateOptionsMenu(Menu onCreate, MenuInflater inflater) { public void onCreateOptionsMenu(Menu onCreate, MenuInflater inflater) {
boolean light = ((OsmandApplication) getActivity().getApplication()).getSettings().isLightActionBar();
Menu menu = onCreate; Menu menu = onCreate;
if(getActivity() instanceof SearchActivity) { if(getActivity() instanceof SearchActivity) {
menu = ((SearchActivity) getActivity()).getClearToolbar(true).getMenu(); menu = ((SearchActivity) getActivity()).getClearToolbar(true).getMenu();
} }
MenuItem menuItem = menu.add(0, 1, 0, R.string.search_offline_clear_search); MenuItem menuItem = menu.add(0, 1, 0, R.string.search_offline_clear_search);
MenuItemCompat.setShowAsAction(menuItem, MenuItemCompat.SHOW_AS_ACTION_ALWAYS | MenuItemCompat.SHOW_AS_ACTION_WITH_TEXT); MenuItemCompat.setShowAsAction(menuItem, MenuItemCompat.SHOW_AS_ACTION_ALWAYS | MenuItemCompat.SHOW_AS_ACTION_WITH_TEXT);
menuItem = menuItem.setIcon(light ? R.drawable.ic_action_gremove_light : R.drawable.ic_action_gremove_dark); menuItem = menuItem.setIcon(R.drawable.ic_action_gremove_dark);
menuItem.setOnMenuItemClickListener(new OnMenuItemClickListener() { menuItem.setOnMenuItemClickListener(new OnMenuItemClickListener() {
@Override @Override
public boolean onMenuItemClick(MenuItem item) { public boolean onMenuItemClick(MenuItem item) {
@ -79,7 +77,7 @@ public class SearchAddressOnlineFragment extends Fragment implements SearchActiv
if (getActivity() instanceof SearchActivity) { if (getActivity() instanceof SearchActivity) {
menuItem = menu.add(0, 0, 0, R.string.search_offline_address); menuItem = menu.add(0, 0, 0, R.string.search_offline_address);
MenuItemCompat.setShowAsAction(menuItem, MenuItemCompat.SHOW_AS_ACTION_ALWAYS | MenuItemCompat.SHOW_AS_ACTION_WITH_TEXT); MenuItemCompat.setShowAsAction(menuItem, MenuItemCompat.SHOW_AS_ACTION_ALWAYS | MenuItemCompat.SHOW_AS_ACTION_WITH_TEXT);
menuItem = menuItem.setIcon(light ? R.drawable.ic_action_gnext_light : R.drawable.ic_action_gnext_dark); menuItem = menuItem.setIcon(R.drawable.ic_action_gnext_dark);
menuItem.setOnMenuItemClickListener(new OnMenuItemClickListener() { menuItem.setOnMenuItemClickListener(new OnMenuItemClickListener() {
@Override @Override
public boolean onMenuItemClick(MenuItem item) { public boolean onMenuItemClick(MenuItem item) {

View file

@ -150,7 +150,7 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
showFilterItem = menu.add(0, FILTER, 0, R.string.search_poi_filter); showFilterItem = menu.add(0, FILTER, 0, R.string.search_poi_filter);
MenuItemCompat.setShowAsAction(showFilterItem, MenuItemCompat.setShowAsAction(showFilterItem,
MenuItemCompat.SHOW_AS_ACTION_ALWAYS); MenuItemCompat.SHOW_AS_ACTION_ALWAYS);
showFilterItem = showFilterItem.setIcon(light ? R.drawable.ic_action_filter_light: R.drawable.ic_action_filter_dark); showFilterItem = showFilterItem.setIcon(R.drawable.ic_action_filter_dark);
showFilterItem.setOnMenuItemClickListener(new OnMenuItemClickListener() { showFilterItem.setOnMenuItemClickListener(new OnMenuItemClickListener() {
@Override @Override
public boolean onMenuItemClick(MenuItem item) { public boolean onMenuItemClick(MenuItem item) {
@ -182,7 +182,7 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
showOnMapItem = menu.add(0, SHOW_ON_MAP, 0, R.string.search_shown_on_map); showOnMapItem = menu.add(0, SHOW_ON_MAP, 0, R.string.search_shown_on_map);
MenuItemCompat.setShowAsAction(showOnMapItem, MenuItemCompat.setShowAsAction(showOnMapItem,
MenuItemCompat.SHOW_AS_ACTION_ALWAYS); MenuItemCompat.SHOW_AS_ACTION_ALWAYS);
showOnMapItem = showOnMapItem.setIcon(light ? R.drawable.ic_action_map_marker_light : R.drawable.ic_action_map_marker_dark); showOnMapItem = showOnMapItem.setIcon(R.drawable.ic_action_map_marker_dark);
showOnMapItem.setOnMenuItemClickListener(new OnMenuItemClickListener() { showOnMapItem.setOnMenuItemClickListener(new OnMenuItemClickListener() {
@Override @Override
public boolean onMenuItemClick(MenuItem item) { public boolean onMenuItemClick(MenuItem item) {

View file

@ -1,6 +1,7 @@
package net.osmand.plus.helpers; package net.osmand.plus.helpers;
import android.app.Activity; import android.app.Activity;
import android.content.Context;
import android.content.pm.ActivityInfo; import android.content.pm.ActivityInfo;
import android.util.DisplayMetrics; import android.util.DisplayMetrics;
import android.util.Log; import android.util.Log;
@ -74,4 +75,10 @@ public class ScreenOrientationHelper {
return orientation; return orientation;
} }
public static boolean isOrientationPortrait(Activity ctx) {
int orientation = ScreenOrientationHelper.getScreenOrientation(ctx);
return orientation == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT ||
orientation == ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT;
}
} }

View file

@ -139,7 +139,7 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
} }
} }
setContentView(R.layout.osmo_group_list); setContentView(R.layout.osmo_group_list);
getSupportActionBar().setTitle(R.string.osmo_activity); getSupportActionBar().setTitle(R.string.osmo);
setSupportProgressBarIndeterminateVisibility(false); setSupportProgressBarIndeterminateVisibility(false);
setupHeader(); setupHeader();
setupFooter(); setupFooter();
@ -1152,10 +1152,15 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
} else { } else {
label.setTypeface(Typeface.DEFAULT, Typeface.ITALIC); label.setTypeface(Typeface.DEFAULT, Typeface.ITALIC);
} }
View v = row.findViewById(R.id.settings); ImageView v = (ImageView) row.findViewById(R.id.settings);
if(model.isMainGroup()) { if(model.isMainGroup()) {
v.setVisibility(View.GONE); v.setVisibility(View.GONE);
} else { } else {
if (getMyApplication().getSettings().isLightContent()){
v.setImageResource(R.drawable.ic_action_settings_light);
} else {
v.setImageResource(R.drawable.ic_action_settings_dark);
}
v.setVisibility(View.VISIBLE); v.setVisibility(View.VISIBLE);
v.setOnClickListener(new View.OnClickListener() { v.setOnClickListener(new View.OnClickListener() {