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