Make actionbar transparent on dashboard

This commit is contained in:
Denis 2015-01-12 11:57:14 +02:00
parent 8714cb380e
commit 038361b062
6 changed files with 56 additions and 73 deletions

View file

@ -1,24 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:background="@drawable/bg_cardui"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<LinearLayout android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="@dimen/dashHeaderHeight">
<TextView android:id="@+id/map_text"
android:text="@string/map_Button"
style="@style/DashboardSubHeader"/>
<Button android:id="@+id/show_map"
android:text="@string/show_map"
style="@style/DashboardGeneralButton"/>
</LinearLayout>
<RelativeLayout android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/subHeaderPadding">
<LinearLayout android:id="@+id/loading"
android:layout_width="fill_parent"
android:layout_height="@dimen/dashMapHeight"
@ -45,10 +32,5 @@
android:src="@drawable/background"
android:layout_width="match_parent"
android:layout_height="@dimen/dashMapHeight"
android:layout_marginLeft="@dimen/subHeaderPadding"
android:layout_marginRight="@dimen/subHeaderPadding"
android:layout_marginBottom="@dimen/subHeaderPadding"
android:visibility="gone"/>
</RelativeLayout>
</LinearLayout>
</RelativeLayout>

View file

@ -1,19 +1,30 @@
<?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:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/main_scroll"
android:background="@color/dashboard_background" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="@dimen/dashPadding" >
android:layout_height="wrap_content"
android:orientation="vertical">
<fragment
android:layout_marginRight="-3dp"
android:layout_marginLeft="-3dp"
android:layout_marginTop="-3dp"
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mapFragment"
android:name="net.osmand.plus.dashboard.DashMapFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:padding="@dimen/dashPadding" >
<LinearLayout android:id="@+id/content"
android:orientation="vertical"
@ -22,12 +33,7 @@
<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:id="@+id/SearchFragment"
android:name="net.osmand.plus.dashboard.DashSearchFragment"
android:layout_marginTop="@dimen/dashCardMargin"
android:layout_width="match_parent"
@ -35,6 +41,7 @@
<fragment
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/FavoritesFragment"
android:name="net.osmand.plus.dashboard.DashFavoritesFragment"
android:layout_marginTop="@dimen/dashCardMargin"
android:layout_width="match_parent"
@ -42,6 +49,7 @@
<fragment
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/NotesFragment"
android:name="net.osmand.plus.dashboard.DashAudioVideoNotesFragment"
android:layout_marginTop="@dimen/dashCardMargin"
android:layout_width="match_parent"
@ -49,6 +57,7 @@
<fragment
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/DownloadFragment"
android:name="net.osmand.plus.dashboard.DashDownloadMapsFragment"
android:layout_marginTop="@dimen/dashCardMargin"
android:layout_width="match_parent"
@ -56,6 +65,7 @@
<fragment
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/UpdateFragment"
android:name="net.osmand.plus.dashboard.DashUpdatesFragment"
android:layout_marginTop="@dimen/dashCardMargin"
android:layout_width="match_parent"
@ -63,34 +73,27 @@
<fragment
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/PluginFragment"
android:name="net.osmand.plus.dashboard.DashPluginsFragment"
android:layout_marginTop="@dimen/dashCardMargin"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
<LinearLayout android:id="@+id/credentials"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:visibility="gone"
android:padding="@dimen/dashPadding"
android:baselineAligned="false">
<LinearLayout android:id="@+id/credentials"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:visibility="gone"
android:padding="@dimen/dashPadding"
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="@dimen/dashAboutTextSize" />
</LinearLayout>
<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="@dimen/dashAboutTextSize"/>
</LinearLayout>
</LinearLayout>

View file

@ -9,7 +9,7 @@
<dimen name="dashFavIconSize">28dp</dimen>
<dimen name="dashFavIconMargin">12dp</dimen>
<dimen name="dashFavDirectionSize">10dp</dimen>
<dimen name="dashMapHeight">110dp</dimen>
<dimen name="dashMapHeight">200dp</dimen>
<dimen name="dashNoteIconSize">28dp</dimen>
<dimen name="dashPluginPadding">4dp</dimen>
<dimen name="dashPluginMargin">8dp</dimen>

