TopSheet - a "top" version of BottomSheet

Overview

TopSheet - a "top" version of BottomSheet

Build Status Release

TopSheetBehaviour

View sheet = findViewById(R.id.top_sheet);
TopSheetBehavior.from(sheet).setState(TopSheetBehavior.STATE_EXPANDED);

TopSheetDialog

TopSheetDialog dialog = new TopSheetDialog(this);
dialog.setContentView(R.layout.sheet_content);
dialog.show();

License

Copyright 2021 Andrea Maglie

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Comments
  • It is giving an error when importing the library.

    It is giving an error when importing the library.

    Failed to resolve: com.github.TechIsFun:AndroidTopSheet:Tag
    Show in Project Structure dialog
    Affected Modules: app
    

    Even though I added:

    allprojects {
        repositories {
            mavenCentral()
            google()
            jcenter()
            maven { url 'https://jitpack.io' }
        }
    }
    

    I am suspecting it has something to do with: Plugin with id 'com.github.dcendents.android-maven' not found.

    opened by charlieaboumoussa 1
  • How to set the TopSheetBehavior up?

    How to set the TopSheetBehavior up?

    I'm currently using the BottomSheetBehavior within my layout by using the following code:

    <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            app:behavior_hideable="false"
            app:behavior_peekHeight="35dp"
            app:layout_behavior="android.support.design.widget.BottomSheetBehavior">
    </RelativeLayout>
    

    I'd love that by replacing the app:layout_behavior parameter value with com.my.app.components.TopSheetBehavior will work out of the box, as it does with the BottomSheetBehavior.

    Am I missing anything? At the moment I'm getting a NullPointerException, with the following trace:

    E/AndroidRuntime: FATAL EXCEPTION: main
                      Process: com.walkaholic.hikeapp.debug, PID: 20213
                      java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v4.widget.ViewDragHelper.processTouchEvent(android.view.MotionEvent)' on a null object reference
                          at com.walkaholic.hikeapp.components.TopSheetBehavior.onTouchEvent(TopSheetBehavior.java:285)
                          at android.support.design.widget.CoordinatorLayout.resetTouchBehaviors(CoordinatorLayout.java:396)
                          at android.support.design.widget.CoordinatorLayout.onAttachedToWindow(CoordinatorLayout.java:238)
                          at android.view.View.dispatchAttachedToWindow(View.java:16638)
                          at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3149)
                          at android.view.ViewGroup.addViewInner(ViewGroup.java:4695)
                          at android.view.ViewGroup.addView(ViewGroup.java:4497)
                          at android.view.ViewGroup.addView(ViewGroup.java:4437)
                          at android.view.ViewGroup.addView(ViewGroup.java:4410)
                          at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1434)
                          at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1759)
                          at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1827)
                          at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:797)
                          at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2596)
                          at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2383)
                          at android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2338)
                          at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2245)
                          at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:703)
                          at android.os.Handler.handleCallback(Handler.java:751)
                          at android.os.Handler.dispatchMessage(Handler.java:95)
                          at android.os.Looper.loop(Looper.java:154)
                          at android.app.ActivityThread.main(ActivityThread.java:6682)
                          at java.lang.reflect.Method.invoke(Native Method)
                          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
                          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
    
    opened by carlos-mg89 1
  • Topsheet fully closed with peekHeight

    Topsheet fully closed with peekHeight

    Steps to reproduce:

    1. Use app:behavior_peekHeight="3dp" in activity_main.xml of sample project
    2. Open top sheet
    3. Swipe up to close top sheet

    Actual: Top sheet is fully closed

    Expected Top sheet is still visible with a height of 3dp.

    opened by AndreRoss 1
  • Use androidx.* instead of android.support.* library

    Use androidx.* instead of android.support.* library

    This PR contains changes that replace android.support library to androidx library.

    Android support library is still available, but Google recommends to use AndroidX library instead of support library. Especially, they noted that all new library development will occur in the AndroidX library. (Check this Link)

    So I think it would be better to use AndroidX library instead of support library.

    What I change includes:

    androidx libraries instead of android.support libraries.

    • appcompat = 'androidx.appcompat:appcompat:1.1.0' instead of appcompat = 'com.android.support:appcompat-v7:24.1.1'
    • annotation = "androidx.annotation:annotation:1.1.0"
    • design = 'com.google.android.material:material:1.0.0' instead of design = 'com.android.support:design:24.1.1'

    compileSdkVersion, targetSdkVersion, buildToolsVersion, and gradle version.

    • compileSdkVersion = 29 (previously compileSdkVersion = 24)
    • targetSdkVersion = 24 (previously targetSdkVersion = 24)
    • buildToolsVersion = "29.0.0" (previously buildToolsVersion = "23.0.2")
    • classpath 'com.android.tools.build:gradle:3.5.2' (previously classpath 'com.android.tools.build:gradle:2.1.3')
    opened by ipuris 0
  • Configure Renovate

    Configure Renovate

    Mend Renovate

    Welcome to Renovate! This is an onboarding PR to help you understand and configure settings before regular Pull Requests begin.

    🚦 To activate Renovate, merge this Pull Request. To disable Renovate, simply close this Pull Request unmerged.


    Detected Package Files

    • .github/workflows/android.yml (github-actions)
    • gradle.properties (gradle)
    • settings.gradle (gradle)
    • build.gradle (gradle)
    • app/build.gradle (gradle)
    • library/build.gradle (gradle)
    • gradle/wrapper/gradle-wrapper.properties (gradle-wrapper)

    Configuration

    🔡 Renovate has detected a custom config for this PR. Feel free to ask for help if you have any doubts and would like it reviewed.

    Important: Now that this branch is edited, Renovate can't rebase it from the base branch any more. If you make changes to the base branch that could impact this onboarding PR, please merge them manually.

    What to Expect

    With your current configuration, Renovate will create 7 Pull Requests:

    Update dependency androidx.appcompat:appcompat to v1.5.1
    • Schedule: ["at any time"]
    • Branch name: renovate/androidx.appcompat-appcompat-1.x
    • Merge into: master
    • Upgrade androidx.appcompat:appcompat to 1.5.1
    Update dependency com.android.tools.build:gradle to v4.2.2
    • Schedule: ["at any time"]
    • Branch name: renovate/com.android.tools.build-gradle-4.x
    • Merge into: master
    • Upgrade com.android.tools.build:gradle to 4.2.2
    Update dependency com.google.android.material:material to v1.7.0
    Update dependency gradle to v6.9.3
    • Schedule: ["at any time"]
    • Branch name: renovate/gradle-6.x
    • Merge into: master
    • Upgrade gradle to 6.9.3
    Update actions/checkout action to v3
    • Schedule: ["at any time"]
    • Branch name: renovate/actions-checkout-3.x
    • Merge into: master
    • Upgrade actions/checkout to v3
    Update dependency com.android.tools.build:gradle to v7
    • Schedule: ["at any time"]
    • Branch name: renovate/com.android.tools.build-gradle-7.x
    • Merge into: master
    • Upgrade com.android.tools.build:gradle to 7.3.1
    Update dependency gradle to v7
    • Schedule: ["at any time"]
    • Branch name: renovate/gradle-7.x
    • Merge into: master
    • Upgrade gradle to 7.5.1

    🚸 Branch creation will be limited to maximum 2 per hour, so it doesn't swamp any CI resources or spam the project. See docs for prhourlylimit for details.


    ❓ Got questions? Check out Renovate's Docs, particularly the Getting Started section. If you need any further assistance then you can also request help here.


    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Need help with NestedScrollView

    Need help with NestedScrollView

    I am trying to use the "TopSheetBehavior" with NestedScrollView.

    if i replace NestedScrollView with LinearLayout, everything work fine. But if i use NestedScrollView, the "FrameLayout (i.e. top Sheet)" cannot be collapsed.

    Just more understanding: I have NestedScrollView | |----->NestedScrollView has TabLayout. | |------> Tablayout has Fragment | |------> Fragment has this "Top Sheet"

    Could you please help... :-)

    opened by pacifire 0
