Merge "Share buttons change" into main
This commit is contained in:
committed by
Android (Google) Code Review
commit
2a4ad7f8a1
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* Copyright (C) 2025 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.
|
||||
*/
|
||||
|
||||
package com.android.quickstep.util
|
||||
|
||||
import android.content.res.Configuration
|
||||
import android.content.res.Resources
|
||||
import android.graphics.Typeface
|
||||
import com.android.wm.shell.shared.TypefaceUtils
|
||||
|
||||
object FontUtils {
|
||||
|
||||
private val baseTypeface =
|
||||
Typeface.create(TypefaceUtils.FontFamily.GSF_LABEL_LARGE.value, Typeface.NORMAL)
|
||||
|
||||
@JvmStatic
|
||||
fun getTypeFace(resources: Resources): Typeface =
|
||||
Typeface.create(baseTypeface, getFontWeight(resources), /* italic= */ false)
|
||||
|
||||
fun getFontWeight(resources: Resources): Int {
|
||||
val fontWeightAdjustment: Int = resources.configuration.fontWeightAdjustment
|
||||
return if (fontWeightAdjustment != Configuration.FONT_WEIGHT_ADJUSTMENT_UNDEFINED) {
|
||||
Typeface.Builder.NORMAL_WEIGHT + fontWeightAdjustment
|
||||
} else {
|
||||
Typeface.Builder.NORMAL_WEIGHT
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -217,6 +217,7 @@ import com.android.quickstep.recents.viewmodel.RecentsViewModel;
|
||||
import com.android.quickstep.util.ActiveGestureProtoLogProxy;
|
||||
import com.android.quickstep.util.AnimUtils;
|
||||
import com.android.quickstep.util.DesktopTask;
|
||||
import com.android.quickstep.util.FontUtils;
|
||||
import com.android.quickstep.util.GroupTask;
|
||||
import com.android.quickstep.util.LayoutUtils;
|
||||
import com.android.quickstep.util.RecentsAtomicAnimationFactory;
|
||||
@@ -983,12 +984,7 @@ public abstract class RecentsView<
|
||||
|
||||
mEmptyMessagePaint.setTextSize(getResources()
|
||||
.getDimension(R.dimen.recents_empty_message_text_size));
|
||||
Typeface typeface = Typeface.create(
|
||||
Typeface.create(TypefaceUtils.FontFamily.GSF_LABEL_LARGE.getValue(),
|
||||
Typeface.NORMAL),
|
||||
getFontWeight(),
|
||||
false);
|
||||
mEmptyMessagePaint.setTypeface(typeface);
|
||||
mEmptyMessagePaint.setTypeface(FontUtils.getTypeFace(getResources()));
|
||||
mEmptyMessagePaint.setAntiAlias(true);
|
||||
mEmptyMessagePadding = getResources()
|
||||
.getDimensionPixelSize(R.dimen.recents_empty_message_text_padding);
|
||||
@@ -7007,14 +7003,6 @@ public abstract class RecentsView<
|
||||
}
|
||||
}
|
||||
|
||||
private int getFontWeight() {
|
||||
int fontWeightAdjustment = getResources().getConfiguration().fontWeightAdjustment;
|
||||
if (fontWeightAdjustment != Configuration.FONT_WEIGHT_ADJUSTMENT_UNDEFINED) {
|
||||
return Typeface.Builder.NORMAL_WEIGHT + fontWeightAdjustment;
|
||||
}
|
||||
return Typeface.Builder.NORMAL_WEIGHT;
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs the spring animations as a task dismisses or settles back into its place in overview.
|
||||
*
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2017 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.
|
||||
-->
|
||||
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="@dimen/horizontal_ellipsis_size"
|
||||
android:height="@dimen/horizontal_ellipsis_size"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0"
|
||||
android:tint="?android:attr/textColorSecondary" >
|
||||
|
||||
<path
|
||||
android:pathData="M6 10c-1.1 0-2 0.9-2 2s0.9 2 2 2 2-0.9 2-2-0.9-2-2-2zm12 0c-1.1 0-2 0.9-2 2s0.9 2 2 2 2-0.9 2-2-0.9-2-2-2zm-6 0c-1.1 0-2 0.9-2 2s0.9 2 2 2 2-0.9 2-2-0.9-2-2-2z"
|
||||
android:fillColor="@android:color/white" />
|
||||
</vector>
|
||||
@@ -404,7 +404,7 @@
|
||||
<dimen name="notification_icon_padding_start">10dp</dimen>
|
||||
<!-- notification_icon_padding + notification_icon_size + notification_icon_padding -->
|
||||
<dimen name="notification_main_text_padding_start">54dp</dimen>
|
||||
<dimen name="horizontal_ellipsis_size">18dp</dimen>
|
||||
<dimen name="horizontal_ellipsis_size">24dp</dimen>
|
||||
|
||||
<!-- Overview -->
|
||||
<dimen name="options_menu_icon_size">24dp</dimen>
|
||||
|
||||
Reference in New Issue
Block a user