All Projects → Semper-Viventem → Material Backdrop

Semper-Viventem / Material Backdrop

Licence: mit
A simple solution for implementing Backdrop pattern for Android

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Material Backdrop

Ibackdrop
A library to simply use Backdrop in your project (make it easy). Read more ->
Stars: ✭ 137 (-38.01%)
Mutual labels:  android-app, material-design, material, android-sdk, material-components
Smart Webcomponents
Web Components & Custom Elements for Professional Web Applications
Stars: ✭ 110 (-50.23%)
Mutual labels:  material-design, material, ui-components, material-components
Mediapicker
Easy customizable picker for all your needs in Android application
Stars: ✭ 105 (-52.49%)
Mutual labels:  android-app, material-design, android-sdk, material-components
Matter
Material Design Components in Pure CSS. Materializing HTML at just one class per component 🍰
Stars: ✭ 888 (+301.81%)
Mutual labels:  library, material-design, material, material-components
Material
A lightweight Material Design library for Angular based on Google's Material Components for the Web.
Stars: ✭ 143 (-35.29%)
Mutual labels:  material-design, material, ui-components, material-components
Svelte Materialify
A Material UI Design Component library for Svelte heavily inspired by vuetify.
Stars: ✭ 351 (+58.82%)
Mutual labels:  material-design, material, ui-components, material-components
Vuetify
🐉 Material Component Framework for Vue
Stars: ✭ 33,085 (+14870.59%)
Mutual labels:  material-design, material, ui-components, material-components
Android Art
🎄 Android™ 设计相关的在线工具: 图标制作、配色方案、尺寸修改、截图加壳等,持续更新...
Stars: ✭ 95 (-57.01%)
Mutual labels:  material-design, material, ui-components
Datingapp
Dating UI kit is used for online meet up with girls and boys . The screen contains more than 30 icons and most of all required elements required to design an application like this. The XML and JAVA files contains comments at each and every point for easy understanding. Everything was made with a detail oriented style and followed by today's web trends. Clean coded & Layers are well-organized, carefully named, and grouped.
Stars: ✭ 97 (-56.11%)
Mutual labels:  android-app, material-design, ui-components
Bottomsheet
BottomSheet dialog library for Android
Stars: ✭ 219 (-0.9%)
Mutual labels:  android-app, material-design, material-components
Materialcalendar
A Material design calendar inspired by the CalendarView of School Diary.
Stars: ✭ 196 (-11.31%)
Mutual labels:  android-app, material-design, material
Cyanea
A theme engine for Android
Stars: ✭ 1,319 (+496.83%)
Mutual labels:  material-design, material, material-components
Togglebuttons
Android toggle buttons that adhere to the Material Design documentation.
Stars: ✭ 88 (-60.18%)
Mutual labels:  material-design, material, ui-components
Material Design Lite
Material Design Components in HTML/CSS/JS
Stars: ✭ 31,931 (+14348.42%)
Mutual labels:  material-design, material, material-components
Smartmaterialspinner
The powerful android spinner library for your application
Stars: ✭ 108 (-51.13%)
Mutual labels:  library, material-design, material
React Md
React material design - An accessible React component library built from the Material Design guidelines in Sass
Stars: ✭ 2,284 (+933.48%)
Mutual labels:  material-design, material, material-components
Permissionsflow
A simple library to make it easy requesting permissions in Android using Kotlin Coroutines.
Stars: ✭ 49 (-77.83%)
Mutual labels:  android-app, library, android-sdk
Cafebar
An upgraded Snackbar for Android that provides more options and easy to use
Stars: ✭ 142 (-35.75%)
Mutual labels:  material-design, ui-components, material-components
Material Components
Documentation and policies for Material Components (all platforms)
Stars: ✭ 872 (+294.57%)
Mutual labels:  material-design, material, material-components
Materialdesign2
A beautiful app designed with Material Design 2 using Android X.
Stars: ✭ 170 (-23.08%)
Mutual labels:  material-design, material, material-components

Backdrop

Download

What is it?

This library makes it easy to implement a Backdrop pattern with a CoordinatorLayout

Download

JCenter (Recommended):

dependencies {
    implementation 'ru.semper-viventem.backdrop:backdrop:0.1.7'
}

JitPack:

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

dependencies {
    implementation 'com.github.Semper-Viventem:BackdropView:0.1.7'
}

How to use it?

You need to add front layout and back layout (with toolbar) to CoordinatorLayout.

Add BackdropBehavior to your front layout:

XML

<android.support.design.widget.CoordinatorLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    
    <!-- BackLayout for BackDrop -->
    <com.google.android.material.appbar.AppBarLayout
        android:id="@+id/backLayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <!-- Must contain a Toolbar -->
        <androidx.appcompat.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"/>

        <!-- For example, NavigationView. Or you can use anything -->
        <com.google.android.material.navigation.NavigationView
            android:id="@+id/navigationView"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:menu="@menu/main_menu"/>
    </com.google.android.material.appbar.AppBarLayout>

    <!-- Add BackdropBehavior to this view -->
    <android.support.design.card.MaterialCardView
        android:id="@+id/foregroundContainer"
        app:layout_behavior="ru.semper_viventem.backdrop.BackdropBehavior"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        
        <!-- Anything -->
    </android.support.design.card.MaterialCardView>

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

Kotlin

I used this extension to search for behavior:

fun <T : CoordinatorLayout.Behavior<*>> View.findBehavior(): T = layoutParams.run {
    if (this !is CoordinatorLayout.LayoutParams) throw IllegalArgumentException("View's layout params should be CoordinatorLayout.LayoutParams")

    (layoutParams as CoordinatorLayout.LayoutParams).behavior as? T
            ?: throw IllegalArgumentException("Layout's behavior is not current behavior")
}
...

val backdropBehavior: BackdropBehavior = foregroundContainer.findBehavior() // find behavior

with(backdropBehavior) {

        // Attach your back layout to behavior.
        // BackDropBehavior will find the toolbar itself.
        attachBackLayout(R.id.backLayout)
        
        // Set navigation icons for toolbar
        setClosedIcon(R.drawable.ic_menu)
        setOpenedIcon(R.drawable.ic_close)
        
        // Add listener
        addOnDropListener(object : BackdropBehavior.OnDropListener {
            override fun onDrop(dropState: BackdropBehavior.DropState, fromUser: Boolean) {
                // TODO: handle listener            
            }
        })
}

...

License


MIT License

Copyright (c) 2018 Konstantin Kulikov ([email protected])

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].