Fix visual styles in QSCustomizer and CarrierText

Test: manual, including Dark mode

Change-Id: I08605045e93f2e653c67350add52f2190d87cfe0
Fixes: 124251376
Fixes: 124250851
This commit is contained in:
Fabian Kozynski
2019-02-12 13:54:16 -05:00
parent 8e95f0bfb9
commit f80234c190
12 changed files with 57 additions and 22 deletions

View File

@@ -0,0 +1,17 @@
<!--
Copyright (C) 2019 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<color xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/qs_customize_decoration"/>

View File

@@ -15,7 +15,7 @@
-->
<inset xmlns:android="http://schemas.android.com/apk/res/android">
<shape>
<solid android:color="?android:attr/colorPrimary"/>
<solid android:color="@color/qs_customize_background"/>
<corners android:radius="?android:attr/dialogCornerRadius" />
</shape>
</inset>

View File

@@ -15,7 +15,7 @@
-->
<inset xmlns:android="http://schemas.android.com/apk/res/android">
<shape>
<solid android:color="?android:attr/colorSecondary"/>
<solid android:color="@color/qs_customize_background"/>
<corners
android:topLeftRadius="?android:attr/dialogCornerRadius"
android:topRightRadius="?android:attr/dialogCornerRadius" />

View File

@@ -71,7 +71,7 @@
android:gravity="center_vertical"
android:ellipsize="marquee"
android:textDirection="locale"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textAppearance="@style/TextAppearance.StatusBar.Clock"
android:textColor="?attr/wallpaperTextColorSecondary"
android:singleLine="true"
systemui:showMissingSim="true"

View File

@@ -24,5 +24,4 @@
android:paddingTop="20dp"
android:paddingBottom="13dp"
android:textAppearance="@style/TextAppearance.QSEdit.Headers"
android:textColor="?android:attr/colorAccent"
android:text="@string/drag_to_add_tiles" />

View File

@@ -24,5 +24,4 @@
android:gravity="center"
android:minHeight="@dimen/qs_customize_header_min_height"
android:textAppearance="@style/TextAppearance.QSEdit.Headers"
android:textColor="?android:attr/colorAccent"
android:text="@string/drag_to_rearrange_tiles" />

View File

@@ -37,7 +37,8 @@
android:layout_height="wrap_content"
android:background="@drawable/qs_customizer_toolbar"
android:navigationContentDescription="@*android:string/action_bar_up_description"
style="?android:attr/toolbarStyle" />
style="@style/QSCustomizeToolbar"
/>
<androidx.recyclerview.widget.RecyclerView
android:id="@android:id/list"

View File

@@ -41,4 +41,10 @@
<!-- The color of the text inside a notification -->
<color name="notification_primary_text_color">@*android:color/notification_primary_text_color_dark</color>
<!-- The color of the background in the top part of QSCustomizer -->
<color name="qs_customize_background">@color/GM2_grey_900</color>
<!-- The color of the background in the bottom part of QSCustomizer -->
<color name="qs_customize_decoration">@color/GM2_grey_800</color>
</resources>

View File

