Updated layout for Search Activity - Origin for Address and Favorites
This commit is contained in:
parent
ed4da2f033
commit
732281578e
6 changed files with 15 additions and 7 deletions
8
OsmAnd/res/layout/single_fragment_layout.xml
Normal file
8
OsmAnd/res/layout/single_fragment_layout.xml
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:id="@android:id/content"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
</LinearLayout>
|
|
@ -46,8 +46,6 @@ public class FavoritesActivity extends TabActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle icicle) {
|
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);
|
((OsmandApplication) getApplication()).applyTheme(this);
|
||||||
super.onCreate(icicle);
|
super.onCreate(icicle);
|
||||||
getSupportActionBar().setTitle(R.string.favorites_Button);
|
getSupportActionBar().setTitle(R.string.favorites_Button);
|
||||||
|
|
|
@ -2,6 +2,8 @@ package net.osmand.plus.activities;
|
||||||
|
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import net.osmand.plus.OsmandApplication;
|
import net.osmand.plus.OsmandApplication;
|
||||||
|
import net.osmand.plus.R;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
|
|
||||||
|
@ -11,6 +13,7 @@ public class FavoritesListActivity extends OsmandActionBarActivity {
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
((OsmandApplication) getApplication()).applyTheme(this);
|
((OsmandApplication) getApplication()).applyTheme(this);
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.single_fragment_layout);
|
||||||
if (savedInstanceState == null) {
|
if (savedInstanceState == null) {
|
||||||
// During initial setup, plug in the details fragment.
|
// During initial setup, plug in the details fragment.
|
||||||
FavoritesListFragment details = new FavoritesListFragment();
|
FavoritesListFragment details = new FavoritesListFragment();
|
||||||
|
|
|
@ -81,7 +81,6 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
|
||||||
private Set<FavoriteGroup> groupsToDelete = new LinkedHashSet<FavoriteGroup>();
|
private Set<FavoriteGroup> groupsToDelete = new LinkedHashSet<FavoriteGroup>();
|
||||||
private ActionMode actionMode;
|
private ActionMode actionMode;
|
||||||
private SearchView searchView;
|
private SearchView searchView;
|
||||||
protected boolean hideActionBar;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAttach(Activity activity) {
|
public void onAttach(Activity activity) {
|
||||||
|
|
|
@ -5,6 +5,8 @@ import android.view.MenuItem;
|
||||||
import net.osmand.plus.OsmandApplication;
|
import net.osmand.plus.OsmandApplication;
|
||||||
import android.content.pm.ActivityInfo;
|
import android.content.pm.ActivityInfo;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
|
import net.osmand.plus.R;
|
||||||
import net.osmand.plus.activities.OsmandActionBarActivity;
|
import net.osmand.plus.activities.OsmandActionBarActivity;
|
||||||
|
|
||||||
|
|
||||||
|
@ -13,10 +15,8 @@ public class SearchAddressActivity extends OsmandActionBarActivity {
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
((OsmandApplication) getApplication()).applyTheme(this);
|
((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);
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.single_fragment_layout);
|
||||||
if (savedInstanceState == null) {
|
if (savedInstanceState == null) {
|
||||||
// During initial setup, plug in the details fragment.
|
// During initial setup, plug in the details fragment.
|
||||||
SearchAddressFragment details = new SearchAddressFragment();
|
SearchAddressFragment details = new SearchAddressFragment();
|
||||||
|
|
|
@ -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_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() {
|
menuItem.setOnMenuItemClickListener(new OnMenuItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onMenuItemClick(MenuItem item) {
|
public boolean onMenuItemClick(MenuItem item) {
|
||||||
|
|
Loading…
Reference in a new issue