All Projects → Guilherme-HRamos → OwlBottomSheet

Guilherme-HRamos / OwlBottomSheet

Licence: MIT License
Simple library to show a bottom sheet like Owl app from Material Design studies cases

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to OwlBottomSheet

Bottomsheet
BottomSheet dialog library for Android
Stars: ✭ 219 (+397.73%)
Mutual labels:  design, material-ui, material-components, bottomsheet
Materialbanner
A library that provides an implementation of the banner widget from the Material design.
Stars: ✭ 241 (+447.73%)
Mutual labels:  material-ui, material-components
Material Admin
Free Material Admin Template
Stars: ✭ 219 (+397.73%)
Mutual labels:  material-ui, material-components
Syntaxmeets
Syntaxmeets. Create rooms 🏠 Call your friends 👬🏼 Sip Chai, ☕ Chat, Create, and Code👨‍💻. A coding platform to code simultaneously 🚀 with your friends and design your algorithms on SyntaxPad.💫✨
Stars: ✭ 110 (+150%)
Mutual labels:  design, material-ui
Ibackdrop
A library to simply use Backdrop in your project (make it easy). Read more ->
Stars: ✭ 137 (+211.36%)
Mutual labels:  material-ui, material-components
Materialdrawer
The flexible, easy to use, all in one drawer library for your Android project. Now brand new with material 2 design.
Stars: ✭ 11,498 (+26031.82%)
Mutual labels:  material-ui, material-components
Material Sense
A React Material UI template to create rich applications with wizards, charts and ranges
Stars: ✭ 711 (+1515.91%)
Mutual labels:  design, material-ui
Cyanea
A theme engine for Android
Stars: ✭ 1,319 (+2897.73%)
Mutual labels:  material-ui, material-components
React Materialui Notifications
Spec compliant notifications for react and material ui users
Stars: ✭ 252 (+472.73%)
Mutual labels:  design, material-ui
Material-Backdrop-Android
Material Backdrop
Stars: ✭ 106 (+140.91%)
Mutual labels:  material-ui, material-components
Blazormaterial
Blazor components implementing Google's Material components for web - https://material.io/components/web
Stars: ✭ 136 (+209.09%)
Mutual labels:  material-ui, material-components
media-picker
Easy customizable picker for all your needs in Android application
Stars: ✭ 167 (+279.55%)
Mutual labels:  material-ui, material-components
Smart Webcomponents
Web Components & Custom Elements for Professional Web Applications
Stars: ✭ 110 (+150%)
Mutual labels:  material-ui, material-components
Materialnavigationview Android
📱 Android Library to implement Rich, Beautiful, Stylish 😍 Material Navigation View for your project with Material Design Guidelines. Easy to use.
Stars: ✭ 168 (+281.82%)
Mutual labels:  material-ui, material-components
Mediapicker
Easy customizable picker for all your needs in Android application
Stars: ✭ 105 (+138.64%)
Mutual labels:  material-ui, material-components
Aestheticdialogs
📱 An Android Library for 💫fluid, 😍beautiful, 🎨custom Dialogs.
Stars: ✭ 352 (+700%)
Mutual labels:  design, material-ui
Android Iconics
Android-Iconics - Use any icon font, or vector (.svg) as drawable in your application.
Stars: ✭ 4,916 (+11072.73%)
Mutual labels:  material-ui, material-components
Slidetoact
A simple 'Slide to Unlock' Material widget for Android, written in Kotlin 📱🎨🦄
Stars: ✭ 783 (+1679.55%)
Mutual labels:  material-ui, material-components
Materialdesign2
A beautiful app designed with Material Design 2 using Android X.
Stars: ✭ 170 (+286.36%)
Mutual labels:  design, material-components
material
🎨 Materialize your forum with this Flarum extension that uses the latest guidelines.
Stars: ✭ 14 (-68.18%)
Mutual labels:  material-ui, material-components

OwlBottomSheet

Adding the project

Add it in your root build.gradle at the end of repositories:

allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}

Add the dependency:

dependencies {
	        implementation 'com.github.Guilherme-HRamos:OwlBottomSheet:1.01'
	}

Usage

In your Activity layout:


<android.support.design.widget.CoordinatorLayout
    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="match_parent"
    tools:context=".MainActivity">

    <!-- content -->
    
    <!-- ... -->

    <!-- bottom sheet -->
    <br.vince.owlbottomsheet.OwlBottomSheet
        android:id="@+id/owl_bottom_sheet"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>

</android.support.design.widget.CoordinatorLayout>

In your Activity:

public class MainActivity extends AppCompatActivity {

    // the bottom sheet
    private OwlBottomSheet mBottomSheet;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        
        mBottomSheet = findViewById(R.id.owl_bottom_sheet);

        setupView();
    }

    // basic usage
    private void setupView() {
    
        //used to calculate some animations. it's required
        mBottomSheet.setActivityView(this);
        
        //icon to show in collapsed sheet
        mBottomSheet.setIcon(R.drawable.ic_keyboard_arrow_down_black_24dp);

        //bottom sheet color
        mBottomSheet.setBottomSheetColor(ContextCompat.getColor(this,R.color.colorPrimaryDark));

        //view shown in bottom sheet
        mBottomSheet.attachContentView(R.layout.layout_bottom_sheet_example);

        //getting close button from view shown
        mBottomSheet.getContentView().findViewById(R.id.comments_sheet_close_button)
                .setOnClickListener(v -> mBottomSheet.collapse());
    }


    // collapse bottom sheet when back button pressed
    @Override
    public void onBackPressed() {
        if (!mBottomSheet.isExpanded())
            super.onBackPressed();
        else
            mBottomSheet.collapse();
    }
}

Methods:

    /**
     * Set icon to show in collapsed sheet
     * @param drawable ex R.drawable.collapse_icon
     */
    public void setIcon(@DrawableRes int drawable);

    /**
     * Color of bottom sheet
     * @param color ex: ContextCompat.getColor(getContext(), R.color.colorAccent);
     */
    public void setBottomSheetColor(@ColorInt int color);

    /**
     * This will make OwlBottomSheet calculate animation from that Activity (required)
     */
    public void setActivityView(AppCompatActivity activity);

    /**
     * Click listener interceptor from collapse and expand click
     */
    public void setOnClickInterceptor(OnClickInterceptor interceptor);

    /**
     * Get animation duration
     */
    public int getDuration();

    /**
     * Set animation duration. For better results, it's recommended 250~350
     */
    public void setDuration(int duration);

    /**
     * Get on click interceptor listener
     */
    public OnClickInterceptor getOnClickInterceptor();

    /**
     * Collapse bottom sheet
     */
    public void collapse();

    /**
     * Expand bottom sheet
     */
    public void expand();

    /**
     * Get bottom sheet state
     * @return
     */
    public boolean isExpanded();

    /**
     * Get view shown
     * @return
     */
    public View getContentView();

    /**
     * Attach view to show in bottom sheet
     * @param view to be added to bottom sheet
     */
    public void attachContentView(View view);

    /**
     * Attach view to show in bottom sheet
     * @param view layout to be inflated on bottom sheet
     */
    public void attachContentView(@LayoutRes int view);

Finally

This is a very simple library for usage. There is not a lot customizations yet. I did this because I needed for personal usage, and I decided to share that. Feel free to contribute ;)

License

MIT License

Copyright (c) 2018 Guilherme Ramos

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].