Loading packages/SystemUI/res/layout/bubble_overflow_view.xml +2 −3 Original line number Diff line number Diff line Loading @@ -30,9 +30,8 @@ <TextView android:id="@+id/bubble_view_name" android:fontFamily="@*android:string/config_bodyFontFamily" android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Body2" android:textColor="?android:attr/textColorSecondary" android:textAppearance="@*android:style/TextAppearance.DeviceDefault.ListItem" android:textSize="13sp" android:layout_width="fill_parent" android:layout_height="wrap_content" android:maxLines="1" Loading packages/SystemUI/src/com/android/systemui/bubbles/BubbleOverflowActivity.java +15 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,7 @@ import android.widget.TextView; import androidx.recyclerview.widget.GridLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.android.internal.util.ContrastColorUtil; import com.android.systemui.R; import java.util.ArrayList; Loading Loading @@ -214,6 +215,8 @@ class BubbleOverflowAdapter extends RecyclerView.Adapter<BubbleOverflowAdapter.V @Override public BubbleOverflowAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { // Set layout for overflow bubble view. LinearLayout overflowView = (LinearLayout) LayoutInflater.from(parent.getContext()) .inflate(R.layout.bubble_overflow_view, parent, false); LinearLayout.LayoutParams params = new LinearLayout.LayoutParams( Loading @@ -222,6 +225,18 @@ class BubbleOverflowAdapter extends RecyclerView.Adapter<BubbleOverflowAdapter.V params.width = mWidth; params.height = mHeight; overflowView.setLayoutParams(params); // Ensure name has enough contrast. final TypedArray ta = mContext.obtainStyledAttributes( new int[]{android.R.attr.colorBackgroundFloating, android.R.attr.textColorPrimary}); final int bgColor = ta.getColor(0, Color.WHITE); int textColor = ta.getColor(1, Color.BLACK); textColor = ContrastColorUtil.ensureTextContrast(textColor, bgColor, true); ta.recycle(); TextView viewName = overflowView.findViewById(R.id.bubble_view_name); viewName.setTextColor(textColor); return new ViewHolder(overflowView); } Loading Loading
packages/SystemUI/res/layout/bubble_overflow_view.xml +2 −3 Original line number Diff line number Diff line Loading @@ -30,9 +30,8 @@ <TextView android:id="@+id/bubble_view_name" android:fontFamily="@*android:string/config_bodyFontFamily" android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Body2" android:textColor="?android:attr/textColorSecondary" android:textAppearance="@*android:style/TextAppearance.DeviceDefault.ListItem" android:textSize="13sp" android:layout_width="fill_parent" android:layout_height="wrap_content" android:maxLines="1" Loading
packages/SystemUI/src/com/android/systemui/bubbles/BubbleOverflowActivity.java +15 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,7 @@ import android.widget.TextView; import androidx.recyclerview.widget.GridLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.android.internal.util.ContrastColorUtil; import com.android.systemui.R; import java.util.ArrayList; Loading Loading @@ -214,6 +215,8 @@ class BubbleOverflowAdapter extends RecyclerView.Adapter<BubbleOverflowAdapter.V @Override public BubbleOverflowAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { // Set layout for overflow bubble view. LinearLayout overflowView = (LinearLayout) LayoutInflater.from(parent.getContext()) .inflate(R.layout.bubble_overflow_view, parent, false); LinearLayout.LayoutParams params = new LinearLayout.LayoutParams( Loading @@ -222,6 +225,18 @@ class BubbleOverflowAdapter extends RecyclerView.Adapter<BubbleOverflowAdapter.V params.width = mWidth; params.height = mHeight; overflowView.setLayoutParams(params); // Ensure name has enough contrast. final TypedArray ta = mContext.obtainStyledAttributes( new int[]{android.R.attr.colorBackgroundFloating, android.R.attr.textColorPrimary}); final int bgColor = ta.getColor(0, Color.WHITE); int textColor = ta.getColor(1, Color.BLACK); textColor = ContrastColorUtil.ensureTextContrast(textColor, bgColor, true); ta.recycle(); TextView viewName = overflowView.findViewById(R.id.bubble_view_name); viewName.setTextColor(textColor); return new ViewHolder(overflowView); } Loading