diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index db078986..144bed7e 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -32,7 +32,7 @@ jobs: uses: actions/setup-java@v2 with: distribution: "zulu" - java-version: "8" + java-version: "11" cache: "gradle" - name: grant execute permission for gradlew diff --git a/README.md b/README.md index 142039cd..d3513169 100644 --- a/README.md +++ b/README.md @@ -11,16 +11,14 @@

- A library for Android, useful for creating Samsung's OneUI styled apps. This library contains a theme which will apply for most views (see [which](#Progress)) in your layout, and some custom OneUI views. The text which is in the custom views is translated to 90 languages, so you don't need to worry for these. Android 5.0 (api 21) and above are supported, the library also has Dark mode, Landscape, Tablet, DeX and RTL support. This library has been tested in Android Studio, but should work in other IDEs too. You can download and install the latest apk of the sample app [here](https://github.com/Yanndroid/OneUI-Design-Library/raw/master/app/release/app-release.apk). Suggestions, improvements and help are always welcome. + A library for Android, useful for creating Samsung's OneUI styled apps. This library contains a theme which will apply for most views (see [which](#Progress)) in your layout, and some custom OneUI views. The text which is in the custom views is translated to 90 languages, so you don't need to worry for these. Android 5.0 (api 21) and above are supported, the library also has Dark mode, Landscape, Tablet, DeX and RTL support. This library has been tested in Android Studio, but should work in other IDEs too. You can download and install the latest apk of the sample app [here](https://github.com/Yanndroid/OneUI-Design-Library/raw/master/app/release/app-release.apk). You can also check out my other apps for more examples on how to use this library. Suggestions, improvements and help are always welcome. Huge thanks to [BlackMesa123](https://github.com/BlackMesa123) who has contributed a lot to this project. -Excuse my bad english, feel free to correct it. :) - - [Screenshots](#Screenshots) - [Installation](#Installation) -- [Usage](#Usage) +- [Documentation](#Documentation) - [Progress](#Progress) - [Changelog](#Changelog) - [More info](#More-info) @@ -36,7 +34,7 @@ v2.0.0 and future versions are (and only will be) available on mavenCentral. For 1. Add the dependency to build.gradle (Module: ...) ```gradle dependencies { - implementation 'io.github.yanndroid:oneui:2.1.1' + implementation 'io.github.yanndroid:oneui:2.2.0' ... } ``` @@ -142,7 +140,9 @@ dependencies {
-## Usage +If you encounter problems with Proguard (missing classes), see this [Issue](https://github.com/Yanndroid/OneUI-Design-Library/issues/53) by [AlirezaIvaz](https://github.com/AlirezaIvaz). + +## Documentation In general, most of the views are styled automatically when you apply ```android:theme="@style/OneUITheme"``` in AndroidManifest.xml, the usage of the custom views in the library however is needed to achieve the best results. - [DrawerLayout](#DrawerLayout) @@ -200,7 +200,7 @@ In general, most of the views are styled automatically when you apply ```android ``` -The children of this view can be at four different location: on the **main screen**, in the **drawer**, in the **footer** (useful for views like BottomNavigationView) or in the **appbar header** as a custom title. To specify the location of each child you can set the attribute ```app:layout_location``` of the child to either ```main_content``` (default), ```drawer_panel```, ```footer``` or ```appbar_header```. +The children of this view can be at five different location: on the **main screen**, in the **drawer**, in the **footer** (useful for views like BottomNavigationView), in the **appbar header** as a custom title or in the **root layout** (views like FAB). To specify the location of each child you can set the attribute ```app:layout_location``` of the child to either ```main_content``` (default), ```drawer_panel```, ```footer```, ```appbar_header``` or ```root```. ```app:toolbar_title``` and ```app:toolbar_subtitle``` can be used to set the title and subtitle of the AppBar and Toolbar. The AppBar status is set to expanded by default, you can simply set ```app:toolbar_expanded``` to false if you want it to be collapsed. On small screens/dpi the toolbar will not expand. @@ -222,7 +222,7 @@ public void setDrawerButtonIcon(Drawable drawerIcon) public void setDrawerButtonTooltip(CharSequence tooltipText) public void setDrawerButtonOnClickListener(OnClickListener listener) ``` -Toolbar methods. (for more use ```getToolbarLayout()``` and it's methods) +Toolbar methods. (for more, use ```getToolbarLayout()``` and it's methods) ```java public void setToolbarTitle(CharSequence title) public void setToolbarTitle(CharSequence expandedTitle, CharSequence collapsedTitle) @@ -239,8 +239,6 @@ Open/close the drawer panel with an optional animation. public void setDrawerOpen(Boolean open, Boolean animate) ``` -See [Advanced](#Advanced) for even more methods. - ### ToolbarLayout "Ready-to-go" Samsung's AppBar. @@ -259,7 +257,7 @@ See [Advanced](#Advanced) for even more methods. ``` -The children of this view can be at three different location: on the **main screen**, in the **footer** (useful for views like BottomNavigationView) or in the **appbar header** as a custom title. To specify the location of each child you can set the attribute ```app:layout_location``` of the child to either ```main_content``` (default), ```footer``` or ```appbar_header```. +The children of this view can be at four different location: on the **main screen**, in the **footer** (useful for views like BottomNavigationView), in the **appbar header** as a custom title or in the **root layout** (views like FAB). To specify the location of each child you can set the attribute ```app:layout_location``` of the child to either ```main_content``` (default), ```footer```, ```appbar_header``` or ```root```. ```app:title``` and ```app:subtitle``` can be used to set the title and subtitle of the AppBar and Toolbar. The AppBar status is set to expanded by default, you can simply set ```app:toolbar_expanded``` to false if you want it to be collapsed. You can also disable totally the CollapsingToolbar by setting ```app:toolbar_expandable``` to false. On small screens/dpi the toolbar will not expand anyway. @@ -297,22 +295,12 @@ public void setNavigationButtonVisible(boolean visible) public void setNavigationButtonBadge(int count) public void setNavigationOnClickListener(OnClickListener listener) ``` -Manage the Toolbar Menu. In the Menu resource file use ```app:showAsAction="always"``` to show the item as a Action instead of in the popup menu. Changing the Icon or the Visibility won't do anything if this item isn't a Action. +Manage the Toolbar Menu. In the Menu resource file use ```app:showAsAction="always"``` to show the item as a Action instead of in the popup menu. ```java -public void inflateToolbarMenu(@MenuRes int resId) +public void inflateToolbarMenu(Menu menu) +public void inflateToolbarMenu(@MenuRes int menuRes) public Menu getToolbarMenu() public void setOnToolbarMenuItemClickListener(OnMenuItemClickListener listener) - -public void setOverflowMenuBadge(MenuItem item, Integer badge) -public Integer getOverflowMenuBadge(MenuItem item) - -public void setToolbarMenuItemIcon(MenuItem item, Drawable drawable) -public void setToolbarMenuItemIcon(MenuItem item, @DrawableRes int resId) -public void setToolbarMenuItemTitle(MenuItem item, CharSequence title) //title = tooltip -public void setToolbarMenuItemVisibility(MenuItem item, boolean visible) -public void setToolbarMenuItemEnabled(MenuItem item, boolean enabled) - -public ToolbarImageButton getToolbarMenuItemView(MenuItem item) ``` SelectMode. Changes the layout of the Toolbar to the one you can see in any Samsung app, when you long click a list item. This will show a "All" checkbox, "x selected" counter as the title and a bottom menu (see [screenshot](readme-resources/screenshots/toolbarlayout_selectmode.png)). In the Menu resource file for the bottom menu use ```app:showAsAction="always"``` to show the item as a Action instead of in the "more" menu. ```java @@ -323,28 +311,34 @@ public void setSelectModeCount(int count) public void setSelectModeAllChecked(boolean checked) public void setSelectModeAllCheckedChangeListener(CompoundButton.OnCheckedChangeListener listener) +public void setSelectModeBottomMenu(Menu menu, OnMenuItemClickListener listener) public void setSelectModeBottomMenu(@MenuRes int menuRes, OnMenuItemClickListener listener) public Menu getSelectModeBottomMenu() ``` -SearchMode. Changes the layout of the Toolbar to a Search layout, with a text field and a voice input icon. (see [screenshot](readme-resources/screenshots/toolbarlayout_searchmode.png)) +SearchMode. Changes the layout of the Toolbar to a Search layout, with a text field and a voice input icon (see [screenshot](readme-resources/screenshots/toolbarlayout_searchmode.png)). ```java public void showSearchMode() public void dismissSearchMode() public boolean isSearchMode() public void setSearchModeListener(SearchModeListener listener) - -public void onSearchModeVoiceInputResult(ActivityResult result) - -//for the voice input to work you need to add this in your activity/fragment: -private ActivityResultLauncher activityResultLauncher; +``` +:warning: For the voice input to work, you need to add this in your activity/fragment: + ```java + private ActivityResultLauncher activityResultLauncher; //onCreate: activityResultLauncher = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), result -> toolbarLayout.onSearchModeVoiceInputResult(result)); //setSearchModeListener - onVoiceInputClick activityResultLauncher.launch(intent); + ``` +Also add this in your manifest for api 30+: +```xml + + + + + ``` -See [Advanced](#Advanced) for even more methods. - ### SplashView The activity you are gonna use for SplashView has a different style than the rest of the application, so you need to add this ```android:theme="@style/OneUISplashTheme"``` to your splash activity in AndroidManifest. @@ -393,8 +387,6 @@ Listener for the Splash Animation public void setSplashAnimationListener(Animation.AnimationListener listener) ``` -See [Advanced](#Advanced) for even more methods. - 2) A simple Splash View without animation. (Samsung apps use their own ```com.samsung.android.startingwindow.LAYOUT_RESID_FOR_MASS``` flag in manifest) @@ -425,8 +417,6 @@ Returns the text of the Splash TextView public String getText() ``` -See [Advanced](#Advanced) for even more methods. - ### AboutPage A layout that looks like and has the same functions as the About Screen in any Samsung app. Like the [SplashView](#SplashView), the activity you're gonna use has a different style than the rest of the application, so you need to add this ```android:theme="@style/OneUIAboutTheme"``` to your About Activity in AndroidManifest. @@ -468,8 +458,6 @@ public void setUpdateButtonOnClickListener(OnClickListener listener) public void setRetryButtonOnClickListener(OnClickListener listener) ``` -See [Advanced](#Advanced) for even more methods. - ### SwitchBarLayout This is a extended [ToolbarLayout](#ToolbarLayout) with [SwitchBar](#SwitchBar). Useful for creating inner preferences layouts in pair with [SwitchPreferenceScreen](#SwitchPreferenceScreen). @@ -508,8 +496,6 @@ Expand or collapse the toolbar with an optional animation. public void setToolbarExpanded(boolean expanded, boolean animate) ``` -See [Advanced](#Advanced) for even more methods. - ### CoordinatorLayout Samsung's CoordinatorLayout ```xml @@ -739,7 +725,7 @@ Control the state (colored, bold text). ```java public void setButtonSelected(Boolean selected) public void toggleButtonSelected() -public Boolean isButtonSelcted() +public Boolean isButtonSelected() ``` Enable/disable the OptionButton. ```java @@ -1100,21 +1086,21 @@ Samsung's Radio Preferences used in Light/Dark mode Settings and Resolution Sett Create a PopupMenu with it's anchor. ```java -//de.dlyt.yanndroid.oneui.view.PopupMenu +//de.dlyt.yanndroid.oneui.menu.PopupMenu PopupMenu popupMenu = new PopupMenu(view); ``` -Inflate a menu resource or a list of the items to show. +Inflate a menu resource or a Menu (de.dlyt.yanndroid.oneui.menu.Menu). ```java public void inflate(@MenuRes int menuRes) -public void inflate(ArrayList menuItems) +public void inflate(Menu menu) ``` -Get the menu (will only work if you inflate with a menu resource) +Get the menu. ```java public Menu getMenu() ``` -Set the menu item click listener. +Set the menu item click and update listener. ```java -public void setOnMenuItemClickListener(OnMenuItemClickListener listener) +public void setPopupMenuListener(PopupMenuListener listener) ``` Show and dismiss the popup. ```java @@ -1123,17 +1109,6 @@ public void show(int xoff, int yoff) //with offset public void dismiss() public boolean isShowing() ``` -Manage the menu items. -```java -public void setMenuItemBadge(MenuItem item, Integer badge) -public void setMenuItemTitle(MenuItem item, CharSequence title) -public void setMenuItemEnabled(MenuItem item, boolean enabled) -public Integer getMenuItemBadge(MenuItem item) -``` -Get the number of all badges in the menu. -```java -public Integer getTotalBadgeCount() -``` ### Tooltip Samsung's Tooltip. @@ -1174,7 +1149,7 @@ Snackbar.make(view, "Text label", Snackbar.LENGTH_SHORT).setAction("Action", new ``` ### Advanced -This is for advanced usage only. I've added the method ```getView(int view)``` to some of the custom views to access the views inside it and change them directly. This can be helpful if you want to do something which isn't implemented in the custom views yet as I can't think of all possible uses. Currently this method is available in DrawerLayout, ToolbarLayout, SplashView, AboutPage and SwitchBarLayout. +For further customization or if you need something which isn't implemented in the custom views yet (I can't think of all possible uses), you can always access the views inside it with ```findViewById(int id)``` and change them directly. For the Ids please refer to the source code. ### Icons There are also a lot of the stock icons you can find in Samsung apps included in this library, and we will add more over time. You can use them with ```@drawable/ic_samsung_...``` and ```R.drawable.ic_samsung_...```. @@ -1265,7 +1240,7 @@ The sample app icon for example: ### OneUI 4 -Starting with v2.1.0, the new OneUI 4 design is being added to this library. Since Samsung hasn't released a stable version yet and still has a lot of stuff to fix, only some views are (partly) using the new style. As long as OneUI 4 is beta, this feature will also be, so don't expect too much. All the views which don't have the new style yet will use the old one (OneUI 3) instead. If you already want to use the OneUI 4 style, instead of ```@style/OneUITheme```, ```@style/OneUIAboutTheme``` and ```@style/OneUISplashTheme``` use ```@style/OneUI4Theme```, ```@style/OneUI4AboutTheme``` and ```@style/OneUI4SplashTheme``` in your manifest file. +Starting with v2.1.0, the new OneUI 4 design is being added to this library and v2.2.0 makes it the default theme of the library. If you still want to use the OneUI 3 style, instead of ```@style/OneUITheme```, ```@style/OneUIAboutTheme``` and ```@style/OneUISplashTheme``` use ```@style/OneUI3Theme```, ```@style/OneUI3AboutTheme``` and ```@style/OneUI3SplashTheme``` in your manifest file. All the views which don't have the new style yet will use the old one (OneUI 3) instead. ## Progress @@ -1299,6 +1274,22 @@ Starting with v2.1.0, the new OneUI 4 design is being added to this library. Sin ## Changelog +
+2.2.0 + +- OneUI4++ (huge thanks to [BlackMesa123](https://github.com/BlackMesa123)) + - AppBar/Toolbar + - Edge effect + - TabLayout/BottomNavigationView + - SwipeRefreshLayout + - EditText + - and more... +- ToolbarLayout & PopupMenu/Menu improvements +- icons++ (OneUI4) +- fixes & minor changes + +
+
2.1.1 @@ -1436,5 +1427,4 @@ Starting with v2.1.0, the new OneUI 4 design is being added to this library. Sin - [BlackMesa123](https://github.com/BlackMesa123) for a lot of OneUI stuff, more compatibility and his experience. - [TenSeventy7](https://github.com/TenSeventy7) for some stuff and help. - [leonbcode](https://github.com/leonbcode) for github actions, so this library is always up-to-date. -- [AlirezaIvaz](https://github.com/AlirezaIvaz) for translation correction (Persian) and issue reporting. -- [nfauv2001](https://github.com/nfauv2001) for helping me out with my english. +- All the [Contributors](https://github.com/Yanndroid/OneUI-Design-Library/graphs/contributors) and Issue Reporters. \ No newline at end of file diff --git a/app/release/app-release.apk b/app/release/app-release.apk index 007e8562..b2f7f7cc 100644 Binary files a/app/release/app-release.apk and b/app/release/app-release.apk differ diff --git a/app/release/output-metadata.json b/app/release/output-metadata.json index 68345705..27f916ab 100644 --- a/app/release/output-metadata.json +++ b/app/release/output-metadata.json @@ -1,5 +1,5 @@ { - "version": 2, + "version": 3, "artifactType": { "type": "APK", "kind": "Directory" @@ -10,9 +10,11 @@ { "type": "SINGLE", "filters": [], - "versionCode": 54, - "versionName": "2.1.1", + "attributes": [], + "versionCode": 55, + "versionName": "2.2.0", "outputFile": "app-release.apk" } - ] + ], + "elementType": "File" } \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 21d8199e..f3db3c8f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,8 +2,8 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 android.useAndroidX=true android.enableJetifier=true # version -VERSION_NAME=2.1.1 -VERSION_CODE=6 +VERSION_NAME=2.2.0 +VERSION_CODE=7 # mavenCentral GROUP_ID=io.github.yanndroid ARTIFACT_ID=oneui diff --git a/yanndroid/oneui/src/main/java/androidx/appcompat/widget/SeslAbsSeekBar.java b/yanndroid/oneui/src/main/java/androidx/appcompat/widget/SeslAbsSeekBar.java index 8b7c5cbc..4d2b6dad 100644 --- a/yanndroid/oneui/src/main/java/androidx/appcompat/widget/SeslAbsSeekBar.java +++ b/yanndroid/oneui/src/main/java/androidx/appcompat/widget/SeslAbsSeekBar.java @@ -49,14 +49,7 @@ public abstract class SeslAbsSeekBar extends ProgressBar { public static final boolean IS_BASE_SDK_VERSION; static { - boolean var0; - if (Build.VERSION.SDK_INT <= 23) { - var0 = true; - } else { - var0 = false; - } - - IS_BASE_SDK_VERSION = var0; + IS_BASE_SDK_VERSION = Build.VERSION.SDK_INT <= 23; } public final List mGestureExclusionRects; @@ -265,7 +258,6 @@ public SeslAbsSeekBar(Context var1, AttributeSet var2, int var3, int var4) { int[] var8 = new int[]{16842910}; int[] var10 = new int[]{-16842910}; var4 = getColor(var1, R.attr.colorPrimary); - ; var3 = var6.getColor(R.color.sesl_seekbar_disable_color_activated, var1.getTheme()); this.mDefaultActivatedThumbColor = new ColorStateList(new int[][]{var8, var10}, new int[]{var4, var3}); } @@ -579,7 +571,6 @@ public int getMax() { var1 = super.getMax(); } } finally { - ; } return var1; @@ -602,7 +593,6 @@ public void setMax(int var1) { this.setKeyProgressIncrement(Math.max(1, Math.round((float) var1 / 20.0F))); } } finally { - ; } } @@ -619,7 +609,6 @@ public int getMin() { var1 = super.getMin(); } } finally { - ; } return var1; @@ -641,7 +630,6 @@ public void setMin(int var1) { this.setKeyProgressIncrement(Math.max(1, Math.round((float) var1 / 20.0F))); } } finally { - ; } } @@ -658,7 +646,6 @@ public int getProgress() { var1 = super.getProgress(); } } finally { - ; } return var1; @@ -676,7 +663,6 @@ public void setProgress(int var1) { super.setProgress(var2); } finally { - ; } } @@ -970,7 +956,6 @@ public void onDraw(Canvas var1) { this.drawThumb(var1); } } finally { - ; } } @@ -1476,33 +1461,30 @@ private void setHoveringPoint(int i, int i2) { public void setMode(int var1) { super.setMode(var1); - if (var1 != 0) { - if (var1 != 1) { - if (var1 != 3) { - if (var1 != 4) { - if (var1 != 5) { - if (var1 == 6) { - this.initializeExpandVerticalMode(); - } - } else { - this.initializeExpandMode(); - } - } else { - this.mSplitProgress = this.getContext().getResources().getDrawable(R.drawable.sesl_split_seekbar_primary_progress, null); - this.mDivider = this.getContext().getResources().getDrawable(R.drawable.sesl_split_seekbar_vertical_bar, null); - this.updateSplitProgress(); - } - } else { - Resources var2 = this.getContext().getResources(); - this.setThumb(var2.getDrawable(R.drawable.sesl_scrubber_control_anim, null)); - this.setThumbTintList(this.mDefaultActivatedThumbColor); - } - } else { + switch (var1) { + case 0: + this.setProgressTintList(this.mDefaultActivatedProgressColor); + this.setThumbTintList(this.mDefaultActivatedThumbColor); + break; + case 1: this.updateWarningMode(this.getProgress()); - } - } else { - this.setProgressTintList(this.mDefaultActivatedProgressColor); - this.setThumbTintList(this.mDefaultActivatedThumbColor); + break; + case 3: + Resources var2 = this.getContext().getResources(); + this.setThumb(var2.getDrawable(R.drawable.sesl_scrubber_control_anim, null)); + this.setThumbTintList(this.mDefaultActivatedThumbColor); + break; + case 4: + this.mSplitProgress = this.getContext().getResources().getDrawable(R.drawable.sesl_split_seekbar_primary_progress, null); + this.mDivider = this.getContext().getResources().getDrawable(R.drawable.sesl_split_seekbar_vertical_bar, null); + this.updateSplitProgress(); + break; + case 5: + this.initializeExpandMode(); + break; + case 6: + this.initializeExpandVerticalMode(); + break; } this.invalidate(); @@ -1537,10 +1519,6 @@ public void setOverlapPointForDualColor(int var1) { } } - public void setProgressDrawable(Drawable var1) { - super.setProgressDrawable(var1); - } - public boolean setProgressInternal(int var1, boolean var2, boolean var3) { var2 = super.setProgressInternal(var1, var2, var3); this.updateWarningMode(var1); @@ -1579,7 +1557,9 @@ public void setSystemGestureExclusionRects(List var1) { @SuppressLint("RestrictedApi") public final void setThumbPos(int var1, Drawable var2, float var3, int var4) { int var5 = super.mCurrentMode; - if (var5 != 3 && var5 != 6) { + if (var5 == 3 || var5 == 6) { + this.setThumbPosInVertical(this.getHeight(), var2, var3, var4); + } else { int var6 = this.getPaddingLeft(); int var7 = this.getPaddingRight(); int var8 = var2.getIntrinsicWidth(); @@ -1614,8 +1594,6 @@ public final void setThumbPos(int var1, Drawable var2, float var3, int var4) { this.updateGestureExclusionRects(); this.mThumbPosX = var5 + this.getPaddingLeft() - (this.getPaddingLeft() - var8 / 2); this.updateSplitProgress(); - } else { - this.setThumbPosInVertical(this.getHeight(), var2, var3, var4); } } @@ -2092,7 +2070,6 @@ public void draw(Canvas var1) { mDrawable.setBounds(0, (int) (SeslAbsSeekBar.this.getHeight() / 2 - var4), (int) var3, (int) (SeslAbsSeekBar.this.getHeight() / 2 + var4)); mDrawable.draw(var1); - } else { var4 = (float) (SeslAbsSeekBar.this.getHeight() - SeslAbsSeekBar.this.getPaddingTop() - SeslAbsSeekBar.this.getPaddingBottom()); var3 = this.mRadius; @@ -2325,7 +2302,11 @@ public void draw(Canvas var1) { if (!this.mIsVertical) { var1.drawCircle((float) SeslAbsSeekBar.this.mThumbPosX, (float) SeslAbsSeekBar.this.getHeight() / 2.0F, (float) this.mRadiusForAni, this.mPaint); } else { - var1.drawCircle((float) SeslAbsSeekBar.this.getWidth() / 2.0F, (float) SeslAbsSeekBar.this.mThumbPosX, (float) this.mRadiusForAni, this.mPaint); + if (SeslAbsSeekBar.this.mCurrentMode == 3) { + var1.drawCircle((float) SeslAbsSeekBar.this.getWidth() / 2.0F, (float) SeslAbsSeekBar.this.mThumbPosX, (float) this.mRadiusForAni, this.mPaint); + } else { + var1.drawCircle((float) (SeslAbsSeekBar.this.getWidth() - (SeslAbsSeekBar.this.getPaddingLeft() + SeslAbsSeekBar.this.getPaddingRight())) / 2.0F, (float) SeslAbsSeekBar.this.mThumbPosX - SeslAbsSeekBar.this.getPaddingLeft(), (float) this.mRadiusForAni, this.mPaint); + } } var1.restore(); diff --git a/yanndroid/oneui/src/main/java/de/dlyt/yanndroid/oneui/view/ProgressBar.java b/yanndroid/oneui/src/main/java/de/dlyt/yanndroid/oneui/view/ProgressBar.java index 3fca3ae7..0f78a660 100644 --- a/yanndroid/oneui/src/main/java/de/dlyt/yanndroid/oneui/view/ProgressBar.java +++ b/yanndroid/oneui/src/main/java/de/dlyt/yanndroid/oneui/view/ProgressBar.java @@ -643,8 +643,6 @@ private void updateDrawableState() { } } - /* JADX INFO: finally extract failed */ - /* access modifiers changed from: package-private */ @SuppressLint("RestrictedApi") public void drawTrack(Canvas canvas) { Drawable drawable = this.mCurrentDrawable; @@ -945,7 +943,7 @@ public void setProgressDrawable(Drawable drawable) { if (drawable.isStateful()) { drawable.setState(getDrawableState()); } - if (this.mCurrentMode == 3) { + if (this.mCurrentMode == 3 || this.mCurrentMode == 6) { int minimumWidth = drawable.getMinimumWidth(); if (this.mMaxWidth < minimumWidth) { this.mMaxWidth = minimumWidth; @@ -1307,13 +1305,11 @@ public void setInterpolator(Context context, @InterpolatorRes int i) { } public void setMode(int i2) { - Drawable drawable; + Drawable drawable = null; this.mCurrentMode = i2; if (i2 == 3) { drawable = androidx.core.content.ContextCompat.getDrawable(getContext(), R.drawable.sesl_scrubber_progress_vertical); - } else if (i2 != 4) { - drawable = null; - } else { + } else if (i2 == 4) { drawable = androidx.core.content.ContextCompat.getDrawable(getContext(), R.drawable.sesl_split_seekbar_background_progress); } if (drawable != null) {