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

Commit d14b639

Browse files
committed
v2.0.1
1 parent 183c2ac commit d14b639

File tree

9 files changed

+68
-15
lines changed

9 files changed

+68
-15
lines changed

README.md

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ v2.0.0 and future versions are (and only will be) available on mavenCentral. For
3838
1. Add the dependency to build.gradle (Module: ...)
3939
```gradle
4040
dependencies {
41-
implementation 'io.github.yanndroid:oneui:2.0.0'
41+
implementation 'io.github.yanndroid:oneui:2.0.1'
4242
...
4343
}
4444
```
@@ -160,6 +160,7 @@ In general, most of the views are styled automatically when you apply ```android
160160
- [SeekBar](#SeekBar)
161161
- [ProgressBar](#ProgressBar)
162162
- [SwitchBar](#SwitchBar)
163+
- [Spinner](#Spinner)
163164
- [OptionButton](#OptionButton)
164165
- [OptionGroup](#OptionGroup)
165166
- [RelatedCard](#RelatedCard)
@@ -201,7 +202,7 @@ In general, most of the views are styled automatically when you apply ```android
201202
```
202203
The children of this view can be at three different location: on the **main screen**, in the **drawer** or in the **footer** (useful for views like BottomNavigationView). 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``` or ```footer```.
203204

204-
```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.
205+
```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.
205206

