All Projects → HeyAlex → Cornersheet

HeyAlex / Cornersheet

Licence: mit
Behavior to expand view from corner

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Cornersheet

Bottomsheetcoordinatorlayout
A handy CoordinatorLayout that works well when used in a bottom sheet, even with AppBarLayouts inside.
Stars: ✭ 241 (-12.04%)
Mutual labels:  android-ui, bottomsheet
Bottomsheet
BottomSheet dialog library for Android
Stars: ✭ 219 (-20.07%)
Mutual labels:  android-ui, bottomsheet
Superbottomsheet
Android native BottomSheet on steroids 💪
Stars: ✭ 548 (+100%)
Mutual labels:  android-ui, bottomsheet
Google-Maps-BottomSheet
A BottomSheetBehavior framework mirroring Google Maps'
Stars: ✭ 75 (-72.63%)
Mutual labels:  android-ui, bottomsheet
Materiallettericon
Material first letter icon like lollipop contacts icon. Letter(s) on a shape drawn on canvas.
Stars: ✭ 255 (-6.93%)
Mutual labels:  android-ui
SwipeRefreshPlus
参考swiperefreshlayout添加下拉加载更多
Stars: ✭ 24 (-91.24%)
Mutual labels:  android-ui
FancyTab
No description or website provided.
Stars: ✭ 15 (-94.53%)
Mutual labels:  android-ui
BalloonPopup
Forget Android Toast! BalloonPopup displays a round or squared popup and attaches it to a View, like a callout. Uses the Builder pattern for maximum ease. The popup can automatically hide and can persist when the value is updated.
Stars: ✭ 32 (-88.32%)
Mutual labels:  android-ui
Carbon
Material Design implementation for Android 4.0+. Shadows, ripples, vectors, fonts, animations, widgets, rounded corners and more.
Stars: ✭ 2,942 (+973.72%)
Mutual labels:  android-ui
Bottomsheet Imagepicker
Modern image picker for Android
Stars: ✭ 267 (-2.55%)
Mutual labels:  bottomsheet
Xtimer Flutter App
Flutter timer app
Stars: ✭ 255 (-6.93%)
Mutual labels:  android-ui
SlidingUpMenu
🚀 A very customizable library that allows you to present menu items (from menu resource and/or other sources) to users as a bottom sheet.
Stars: ✭ 26 (-90.51%)
Mutual labels:  bottomsheet
Tableview
TableView is a powerful Android library for displaying complex data structures and rendering tabular data composed of rows, columns and cells.
Stars: ✭ 2,928 (+968.61%)
Mutual labels:  android-ui
OwlBottomSheet
Simple library to show a bottom sheet like Owl app from Material Design studies cases
Stars: ✭ 44 (-83.94%)
Mutual labels:  bottomsheet
Ratebottomsheet
To help to promote your android app by prompting users to rate your app in a BottomSheet ⭐️
Stars: ✭ 268 (-2.19%)
Mutual labels:  bottomsheet
KotlinProject
This repo help for all developer who want to learn android or want to work on advance feature of android. This repo created with help of @awesomeui, @materialdesign and android latest feature. this repo contain major feature like : @awesome UI, @Material design, @firebase (auth, realtime database, firestore, push notification), @database (Room d…
Stars: ✭ 40 (-85.4%)
Mutual labels:  android-ui
android-SpringAnimator
A framer.js DHO and RK4 spring animation port for Android.
Stars: ✭ 39 (-85.77%)
Mutual labels:  android-ui
Sequent
A simple continuous animation library for Android UI.
Stars: ✭ 263 (-4.01%)
Mutual labels:  android-ui
RecyclerELE
Android Library for easy addition of Empty, Loading and Error views in a RecyclerView
Stars: ✭ 27 (-90.15%)
Mutual labels:  android-ui
Coffeegram
Android app using Jetpack Compose together with StateFlow and MVI
Stars: ✭ 155 (-43.43%)
Mutual labels:  android-ui

Corner Sheet

Behavior to make a view expands from corner

Usage

The usage is similar to BottomSheetBehavior Corner Sheet - behavior that allow you expand a view from corner.

A simple view with behavior in xml will be look like:

<androidx.coordinatorlayout.widget.CoordinatorLayout
    android:id="@+id/coordinator"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

        <FrameLayout
            android:id="@+id/corner_behavior_container"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:backgroundTint="@color/colorPrimary"
            app:behavior_expanded_width="175dp"
            app:behavior_horizontal_peekHeight="94dp"
            app:behavior_peekHeight="60dp"
            app:layout_behavior="com.github.heyalex.cornersheet.behavior.CornerSheetBehavior"
            app:shapeAppearanceOverlay="@style/ShapeAppearanceOverlay.CornerShape"
            tools:ignore="MissingPrefix">

            <androidx.appcompat.widget.Toolbar
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@android:color/transparent"
                app:title="Corner Sample"
                app:titleTextColor="@android:color/white" />

        </FrameLayout>

</androidx.coordinatorlayout.widget.CoordinatorLayout>

You can use the following attributes on view with CornerSheetBehavior.

Properties Type Default
behavior_horizontalExpandingRatio float 0.2f
behavior_expanded_width dimension 0dp
behavior_horizontal_peekHeight dimension 0dp

Customize corner shape with shapeAppearanceOverlay attribute:

 <style name="ShapeAppearanceOverlay.CornerShape" parent="">
        <item name="cornerSizeTopLeft">30dp</item>
        <item name="cornerFamily">rounded</item>
 </style>

There are 3 state of CornerSheetBehavior:

State Description
CornerSheetBehavior.STATE_EXPANDED expanded horizontally on behavior_expanded_width value
CornerSheetBehavior.STATE_COLLAPSED expanded horizontally on behavior_horizontal_peekHeight value
CornerSheetBehavior.STATE_HIDDEN hide horizontally

There are following api that can be used on CornerSheetBehavior:

behavior.expandingRatio = 0.5f
behavior.horizontalState = CornerSheetBehavior.STATE_EXPANDED
behavior.expandedWidth = 170.dp()
behavior.setHorizontalPeekHeight(60.dp(), animate = true) //will be animated if horizontal state is CornerSheetBehavior.STATE_COLLAPSED

Just check app module with "Behavior Sample":

There is also an option to use a view that can contain a header and content:

<androidx.coordinatorlayout.widget.CoordinatorLayout
    android:id="@+id/coordinator"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <com.github.heyalex.CornerDrawer
        android:id="@+id/corner_drawer"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:clickable="true"
        app:behavior_horizontal_peekHeight="58dp"
        app:content_color="@color/corner_drawer_content_color"
        app:content_view="@layout/content_layout"
        app:header_color="@color/corner_drawer_header_color"
        app:header_view="@layout/header_layout"
        app:layout_behavior="com.github.heyalex.cornersheet.behavior.CornerSheetHeaderBehavior"
        app:shapeAppearanceOverlay="@style/ShapeAppearanceOverlay.CornerShape" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>

With CornerDrawer you don't need to set behavior_peekHeight and behavior_expanded_width, they will be assigned automatically when header_view will be inflated.

You can use an attributes on behavior that described below and a following attributes on CornerDrawer

Properties Type Default
header_view reference -1
header_color reference #FFF
content_view reference -1
content_color reference #FFF

The main preview is done with CornerDrawer, just check app module with "Support Sample"

Integration

This library is available on jcenter, so you need to add this repository to your root build.gradle:

allprojects {
    repositories {
        ...
        jcenter()
    }
}

Add one of the following dependency:

dependencies {

    //only CornerSheetBehavior
    implementation 'com.github.heyalex.cornersheet:core:v1.0.1'

    //CornerSheetBehavior and CornerDrawer
    implementation 'com.github.heyalex.cornersheet:drawer:v1.0.1'
}

Samples

You can find sample in app module, to understand functionality of library or just get an APK here

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