From 732281578e0bbb3a5b12fe246ae20445edf92633 Mon Sep 17 00:00:00 2001 From: Bars107 Date: Tue, 3 Feb 2015 16:31:50 +0200 Subject: [PATCH] Updated layout for Search Activity - Origin for Address and Favorites --- OsmAnd/res/layout/single_fragment_layout.xml | 8 ++++++++ .../src/net/osmand/plus/activities/FavoritesActivity.java | 2 -- .../net/osmand/plus/activities/FavoritesListActivity.java | 3 +++ .../net/osmand/plus/activities/FavoritesTreeFragment.java | 1 - .../plus/activities/search/SearchAddressActivity.java | 6 +++--- .../plus/activities/search/SearchAddressFragment.java | 2 +- 6 files changed, 15 insertions(+), 7 deletions(-) create mode 100644 OsmAnd/res/layout/single_fragment_layout.xml diff --git a/OsmAnd/res/layout/single_fragment_layout.xml b/OsmAnd/res/layout/single_fragment_layout.xml new file mode 100644 index 0000000000..2365f36d98 --- /dev/null +++ b/OsmAnd/res/layout/single_fragment_layout.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/activities/FavoritesActivity.java b/OsmAnd/src/net/osmand/plus/activities/FavoritesActivity.java index 4301d44246..5e42bc9679 100644 --- a/OsmAnd/src/net/osmand/plus/activities/FavoritesActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/FavoritesActivity.java @@ -46,8 +46,6 @@ public class FavoritesActivity extends TabActivity { @Override public void onCreate(Bundle icicle) { - //This has to be called before setContentView and you must use the - //class in com.actionbarsherlock.view and NOT android.view ((OsmandApplication) getApplication()).applyTheme(this); super.onCreate(icicle); getSupportActionBar().setTitle(R.string.favorites_Button); diff --git a/OsmAnd/src/net/osmand/plus/activities/FavoritesListActivity.java b/OsmAnd/src/net/osmand/plus/activities/FavoritesListActivity.java index 44d71af761..9c43feba44 100644 --- a/OsmAnd/src/net/osmand/plus/activities/FavoritesListActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/FavoritesListActivity.java @@ -2,6 +2,8 @@ package net.osmand.plus.activities; import android.view.MenuItem; import net.osmand.plus.OsmandApplication; +import net.osmand.plus.R; + import android.os.Bundle; @@ -11,6 +13,7 @@ public class FavoritesListActivity extends OsmandActionBarActivity { protected void onCreate(Bundle savedInstanceState) { ((OsmandApplication) getApplication()).applyTheme(this); super.onCreate(savedInstanceState); + setContentView(R.layout.single_fragment_layout); if (savedInstanceState == null) { // During initial setup, plug in the details fragment. FavoritesListFragment details = new FavoritesListFragment(); diff --git a/OsmAnd/src/net/osmand/plus/activities/FavoritesTreeFragment.java b/OsmAnd/src/net/osmand/plus/activities/FavoritesTreeFragment.java index ae35e6a5e6..90f7b1d097 100644 --- a/OsmAnd/src/net/osmand/plus/activities/FavoritesTreeFragment.java +++ b/OsmAnd/src/net/osmand/plus/activities/FavoritesTreeFragment.java @@ -81,7 +81,6 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment { private Set groupsToDelete = new LinkedHashSet(); private ActionMode actionMode; private SearchView searchView; - protected boolean hideActionBar; @Override public void onAttach(Activity activity) { diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchAddressActivity.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchAddressActivity.java index 7bae5238ab..70735bec7a 100644 --- a/OsmAnd/src/net/osmand/plus/activities/search/SearchAddressActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchAddressActivity.java @@ -5,6 +5,8 @@ import android.view.MenuItem; import net.osmand.plus.OsmandApplication; import android.content.pm.ActivityInfo; import android.os.Bundle; + +import net.osmand.plus.R; import net.osmand.plus.activities.OsmandActionBarActivity; @@ -13,10 +15,8 @@ public class SearchAddressActivity extends OsmandActionBarActivity { @Override protected void onCreate(Bundle savedInstanceState) { ((OsmandApplication) getApplication()).applyTheme(this); - if (Build.VERSION.SDK_INT > Build.VERSION_CODES.ICE_CREAM_SANDWICH) { - getWindow().setUiOptions(ActivityInfo.UIOPTION_SPLIT_ACTION_BAR_WHEN_NARROW); - } super.onCreate(savedInstanceState); + setContentView(R.layout.single_fragment_layout); if (savedInstanceState == null) { // During initial setup, plug in the details fragment. SearchAddressFragment details = new SearchAddressFragment(); diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchAddressFragment.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchAddressFragment.java index 0b49b7c17a..9f2906ad02 100644 --- a/OsmAnd/src/net/osmand/plus/activities/search/SearchAddressFragment.java +++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchAddressFragment.java @@ -97,7 +97,7 @@ public class SearchAddressFragment extends Fragment { if(getActivity() instanceof SearchAddressActivity) { MenuItem menuItem = menu.add(0, SELECT_POINT, 0, ""); MenuItemCompat.setShowAsAction(menuItem, MenuItemCompat.SHOW_AS_ACTION_ALWAYS); - menuItem = menuItem.setIcon(light ? R.drawable.ic_action_ok_light : R.drawable.ic_action_ok_dark); + menuItem = menuItem.setIcon(light ? R.drawable.ic_action_ok_dark : R.drawable.ic_action_ok_dark); menuItem.setOnMenuItemClickListener(new OnMenuItemClickListener() { @Override public boolean onMenuItemClick(MenuItem item) {