Added padding for activities which doesnt want action bar overlay

This commit is contained in:
Denis 2015-01-12 20:39:28 +02:00
parent 2d448bc562
commit a44ef3f35a
5 changed files with 13 additions and 7 deletions

View file

@ -9,6 +9,7 @@
<LinearLayout android:id="@+id/loading"
android:layout_width="fill_parent"
android:layout_height="@dimen/dashMapHeight"
android:paddingTop="?attr/actionBarSize"
android:gravity="center_vertical|center_horizontal"
android:orientation="horizontal">

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout"
android:layout_marginTop="?attr/actionBarSize"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
</FrameLayout>

View file

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_marginTop="?attr/actionBarSize"
android:layout_width="match_parent"
android:layout_height="match_parent">

View file

@ -71,9 +71,7 @@ public class FavouritesActivity extends ActionBarActivity {
}
if(!hasGpx) {
FrameLayout fl = new FrameLayout(this);
fl.setId(R.id.layout);
setContentView(fl);
setContentView(R.layout.search_activity_single);
getSupportFragmentManager().beginTransaction().add(R.id.layout, new FavouritesTreeFragment()).commit();
} else {
setContentView(R.layout.tab_content);

View file

@ -100,7 +100,6 @@ public class SearchActivity extends ActionBarActivity implements OsmAndLocationL
((OsmandApplication) getApplication()).applyTheme(this);
super.onCreate(savedInstanceState);
long t = System.currentTimeMillis();
//getSherlock().setUiOptions(ActivityInfo.UIOPTION_SPLIT_ACTION_BAR_WHEN_NARROW);
getSupportActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
setContentView(R.layout.search_main);
settings = ((OsmandApplication) getApplication()).getSettings();
@ -142,9 +141,7 @@ public class SearchActivity extends ActionBarActivity implements OsmAndLocationL
mTabsAdapter.addTab(transportTab, getFragment(TRANSPORT_TAB_INDEX), null);
tabHost.setCurrentTab(tab);
} else {
FrameLayout fl = new FrameLayout(this);
fl.setId(R.id.layout);
setContentView(fl);
setContentView(R.layout.search_activity_single);
Class<?> cl = getFragment(tab);
try {
getSupportFragmentManager().beginTransaction().replace(R.id.layout, (Fragment) cl.newInstance()).commit();