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

Commit 06c55bf

Browse files
authored
Dev (#56)
v2.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
1 parent 591b7fc commit 06c55bf

File tree

6 files changed

+95
-126
lines changed

6 files changed

+95
-126
lines changed

README.md

Lines changed: 52 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,14 @@
1111
<img loading="lazy" src="readme-resources/banner.png"/>
1212
</p>
1313

14-
<img loading="lazy" src="https://github.com/Yanndroid/Yanndroid/blob/master/cats.gif" width="25" height="25" /> 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.
14+
<img loading="lazy" src="https://github.com/Yanndroid/Yanndroid/blob/master/cats.gif" width="25" height="25" /> 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.
1515

1616
Huge thanks to [BlackMesa123](https://github.com/BlackMesa123) who has contributed a lot to this project.
1717

18-
Excuse my bad english, feel free to correct it. :)
19-
2018

2119
- [Screenshots](#Screenshots)
2220
- [Installation](#Installation)
23-
- [Usage](#Usage)
21+
- [Documentation](#Documentation)
2422
- [Progress](#Progress)
2523
- [Changelog](#Changelog)
2624
- [More info](#More-info)
@@ -36,7 +34,7 @@ v2.0.0 and future versions are (and only will be) available on mavenCentral. For
3634
1. Add the dependency to build.gradle (Module: ...)
3735
```gradle
3836
dependencies {
39-
implementation 'io.github.yanndroid:oneui:2.1.1'
37+
implementation 'io.github.yanndroid:oneui:2.2.0'
4038
...
4139
}
4240
```
@@ -142,7 +140,9 @@ dependencies {
142140
</details>
143141
<br/>
144142

145-
## Usage
143+
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).
144+
145+
## Documentation
146146
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.
147147

148148
- [DrawerLayout](#DrawerLayout)
@@ -200,7 +200,7 @@ In general, most of the views are styled automatically when you apply ```android
200200

201201
</de.dlyt.yanndroid.oneui.layout.DrawerLayout>
202202
```
203-
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```.
203+
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```.
204204

205205
```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.
206206

@@ -222,7 +222,7 @@ public void setDrawerButtonIcon(Drawable drawerIcon)
222222
public void setDrawerButtonTooltip(CharSequence tooltipText)
223223
public void setDrawerButtonOnClickListener(OnClickListener listener)
224224
```
225-
Toolbar methods. (for more use ```getToolbarLayout()``` and it's methods)
225+
Toolbar methods. (for more, use ```getToolbarLayout()``` and it's methods)
226226
```java
227227
public void setToolbarTitle(CharSequence title)
228228
public void setToolbarTitle(CharSequence expandedTitle, CharSequence collapsedTitle)
@@ -239,8 +239,6 @@ Open/close the drawer panel with an optional animation.
239239
public void setDrawerOpen(Boolean open, Boolean animate)
240240
```
241241

242-
See [Advanced](#Advanced) for even more methods.
243-
244242
### ToolbarLayout
245243
"Ready-to-go" Samsung's AppBar.
246244

@@ -259,7 +257,7 @@ See [Advanced](#Advanced) for even more methods.
259257

260258
</de.dlyt.yanndroid.oneui.layout.ToolbarLayout>
261259
```
262-
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```.
260+
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```.
263261

264262
```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.
265263

@@ -297,22 +295,12 @@ public void setNavigationButtonVisible(boolean visible)
297295
public void setNavigationButtonBadge(int count)
298296
public void setNavigationOnClickListener(OnClickListener listener)
299297
```
300-
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.
298+
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.
301299
```java
302-
public void inflateToolbarMenu(@MenuRes int resId)
300+
public void inflateToolbarMenu(Menu menu)
301+
public void inflateToolbarMenu(@MenuRes int menuRes)
303302
public Menu getToolbarMenu()
304303
public void setOnToolbarMenuItemClickListener(OnMenuItemClickListener listener)
305-
306-
public void setOverflowMenuBadge(MenuItem item, Integer badge)
307-
public Integer getOverflowMenuBadge(MenuItem item)
308-
309-
public void setToolbarMenuItemIcon(MenuItem item, Drawable drawable)
310-
public void setToolbarMenuItemIcon(MenuItem item, @DrawableRes int resId)
311-
public void setToolbarMenuItemTitle(MenuItem item, CharSequence title) //title = tooltip
312-
public void setToolbarMenuItemVisibility(MenuItem item, boolean visible)
313-
public void setToolbarMenuItemEnabled(MenuItem item, boolean enabled)
314-
315-
public ToolbarImageButton getToolbarMenuItemView(MenuItem item)
316304
```
317305
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.
318306
```java
@@ -323,28 +311,34 @@ public void setSelectModeCount(int count)
323311
public void setSelectModeAllChecked(boolean checked)
324312
public void setSelectModeAllCheckedChangeListener(CompoundButton.OnCheckedChangeListener listener)
325313

314+
public void setSelectModeBottomMenu(Menu menu, OnMenuItemClickListener listener)
326315
public void setSelectModeBottomMenu(@MenuRes int menuRes, OnMenuItemClickListener listener)
327316
public Menu getSelectModeBottomMenu()
328317
```
329-
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))
318+
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)).
330319
```java
331320
public void showSearchMode()
332321
public void dismissSearchMode()
333322
public boolean isSearchMode()
334323
public void setSearchModeListener(SearchModeListener listener)
335-
336-
public void onSearchModeVoiceInputResult(ActivityResult result)
337-
338-
//for the voice input to work you need to add this in your activity/fragment:
339-
private ActivityResultLauncher<Intent> activityResultLauncher;
324+
```
325+
:warning: For the voice input to work, you need to add this in your activity/fragment:
326+
```java
327+
private ActivityResultLauncher<Intent> activityResultLauncher;
340328
//onCreate:
341329
activityResultLauncher = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), result -> toolbarLayout.onSearchModeVoiceInputResult(result));
342330
//setSearchModeListener - onVoiceInputClick
343331
activityResultLauncher.launch(intent);
332+
```
333+
Also add this in your manifest for api 30+:
334+
```xml
335+
<queries>
336+
<intent>
337+
<action android:name="android.speech.action.RECOGNIZE_SPEECH" />
338+
</intent>
339+
</queries>
344340
```
345341

346-
See [Advanced](#Advanced) for even more methods.
347-
348342
### SplashView
349343
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.
350344

@@ -393,8 +387,6 @@ Listener for the Splash Animation
393387
public void setSplashAnimationListener(Animation.AnimationListener listener)
394388
```
395389

396-
See [Advanced](#Advanced) for even more methods.
397-
398390
2) A simple Splash View without animation. (Samsung apps use their own ```com.samsung.android.startingwindow.LAYOUT_RESID_FOR_MASS``` flag in manifest)
399391

400392
<img loading="lazy" align="left" src="readme-resources/screenshots/splash_simple.png" width="150"/>
@@ -425,8 +417,6 @@ Returns the text of the Splash TextView
425417
public String getText()
426418
```
427419

428-
See [Advanced](#Advanced) for even more methods.
429-
430420
### AboutPage
431421
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.
432422

@@ -468,8 +458,6 @@ public void setUpdateButtonOnClickListener(OnClickListener listener)
468458
public void setRetryButtonOnClickListener(OnClickListener listener)
469459
```
470460

471-
See [Advanced](#Advanced) for even more methods.
472-
473461
### SwitchBarLayout
474462
This is a extended [ToolbarLayout](#ToolbarLayout) with [SwitchBar](#SwitchBar). Useful for creating inner preferences layouts in pair with [SwitchPreferenceScreen](#SwitchPreferenceScreen).
475463

@@ -508,8 +496,6 @@ Expand or collapse the toolbar with an optional animation.
508496
public void setToolbarExpanded(boolean expanded, boolean animate)
509497
```
510498

511-
See [Advanced](#Advanced) for even more methods.
512-
513499
### CoordinatorLayout
514500
Samsung's CoordinatorLayout
515501
```xml
@@ -739,7 +725,7 @@ Control the state (colored, bold text).
739725
```java
740726
public void setButtonSelected(Boolean selected)
741727
public void toggleButtonSelected()
742-
public Boolean isButtonSelcted()
728+
public Boolean isButtonSelected()
743729
```
744730
Enable/disable the OptionButton.
745731
```java
@@ -1100,21 +1086,21 @@ Samsung's Radio Preferences used in Light/Dark mode Settings and Resolution Sett
11001086

11011087
Create a PopupMenu with it's anchor.
11021088
```java
1103-
//de.dlyt.yanndroid.oneui.view.PopupMenu
1089+
//de.dlyt.yanndroid.oneui.menu.PopupMenu
11041090
PopupMenu popupMenu = new PopupMenu(view);
11051091
```
1106-
Inflate a menu resource or a list of the items to show.
1092+
Inflate a menu resource or a Menu (de.dlyt.yanndroid.oneui.menu.Menu).
11071093
```java
11081094
public void inflate(@MenuRes int menuRes)
1109-
public void inflate(ArrayList<MenuItem> menuItems)
1095+
public void inflate(Menu menu)
11101096
```
1111-
Get the menu (will only work if you inflate with a menu resource)
1097+
Get the menu.
11121098
```java
11131099
public Menu getMenu()
11141100
```
1115-
Set the menu item click listener.
1101+
Set the menu item click and update listener.
11161102
```java
1117-
public void setOnMenuItemClickListener(OnMenuItemClickListener listener)
1103+
public void setPopupMenuListener(PopupMenuListener listener)
11181104
```
11191105
Show and dismiss the popup.
11201106
```java
@@ -1123,17 +1109,6 @@ public void show(int xoff, int yoff) //with offset
11231109
public void dismiss()
11241110
public boolean isShowing()
11251111
```
1126-
Manage the menu items.
1127-
```java
1128-
public void setMenuItemBadge(MenuItem item, Integer badge)
1129-
public void setMenuItemTitle(MenuItem item, CharSequence title)
1130-
public void setMenuItemEnabled(MenuItem item, boolean enabled)
1131-
public Integer getMenuItemBadge(MenuItem item)
1132-
```
1133-
Get the number of all badges in the menu.
1134-
```java
1135-
public Integer getTotalBadgeCount()
1136-
```
11371112

11381113
### Tooltip
11391114
Samsung's Tooltip.
@@ -1174,7 +1149,7 @@ Snackbar.make(view, "Text label", Snackbar.LENGTH_SHORT).setAction("Action", new
11741149
```
11751150

11761151
### Advanced
1177-
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.
1152+
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.
11781153

11791154
### Icons
11801155
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:
12651240
<img loading="lazy" src="readme-resources/app-icons/sample.png" width="50" height="50" />
12661241

12671242
### OneUI 4
1268-
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.
1243+
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.
12691244

12701245
## Progress
12711246

@@ -1299,6 +1274,22 @@ Starting with v2.1.0, the new OneUI 4 design is being added to this library. Sin
12991274

13001275
## Changelog
13011276

1277+
<details>
1278+
<summary>2.2.0</summary>
1279+
1280+
- OneUI4++ (huge thanks to [BlackMesa123](https://github.com/BlackMesa123))
1281+
- AppBar/Toolbar
1282+
- Edge effect
1283+
- TabLayout/BottomNavigationView
1284+
- SwipeRefreshLayout
1285+
- EditText
1286+
- and more...
1287+
- ToolbarLayout & PopupMenu/Menu improvements
1288+
- icons++ (OneUI4)
1289+
- fixes & minor changes
1290+
1291+
</details>
1292+
13021293
<details>
13031294
<summary>2.1.1</summary>
13041295

@@ -1436,5 +1427,4 @@ Starting with v2.1.0, the new OneUI 4 design is being added to this library. Sin
14361427
- [BlackMesa123](https://github.com/BlackMesa123) for a lot of OneUI stuff, more compatibility and his experience.
14371428
- [TenSeventy7](https://github.com/TenSeventy7) for some stuff and help.
14381429
- [leonbcode](https://github.com/leonbcode) for github actions, so this library is always up-to-date.
1439-
- [AlirezaIvaz](https://github.com/AlirezaIvaz) for translation correction (Persian) and issue reporting.
1440-
- [nfauv2001](https://github.com/nfauv2001) for helping me out with my english.
1430+
- All the [Contributors](https://github.com/Yanndroid/OneUI-Design-Library/graphs/contributors) and Issue Reporters.

app/release/app-release.apk

185 KB
Binary file not shown.

app/release/output-metadata.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": 2,
2+
"version": 3,
33
"artifactType": {
44
"type": "APK",
55
"kind": "Directory"
@@ -10,9 +10,11 @@
1010
{
1111
"type": "SINGLE",
1212
"filters": [],
13-
"versionCode": 54,
14-
"versionName": "2.1.1",
13+
"attributes": [],
14+
"versionCode": 55,
15+
"versionName": "2.2.0",
1516
"outputFile": "app-release.apk"
1617
}
17-
]
18+
],
19+
"elementType": "File"
1820
}

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
22
android.useAndroidX=true
33
android.enableJetifier=true
44
# version
5-
VERSION_NAME=2.1.1
6-
VERSION_CODE=6
5+
VERSION_NAME=2.2.0
6+
VERSION_CODE=7
77
# mavenCentral
88
GROUP_ID=io.github.yanndroid
99
ARTIFACT_ID=oneui

0 commit comments

Comments
 (0)