One UI libraries for Android apps.

Related tags

App android oneui sesl
Overview

⚠️ W.I.P.

For Wear OS, please look at seslw.


This repo contains a collection of the libraries used by Samsung in their One UI apps. Samsung's One UI apps are created by using an heavily modified version of Google's Android Jetpack and Material Components libraries, that include a different styling of the UI, DeX/S Pen support, new features and much more. The intent of this library is to make those Samsung UX elements available to everyone for study, modding or whatever feels right for you. Any form of contribution, suggestions, bug report or feature request will be welcome.

These libraries will soon replace the current OneUI Design Library once they are ready.

Why should I move to using this new lib?

While the old library was a completely separated module, we now are implementing Samsung specific code directly in Google's libraries. Replacing Google libraries with ours will now make creating apps easier since you don't have to rely, for the most part, on workarounds or custom APIs anymore. Each component is now separated in its own module, meaning you can now choose what to add and what to exclude in your project.

Libraries

Android Jetpack:

  • appcompat (based on 1.0.39-sesl4)
  • coordinatorlayout (based on 1.0.2-sesl4)
  • drawerlayout (based on 1.0.2-sesl4)
  • preference (based on 1.0.5-sesl4)
  • recyclerview (based on 1.0.21-sesl4)
  • swiperefreshlayout (based on 1.0.10-sesl4)
  • viewpager (based on 1.0.3-sesl4)
  • viewpager2 (based on 1.0.1-sesl4)

Material Components:

  • material (based on 1.0.34-sesl4)

    • appbar
    • bottomnavigation
    • navigation
    • navigationrail
    • snackbar
    • tabs

Samsung:

  • apppickerview (based on 1.0.17-sesl4)
  • indexscroll (based on 1.0.14-sesl4)
  • picker-color (based on 1.0.18-sesl4)

Uncomplete/to-be-added libs:

  • picker-basic (based on 1.0.33-sesl4): still needs complete merging
  • slidingpanelayout (based on 1.0.8-sesl4): broken, needs fixes
  • Unnamed lib (will contain all the utilities and resources from the previous library)

More info

Special thanks to:

  • Google for their Jetpack and Material Components libraries.
  • Samsung for their awesome OneUI Design. :)
  • All the current and future contributors and issue reporters. :D