206207
The drawable in ```app:drawer_icon="..."``` is the little icon in the header of the drawer panel. There are already some stock OneUI [icons](#Icons) included in the library you can use.
207208

@@ -272,7 +273,7 @@ See [Advanced](#Advanced) for even more methods.
272273
```
273274
The children of this view can be at two different location: on the **main screen**, or in the **footer** (useful for views like BottomNavigationView). To specify the location of each child you can set the attribute ```app:layout_location``` of the child to either ```main_content``` (default), or ```footer```.
274275

275-
```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.
276+
```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.
276277

277278
The drawable in ```app:navigationIcon="..."``` is the icon for the Toolbar Navigation Button. There are already some stock OneUI [icons](#Icons) included in the library you can use.
278279

@@ -664,6 +665,20 @@ SwitchBar Listener.
664665
public void addOnSwitchChangeListener(OnSwitchChangeListener onSwitchChangeListener)
665666
```
666667

668+
### Spinner
669+
670+
Spinner with rounded corners and custom selector.
671+
672+
<img src="readme-resources/screenshots/spinner.png" width="260"/>
673+
674+
```xml
675+
<androidx.appcompat.widget.SeslSpinner
676+
android:layout_width="match_parent"
677+
android:layout_height="wrap_content" />
678+
```
679+
680+
Same usage as [Spinner](https://developer.android.com/reference/android/widget/Spinner).
681+
667682
### OptionButton
668683
Create lists inside DrawerLayout without using RecyclerView with OptionButton.
669684

@@ -797,7 +812,13 @@ Samsung's BottomNavigationView.
797812
</de.dlyt.yanndroid.oneui.view.BottomNavigationView>
798813
```
799814

800-
If you want to set it up with a ViewPager you'll have to use the [ViewPager](#ViewPager) bundled in the library, the usage is the same as Google's [TabLayout](https://developer.android.com/reference/com/google/android/material/tabs/TabLayout), but you'll have to call ```updateWidget(Activity activity)``` after you configurated it.
815+
If you want to set it up with a ViewPager you'll have to use the [ViewPager](#ViewPager) bundled in the library, the usage is the same as Google's [TabLayout](https://developer.android.com/reference/com/google/android/material/tabs/TabLayout), but you'll have to call ```updateWidget(Activity activity)``` after you configurated it.
816+
817+
#### Methods
818+
Add a custom ImageButton (like in Samsung's Gallery).
819+
```java
820+
public void addTabCustomButton(Drawable icon, CustomButtonClickListener listener)
821+
```
801822

802823
### TabLayout
803824
Samsung's TabLayout.
@@ -1120,7 +1141,7 @@ There are also some of the stock icons you can find in Samsung apps included in
11201141

11211142
<img src="readme-resources/screenshots/icons.png" width="350"/>
11221143

1123-
*not all icons are shown here because there are too much now (152). They are all listed with the name in the icon tab of the sample app.
1144+
*not all icons are shown here because there are too much now (186). They are all listed with the name in the icon tab of the sample app.
11241145

11251146
### Color theme
11261147
The default color of the style is the same blue as Samsung (see [Screenshots](#Screenshots)). But like Samsung has different colors for different apps, you too can use other colors which will apply on the entire App and even on the [App Icon](#App-Icon). In this library there are three different ways to do that and all three can be used simultaneously:
@@ -1227,14 +1248,29 @@ My sample app icon for example:
12271248
- [x] Drawer Divider
12281249
- [x] SnackBar
12291250
- [x] Color Picker Dialog
1230-
- [x] Spinner *
1251+
- [x] Spinner
12311252
- [ ] SearchView
12321253
- [ ] BottomSheet
12331254

12341255
*needs improvement
12351256

12361257
## Changelog
12371258

1259+
<details>
1260+
<summary>2.0.1</summary>
1261+
1262+
- fixed:
1263+
- scroll bevavior on clickable views
1264+
- aboutpage button font and ripple
1265+
- popupmenu going beyond screen
1266+
- drawerLayout back click closes drawer
1267+
- crash on small screens/dpi
1268+
- icons++
1269+
- Spinner
1270+
- BottomNavigationView improvements
1271+
1272+
</details>
1273+
12381274
<details>
12391275
<summary>2.0.0</summary>
12401276

app/release/app-release.apk

548 KB
Binary file not shown.

app/release/output-metadata.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
{
1111
"type": "SINGLE",
1212
"filters": [],
13-
"versionCode": 51,
14-
"versionName": "2.0.0",
13+
"versionCode": 52,
14+
"versionName": "2.0.1",
1515
"outputFile": "app-release.apk"
1616
}
1717
]

app/src/main/java/de/dlyt/yanndroid/oneuiexample/MainActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ public void onClick(View v) {
342342
private void popupView(View view) {
343343
PopupMenu popupMenu = new PopupMenu(view);
344344
ArrayList<String> list = new ArrayList<>();
345-
for (int i = 0; i < 24; i++) list.add("Menu Item " + i);
345+
for (int i = 0; i < 4; i++) list.add("Menu Item " + i);
346346
popupMenu.inflate(list);
347347
popupMenu.setOnMenuItemClickListener((parent, view1, position, id) -> {
348348
popupMenu.dismiss();

app/src/main/java/de/dlyt/yanndroid/oneuiexample/tabs/IconsTab.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ public class IconsTab extends Fragment {
115115
R.drawable.ic_samsung_info,
116116
R.drawable.ic_samsung_keyboard,
117117
R.drawable.ic_samsung_light_bulb,
118+
R.drawable.ic_samsung_light_bulb_settings,
118119
R.drawable.ic_samsung_list,
119120
R.drawable.ic_samsung_list_extended,
120121
R.drawable.ic_samsung_list_grid,

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.0.0
6-
VERSION_CODE=3
5+
VERSION_NAME=2.0.1
6+
VERSION_CODE=4
77
# mavenCentral
88
GROUP_ID=io.github.yanndroid
99
ARTIFACT_ID=oneui
24.8 KB
Loading

yanndroid/oneui/src/main/res/drawable/ic_samsung_light_bulb.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
<vector xmlns:android="http://schemas.android.com/apk/res/android"
33
android:width="24.0dip"
44
android:height="24.0dip"
5-
android:viewportWidth="24.0"
6-
android:viewportHeight="24.0">
5+
android:viewportWidth="22.0"
6+
android:viewportHeight="22.0">
77
<group
8-
android:translateX="-2"
9-
android:translateY="-2">
8+
android:translateX="-3"
9+
android:translateY="-3">
1010
<path
1111
android:fillColor="?actionMenuTextColor"
1212
android:fillType="nonZero"
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:width="24.0dip"
4+
android:height="24.0dip"
5+
android:viewportWidth="24.0"
6+
android:viewportHeight="24.0">
7+
<path
8+
android:fillColor="?actionMenuTextColor"
9+
android:pathData="M16.71,10a6.5,6.5 0,0 0,0.1 -1.09,6.61 6.61,0 1,0 -9.38,6v1.76h3.23a6.58,6.58 0,0 1,3.27 -5.79A6.68,6.68 0,0 1,16.71 10Z" />
10+
<path
11+
android:fillColor="?actionMenuTextColor"
12+
android:pathData="M10.91,18.28H7.43V19h0c0,1.09 0.72,1.13 1.17,1.27a1.71,1.71 0,0 0,3.22 0h0c-0.11,-0.17 -0.22,-0.33 -0.33,-0.51A6.23,6.23 0,0 1,10.91 18.28Z" />
13+
<path
14+
android:fillColor="?actionMenuTextColor"
15+
android:pathData="M20.86,17.22a0.5,0.5 0,0 1,-0.18 -0.43v-0.67a0.56,0.56 0,0 1,0.18 -0.42l0.63,-0.72a0.33,0.33 0,0 0,0.08 -0.39L21,13.66c-0.07,-0.12 -0.3,-0.29 -0.44,-0.24l-0.94,0.19a0.57,0.57 0,0 1,-0.46 -0.06l-0.55,-0.31a0.53,0.53 0,0 1,-0.28 -0.37L18,12a0.32,0.32 0,0 0,-0.3 -0.26h-1.2a0.33,0.33 0,0 0,-0.3 0.26l-0.31,0.91a0.52,0.52 0,0 1,-0.27 0.37l-0.57,0.33a0.57,0.57 0,0 1,-0.46 0.06l-0.94,-0.19a0.33,0.33 0,0 0,-0.38 0.13l-0.59,1a0.32,0.32 0,0 0,0.07 0.39l0.64,0.73a0.52,0.52 0,0 1,0.17 0.42v0.64a0.56,0.56 0,0 1,-0.18 0.42l-0.64,0.73a0.32,0.32 0,0 0,-0.07 0.39l0.59,1a0.33,0.33 0,0 0,0.38 0.13l0.94,-0.19a0.57,0.57 0,0 1,0.46 0.06l0.58,0.34a0.57,0.57 0,0 1,0.27 0.37l0.31,0.91a0.32,0.32 0,0 0,0.3 0.26h1.07c0.14,0 0.4,-0.11 0.43,-0.26l0.31,-0.91a0.55,0.55 0,0 1,0.28 -0.37l0.56,-0.32a0.57,0.57 0,0 1,0.46 -0.06l0.94,0.19a0.33,0.33 0,0 0,0.38 -0.13l0.53,-0.92c0.07,-0.13 0.1,-0.41 0,-0.51ZM17.93,17.85a1.61,1.61 0,0 1,-2.21 -0.58,1.64 1.64,0 0,1 0.61,-2.22 1.61,1.61 0,0 1,2.21 0.58A1.64,1.64 0,0 1,17.93 17.85Z" />
16+
</vector>

0 commit comments

Comments
 (0)