Popularity
4.1
Stable
Activity
0.0
Stable
273
17
55

Programming language: Java
License: MIT License
Tags: Layout Widget    
Latest version: v0.1-alpha

RearrangeableLayout alternatives and similar packages

Based on the "Layout Widget" category.
Alternatively, view RearrangeableLayout alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of RearrangeableLayout or a related project?

Add another 'Layout Widget' Package

README

Android Rearrangeable Layout

An android layout to re-arrange child views via dragging

Android Arsenal

Screencast Demo

Layout Usage

All the child views are draggable once the layout is added to an activity (activity_main.xml)


<com.rajasharan.layout.RearrangeableLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/rearrangeable_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:clipToPadding="false"
    app:outlineWidth="2dp"
    app:outlineColor="@color/cyan"
    app:selectionAlpha="0.5"
    app:selectionZoom="1.2"
    >

    <!-- add child views with `android:id` attr to
         save position during orientation change -->

    <TextView
        android:id="@+id/textview_1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Sample Demo with very large text that will overflow in width"
        android:textSize="30sp"
        android:background="@android:color/holo_green_light"
        android:layout_margin="15dp"
        />

    <!-- more child views -->

</com.rajasharan.layout.RearrangeableLayout>

Child Position Listener

Add a ChildPositionListener to the root layout to receive updates whenever any child view is dragged (MainActivity.java)


@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    root = (RearrangeableLayout) findViewById(R.id.rearrangeable_layout);
    root.setChildPositionListener(new RearrangeableLayout.ChildPositionListener() {
        @Override
        public void onChildMoved(View childView, Rect oldPosition, Rect newPosition) {
            Log.d(TAG, childView.toString());
            Log.d(TAG, oldPosition.toString() + " -> " + newPosition.toString());
        }
    });
}

License

The MIT License (MIT)


*Note that all licence references and agreements mentioned in the RearrangeableLayout README section above are relevant to that project's source code only.