Comments
  • Trying to implement SelectMode on ToolbarLayout

    Trying to implement SelectMode on ToolbarLayout

    Hello there, I am trying to implement multiSelect on RecycleView on ToolbarLayout, just like in this picture multi-select

    But I am failing

    My selecting methods look like this

    public void setSelecting(boolean enabled) {
            TabLayout subTabs = getActivity().findViewById(R.id.sub_tabs);
            TabLayout mainTabs = getActivity().findViewById(R.id.main_samsung_tabs);
            ViewPager2 viewPager2 = getActivity().findViewById(R.id.viewPager2);
    
            if (enabled) {
                mSelecting = true;
                adapter.notifyItemRangeChanged(0, adapter.getItemCount() - 1);
                toolbarLayout.setSelectModeBottomMenu(R.menu.select_mode_menu, item -> {
                    item.setBadge(item.getBadge() + 1);
                    Toast.makeText(this, item.getTitle(), Toast.LENGTH_SHORT).show();
                    return true;
                });
                toolbarLayout.showSelectMode();
                toolbarLayout.setSelectModeAllCheckedChangeListener((buttonView, isChecked) -> {
                    if (checkAllListening) {
                        for (int i = 0; i < adapter.getItemCount() - 1; i++) {
                            selected.put(i, isChecked);
                            adapter.notifyItemChanged(i);
                        }
                    }
                    int count = 0;
                    for (Boolean b : selected.values()) if (b) count++;
                    toolbarLayout.setSelectModeCount(count);
                });
                toolbarLayout.showSelectModeBottomBar(false);
                subTabs.setEnabled(false);
                mainTabs.setEnabled(false);
                viewPager2.setUserInputEnabled(false);
                onBackPressedCallback.setEnabled(true);
            } else {
                mSelecting = false;
    
                mHandler.removeCallbacks(mShowBottomBarRunnable);
    
                for (int i = 0; i < adapter.getItemCount() - 1; i++) selected.put(i, false);
                adapter.notifyItemRangeChanged(0, adapter.getItemCount() - 1);
    
                toolbarLayout.setSelectModeCount(0);
                toolbarLayout.dismissSelectMode();
                subTabs.setEnabled(true);
                mainTabs.setEnabled(true);
                viewPager2.setUserInputEnabled(true);
                onBackPressedCallback.setEnabled(false);
            }
        }
    
        public void toggleItemSelected(int position) {
            selected.put(position, !selected.get(position));
            adapter.notifyItemChanged(position);
    
            checkAllListening = false;
            int count = 0;
            for (Boolean b : selected.values()) if (b) count++;
            toolbarLayout.setSelectModeAllChecked(count == adapter.getItemCount() - 1);
            toolbarLayout.setSelectModeCount(count);
            checkAllListening = true;
        }
    

    I can secsesfully detect short and long clicks with my adapter like so

    package si.wolf.sonoffc.adapters;
    
    import android.content.Context;
    import android.util.Log;
    import android.view.LayoutInflater;
    import android.view.View;
    import android.view.ViewGroup;
    import android.widget.Button;
    import android.widget.CompoundButton;
    import android.widget.TextView;
    
    //import androidx.recyclerview.widget.RecyclerView;     //Google
    import de.dlyt.yanndroid.oneui.view.RecyclerView;       //Samsung
    
    import java.util.List;
    
    import de.dlyt.yanndroid.oneui.view.Switch;
    
    import si.wolf.sonoffc.R;
    import si.wolf.sonoffc.models.Device;
    
    // Create the basic adapter extending from RecyclerView.Adapter
    // Note that we specify the custom ViewHolder which gives us access to our views
    public class DevicesAdapter extends RecyclerView.Adapter<DevicesAdapter.ViewHolder> {
    
        // Events
        private ClickListener mclickListener;
        private ItemCheckChangedListener mCheckChangedListener;
    
        // ... view holder defined above...
    
        // Store a member variable for the contacts
        private List<Device> mDevices;
    
        // Pass in the contact array into the constructor
        public DevicesAdapter(List<Device> contacts) {
            mDevices = contacts;
        }
    
        // Provide a direct reference to each of the views within a data item
        // Used to cache the views within the item layout for fast access
        public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener, View.OnLongClickListener, CompoundButton.OnCheckedChangeListener{
            // Your holder should contain a member variable
            // for any view that will be set as you render a row
            public TextView nameTextView;
            public TextView descriptionTextView;
            public Switch enabledSwich;
    
            // We also create a constructor that accepts the entire item row
            // and does the view lookups to find each subview
            public ViewHolder(View itemView) {
                // Stores the itemView in a public final member variable that can be used
                // to access the context from any ViewHolder instance.
                super(itemView);
    
                nameTextView = (TextView) itemView.findViewById(R.id.device_name);
                descriptionTextView = (TextView) itemView.findViewById(R.id.device_ip);
                enabledSwich = (Switch) itemView.findViewById(R.id.enabled_swich);
    
                //Events
                itemView.setOnLongClickListener(this);  // long click should be set up before standard click
                itemView.setOnClickListener(this);
            }
    
            //Click listener
            @Override
            public void onClick(View v) {
                mclickListener.onItemClick(v, getAdapterPosition());
            }
    
            @Override
            public boolean onLongClick(View v) {
                mclickListener.onItemLongClick(v, getAdapterPosition());
                // return false; // fire normal click also
                return true;
            }
            //Check changed listener
            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                if (mCheckChangedListener != null) mCheckChangedListener.onItemCheckedChanged(buttonView, getAdapterPosition());
            }
        }
    
        // ... constructor and member variables
    
        // Usually involves inflating a layout from XML and returning the holder
        @Override
        public DevicesAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
            Context context = parent.getContext();
            LayoutInflater inflater = LayoutInflater.from(context);
    
            // Inflate the custom layout
            View contactView = inflater.inflate(R.layout.item_contact, parent, false);
    
            // Return a new holder instance
            ViewHolder viewHolder = new ViewHolder(contactView);
            return viewHolder;
        }
    
        // Involves populating data into the item through holder
        @Override
        public void onBindViewHolder(DevicesAdapter.ViewHolder holder, int position) {
            // Get the data model based on position
            Device device = mDevices.get(position);
    
            // Set item views based on your views and data model
            TextView textView_name = holder.nameTextView;
            textView_name.setText(device.getName());
            TextView textView_description = holder.descriptionTextView;
            textView_description.setText(device.getIPAddress());
            Switch enabled_switch = holder.enabledSwich;
            enabled_switch.setChecked(device.isOnline());
    
            //To implement this outside view here: https://stackoverflow.com/a/49969478/17826480
            holder.enabledSwich.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
                @Override
                public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                    Log.d("demo", "onChecked: position: " + position + " | name: " + device.getName());
                }
            });
        }
    
        // Returns the total count of items in the list
        @Override
        public int getItemCount() {
            return mDevices.size();
        }
    
        //Events
    
        // convenience method for getting data at click position
        public String getItem(int id) {
            return mDevices.get(id).getName();
        }
    
        //Click events
        // allows clicks events to be caught
        // parent activity will implement this method to respond to click events
        public void setOnItemClickListener(ClickListener listener) {
            mclickListener = listener;
        }
    
        public interface ClickListener {
            void onItemClick(View v, int position);
            void onItemLongClick(View v, int position);
        }
    
        // parent activity will implement this method to respond to click events
        public interface ItemCheckChangedListener {
            void onItemCheckedChanged(View view, int position);
        }
    
        //Listens for button toggle
        public void setToggleListener(CompoundButton.OnCheckedChangeListener listener)
        {
    
        }
    }
    

    then in MainActivity onCreate, you bind to them

            //Handle click events
            adapter.setOnItemClickListener(new DevicesAdapter.ClickListener() {
                String TAG = "clicky";
                @Override
                public void onItemClick(View v, int position) {
                    Log.d(TAG, "Click: " + adapter.getItem(position));
                    //Toast.makeText(this, "You clicked " + adapter.getItem(position) + " on row number " + position, Toast.LENGTH_SHORT).show();
    
                }
                @Override
                public void onItemLongClick(View v, int position) {
                    Log.d(TAG, "Long Click");
                    //Toast.makeText(this, "You long clicked " + adapter.getItem(position) + " on row number " + position, Toast.LENGTH_SHORT).show();
                    if (!mSelecting) setSelecting(true);
                    toggleItemSelected(position);
                    rvDevices.seslStartLongPressMultiSelection(); //RecycleView
                }
            });
    

    My view looks like this activity_main.xml

    <?xml version="1.0" encoding="utf-8"?>
    <de.dlyt.yanndroid.oneui.layout.ToolbarLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        xmlns:tools="http://schemas.android.com/tools"
        android:id="@+id/toolbar_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:title="@string/app_name"
        app:subtitle="@string/app_description"
        app:expandable="true"
        app:expanded="true"
        tools:context=".MainActivity">
    
        <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
            xmlns:app="http://schemas.android.com/apk/res-auto"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@color/item_background_color">
    
            <!-- Google --><!--
                <androidx.recyclerview.widget.RecyclerView
            -->
    
            <!-- Samsung -->
            <de.dlyt.yanndroid.oneui.view.RecyclerView
                android:id="@+id/rvDevices"
                android:layout_width="0dp"
                android:layout_height="0dp"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent" />
    
        </androidx.constraintlayout.widget.ConstraintLayout>
        
    
    </de.dlyt.yanndroid.oneui.layout.ToolbarLayout>
    

    my recycleView row looks like this (probably doesn't matter for multiselect but just in case)

    <?xml version="1.0" encoding="utf-8"?>
    <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:padding="5dp"
        android:background="?android:attr/selectableItemBackground">
    
        <TextView
            android:id="@+id/device_name"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginEnd="8dp"
            android:text="Relay"
            android:textSize="16dp"
            android:textStyle="bold"
            android:layout_marginStart="@dimen/sesl_action_bar_content_inset"
            app:layout_constraintEnd_toStartOf="@+id/enabled_swich"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />
    
        <TextView
            android:id="@+id/device_ip"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
    
            android:layout_marginTop="4dp"
            android:layout_marginEnd="8dp"
            android:text="192.168.88.19"
            android:layout_marginStart="@dimen/sesl_action_bar_content_inset"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toStartOf="@+id/enabled_swich"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/device_name"
            app:layout_constraintVertical_bias="0.0" />
    
        <de.dlyt.yanndroid.oneui.view.Switch
            android:id="@+id/enabled_swich"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginEnd="2dp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toEndOf="@+id/device_ip"
            app:layout_constraintTop_toTopOf="parent"
            />
    
    
    </androidx.constraintlayout.widget.ConstraintLayout>
    

    and my bottomBar which I would like to show when multiselecting (select_mode_menu) looks like this

    <?xml version="1.0" encoding="utf-8"?>
    <menu xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto">
    
        <item
            android:id="@+id/move"
            android:icon="@drawable/ic_oui_move"
            android:title="Move"
            app:showAsAction="always" />
    
        <item
            android:id="@+id/delete"
            android:icon="@drawable/ic_ouid_delete"
            android:title="Delete"
            app:showAsAction="always" />
    
        <item
            android:id="@+id/add"
            android:icon="@drawable/ic_oui_list_add"
            android:title="Add"
            app:showAsAction="always" />
    
        <item
            android:id="@+id/edit"
            android:icon="@drawable/ic_oui3_edit"
            android:title="Edit"
            app:showAsAction="always" />
    
        <item
            android:id="@+id/item1"
            android:title="Menu Item 1"
            app:showAsAction="never" />
    
        <item
            android:id="@+id/item2"
            android:title="Menu Item 2"
            app:showAsAction="never" />
    
        <item
            android:id="@+id/item3"
            android:title="Menu Item 3"
            app:showAsAction="never" />
    
    </menu>
    

    Now I have a bit of trouble, since your I have no idea what theese in setSelecting do (yea, I am trying to adapt from here: https://github.com/OneUIProject/OneUI-Design-Library/blob/062c469b35ce127eeb84c0130725ead7032fc516/app/src/main/java/de/dlyt/yanndroid/oneuiexample/tabs/IconsTab.java#L494

    TabLayout subTabs = getActivity().findViewById(R.id.sub_tabs);
            TabLayout mainTabs = getActivity().findViewById(R.id.main_samsung_tabs);
            ViewPager2 viewPager2 = getActivity().findViewById(R.id.viewPager2);
    

    as well as what is showSelectModeBottomBar(false); suppose to do (toolbarLayout, nor Drawer layout seem to have it) and I don't realy know how you then handle back button press

    and yea, I am still using the old oneUI library, because it has better documentation and it is the only lib that supports both OneUI3 (which I prefer) and OneUI4 theme

    and I still have no idea, why there are 2 libraries https://github.com/OneUIProject/sesl https://github.com/OneUIProject/oneui-design

    that both seam to do the same thing (which is better :smile: ?)

    Hope you can help me and Thanks for Anwsering and Best Regards

    opened by veso266 9
  • Round corner issue?

    Round corner issue?

    Hello, I have used this library for one of my projects, but when using it I found some inadequacies.

    1. Is there a way to round the 4 corners of the PreferenceFragment(Compat), as I marked in red (screenshot in light mode)
    2. when I add a PreferenceCategory with elements inside, the preference background color error(I think so) (dark mode screenshot) #Edit2 : I found that i need to use seslSetFillBottomEnabled(true); but how i can use RecycleView in PreferenceFragmentCompat, as PreferenceFragmentCompat created its own RecycleView, Thanks LIGHT DARK
    opened by long266 8
  • Examples

    Examples

    Hello there, I recently found your awesome library: https://github.com/OneUIProject/OneUI-Design-Library

    and was stunned by it, now I was looking for a List view example, something similar that Samsung is showing in their design docs on page 20 slika

    But I couldn't find any example, then I found out that that library is deprecated in favour of this one, but here I couldn't find any examples eather

    so I was wondering is there any list example like the picture above

    Thanks, and thank you for developing this amazing library (wondering why Samsung never released their OneUI library so other people could create apps like samsung)

    opened by veso266 6
  • Inquire about how to use the library.

    Inquire about how to use the library.

    Hello.

    I would like to apply Sesl Library to the project. I am inquiring about this.

    Here's the first question.

    I would like to apply Sesl library.

    In the settings.gradle file, include ':SESL' project (':SESL').projectDir = new File('File Path')

    In the build.gradle file, implementation project(':SESL')

    The following is an error message.

    Build was configured to prefer settings repositories over project repositories but repository 'Google' was added by build file '../SESL/build.gradle'

    Have you ever experienced such an error message? If you have, please share your experiences.

    Here's the second question.

    I want to add only specific libraries within the sesl library, not the entire sesl library. Do you have any recommendations for this idea?

    I know that you have a lot of trouble to upgrade the project. Thank you very much. I'm sorry to bother you with the question, but please answer it.

    opened by WORLD8848 3
  • Feature Request: About ColorPickerPreference

    Feature Request: About ColorPickerPreference

    Screenshot_2022-06-03_125541

    • I know that it is possible to use the old ColorPickerPreference, so I added it to my project
    • But it would be better if supported in this new library or oneui-design
    • I tried merge it into one and add app:pickerType, but compile error because it has same name, so I decided to split it into separate Preference, one for Detailed ColorPicker and one for Classic ColorPicker

    - Here is mine: https://github.com/long266/Lumi-Constellation/commit/72a752eed6d3f97c1e1f3fdeb0e4fff4d167ffab - Based on: Yanndroid ColorPickerPreference

    opened by long266 1
Owner
OneUI Project
Unofficial OneUI Library and Apps for Android
OneUI Project
Google one tap sign in - Flutter Google One Tap Sign In (Android)

Google One Tap Sign In Google One Tap Sign In (Android) A Flutter Plugin for Google One Tap Sign In Getting Started To access Google Sign-In, you'll n

null 6 Nov 23, 2022
All news in one place - one application

nuntiumNewsApp Nuntium | Daily News App Nuntuim news app is a personalised news aggregator that organises and highlights what’s happening in the world

Ro'ziboyev Ismoil 1 Dec 3, 2021
You can store all your password, bank details, card details in one place and remember only one master PIN. The application works totally offline.

Keep Password An application where you can store all your password, bank details, card details in one place and remember only one master PIN. The appl

rıdvan 4 Apr 18, 2022
Android playground project with modularization by feature (android libraries), unit tests, MVVM & MVI.

Movies Movies is a simple project to study and play with some android components, architecture and tools for Android development. Tech Stack This proj

Christopher Elias 333 Dec 30, 2022
🌄 Photo editor using native modules for iOS and Android. Inherit from 2 available libraries, Brightroom (iOS) and PhotoEditor (Android)

React Native Photo Editor (RNPE) ?? Image editor using native modules for iOS and Android. Inherit from 2 available libraries, Brightroom (iOS) and Ph

Baron Ha. 242 Dec 28, 2022
A sample app illustrating Android development using Kotlin with MVVM architecture, Android Jetpack, and other commonly used libraries.

Anime Facts A sample app illustrating Android development using Kotlin with MVVM architecture, Android Jetpack, and other commonly used libraries. Ani

Eugene Javiñas 0 Dec 5, 2021
An android application which shows usage of various jetpack libraries built by the android team

JetPacker JetPacker is an android application which implements various jetpack libraries created by the android team. FEATURES - (Will be updated as m

Ibrahim 14 Dec 9, 2022
A simple Android project using modern Android development tools and libraries.

A simple Android project using modern Android development tools and libraries.

Ahmed Sumeiry 0 Feb 3, 2022
A sample Android app which showcases advanced usage of Dagger among other open source libraries.

U+2020 A sample Android app which showcases advanced usage of Dagger among other open source libraries. Watch the corresponding talk or view the slide

Jake Wharton 5.7k Dec 27, 2022
Proguard configurations for common Android libraries

android-proguard-snippets Example Proguard configurations for common Android libraries. This project assumes that your ProGuard configuration is based

Kevin Schultz 4.6k Dec 30, 2022
some android libraries to speed up development.

emo - speed up android development This repository contains series of libraries for android developers: ui-core: Contain some basic components such as

cgspine 50 Dec 29, 2022
Movie application created with TMDB API, Architecture Components, Android Jetpack libraries

MovieApp Movie application created with TMDB API, Architecture Components, Android Jetpack libraries Built With ??️ • Kotlin - The language used in th

Ahmet Tufan 5 Sep 29, 2022
The application is developed using Modern tools/libraries with UI implementations with Navigation architecture

This is mobile application which actual users will interact with. The application is developed using Modern tools/libraries with UI implementations with Navigation architecture. It connects with the Dog API to retrieve data. more detail of api can be found here - https://dog.ceo/dog-api/documentation/random This project a basic example of Retrofit and mvvm

null 4 Feb 3, 2022
It is a NBAApp developed by Kotlin. It uses MVVM design pattern, Coroutines, Retrofit and JetPack libraries like Room, Lifecycle, ViewBinding, DataBinding, Hilt and Navigation.

NbaApp It is a NBAApp developed by Kotlin. It uses MVVM design pattern, Coroutines, Retrofit and JetPack libraries like Room, Lifecycle, ViewBinding,

Tuna Ateş Koç 2 Feb 26, 2022
WatchFaceAlphaKotlin - Demonstrates watch faces using the new androidX alpha libraries (Kotlin)

Alpha WatchFace Sample (Kotlin) Demonstrates watch faces using the new androidX

Bastiaan Quast 0 Jan 4, 2022
Native-loader - Safely load native libraries in Java

Native Loader ??️ Safe native loading in Java based off of the native-loader use

Mixtape 1 Oct 19, 2022
Project allowing to query products (languages, libraries, databases, etc) by their properties.

Products app This project allow to search products (mostly software products for now such as languages, libraries etc) based on their properties. For

null 1 May 1, 2022
Simple Notes app, MVVM with Google Architectural components Room database, LiveData and ViewModel. Written in Kotlin using androidx libraries

Simple Notes app, MVVM with Google Architectural components Room database, LiveData and ViewModel. Written in Kotlin using androidx libraries. Implemented Firebase Auth and Database, and used Room database

Javokhir Jambulov 3 Aug 1, 2022
An android app make a one-stop solution for finding the desired reading or research partner, sell their own products, and also be a tutor

The purpose of this project is to make a one-stop solution for finding the desired reading or research partner, sell their own products, and also be a tutor.

Md.Asraful Islam Asif 4 Dec 14, 2022