moraisigor / slidingdrawer Goto Github PK
View Code? Open in Web Editor NEWSlidingDrawer hides content out of the screen and allows the user to drag a handle to bring the content on screen.
License: Apache License 2.0
SlidingDrawer hides content out of the screen and allows the user to drag a handle to bring the content on screen.
License: Apache License 2.0
Hello,
I have an activity where I call lock() on the drawer when a fragment is loaded into the FrameLayout. However, if I tap on the handle for the sliding drawer (which is still visible with the fragment loaded), the drawer opens! (it doesn't animate open, it just jumps open).
I believe this is a bug. I would expect that when the drawer is locked, it wouldn't respond to any touch input.
The XML for the sliding drawer is below.
Let me know what else you need to further debug this and I'll happily provide.
<hollowsoft.slidingdrawer.SlidingDrawer
android:id="@+id/mainDrawer"
android:layout_width="match_parent"
android:layout_height="400dp"
android:orientation="vertical"
android:rotation="180"
layout:allowSingleTap="false"
layout:animateOnClick="false"
layout:content="@+id/mainDrawerContent"
layout:handle="@+id/mainDrawerHandle">
<android.support.v7.widget.AppCompatImageView
android:id="@+id/mainDrawerHandle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorPrimaryDark"
android:rotation="180"
app:srcCompat="@mipmap/logo" />
<LinearLayout
android:id="@+id/mainDrawerContent"
android:gravity="center"
android:rotation="180"
android:background="@color/colorPrimaryDark"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<android.support.v7.widget.AppCompatButton .../>
<android.support.v7.widget.AppCompatButton .../>
<android.support.v7.widget.AppCompatButton .../>
<android.support.v7.widget.AppCompatButton .../>
</LinearLayout>
</hollowsoft.slidingdrawer.SlidingDrawer>
Hi. I'm using this SlidingDrawer very usefully.
But I found a bug when I use Pixel 2 API 24 Emulator
I put some textviews Inside of the Sliding drawer, and I change the text every second.
when I test it with API 28, It's work well.
But in Pixel 2 API 24, it doesn't work.
My XML code looks like this..
<hollowsoft.slidingdrawer.SlidingDrawer
android:id="@+id/runningDrawer"
android:layout_width="match_parent"
android:layout_height="160dp"
android:layout_alignParentBottom="true"
android:layout_marginBottom="70dp"
layout:content="@+id/content"
layout:handle="@+id/runningHandle">
<Button
android:id="@+id/runningHandle"
android:layout_width="70dp"
android:layout_height="27dp"
android:background="@drawable/button_white_background"
android:gravity="center"
android:text="▲"
android:textColor="@color/red"
android:textSize="15dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginLeft="5dp"
android:layout_marginTop="5dp"
android:layout_marginRight="5dp"
android:layout_weight="1.0"
android:gravity="center"
android:orientation="vertical">
<TextView
style="@style/ListDetail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/Distance_km" />
<TextView
android:layout_marginTop="15dp"
android:id="@+id/runningDistanceTextView"
style="@style/blackMediumText18"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@{viewModel.distanceSpeed.distance}" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginLeft="5dp"
android:layout_marginTop="5dp"
android:layout_marginRight="5dp"
android:layout_weight="1.0"
android:gravity="center"
android:orientation="vertical">
<TextView
style="@style/ListDetail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/Time" />
<Chronometer
android:layout_marginTop="15dp"
android:id="@+id/runningTimerTextView"
style="@style/blackMediumText18"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginLeft="5dp"
android:layout_marginTop="5dp"
android:layout_marginRight="5dp"
android:layout_weight="1.0"
android:gravity="center"
android:orientation="vertical">
<TextView
style="@style/ListDetail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/speed_km" />
<TextView
android:layout_marginTop="15dp"
android:id="@+id/runningSpeedTextView"
style="@style/blackMediumText18"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="0.0" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</hollowsoft.slidingdrawer.SlidingDrawer>
Thanks Trying your sample code and only have one TextView as content. The SlidingDrawer takes upp the entire screen even when it´s not in open state. I tried this:
android:background="@android:color/transparent"
without any luck, any idea?
Please prefix your attributes. Not prefixing your attrs causes projects to not compile.
See here: ApmeM/android-flowlayout#29
How can i add content with in Activity
hi there,
I am looking for a versatile sliding drawer and it looks like yours could fit the bill.
I am just wondering if it can be used when opening from the left of the screen.
I fiddled a bit with the sample code but could not make it work that way...
Any hint will be much appreciated.
Many thanks in advance,
JM
Why is it that minSdkVersion for this library is 16?
Android's (deprecated) version of this has minSdkVersion of 3.
I'm trying to create view on the activity. When I call the SlidingDrawer class, it requires AttributeSet class. Is there any way to initialize it later?
If i put the handle inside a RelativeLayout to change its position the sliding won't work anymore
I'm trying to position the handle on the top right corner.
Can you provide a solution for this problem?
Stuff like this: �AS IS�
Causes Error:(4, 56) error: unmappable character for encoding UTF-8
Errors in Android Studio....
Are you planning to support left to right in horizontal mode?
Would be great if we can just add this to gradle...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.