Android: Have An Arbitrary View Slide Under Another View Like The Software Keyboard Does
I want to have a View pop in at the bottom of the page exactly like the software keyboard view does in the compose section of the Mms app. It slides in from the bottom, as if it's
Solution 1:
Sure it makes sense!
I have a SlidingPanel
demo that demonstrates the general technique. It's a bit more complicated than it needs to be, since it implements a custom View
class.
The gist is you actually have your panel in the layout to begin with, positioned where you want it to be, but you set android:visibility="gone"
so it doesn't appear. When you want it visible, make it visible and set up a TranslateAnimation
to slide it in.
Solution 2:
Today there is a SlidingLayout view to use as explianed in this question.
Just use this lib and add the following in your layout:
<com.wunderlist.slidinglayer.SlidingLayer
xmlns:slidingLayer="http://schemas.android.com/apk/res-auto"android:id="@+id/slidingLayer1"android:layout_width="@dimen/layer_width"android:layout_height="@dimen/layer_height"slidingLayer:shadowDrawable="@drawable/sidebar_shadow"slidingLayer:shadowSize="@dimen/shadow_size"slidingLayer:offsetDistance="@dimen/offset_distance"slidingLayer:previewOffsetDistance="@dimen/preview_offset_distance"slidingLayer:stickTo="top|bottom|right|left"slidingLayer:changeStateOnTap="true">
and add the following to your gradle build file:
compile'com.wunderlist:sliding-layer:1.2.5'
You can download a demo app from here
Post a Comment for "Android: Have An Arbitrary View Slide Under Another View Like The Software Keyboard Does"