@@ -35,6 +35,8 @@
<color name="status_bar_clock_color">#FFFFFFFF</color>
<color name="qs_user_detail_icon_muted">#FFFFFFFF</color> <!-- not so muted after all -->
<color name="qs_tile_disabled_color">#9E9E9E</color> <!-- 38% black -->
<color name="qs_customize_background">@color/GM2_grey_50</color>
<color name="qs_customize_decoration">@color/GM2_grey_100</color>
<!-- Tint color for the content on the notification overflow card. -->
<color name="keyguard_overflow_content_color">#ff686868</color>
@@ -72,7 +74,7 @@
<color name="notification_primary_text_color">@*android:color/notification_primary_text_color_light</color>
<!-- The "inside" of a notification, reached via longpress -->
<color name="notification_guts_bg_color">#f8f9fa</color>
<color name="notification_guts_bg_color">@color/GM2_grey_50</color>
<color name="assist_orb_color">#ffffff</color>
@@ -123,7 +125,7 @@
<color name="zen_introduction">#ffffffff</color>
<color name="smart_reply_button_text">#5F6368</color>
<color name="smart_reply_button_text">@color/GM2_grey_700</color>
<color name="smart_reply_button_text_dark_bg">@*android:color/notification_primary_text_color_dark</color>
<color name="smart_reply_button_background">#ffffffff</color>
<color name="smart_reply_button_stroke">#ffdadce0</color>
@@ -134,4 +136,17 @@
<!-- Logout button -->
<color name="logout_button_bg_color">#ccffffff</color>
<!-- GM2 colors -->
<color name="GM2_grey_50">#F8F9FA</color>
<color name="GM2_grey_100">#F1F3F4</color>
<color name="GM2_grey_200">#E8EAED</color>
<color name="GM2_grey_300">#DADCE0</color>
<color name="GM2_grey_400">#BDC1C6</color>
<color name="GM2_grey_500">#9AA0A6</color>
<color name="GM2_grey_600">#80868B</color>
<color name="GM2_grey_650">#70757A</color>
<color name="GM2_grey_700">#5F6368</color>
<color name="GM2_grey_800">#3C4043</color>
<color name="GM2_grey_900">#202124</color>
</resources>

View File

@@ -458,8 +458,15 @@
</style>
<style name="TextAppearance.QSEdit.Headers"
parent="@*android:style/TextAppearance.Material.Body2">
<item name="android:fontFamily">@*android:string/config_headlineFontFamily</item>
parent="@*android:style/TextAppearance.DeviceDefault.Body2">
<item name="android:textSize">11sp</item>
<item name="android:textColor">?android:attr/textColorSecondary</item>
<item name="android:textAllCaps">true</item>
</style>
<style name="QSCustomizeToolbar" parent="@*android:style/Widget.DeviceDefault.Toolbar">
<item name="android:textColor">?android:attr/textColorPrimary</item>
<item name="android:elevation">10dp</item>
</style>
<style name="edit_theme" parent="qs_theme">

View File

@@ -38,7 +38,6 @@ import androidx.recyclerview.widget.RecyclerView;
import com.android.internal.logging.MetricsLogger;
import com.android.internal.logging.nano.MetricsProto;
import com.android.settingslib.Utils;
import com.android.systemui.Dependency;
import com.android.systemui.R;
import com.android.systemui.plugins.qs.QS;
@@ -103,10 +102,6 @@ public class QSCustomizer extends LinearLayout implements OnMenuItemClickListene
mToolbar.getMenu().add(Menu.NONE, MENU_RESET, 0,
mContext.getString(com.android.internal.R.string.reset));
mToolbar.setTitle(R.string.qs_edit);
int accentColor = Utils.getColorAttrDefaultColor(context, android.R.attr.colorAccent);
mToolbar.setTitleTextColor(accentColor);
mToolbar.getNavigationIcon().setTint(accentColor);
mToolbar.getOverflowIcon().setTint(accentColor);
mRecyclerView = findViewById(android.R.id.list);
mTransparentView = findViewById(R.id.customizer_transparent_view);
mTileAdapter = new TileAdapter(getContext());

View File

@@ -19,9 +19,8 @@ import android.app.AlertDialog.Builder;
import android.content.ComponentName;
import android.content.Context;
import android.content.DialogInterface;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.os.Handler;
import android.view.LayoutInflater;
import android.view.View;
@@ -505,13 +504,10 @@ public class TileAdapter extends RecyclerView.Adapter<Holder> implements TileSta
};
private class TileItemDecoration extends ItemDecoration {
private final ColorDrawable mDrawable;
private final Drawable mDrawable;
private TileItemDecoration(Context context) {
TypedArray ta =
context.obtainStyledAttributes(new int[]{android.R.attr.colorSecondary});
mDrawable = new ColorDrawable(ta.getColor(0, 0));
ta.recycle();
mDrawable = context.getDrawable(R.drawable.qs_customize_tile_decoration);
}