Implementation method of Android custom bottom pull-up control

@H_ 404_ 2 @ Preface

In the new January, today we provide an implementation of Android custom bottom pull layout. The reason is that I need to implement such a control in the project, so I just write a practicing hand by myself.

After writing, I feel that all the requirements I can think of are basically available (there may be other requirements, but basically just change them). I spent a little time directly hosting it on GitHub. I hope it can give you some reference value:

Slidebottomlayout Android easy to use Android bottom pull-up control

@H_ 404_ 2 @ let's take a look at the implementation effect:

@H_ 404_ 2@ analyze the basic requirements of this control as follows:

1. One part can be dragged as a handle (that is, the handle in the figure). The height of this part is exposed in the interface - > need to implement: handle button

*Special needs and special analysis, such as making this handle transparent and realizing the effect of no handle

2. The layout on the bottom has a certain height limit, which does not necessarily cover the whole screen of the equipment - > the maximum height needs to be customized

3. When you pull up a little from the bottom, raise your hand and retract the layout. If it exceeds a certain height, it will automatically pop up to the highest and hide. Similarly - > you need to customize the threshold of automatically reaching the top / hiding

@H_ 404_ 2 @ direct use

The direct use is also very simple. The author has carried out simple packaging for reference:

@H_ 404_ 2@1. Add in the build.gradle file of project:

@H_ 404_ 2@2. Add in the build.gradle file of module:

@H_ 404_ 2@3.Add view in your layout:

It should be noted that in order to simplify the implementation, the author stole a lazy and set that there can only be one direct sub view (similar to Scrollview) under the layout

So if you need to add a layout, nest a ViewGroup outside:

@H_ 404_ 2 @ implementation steps

The specific code is as follows, in which the setting methods of the above requirements have been declared in the code:

@H_ 404_ 2 @ first look at the attribute declaration:

The notes are also relatively clear. If you have questions, please refer to slidebottomlayout Android's easy-to-use Android bottom pull-up control for details

There are relatively detailed instructions. In addition, if you have some requirements, you can put them forward in the issue. Thank you in advance!

The above implementation method of Android custom bottom pull-up control is all the content shared by Xiaobian. I hope it can give you a reference and support more programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>