DragLinearLayout alternatives and similar packages
Based on the "Layout Widget" category.
Alternatively, view DragLinearLayout alternatives based on common mentions on social networks and blogs.
-
SmartRefreshLayout
🔥下拉刷新、上拉加载、二级刷新、淘宝二楼、RefreshLayout、OverScroll,Android智能下拉刷新框架,支持越界回弹、越界拖动,具有极强的扩展性,集成了几十种炫酷的Header和 Footer。 -
SmartTabLayout
A custom ViewPager title strip which gives continuous feedback to the user when scrolling -
FoldingCell
:octocat: 📃 FoldingCell is a material design expanding content cell inspired by folding paper material made by @Ramotion -
FreeFlow
DISCONTINUED. A layout engine for Android that decouples layouts from the View containers that manage scrolling and view recycling. FreeFlow makes it really easy to create custom layouts and beautiful transition animations as data and layouts change -
android-PullRefreshLayout
This component like SwipeRefreshLayout, it is more beautiful than SwipeRefreshLayout. -
android-flowlayout
Linear layout, that wrap its content to the next line if there is no space in the current line. -
SuperSwipeRefreshLayout
A custom SwipeRefreshLayout to support the pull-to-refresh featrue.RecyclerView,ListView,GridView,NestedScrollView,ScrollView are supported. -
DragTopLayout
DISCONTINUED. DEPRECATED, Please use another library https://github.com/henrytao-me/smooth-app-bar-layout/ -
Vorolay
VoronoiView is a view (ViewGroup) that allows you to add and display views inside Voronoi diagram regions. -
FlowLayout
Android implementation of FlowLayout. Layout arranges its children in multiple rows depending on their width. -
Android-MosaicLayout-v0.1
[UNMAINTAINED]: AndroidMosaicLayout is android layout to display group of views as grid consists of different asymmetric patterns (90 different patterns). -
Android-RatioLayout
This is a specified proportion to the size of the Layout or View support library, with which you can easily set a fixed ratio of the size of the Layout or View, internal adaptive size calculation, completely abandon the code to calculate the size! If you have any questions in the course or suggestions, please send an e-mail to the following e-mail, thank you! -
GooglePlusLayout
GoolgePlusLayout is a custom layout that plays animation on the children views while scrolling as the layout in the Google Plus (android) main page
CodeRabbit: AI Code Reviews for Developers
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of DragLinearLayout or a related project?
README
DragLinearLayout
An Android LinearLayout
that supports draggable and swappable child View
s.
Why?
Why bother doing drag & swap in a LinearLayout
when there are
so many solutions for ListView
?
- Simplicity - no need for
ListAdapter
s. By default, works like aLinearLayout
. - Flexibility - supports heterogeneous, selectively draggable (or not draggable), children.
- Portability - can be used in any layout, e.g. as a child in a
ScrollView
container.
Usage
Add it to your project using Gradle:
compile 'com.jmedeisis:draglinearlayout:1.1.0'
The DragLinearLayout
can be used in place of any LinearLayout
. However, by default, children
will not be draggable. To set an existing View
as draggable, use
DragLinearLayout#setViewDraggable(View, View)
, passing in the child View
and a (non-null!)
View
that will act as the handle for dragging it (this can be the View
itself).
XML layout file:
<com.jmedeisis.draglinearlayout.DragLinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/text" />
<ImageView
android:layout_width="match_parent"
android:layout_height="120dp"
android:scaleType="centerCrop"
android:src="@drawable/image"/>
<Button
android:id="@+id/button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/button_text"/>
</com.jmedeisis.draglinearlayout.DragLinearLayout>
Enabling drag & swap for all child views:
DragLinearLayout dragLinearLayout = (DragLinearLayout) findViewById(R.id.container);
for(int i = 0; i < dragLinearLayout.getChildCount(); i++){
View child = dragLinearLayout.getChildAt(i);
// the child will act as its own drag handle
dragLinearLayout.setViewDraggable(child, child);
}
Use #addDragView(View, View)
,#addDragView(View, View, int)
and #removeDragView(View)
to
manage draggable children dynamically:
final View view = View.inflate(context, R.layout.view_layout, null);
dragLinearLayout.addDragView(view, view.findViewById(R.id.view_drag_handle));
// ..
dragLinearLayout.removeDragView(view);
Attach an OnViewSwapListener
with #setOnViewSwapListener(OnViewSwapListener)
to detect changes
to the ordering of child View
s:
dragLinearLayout.setOnViewSwapListener(new DragLinearLayout.OnViewSwapListener() {
@Override
public void onSwap(View firstView, int firstPosition,
View secondView, int secondPosition) {
// update data, etc..
}
});
When placing the DragLinearLayout
inside a ScrollView
, call #setContainerScrollView(ScrollView)
to enable the user to scroll while dragging a child view.
For best visual results, use children that have opaque backgrounds. Furthermore, do not use
horizontal padding for the DragLinearLayout
; instead, let children apply their own horizontal
padding.
Refer to the included sample activity project for a demonstration of the above usage techniques and more.
Limitations
- Supports only the
LinearLayout#VERTICAL
orientation.
License
This project is licensed under the terms of the MIT license.
You may find a copy of the license in the included LICENSE
file.
*Note that all licence references and agreements mentioned in the DragLinearLayout README section above
are relevant to that project's source code only.