[android] Background color fix.

This commit is contained in:
Roman Romanov 2016-11-09 15:53:11 +04:00
parent d6ab3b9d0c
commit deeee25526
7 changed files with 59 additions and 4 deletions

View file

@ -13,7 +13,7 @@
android:paddingTop="@dimen/margin_half"
android:paddingBottom="@dimen/margin_half"
android:layout_marginRight="@dimen/margin_base"
android:background="?panel"
android:background="?cardBackground"
android:textAppearance="@style/MwmTextAppearance.Caption"
tools:text="Downloaded"
tools:background="#80FF0000"/>

View file

@ -3,7 +3,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
style="@style/MwmWidget.Floating"
android:background="?windowBackgroundForced"
android:background="?cardBackground"
android:layout_width="match_parent"
android:layout_height="match_parent">
<include layout="@layout/toolbar_with_search"/>

View file

@ -6,7 +6,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:animateLayoutChanges="true"
android:background="?windowBackgroundForced">
android:background="?cardBackground">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"

View file

@ -15,10 +15,21 @@
<item name="android:windowBackground">@null</item>
</style>
<style name="MwmTheme.Settings"/>
<style name="MwmTheme.Settings">
<item name="android:windowBackground">@color/bg_cards</item>
</style>
<style name="MwmTheme.Night.Settings">
<item name="colorSwitchThumbNormal">?android:colorControlNormal</item>
<item name="android:windowBackground">@color/bg_cards_night</item>
</style>
<style name="MwmTheme.CardBg">
<item name="android:windowBackground">@color/bg_cards</item>
</style>
<style name="MwmTheme.Night.CardBg">
<item name="android:windowBackground">@color/bg_cards_night</item>
</style>
<style name="MwmTheme.DialogFragment" parent="android:Theme.Holo.Light.Dialog.NoActionBar">

View file

@ -1,10 +1,25 @@
package com.mapswithme.maps.bookmarks;
import android.support.v4.app.Fragment;
import com.mapswithme.maps.R;
import com.mapswithme.maps.base.BaseToolbarActivity;
import com.mapswithme.util.ThemeUtils;
public class BookmarkCategoriesActivity extends BaseToolbarActivity
{
@Override
public int getThemeResourceId(String theme)
{
if (ThemeUtils.isDefaultTheme(theme))
return R.style.MwmTheme_CardBg;
if (ThemeUtils.isNightTheme(theme))
return R.style.MwmTheme_Night_CardBg;
throw new IllegalArgumentException("Attempt to apply unsupported theme: " + theme);
}
@Override
protected Class<? extends Fragment> getFragmentClass()
{

View file

@ -1,10 +1,25 @@
package com.mapswithme.maps.bookmarks;
import android.support.v4.app.Fragment;
import com.mapswithme.maps.R;
import com.mapswithme.maps.base.BaseToolbarActivity;
import com.mapswithme.util.ThemeUtils;
public class BookmarkListActivity extends BaseToolbarActivity
{
@Override
public int getThemeResourceId(String theme)
{
if (ThemeUtils.isDefaultTheme(theme))
return R.style.MwmTheme_CardBg;
if (ThemeUtils.isNightTheme(theme))
return R.style.MwmTheme_Night_CardBg;
throw new IllegalArgumentException("Attempt to apply unsupported theme: " + theme);
}
@Override
protected Class<? extends Fragment> getFragmentClass()
{

View file

@ -6,9 +6,11 @@ import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.NavUtils;
import com.mapswithme.maps.R;
import com.mapswithme.maps.activity.CustomNavigateUpListener;
import com.mapswithme.maps.base.BaseMwmFragmentActivity;
import com.mapswithme.maps.base.OnBackPressListener;
import com.mapswithme.util.ThemeUtils;
public class SearchActivity extends BaseMwmFragmentActivity implements CustomNavigateUpListener
{
@ -21,6 +23,18 @@ public class SearchActivity extends BaseMwmFragmentActivity implements CustomNav
context.startActivity(i);
}
@Override
public int getThemeResourceId(String theme)
{
if (ThemeUtils.isDefaultTheme(theme))
return R.style.MwmTheme_CardBg;
if (ThemeUtils.isNightTheme(theme))
return R.style.MwmTheme_Night_CardBg;
throw new IllegalArgumentException("Attempt to apply unsupported theme: " + theme);
}
@Override
protected Class<? extends Fragment> getFragmentClass()
{