Updated layout for old androids

This commit is contained in:
Bars107 2015-01-23 13:10:30 +02:00
parent e484703e35
commit 813d3638c0
4 changed files with 22 additions and 4 deletions

View file

@ -32,6 +32,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<fragment
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ErrorFragment"
android:name="net.osmand.plus.dashboard.DashErrorFragment"
android:layout_marginTop="@dimen/dashCardMargin"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<fragment
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/SearchFragment"
@ -91,7 +99,7 @@
<!--To make sure that floating button is always visible-->
<View android:layout_width="match_parent"
android:layout_height="76dp"
android:layout_height="@dimen/dashFABMargin"
android:orientation="vertical"/>
</LinearLayout>

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="dashFABMargin">76dp</dimen>
</resources>

View file

@ -20,6 +20,7 @@
<dimen name="dashAboutTextSize">20sp</dimen>
<dimen name="dashCardMargin">4dp</dimen>
<dimen name="abp__shadow_height">4dp</dimen>
<dimen name="dashFABMargin">0dp</dimen>
<!-- TextSizes -->
<dimen name="showAllButtonTextSize">12sp</dimen>

View file

@ -94,10 +94,14 @@ public class MainMenuActivity extends BaseDownloadActivity implements OsmAndLoca
if (headerHeight < t - margin){
//hiding action bar - showing floating button
//getSupportActionBar().hide();
fabButton.showFloatingActionButton();
if (fabButton != null) {
fabButton.showFloatingActionButton();
}
} else {
//getSupportActionBar().show();
fabButton.hideFloatingActionButton();
if (fabButton != null) {
fabButton.hideFloatingActionButton();
}
//makes other cards to move on top of the map card to make it look like android animations
View fragments = findViewById(R.id.fragments);
@ -189,8 +193,9 @@ public class MainMenuActivity extends BaseDownloadActivity implements OsmAndLoca
startMapActivity();
}
});
fabButton.hideFloatingActionButton();
}
fabButton.hideFloatingActionButton();
getLocationProvider().addCompassListener(this);
getLocationProvider().registerOrUnregisterCompassListener(true);