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

Commit 88e6805

Browse files
committed
Merge branch 'dev'
2 parents 01aa4cb + cf3fef4 commit 88e6805

File tree

104 files changed

+1571
-433
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+1571
-433
lines changed

README.md

Lines changed: 67 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Huge thanks to [BlackMesa123](https://github.com/BlackMesa123) who has contribut
1818

1919
- [Screenshots](#Screenshots)
2020
- [Installation](#Installation)
21+
- [Issues](#Issues)
2122
- [Documentation](#Documentation)
2223
- [Progress](#Progress)
2324
- [Changelog](#Changelog)
@@ -26,15 +27,16 @@ Huge thanks to [BlackMesa123](https://github.com/BlackMesa123) who has contribut
2627

2728
## Screenshots
2829

29-
<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)
3033

3134
## Installation
32-
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.)
3335

3436
1. Add the dependency to build.gradle (Module: ...)
3537
```gradle
3638
dependencies {
37-
implementation 'io.github.yanndroid:oneui:2.2.0'
39+
implementation 'io.github.yanndroid:oneui:2.2.1'
3840
...
3941
}
4042
```
@@ -74,73 +76,18 @@ res/values-v25/styles.xml
7476

7577
</details>
7678

79+
## Issues
7780

78-
<details>
79-
<summary>Older versions</summary>
81+
### Proguard
8082

81-
### with [Jitpack](https://jitpack.io/#Yanndroid/SamsungOneUi):
82-
1. Add jitpack to build.gradle (Project: ...)
83-
```gradle
84-
allprojects {
85-
repositories {
86-
...
87-
maven { url 'https://jitpack.io' }
88-
}
89-
}
90-
```
91-
2. Add the dependency to build.gradle (Module: ...)
92-
```gradle
93-
dependencies {
94-
implementation 'com.github.Yanndroid:OneUI-Design-Library:1.3.0'
95-
...
96-
}
97-
```
98-
3. Apply the main theme in AndroidManifest.xml
99-
```xml
100-
<application
101-
...
102-
android:theme="@style/SamsungTheme"
103-
>
104-
...
105-
</application>
106-
```
107-
108-
109-
### with Github Packages:
110-
1. Create a [new token](https://github.com/settings/tokens) with ```read:packages``` permission.
111-
2. Add the dependency to build.gradle (Module: ...)
112-
```gradle
113-
repositories {
114-
maven {
115-
url = uri("https://maven.pkg.github.com/Yanndroid/OneUI-Design-Library")
116-
credentials {
117-
username = "your username"
118-
password = "your token"
119-
}
120-
}
121-
}
122-
123-
124-
dependencies {
125-
implementation 'de.dlyt.yanndroid:oneui:1.3.0'
126-
...
127-
}
128-
```
83+
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).
12984

130-
3. Apply the main theme in AndroidManifest.xml
85+
### Preview render problem
86+
Some of the custom views might not render in the preview, because this library is using a font (```sec-roboto-light```), which Android Studio (and other IDEs probably too) don't know. To temporarily bypass this problem you can simply add
13187
```xml
132-
<application
133-
...
134-
android:theme="@style/SamsungTheme"
135-
>
136-
...
137-
</application>
88+
<string name="sesl_font_family_regular">sans-serif</string>
13889
```
139-
140-
</details>
141-
<br/>
142-
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).
90+
to your strings.xml. But don't forget to remove it afterwards for your release. Thanks to [roynatech2544](https://github.com/roynatech2544), for reporting this issue.
14491

14592
## Documentation
14693
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.
@@ -269,7 +216,7 @@ For further customization you can use ```android:layout``` to apply your own lay
269216
<br clear="left"/>
270217

271218
#### Methods
272-
Return the toolbar, useful for ```setSupportActionBar()```.
219+
Return the Toolbar.
273220
```java
274221
public MaterialToolbar getToolbar()
275222
```
@@ -481,6 +428,10 @@ For further customization you can use ```android:layout``` to apply your own lay
481428
<br clear="left"/>
482429

483430
#### Methods
431+
Return the [ToolbarLayout](#ToolbarLayout).
432+
```java
433+
public ToolbarLayout getToolbarLayout()
434+
```
484435
Return the [SwitchBar](#SwitchBar).
485436
```java
486437
public SwitchBar getSwitchBar()
@@ -582,6 +533,10 @@ public void seslSetFillBottomColor(int color)
582533
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).
583534

584535
### SwipeRefreshLayout
536+
Samsung's SwipeRefreshLayout.
537+
538+
<img loading="lazy" src="readme-resources/screenshots/swiperefreshlayout.jpg" width="300"/>
539+
585540
It's almost the same as Google's one, only difference is a different "pull-down" animation.
586541
```xml
587542
<de.dlyt.yanndroid.oneui.layout.SwipeRefreshLayout
@@ -592,6 +547,12 @@ It's almost the same as Google's one, only difference is a different "pull-down"
592547
```
593548
Attributes and usage are the same as Google's [SwipeRefreshLayout](https://developer.android.com/reference/androidx/swiperefreshlayout/widget/SwipeRefreshLayout).
594549

550+
#### Methods
551+
End the refresh status once the animation ends.
552+
```java
553+
public void seslSetRefreshOnce(boolean once)
554+
```
555+
595556
### Button
596557
The Button has three styles which you can use, depending on your needs.
597558

@@ -811,7 +772,7 @@ public void setTitle(String title)
811772
### BottomNavigationView
812773
Samsung's BottomNavigationView.
813774

814-
<img loading="lazy" src="readme-resources/screenshots/bottomnavigationview.png" width="300"/>
775+
<img loading="lazy" src="readme-resources/screenshots/bottomnavigationview.jpg" width="300"/>
815776

816777
```xml
817778
<de.dlyt.yanndroid.oneui.view.BottomNavigationView
@@ -824,7 +785,7 @@ Samsung's BottomNavigationView.
824785
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.
825786

826787
#### Methods
827-
Add a custom ImageButton (like in Samsung's Gallery).
788+
Add a custom ImageButton like in Samsung's Gallery (as seen in screenshot).
828789
```java
829790
public void addTabCustomButton(Drawable icon, CustomButtonClickListener listener)
830791
```
@@ -1082,26 +1043,49 @@ Samsung's Radio Preferences used in Light/Dark mode Settings and Resolution Sett
10821043

10831044

10841045
### PopupMenu
1085-
<img loading="lazy" src="readme-resources/screenshots/popupmenu.png" width="150"/>
1046+
Create a PopupWindow Menu with it's anchor.
1047+
1048+
<img loading="lazy" src="readme-resources/screenshots/popupmenu.jpg" width="150"/>
10861049

1087-
Create a PopupMenu with it's anchor.
10881050
```java
10891051
//de.dlyt.yanndroid.oneui.menu.PopupMenu
10901052
PopupMenu popupMenu = new PopupMenu(view);
10911053
```
1054+
1055+
#### Methods
10921056
Inflate a menu resource or a Menu (de.dlyt.yanndroid.oneui.menu.Menu).
10931057
```java
10941058
public void inflate(@MenuRes int menuRes)
1059+
public void inflate(@MenuRes int menuRes, CharSequence title)
10951060
public void inflate(Menu menu)
1061+
public void inflate(Menu menu, CharSequence title)
10961062
```
1097-
Get the menu.
1063+
Get the inflated menu.
10981064
```java
10991065
public Menu getMenu()
11001066
```
11011067
Set the menu item click and update listener.
11021068
```java
11031069
public void setPopupMenuListener(PopupMenuListener listener)
11041070
```
1071+
Show a divider between menu groups.
1072+
```java
1073+
public void setGroupDividerEnabled(boolean enabled)
1074+
```
1075+
Set a custom animation set.
1076+
```xml
1077+
<!-- styles.xml -->
1078+
<style name="MenuPopupAnimStyle" parent="@android:style/Animation">
1079+
<item name="android:windowEnterAnimation">@anim/sesl_menu_popup_enter</item>
1080+
<item name="android:windowExitAnimation">@anim/sesl_menu_popup_exit</item>
1081+
</style>
1082+
1083+
<style name="BottomMenuPopupAnimStyle" parent="@android:style/Animation">
1084+
...
1085+
```
1086+
```java
1087+
public void setAnimationStyle(int animationStyle)
1088+
```
11051089
Show and dismiss the popup.
11061090
```java
11071091
public void show()
@@ -1115,7 +1099,7 @@ Samsung's Tooltip.
11151099

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

1118-
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)```:
1102+
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:
11191103
```java
11201104
Tooltip.setTooltipText(view, text);
11211105
SeslViewReflector.semSetHoverPopupType(view, 1 /* SemHoverPopupWindow.TYPE_TOOLTIP */);
@@ -1156,7 +1140,7 @@ There are also a lot of the stock icons you can find in Samsung apps included in
11561140

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

1159-
*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.
1143+
*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.
11601144

11611145
### Color theme
11621146
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:
@@ -1274,6 +1258,15 @@ Starting with v2.1.0, the new OneUI 4 design is being added to this library and
12741258

12751259
## Changelog
12761260

1261+
<details>
1262+
<summary>2.2.1</summary>
1263+
1264+
- OneUI4++ (views, colors, fonts, themes)
1265+
- PopupMenu improvements
1266+
- fixes & minor changes
1267+
1268+
</details>
1269+
12771270
<details>
12781271
<summary>2.2.0</summary>
12791272

@@ -1427,4 +1420,4 @@ Starting with v2.1.0, the new OneUI 4 design is being added to this library and
14271420
- [BlackMesa123](https://github.com/BlackMesa123) for a lot of OneUI stuff, more compatibility and his experience.
14281421
- [TenSeventy7](https://github.com/TenSeventy7) for some stuff and help.
14291422
- [leonbcode](https://github.com/leonbcode) for github actions, so this library is always up-to-date.
1430-
- All the [Contributors](https://github.com/Yanndroid/OneUI-Design-Library/graphs/contributors) and Issue Reporters.
1423+
- All the [Contributors](https://github.com/Yanndroid/OneUI-Design-Library/graphs/contributors) and Issue Reporters.

app/build.gradle

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,26 @@ android {
2727
sourceCompatibility JavaVersion.VERSION_1_8
2828
targetCompatibility JavaVersion.VERSION_1_8
2929
}
30+
31+
project.gradle.addBuildListener(new BuildListener() {
32+
@Override
33+
void settingsEvaluated(Settings settings) {}
34+
35+
@Override
36+
void projectsLoaded(Gradle gradle) {}
37+
38+
@Override
39+
void projectsEvaluated(Gradle gradle) {
40+
File stringFile = new File("${projectDir}/src/main/res/values/strings.xml")
41+
stringFile.write(stringFile.getText('UTF-8').replace("<string name=\"sesl_font_family_regular\" translatable=\"false\">sans-serif</string>", "<string name=\"sesl_font_family_regular\" translatable=\"false\">sec-roboto-light</string>"), 'UTF-8')
42+
}
43+
44+
@Override
45+
void buildFinished(BuildResult result) {
46+
File stringFile = new File("${projectDir}/src/main/res/values/strings.xml")
47+
stringFile.write(stringFile.getText('UTF-8').replace("<string name=\"sesl_font_family_regular\" translatable=\"false\">sec-roboto-light</string>", "<string name=\"sesl_font_family_regular\" translatable=\"false\">sans-serif</string>"), 'UTF-8')
48+
}
49+
})
3050
}
3151

3252
dependencies {

app/release/app-release.apk

53.5 KB
Binary file not shown.

app/release/output-metadata.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
"type": "SINGLE",
1212
"filters": [],
1313
"attributes": [],
14-
"versionCode": 55,
15-
"versionName": "2.2.0",
14+
"versionCode": 56,
15+
"versionName": "2.2.1",
1616
"outputFile": "app-release.apk"
1717
}
1818
],

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,17 @@
22

33
import android.os.Bundle;
44

5-
import androidx.appcompat.app.AppCompatActivity;
6-
75
import com.google.android.material.button.MaterialButton;
86

97
import de.dlyt.yanndroid.oneui.layout.AboutPage;
10-
import de.dlyt.yanndroid.oneui.utils.ThemeUtil;
8+
import de.dlyt.yanndroid.oneuiexample.base.BaseThemeActivity;
119

12-
public class AboutActivity extends AppCompatActivity {
10+
public class AboutActivity extends BaseThemeActivity {
1311

1412
@Override
1513
protected void onCreate(Bundle savedInstanceState) {
16-
new ThemeUtil(this);
14+
mUseAltTheme = true;
15+
1716
super.onCreate(savedInstanceState);
1817
setContentView(R.layout.activity_about);
1918

0 commit comments

Comments
 (0)