Releases(0.1)
Owner
Andrea Maglie
Software Engineer, GDG Organizer, Musician.
Andrea Maglie
A tiny window overlay to log app internal on top of your android app

DebugOverlay A logcat alike overlay to display log messages in your app as independent overlay. Typically in android you would log some app internals

Hannes Dorfmann 150 Nov 29, 2022
Janishar Ali 2.1k Jan 1, 2023
Owasp-top-five - An intro into writing code for greater Android Security

Don’t get stung by OWASP An intro into writing code for greater Android Security

Ed George 5 Feb 13, 2022
BottomSheet-Android - A simple customizable BottomSheet Library for Android Kotlin

BottomSheet-Android A simple customizable BottomSheet Library for Android Kotlin

Munachimso Ugorji 0 Jan 3, 2022
A sample implementation Compose BottomSheet with animation different states

Compose Animated BottomSheet A sample implementation Compose BottomSheet with animation different states Medium post: https://proandroiddev.com/how-to

Yahor 40 Jan 6, 2023
JetCountrypicker - Country code bottomsheet picker in Jetpack Compose

JetCountryPicker Country code bottomsheet picker in Jetpack Compose How to add i

Canopas Software 30 Nov 17, 2022
Kotlin Multiplatform Mobile version of Tisdagsgolfen... yet another version.