View file

@ -52,10 +52,18 @@
<item name="android:divider">@drawable/tab_text_separator</item>
</style>
<style name="MainMenuActionBar" parent="Theme.AppCompat.Light.DarkActionBar">
<!--<item name="android:windowActionBarOverlay">true</item>-->
<!-- Support library compatibility -->
<item name="windowActionBarOverlay">true</item>
</style>
<style name="OsmandLightTheme" parent="Theme.AppCompat.Light">
<item name="expandable_category_color">@color/group_background</item>
<item name="reset_image">@drawable/ic_action_delete_light</item> <!-- @drawable/a_1_navigation_cancel_light -->
<item name="windowActionBarOverlay">true</item>
</style>
<style name="OsmandLightDarkActionBarTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!--<item name="android:windowContentOverlay">@null</item>
@ -77,6 +85,7 @@
<item name="reset_image">@drawable/ic_action_delete_dark</item> <!-- @drawable/a_1_navigation_cancel_dark -->
<item name="expandable_category_color">?android:attr/colorBackground</item>
<item name="android:spinnerStyle">@style/Widget.Spinner</item>
<item name="windowActionBarOverlay">true</item>
</style>
<style name="Widget.Styled.ActionBar" parent="Widget.AppCompat.Light.ActionBar.Solid.Inverse">

View file

@ -7,6 +7,7 @@ import java.util.List;
import java.util.Random;
import android.support.v4.view.MenuItemCompat;
import android.support.v7.app.ActionBar;
import android.view.*;
import net.osmand.Location;
import net.osmand.access.AccessibleAlertBuilder;
@ -101,10 +102,12 @@ public class MainMenuActivity extends BaseDownloadActivity implements OsmAndLoca
if (textVersion.indexOf("#") != -1) {
textVersion = textVersion.substring(0, textVersion.indexOf("#") + 1);
}
getSupportActionBar().setTitle(textVersion);
ColorDrawable color = new ColorDrawable(getResources().getColor(R.color.actionbar_color));
getSupportActionBar().setBackgroundDrawable(color);
getSupportActionBar().setIcon(android.R.color.transparent);
ActionBar actionBar = getSupportActionBar();
actionBar.setTitle(textVersion);
actionBar.setIcon(android.R.color.transparent);
actionBar.setBackgroundDrawable(new ColorDrawable(Color.argb(128, 0, 0, 0)));
//ColorDrawable color = new ColorDrawable(getResources().getColor(R.color.actionbar_color));
//getSupportActionBar().setBackgroundDrawable(color);
boolean firstTime = initApp(this, getMyApplication());
if (getMyApplication().getAppCustomization().checkExceptionsOnStart()) {

View file

@ -11,13 +11,10 @@ import net.osmand.map.MapTileDownloader.IMapDownloaderCallback;
import net.osmand.plus.R;
import net.osmand.plus.activities.MainMenuActivity;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.helpers.FontCache;
import net.osmand.plus.render.MapRenderRepositories;
import net.osmand.plus.resources.ResourceManager;
import android.graphics.Typeface;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.widget.Button;
import android.widget.ProgressBar;
import android.widget.TextView;
@ -48,18 +45,7 @@ public class DashMapFragment extends DashBaseFragment implements IMapDownloaderC
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = getActivity().getLayoutInflater().inflate(R.layout.dash_map_fragment, container, false);
Typeface typeface = FontCache.getRobotoMedium(getActivity());
((TextView) view.findViewById(R.id.map_text)).setTypeface(typeface);
((Button) view.findViewById(R.id.show_map)).setTypeface(typeface);
(view.findViewById(R.id.show_map)).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startMapActivity();
}
});
view.findViewById(R.id.map_image).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {