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

Commit e26559e

Browse files
authored
app: minor fixes to RecyclerView, ToolbarLayout select mode (#71)
* app/RecyclerView: minor fixes Signed-off-by: BlackMesa123 <[email protected]> * app/themes: burp Signed-off-by: BlackMesa123 <[email protected]> * app/styles: use correct fontFamily in EditText Signed-off-by: BlackMesa123 <[email protected]> * app/styles: OUI4 primary text color Signed-off-by: BlackMesa123 <[email protected]> * app/ToolbarLayout: select mode minor fixes Signed-off-by: BlackMesa123 <[email protected]> * app/oneuiexample: use correct theme for each activity Signed-off-by: BlackMesa123 <[email protected]> * README update Signed-off-by: BlackMesa123 <[email protected]> * README burp Signed-off-by: BlackMesa123 <[email protected]> * app/ToolbarLayout: reset select mode checkbox state Signed-off-by: BlackMesa123 <[email protected]>
1 parent a4616d8 commit e26559e

27 files changed

+159
-51
lines changed

README.md

Lines changed: 49 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ Huge thanks to [BlackMesa123](https://github.com/BlackMesa123) who has contribut
2727

2828
## Screenshots
2929

30-
<img loading="lazy" src="readme-resources/screenshots/screenshot_1.png" width="150"/> <img loading="lazy" src="readme-resources/screenshots/screenshot_2.png" width="150"/> <img loading="lazy" src="readme-resources/screenshots/screenrecording.gif" width="150"/>
30+
<p align="center"><img loading="lazy" src="readme-resources/screenshots/screenshot_1.jpg" height="350"/> <img loading="lazy" src="readme-resources/screenshots/screenshot_2.jpg" height="350"/> <img loading="lazy" src="readme-resources/screenshots/screenshot_3.jpg" height="350"/> <img loading="lazy" src="readme-resources/screenshots/screenshot_4.jpg" height="350"/></p>
31+
32+
[GIF version](https://github.com/Yanndroid/OneUI-Design-Library/blob/master/readme-resources/screenshots/screenrecording.gif)
3133

3234
## Installation
3335
v2.0.0 and future versions are (and only will be) available on mavenCentral. For older ones see below. (v1.3.0 was published to MavenCentral during development for testing purpose and should **not** be used as it's unstable and incomplete.)
@@ -139,7 +141,6 @@ dependencies {
139141
```
140142

141143
</details>
142-
<br/>
143144

144145
## Issues
145146

@@ -281,7 +282,7 @@ For further customization you can use ```android:layout``` to apply your own lay
281282
<br clear="left"/>
282283

283284
#### Methods
284-
Return the toolbar, useful for ```setSupportActionBar()```.
285+
Return the Toolbar.
285286
```java
286287
public MaterialToolbar getToolbar()
287288
```
@@ -493,6 +494,10 @@ For further customization you can use ```android:layout``` to apply your own lay
493494
<br clear="left"/>
494495

495496
#### Methods
497+
Return the [ToolbarLayout](#ToolbarLayout).
498+
```java
499+
public ToolbarLayout getToolbarLayout()
500+
```
496501
Return the [SwitchBar](#SwitchBar).
497502
```java
498503
public SwitchBar getSwitchBar()
@@ -594,6 +599,10 @@ public void seslSetFillBottomColor(int color)
594599
Samsung also customized RecyclerView.ItemDecoration class by adding a call to **onDispatchDraw** method of the View. Overriding the ```seslOnDispatchDraw``` method lets you customize even more your list/grid view. You can find an example of it [here](https://github.com/Yanndroid/OneUI-Design-Library/blob/1e110958151a93647b71b80c68e54949a3a0691a/app/src/main/java/de/dlyt/yanndroid/oneuiexample/tabs/IconsTab.java#L298).
595600

596601
### SwipeRefreshLayout
602+
Samsung's SwipeRefreshLayout.
603+
604+
<img loading="lazy" src="readme-resources/screenshots/swiperefreshlayout.jpg" width="300"/>
605+
597606
It's almost the same as Google's one, only difference is a different "pull-down" animation.
598607
```xml
599608
<de.dlyt.yanndroid.oneui.layout.SwipeRefreshLayout
@@ -604,6 +613,12 @@ It's almost the same as Google's one, only difference is a different "pull-down"
604613
```
605614
Attributes and usage are the same as Google's [SwipeRefreshLayout](https://developer.android.com/reference/androidx/swiperefreshlayout/widget/SwipeRefreshLayout).
606615

616+
#### Methods
617+
End the refresh status once the animation ends.
618+
```java
619+
public void seslSetRefreshOnce(boolean once)
620+
```
621+
607622
### Button
608623
The Button has three styles which you can use, depending on your needs.
609624

@@ -823,7 +838,7 @@ public void setTitle(String title)
823838
### BottomNavigationView
824839
Samsung's BottomNavigationView.
825840

826-
<img loading="lazy" src="readme-resources/screenshots/bottomnavigationview.png" width="300"/>
841+
<img loading="lazy" src="readme-resources/screenshots/bottomnavigationview.jpg" width="300"/>
827842

828843
```xml
829844
<de.dlyt.yanndroid.oneui.view.BottomNavigationView
@@ -836,7 +851,7 @@ Samsung's BottomNavigationView.
836851
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 configured it.
837852

838853
#### Methods
839-
Add a custom ImageButton (like in Samsung's Gallery).
854+
Add a custom ImageButton like in Samsung's Gallery (as seen in screenshot).
840855
```java
841856
public void addTabCustomButton(Drawable icon, CustomButtonClickListener listener)
842857
```
@@ -1094,26 +1109,49 @@ Samsung's Radio Preferences used in Light/Dark mode Settings and Resolution Sett
10941109

10951110

10961111
### PopupMenu
1097-
<img loading="lazy" src="readme-resources/screenshots/popupmenu.png" width="150"/>
1112+
Create a PopupWindow Menu with it's anchor.
1113+
1114+
<img loading="lazy" src="readme-resources/screenshots/popupmenu.jpg" width="150"/>
10981115

1099-
Create a PopupMenu with it's anchor.
11001116
```java
11011117
//de.dlyt.yanndroid.oneui.menu.PopupMenu
11021118
PopupMenu popupMenu = new PopupMenu(view);
11031119
```
1120+
1121+
#### Methods
11041122
Inflate a menu resource or a Menu (de.dlyt.yanndroid.oneui.menu.Menu).
11051123
```java
11061124
public void inflate(@MenuRes int menuRes)
1125+
public void inflate(@MenuRes int menuRes, CharSequence title)
11071126
public void inflate(Menu menu)
1127+
public void inflate(Menu menu, CharSequence title)
11081128
```
1109-
Get the menu.
1129+
Get the inflated menu.
11101130
```java
11111131
public Menu getMenu()
11121132
```
11131133
Set the menu item click and update listener.
11141134
```java
11151135
public void setPopupMenuListener(PopupMenuListener listener)
11161136
```
1137+
Show a divider between menu groups.
1138+
```java
1139+
public void setGroupDividerEnabled(boolean enabled)
1140+
```
1141+
Set a custom animation set.
1142+
```xml
1143+
<!-- styles.xml -->
1144+
<style name="MenuPopupAnimStyle" parent="@android:style/Animation">
1145+
<item name="android:windowEnterAnimation">@anim/sesl_menu_popup_enter</item>
1146+
<item name="android:windowExitAnimation">@anim/sesl_menu_popup_exit</item>
1147+
</style>
1148+
1149+
<style name="BottomMenuPopupAnimStyle" parent="@android:style/Animation">
1150+
...
1151+
```
1152+
```java
1153+
public void setAnimationStyle(int animationStyle)
1154+
```
11171155
Show and dismiss the popup.
11181156
```java
11191157
public void show()
@@ -1127,7 +1165,7 @@ Samsung's Tooltip.
11271165

11281166
<img loading="lazy" src="readme-resources/screenshots/tooltip.png" width="100"/>
11291167

1130-
Usage is the same as [TooltipCompat](https://developer.android.com/reference/androidx/appcompat/widget/TooltipCompat) but with additional methods. Please note this won't show up on default views and has to be added manually instead of using ```view.setTooltipText(text)```:
1168+
Usage is the same as [TooltipCompat](https://developer.android.com/reference/androidx/appcompat/widget/TooltipCompat) but with additional methods. Please note this won't show up on default views and has to be added manually. Instead of using ```view.setTooltipText(text)```, use:
11311169
```java
11321170
Tooltip.setTooltipText(view, text);
11331171
SeslViewReflector.semSetHoverPopupType(view, 1 /* SemHoverPopupWindow.TYPE_TOOLTIP */);
@@ -1168,7 +1206,7 @@ There are also a lot of the stock icons you can find in Samsung apps included in
11681206

11691207
<img loading="lazy" src="readme-resources/screenshots/icons.png" width="350"/>
11701208

1171-
*not all icons are shown here because there are too much by now(229). They are all listed with the file name in the icon tab of the sample app.
1209+
*not all icons are shown here because there are too much by now (230). They are all listed with their name in the Icons tab of the sample app.
11721210

11731211
### Color theme
11741212
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:
@@ -1439,4 +1477,4 @@ Starting with v2.1.0, the new OneUI 4 design is being added to this library and
14391477
- [BlackMesa123](https://github.com/BlackMesa123) for a lot of OneUI stuff, more compatibility and his experience.
14401478
- [TenSeventy7](https://github.com/TenSeventy7) for some stuff and help.
14411479
- [leonbcode](https://github.com/leonbcode) for github actions, so this library is always up-to-date.
1442-
- All the [Contributors](https://github.com/Yanndroid/OneUI-Design-Library/graphs/contributors) and Issue Reporters.
1480+
- All the [Contributors](https://github.com/Yanndroid/OneUI-Design-Library/graphs/contributors) and Issue Reporters.

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ public class AboutActivity extends BaseThemeActivity {
1111

1212
@Override
1313
protected void onCreate(Bundle savedInstanceState) {
14+
mUseAltTheme = true;
15+
1416
super.onCreate(savedInstanceState);
1517
setContentView(R.layout.activity_about);
1618

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ public class MainActivity extends BaseThemeActivity {
6262

6363
@Override
6464
protected void onCreate(Bundle savedInstanceState) {
65+
mUseAltTheme = false;
66+
6567
super.onCreate(savedInstanceState);
6668
mContext = this;
6769
setContentView(R.layout.activity_main);

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ public class SplashActivity extends BaseThemeActivity {
1515

1616
@Override
1717
protected void onCreate(Bundle savedInstanceState) {
18+
mUseAltTheme = true;
19+
1820
super.onCreate(savedInstanceState);
1921
setContentView(R.layout.activity_splash);
2022

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
public class SwitchBarActivity extends BaseThemeActivity implements SwitchBar.OnSwitchChangeListener {
1515
@Override
1616
protected void onCreate(Bundle savedInstanceState) {
17+
mUseAltTheme = false;
18+
1719
super.onCreate(savedInstanceState);
1820
setContentView(R.layout.activity_switchbar);
1921

app/src/main/java/de/dlyt/yanndroid/oneuiexample/base/BaseThemeActivity.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,18 @@
1313
public class BaseThemeActivity extends AppCompatActivity {
1414
private static String SP_NAME = BuildConfig.APPLICATION_ID + "_preferences";
1515
private SharedPreferences sp;
16+
public boolean mUseAltTheme;
1617
public boolean mUseOUI4Theme;
1718

1819
@Override
1920
protected void onCreate(Bundle savedInstanceState) {
2021
sp = getSharedPreferences(SP_NAME, Context.MODE_PRIVATE);
2122
mUseOUI4Theme = sp.getBoolean("use_oui4_theme", true);
2223

23-
setTheme(mUseOUI4Theme ? R.style.OneUI4Theme : R.style.OneUI3Theme);
24+
int normalTheme = mUseOUI4Theme ? R.style.OneUI4Theme : R.style.OneUI3Theme;
25+
int altTheme = mUseOUI4Theme ? R.style.OneUI4AboutTheme : R.style.OneUI3AboutTheme;
26+
27+
setTheme(mUseAltTheme ? altTheme : normalTheme);
2428
new ThemeUtil(this);
2529

2630
super.onCreate(savedInstanceState);
15.7 KB
Loading
-6.54 KB
Binary file not shown.
77.5 KB
Loading
-22.7 KB
Binary file not shown.

0 commit comments

Comments
 (0)