Git Product home page Git Product logo

androidtopsheet's Issues

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.

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)

Add STATE_HALF_EXPANDED

add HALF_EXPANDED state that open half of screen even layout height is bigger than screen

like bottom sheet:
BottomSheetBehavior.STATE_HALF_EXPANDED

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.

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... :-)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.