TheCube in Kotlin Multiplatform Experimenting with KMM, and Kotlin, Jetpack, SwiftUI, and all the other new stuff... https://kotlinlang.org/docs/kmm-g

Kim Fransman 0 Dec 25, 2022
A logger with a small, extensible API which provides utility on top of Android's normal Log class.

This is a logger with a small, extensible API which provides utility on top of Android's normal Log class. I copy this class into all the little apps

Jake Wharton 9.9k Jan 8, 2023
An android library for section headers that stick to the top

StickyListHeaders StickyListHeaders is an Android library that makes it easy to integrate section headers in your ListView. These section headers stic

Emil Sjölander 5.5k Jan 2, 2023
Set of extra Transitions on top of Jetpack Transitions Library

Transitions Everywhere Set of extra Transitions on top of AndroidX Transitions Library. About Article about transitions and library Originally this li

Andrey Kulikov 4.9k Dec 30, 2022
You can easily access the top of the screen in Android. Like a iPhone 6 & 6 Plus.

Reachability on Android Easy access on top. Like a iPhone 6 & 6 Plus. demo apk Usage Add dependencies compile 'com.github.sakebook:Reachability:0.2.0@

sakebook 258 Nov 12, 2022
[] Define and render UI specs on top of your Android UI

dspec A simple way to define and render UI specs on top of your Android UI. Usage Enclose the target UI with a DesignSpecFrameLayout, usually the root

Lucas Rocha 561 Dec 16, 2022
A FloatingActionButton subclass that shows a counter badge on right top corner

CounterFab A FloatingActionButton subclass that shows a counter badge on right top corner It's also used by Louvre library. Installation Include the l

André Mion 733 Dec 2, 2022
Annotation Processing Library. Generates proxy class on top of interface/abstract class, that allows to intercept calls. Also known as a design pattern: proxy, delegate, interceptor.

1. AutoProxy Annotation Processing Library. Generates proxy class on top of interface/abstract class, that allows to intercept calls. Also known as a

Oleksandr 19 Nov 24, 2022
An android library for section headers that stick to the top

StickyListHeaders StickyListHeaders is an Android library that makes it easy to integrate section headers in your ListView. These section headers stic

Emil Sjölander 5.5k Jan 5, 2023
A small android library for tagging views inside a ScrollView as "sticky" making them stick to the top of the scroll container until a new sticky view comes and takes it's place

StickyScrollViewItems StickyScrollViewItems is a ScrollView subclass that allowed you to mark items inside the ScrollView as sticky. The items marked

Emil Sjölander 1k Jan 7, 2023
An open source Android library that provides a floating group view at the top of the ExpandableListView

FloatingGroupExpandableListView FloatingGroupExpandableListView is a huge name an open source Android library that provides a floating group view (aka

Diego Lima 376 Nov 28, 2022
An android asynchronous http client built on top of HttpURLConnection.

Versions 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 Version 1.0.6 Description An android asynchronous http client based on HttpURLConnection. Updates U

David 15 Mar 29, 2020