Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
28f336ba92
2 changed files with 77 additions and 3 deletions
59
OsmAnd/res/layout-large-land/dashboard.xml
Normal file
59
OsmAnd/res/layout-large-land/dashboard.xml
Normal 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>
|
|
@ -171,6 +171,7 @@ public class MainMenuActivity extends BaseDownloadActivity {
|
||||||
public void addFragments(boolean firstTime) {
|
public void addFragments(boolean firstTime) {
|
||||||
android.support.v4.app.FragmentManager manager = getSupportFragmentManager();
|
android.support.v4.app.FragmentManager manager = getSupportFragmentManager();
|
||||||
android.support.v4.app.FragmentTransaction fragmentTransaction = manager.beginTransaction();
|
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
|
//after rotation list of fragments in fragment transaction is not cleared
|
||||||
//so we need to check whether some fragments are already existing
|
//so we need to check whether some fragments are already existing
|
||||||
if (manager.findFragmentByTag(DashMapFragment.TAG) == null){
|
if (manager.findFragmentByTag(DashMapFragment.TAG) == null){
|
||||||
|
@ -182,7 +183,11 @@ public class MainMenuActivity extends BaseDownloadActivity {
|
||||||
}
|
}
|
||||||
if (manager.findFragmentByTag(DashSearchFragment.TAG) == null){
|
if (manager.findFragmentByTag(DashSearchFragment.TAG) == null){
|
||||||
DashSearchFragment searchFragment = new DashSearchFragment();
|
DashSearchFragment searchFragment = new DashSearchFragment();
|
||||||
fragmentTransaction.add(R.id.content, searchFragment, DashSearchFragment.TAG);
|
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){
|
if (manager.findFragmentByTag(DashFavoritesFragment.TAG) == null){
|
||||||
DashFavoritesFragment favoritesFragment = new DashFavoritesFragment();
|
DashFavoritesFragment favoritesFragment = new DashFavoritesFragment();
|
||||||
|
@ -194,11 +199,21 @@ public class MainMenuActivity extends BaseDownloadActivity {
|
||||||
}
|
}
|
||||||
if (manager.findFragmentByTag(DashDownloadMapsFragment.TAG) == null){
|
if (manager.findFragmentByTag(DashDownloadMapsFragment.TAG) == null){
|
||||||
DashDownloadMapsFragment fragment = new DashDownloadMapsFragment();
|
DashDownloadMapsFragment fragment = new DashDownloadMapsFragment();
|
||||||
fragmentTransaction.add(R.id.content, fragment, DashDownloadMapsFragment.TAG);
|
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){
|
if (manager.findFragmentByTag(DashPluginsFragment.TAG) == null){
|
||||||
DashPluginsFragment pluginsFragment = new DashPluginsFragment();
|
DashPluginsFragment pluginsFragment = new DashPluginsFragment();
|
||||||
fragmentTransaction.add(R.id.content, pluginsFragment, DashPluginsFragment.TAG).commit();
|
if (tablet) {
|
||||||
|
fragmentTransaction.add(R.id.content_land, pluginsFragment, DashPluginsFragment.TAG).commit();
|
||||||
|
} else {
|
||||||
|
fragmentTransaction.add(R.id.content, pluginsFragment, DashPluginsFragment.TAG).commit();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
setupContributionVersion();
|
setupContributionVersion();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue