Skip to content
This repository was archived by the owner on Sep 3, 2024. It is now read-only.

Commit e4047fd

Browse files
OneUI4: TabLayout/BNV, app info icon (#50)
Signed-off-by: BlackMesa123 <[email protected]> Co-authored-by: BlackMesa123 <[email protected]>
1 parent d49910d commit e4047fd

File tree

11 files changed

+47
-17
lines changed

11 files changed

+47
-17
lines changed

app/src/main/res/menu/main.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
<item
1212
android:id="@+id/info"
13-
android:icon="@drawable/ic_samsung_info"
13+
android:icon="@drawable/ic_samsung_info_2"
1414
android:title="@string/app_info"
1515
app:showAsAction="always" />
1616

yanndroid/oneui/src/main/java/de/dlyt/yanndroid/oneui/layout/AboutPage.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929

3030
public class AboutPage extends LinearLayout {
3131

32+
private boolean mIsOneUI4;
3233
public static final int NOT_UPDATEABLE = -1;
3334
public static final int LOADING = 0;
3435
public static final int UPDATE_AVAILABLE = 1;
@@ -56,6 +57,8 @@ public class AboutPage extends LinearLayout {
5657
public AboutPage(Context context, @Nullable AttributeSet attrs) {
5758
super(context, attrs);
5859

60+
mIsOneUI4 = context.getTheme().obtainStyledAttributes(new int[]{R.attr.isOneUI4}).getBoolean(0, false);
61+
5962
TypedArray attr = context.getTheme().obtainStyledAttributes(attrs, R.styleable.AboutPage, 0, 0);
6063
try {
6164
optional_text = attr.getString(R.styleable.AboutPage_optional_text);
@@ -89,6 +92,9 @@ public void onClick(View view) {
8992
});
9093

9194
toolbarLayout.inflateToolbarMenu(R.menu.about_page);
95+
if (mIsOneUI4) {
96+
toolbarLayout.getToolbarMenuItemView(toolbarLayout.getToolbarMenu().findItem(R.id.app_info)).setImageDrawable(getResources().getDrawable(R.drawable.ic_samsung_info_2, context.getTheme()));
97+
}
9298
toolbarLayout.setOnToolbarMenuItemClickListener(item -> {
9399
if (item.getItemId() == R.id.app_info) {
94100
try {

yanndroid/oneui/src/main/java/de/dlyt/yanndroid/oneui/sesl/tabs/TabRoundRectIndicator.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import de.dlyt.yanndroid.oneui.R;
1818

1919
public class TabRoundRectIndicator extends AbsIndicatorView {
20+
private boolean mIsOneUI4;
2021
private AnimationSet mPressAnimationSet;
2122

2223
public TabRoundRectIndicator(Context context) {
@@ -33,7 +34,8 @@ public TabRoundRectIndicator(Context context, AttributeSet attrs, int defStyleAt
3334

3435
public TabRoundRectIndicator(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
3536
super(context, attrs, defStyleAttr, defStyleRes);
36-
ViewCompat.setBackground(this, ContextCompat.getDrawable(context, R.drawable.sesl_tablayout_subtab_indicator_background));
37+
mIsOneUI4 = context.getTheme().obtainStyledAttributes(new int[]{R.attr.isOneUI4}).getBoolean(0, false);
38+
ViewCompat.setBackground(this, ContextCompat.getDrawable(context, mIsOneUI4 ? R.drawable.sesl4_tablayout_subtab_indicator_background : R.drawable.sesl_tablayout_subtab_indicator_background));
3739
}
3840

3941
@Override
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<selector xmlns:android="http://schemas.android.com/apk/res/android">
3+
<item android:color="@color/sesl4_tablayout_main_tab_indicator_color" />
4+
</selector>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<selector xmlns:android="http://schemas.android.com/apk/res/android">
3+
<item android:color="@color/sesl4_tablayout_text_color_selected" />
4+
</selector>
Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
<?xml version="1.0" encoding="utf-8" ?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<vector xmlns:android="http://schemas.android.com/apk/res/android"
33
android:width="24.0dip"
44
android:height="24.0dip"
5-
android:viewportWidth="19.0"
6-
android:viewportHeight="19.0">
5+
android:viewportWidth="72.0"
6+
android:viewportHeight="72.0">
77
<path
88
android:fillColor="?actionMenuTextColor"
9-
android:fillType="nonZero"
10-
android:pathData="M9.5,2L9.7424,2.0039C13.7665,2.1323 17,5.4461 17,9.5C17,13.6358 13.6358,17 9.5,17C5.365,17 2,13.6358 2,9.5C2,5.365 5.365,2 9.5,2L9.5,2ZM9.5,3.25L9.2713,3.2541C5.9309,3.3749 3.25,6.1307 3.25,9.5C3.25,12.9467 6.0542,15.75 9.5,15.75L9.5,15.75L9.7288,15.7459C13.0699,15.6251 15.75,12.8701 15.75,9.5C15.75,6.0542 12.9467,3.25 9.5,3.25L9.5,3.25ZM10.4149,8.1349L10.4149,13.2091C10.4149,13.5541 10.1349,13.8341 9.7899,13.8341C9.4449,13.8341 9.1649,13.5541 9.1649,13.2091L9.1649,13.2091L9.1649,9.3849L8.3774,9.3849L8.3774,9.3849L8.2849,9.3781C7.9831,9.3335 7.7524,9.0736 7.7524,8.7599C7.7524,8.4149 8.0316,8.1349 8.3774,8.1349L8.3774,8.1349L10.4149,8.1349ZM9.4996,5.1198L9.6042,5.1262C10.0155,5.1776 10.3329,5.5277 10.3329,5.9531C10.3329,6.4131 9.9604,6.7864 9.4996,6.7864C9.0396,6.7864 8.6663,6.4131 8.6663,5.9531C8.6663,5.4922 9.0396,5.1198 9.4996,5.1198L9.4996,5.1198Z"
11-
android:strokeWidth="1.0"
12-
android:strokeColor="#00000000" />
13-
</vector>
9+
android:pathData="M36,8.25c15.327,0 27.75,12.425 27.75,27.753C63.75,51.328 51.327,63.75 36,63.75c-15.325,0 -27.75,-12.423 -27.75,-27.747C8.25,20.676 20.675,8.25 36,8.25zM36,12.75c-12.84,0 -23.25,10.411 -23.25,23.253C12.75,48.842 23.16,59.25 36,59.25c12.842,0 23.25,-10.407 23.25,-23.247C59.25,23.16 48.842,12.75 36,12.75zM39,30.41v20.616c0,1.243 -1.008,2.25 -2.25,2.25c-1.139,0 -2.081,-0.847 -2.229,-1.944L34.5,51.026V34.908l-3.504,0.002c-1.139,0 -2.081,-0.846 -2.229,-1.944l-0.021,-0.306c0,-1.139 0.846,-2.08 1.945,-2.229l0.305,-0.021H39zM36.166,20.896c1.657,0 3,1.344 3,3c0,1.656 -1.344,3 -3,3c-1.656,0 -3,-1.344 -3,-3C33.166,22.24 34.51,20.896 36.166,20.896z" />
10+
</vector>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<layer-list
3+
xmlns:android="http://schemas.android.com/apk/res/android">
4+
<item android:drawable="@drawable/sesl_tablayout_subtab_indicator_ripple" />
5+
<item android:drawable="@drawable/sesl4_tablayout_subtab_indicator_shape" />
6+
</layer-list>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<shape android:shape="rectangle"
3+
xmlns:android="http://schemas.android.com/apk/res/android">
4+
<corners android:radius="@dimen/sesl_tablayout_subtab_indicator_radius" />
5+
<solid android:color="@color/sesl4_tablayout_subtab_indicator_background" />
6+
</shape>

yanndroid/oneui/src/main/res/values-night/colors.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@
116116
<color name="sesl_tablayout_subtab_text_color_selected">#FFFFFF</color>
117117
<color name="sesl_tablayout_text_color_default">#A8A9A9</color>
118118
<color name="sesl_tablayout_text_color_disabled">#66A8A9A9</color>
119+
<color name="sesl4_tablayout_subtab_indicator_background">#1AFFFFFF</color>
120+
<color name="sesl4_tablayout_text_color_selected">#FAFAFA</color>
121+
<color name="sesl4_tablayout_main_tab_indicator_color">#FAFAFA</color>
119122

120123

121124
<!--Dialog-->

yanndroid/oneui/src/main/res/values/colors.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,9 @@
178178
<color name="sesl_tablayout_subtab_text_color_selected">#252525</color>
179179
<color name="sesl_tablayout_text_color_default">#858585</color>
180180
<color name="sesl_tablayout_text_color_disabled">#66858585</color>
181+
<color name="sesl4_tablayout_subtab_indicator_background">#0D000000</color>
182+
<color name="sesl4_tablayout_text_color_selected">#010101</color>
183+
<color name="sesl4_tablayout_main_tab_indicator_color">#252525</color>
181184

182185
<!--Dialog-->
183186
<color name="sesl_dialog_body_text_color">#ff505050</color>

0 commit comments

Comments
 (0)