Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2014-12-15 11:06:09 +01:00
commit 28f336ba92
2 changed files with 77 additions and 3 deletions

View file

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/dashboard_background" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="6dp" >
<LinearLayout android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:orientation="vertical"
android:id="@+id/content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"/>
<LinearLayout
android:orientation="vertical"
android:id="@+id/content_land"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"/>
</LinearLayout>
<LinearLayout android:id="@+id/credentials"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:visibility="gone"
android:padding="6dp"
android:baselineAligned="false">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_weight="0.5" >
<TextView
android:id="@+id/About"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start|bottom"
android:text="@string/about_settings"
android:textSize="20sp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>

View file

@ -171,6 +171,7 @@ public class MainMenuActivity extends BaseDownloadActivity {
public void addFragments(boolean firstTime) {
android.support.v4.app.FragmentManager manager = getSupportFragmentManager();
android.support.v4.app.FragmentTransaction fragmentTransaction = manager.beginTransaction();
boolean tablet = findViewById(R.id.content_land) != null;
//after rotation list of fragments in fragment transaction is not cleared
//so we need to check whether some fragments are already existing
if (manager.findFragmentByTag(DashMapFragment.TAG) == null){
@ -182,8 +183,12 @@ public class MainMenuActivity extends BaseDownloadActivity {
}
if (manager.findFragmentByTag(DashSearchFragment.TAG) == null){
DashSearchFragment searchFragment = new DashSearchFragment();
if (tablet) {
fragmentTransaction.add(R.id.content_land, searchFragment, DashSearchFragment.TAG);
} else {
fragmentTransaction.add(R.id.content, searchFragment, DashSearchFragment.TAG);
}
}
if (manager.findFragmentByTag(DashFavoritesFragment.TAG) == null){
DashFavoritesFragment favoritesFragment = new DashFavoritesFragment();
fragmentTransaction.add(R.id.content, favoritesFragment, DashFavoritesFragment.TAG);
@ -194,12 +199,22 @@ public class MainMenuActivity extends BaseDownloadActivity {
}
if (manager.findFragmentByTag(DashDownloadMapsFragment.TAG) == null){
DashDownloadMapsFragment fragment = new DashDownloadMapsFragment();
if (tablet) {
fragmentTransaction.add(R.id.content_land, fragment, DashDownloadMapsFragment.TAG);
} else {
fragmentTransaction.add(R.id.content, fragment, DashDownloadMapsFragment.TAG);
}
}
if (manager.findFragmentByTag(DashPluginsFragment.TAG) == null){
DashPluginsFragment pluginsFragment = new DashPluginsFragment();
if (tablet) {
fragmentTransaction.add(R.id.content_land, pluginsFragment, DashPluginsFragment.TAG).commit();
} else {
fragmentTransaction.add(R.id.content, pluginsFragment, DashPluginsFragment.TAG).commit();
}
}
setupContributionVersion();
}