Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2014-12-15 15:14:55 +01:00
commit a64fb46722
6 changed files with 106 additions and 60 deletions

View file

@ -15,17 +15,61 @@
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"/>
android:layout_weight="1">
<LinearLayout android:id="@+id/content"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<fragment
xmlns:android="http://schemas.android.com/apk/res/android"
android:name="net.osmand.plus.dashboard.DashMapFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<fragment
xmlns:android="http://schemas.android.com/apk/res/android"
android:name="net.osmand.plus.dashboard.DashFavoritesFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<fragment
xmlns:android="http://schemas.android.com/apk/res/android"
android:name="net.osmand.plus.dashboard.DashUpdatesFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<fragment
xmlns:android="http://schemas.android.com/apk/res/android"
android:name="net.osmand.plus.dashboard.DashDownloadMapsFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:id="@+id/content_land"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"/>
android:layout_weight="1">
<fragment
xmlns:android="http://schemas.android.com/apk/res/android"
android:name="net.osmand.plus.dashboard.DashSearchFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<fragment
xmlns:android="http://schemas.android.com/apk/res/android"
android:name="net.osmand.plus.dashboard.DashPluginsFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
</LinearLayout>

View 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:layout_width="match_parent"
android:layout_height="match_parent">
</LinearLayout>

View file

@ -11,9 +11,50 @@
android:padding="6dp" >
<LinearLayout
android:orientation="vertical"
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
android:layout_height="match_parent">
<LinearLayout android:id="@+id/content"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<fragment
xmlns:android="http://schemas.android.com/apk/res/android"
android:name="net.osmand.plus.dashboard.DashMapFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<fragment
xmlns:android="http://schemas.android.com/apk/res/android"
android:name="net.osmand.plus.dashboard.DashSearchFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<fragment
xmlns:android="http://schemas.android.com/apk/res/android"
android:name="net.osmand.plus.dashboard.DashFavoritesFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<fragment
xmlns:android="http://schemas.android.com/apk/res/android"
android:name="net.osmand.plus.dashboard.DashUpdatesFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<fragment
xmlns:android="http://schemas.android.com/apk/res/android"
android:name="net.osmand.plus.dashboard.DashDownloadMapsFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<fragment
xmlns:android="http://schemas.android.com/apk/res/android"
android:name="net.osmand.plus.dashboard.DashPluginsFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
<LinearLayout android:id="@+id/credentials"
android:layout_width="fill_parent"

View file

@ -104,7 +104,10 @@ public class MainMenuActivity extends BaseDownloadActivity {
getSupportActionBar().setIcon(android.R.color.transparent);
boolean firstTime = initApp(this, getMyApplication());
addFragments(firstTime);
if(getMyApplication().getAppCustomization().checkExceptionsOnStart()){
checkPreviousRunsForExceptions(firstTime);
}
setupContributionVersion();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
FloatingActionButton fabButton = new FloatingActionButton.Builder(this)
@ -168,56 +171,6 @@ public class MainMenuActivity extends BaseDownloadActivity {
about.setMovementMethod(LinkMovementMethod.getInstance());
}
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){
DashMapFragment mapFragment = new DashMapFragment();
fragmentTransaction.add(R.id.content, mapFragment, DashMapFragment.TAG);
}
if(getMyApplication().getAppCustomization().checkExceptionsOnStart()){
checkPreviousRunsForExceptions(firstTime);
}
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);
}
if (manager.findFragmentByTag(DashUpdatesFragment.TAG) == null){
DashUpdatesFragment updatesFragment = new DashUpdatesFragment();
fragmentTransaction.add(R.id.content, updatesFragment, DashUpdatesFragment.TAG);
}
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();
}
private void addErrorFragment(){
android.support.v4.app.FragmentManager manager = getSupportFragmentManager();
android.support.v4.app.FragmentTransaction fragmentTransaction = manager.beginTransaction();

View file

@ -681,7 +681,7 @@ public class MapActivityActions implements DialogProvider {
ContextMenuAdapter optionsMenuHelper = new ContextMenuAdapter(app);
currentDrawer = DrawerType.MAIN_MENU;
optionsMenuHelper.item(R.string.home_button).icons(R.drawable.ic_action_quit_dark, R.drawable.ic_action_quit_light )
optionsMenuHelper.item(R.string.home_button).icons(R.drawable.ic_dashboard_dark, R.drawable.ic_dashboard_light )
.listen(new OnContextMenuClick() {
@Override
public boolean onContextMenuClick(ArrayAdapter<?> adapter, int itemId, int pos, boolean isChecked) {

View file

@ -212,9 +212,9 @@ public class OsmandRasterMapsPlugin extends OsmandPlugin {
adapter.item(R.string.layer_map).icons(R.drawable.ic_action_globus_dark, R.drawable.ic_action_globus_light)
.listen(listener).position(3).reg();
adapter.item(R.string.layer_overlay).selected(overlayLayer.getMap() != null ? 1 : 0).
icons(R.drawable.ic_action_up_dark, R.drawable.ic_action_up_light).listen(listener).position(14).reg();
icons(R.drawable.ic_layer_top_dark, R.drawable.ic_layer_top_light).listen(listener).position(14).reg();
adapter.item(R.string.layer_underlay).selected(underlayLayer.getMap() != null ? 1 : 0)
.icons(R.drawable.ic_action_down_dark, R.drawable.ic_action_down_light).listen(listener).position(15).reg();
.icons(R.drawable.ic_layer_bottom_dark, R.drawable.ic_layer_bottom_light).listen(listener).position(15).reg();
}