├── .idea ├── .name ├── copyright │ └── profiles_settings.xml ├── encodings.xml ├── vcs.xml ├── modules.xml ├── gradle.xml ├── compiler.xml └── misc.xml ├── sample ├── .gitignore ├── sample_in_action.gif ├── src │ └── main │ │ ├── res │ │ ├── drawable-hdpi │ │ │ ├── ic_drag.png │ │ │ ├── ic_launcher.png │ │ │ └── ic_action_new_holo_light.png │ │ ├── drawable-mdpi │ │ │ ├── ic_drag.png │ │ │ ├── ic_launcher.png │ │ │ └── ic_action_new_holo_light.png │ │ ├── drawable-xhdpi │ │ │ ├── ic_drag.png │ │ │ ├── ic_launcher.png │ │ │ └── ic_action_new_holo_light.png │ │ ├── drawable-xxhdpi │ │ │ ├── ic_drag.png │ │ │ ├── ic_launcher.png │ │ │ └── ic_action_new_holo_light.png │ │ ├── values │ │ │ ├── colors.xml │ │ │ ├── dimens.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ ├── drawable-nodpi │ │ │ └── cherry_blossom.jpg │ │ ├── values-v21 │ │ │ └── styles.xml │ │ ├── values-v16 │ │ │ └── styles.xml │ │ ├── drawable │ │ │ └── selector_white_button.xml │ │ ├── values-w820dp │ │ │ └── dimens.xml │ │ └── layout │ │ │ ├── activity_note.xml │ │ │ ├── activity_demo.xml │ │ │ └── list_item_note.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ └── com │ │ └── jmedeisis │ │ └── example │ │ └── draglinearlayout │ │ ├── DemoActivity.java │ │ └── NoteActivity.java ├── build.gradle ├── proguard-rules.pro └── sample.iml ├── library ├── .gitignore ├── src │ └── main │ │ ├── res │ │ ├── values │ │ │ ├── dimens.xml │ │ │ └── attrs.xml │ │ ├── drawable-hdpi │ │ │ └── ab_solid_shadow_holo.9.png │ │ ├── drawable-mdpi │ │ │ └── ab_solid_shadow_holo.9.png │ │ ├── drawable-xhdpi │ │ │ └── ab_solid_shadow_holo.9.png │ │ ├── drawable-xxhdpi │ │ │ └── ab_solid_shadow_holo.9.png │ │ └── drawable │ │ │ └── ab_solid_shadow_holo_flipped.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ └── com │ │ └── jmedeisis │ │ └── draglinearlayout │ │ └── DragLinearLayout.java ├── proguard-rules.pro ├── build.gradle └── library.iml ├── settings.gradle ├── .gitignore ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradle.properties ├── DragLinearLayout.iml ├── LICENSE ├── gradlew.bat ├── README.md └── gradlew /.idea/.name: -------------------------------------------------------------------------------- 1 | DragLinearLayout -------------------------------------------------------------------------------- /sample/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /library/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':sample', ':library' 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /local.properties 3 | /.idea/workspace.xml 4 | /.idea/libraries 5 | .DS_Store 6 | /build 7 | -------------------------------------------------------------------------------- /sample/sample_in_action.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justasm/DragLinearLayout/HEAD/sample/sample_in_action.gif -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justasm/DragLinearLayout/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /sample/src/main/res/drawable-hdpi/ic_drag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justasm/DragLinearLayout/HEAD/sample/src/main/res/drawable-hdpi/ic_drag.png -------------------------------------------------------------------------------- /sample/src/main/res/drawable-mdpi/ic_drag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justasm/DragLinearLayout/HEAD/sample/src/main/res/drawable-mdpi/ic_drag.png -------------------------------------------------------------------------------- /sample/src/main/res/drawable-xhdpi/ic_drag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justasm/DragLinearLayout/HEAD/sample/src/main/res/drawable-xhdpi/ic_drag.png -------------------------------------------------------------------------------- /sample/src/main/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justasm/DragLinearLayout/HEAD/sample/src/main/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/src/main/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justasm/DragLinearLayout/HEAD/sample/src/main/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/src/main/res/drawable-xxhdpi/ic_drag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justasm/DragLinearLayout/HEAD/sample/src/main/res/drawable-xxhdpi/ic_drag.png -------------------------------------------------------------------------------- /sample/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #eee 4 | -------------------------------------------------------------------------------- /sample/src/main/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justasm/DragLinearLayout/HEAD/sample/src/main/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/src/main/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justasm/DragLinearLayout/HEAD/sample/src/main/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/src/main/res/drawable-nodpi/cherry_blossom.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justasm/DragLinearLayout/HEAD/sample/src/main/res/drawable-nodpi/cherry_blossom.jpg -------------------------------------------------------------------------------- /library/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | -------------------------------------------------------------------------------- /library/src/main/res/drawable-hdpi/ab_solid_shadow_holo.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justasm/DragLinearLayout/HEAD/library/src/main/res/drawable-hdpi/ab_solid_shadow_holo.9.png -------------------------------------------------------------------------------- /library/src/main/res/drawable-mdpi/ab_solid_shadow_holo.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justasm/DragLinearLayout/HEAD/library/src/main/res/drawable-mdpi/ab_solid_shadow_holo.9.png -------------------------------------------------------------------------------- /library/src/main/res/drawable-xhdpi/ab_solid_shadow_holo.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justasm/DragLinearLayout/HEAD/library/src/main/res/drawable-xhdpi/ab_solid_shadow_holo.9.png -------------------------------------------------------------------------------- /library/src/main/res/drawable-xxhdpi/ab_solid_shadow_holo.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justasm/DragLinearLayout/HEAD/library/src/main/res/drawable-xxhdpi/ab_solid_shadow_holo.9.png -------------------------------------------------------------------------------- /sample/src/main/res/drawable-hdpi/ic_action_new_holo_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justasm/DragLinearLayout/HEAD/sample/src/main/res/drawable-hdpi/ic_action_new_holo_light.png -------------------------------------------------------------------------------- /sample/src/main/res/drawable-mdpi/ic_action_new_holo_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justasm/DragLinearLayout/HEAD/sample/src/main/res/drawable-mdpi/ic_action_new_holo_light.png -------------------------------------------------------------------------------- /sample/src/main/res/drawable-xhdpi/ic_action_new_holo_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justasm/DragLinearLayout/HEAD/sample/src/main/res/drawable-xhdpi/ic_action_new_holo_light.png -------------------------------------------------------------------------------- /sample/src/main/res/drawable-xxhdpi/ic_action_new_holo_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justasm/DragLinearLayout/HEAD/sample/src/main/res/drawable-xxhdpi/ic_action_new_holo_light.png -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /library/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /sample/src/main/res/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /sample/src/main/res/values-v16/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Jan 06 18:11:16 GMT 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip 7 | -------------------------------------------------------------------------------- /library/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /sample/src/main/res/drawable/selector_white_button.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /library/src/main/res/drawable/ab_solid_shadow_holo_flipped.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | -------------------------------------------------------------------------------- /sample/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | 16dp 8 | 9 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 19 | -------------------------------------------------------------------------------- /sample/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 16dp 6 | 16dp 7 | 8dp 8 | 8dp 9 | 4dp 10 | 4dp 11 | 16dp 12 | 8dp 13 | 48dp 14 | 15 | 16 | -------------------------------------------------------------------------------- /library/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in C:/Users/Justas/Desktop/android-sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /sample/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 22 5 | buildToolsVersion '22.0.1' 6 | 7 | defaultConfig { 8 | applicationId "com.example.draglinearlayout" 9 | minSdkVersion 15 10 | targetSdkVersion 22 11 | versionCode 1 12 | versionName "1.0" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | compile project(":library") 24 | compile fileTree(dir: 'libs', include: ['*.jar']) 25 | compile 'com.android.support:appcompat-v7:22.1.1' 26 | } 27 | -------------------------------------------------------------------------------- /sample/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in C:/Users/Justas/Desktop/android-sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Settings specified in this file will override any Gradle settings 5 | # configured through the IDE. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true -------------------------------------------------------------------------------- /DragLinearLayout.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Justas Medeisis 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /sample/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 10 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 23 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /library/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | apply plugin: 'bintray-release' 3 | 4 | android { 5 | compileSdkVersion 22 6 | buildToolsVersion '22.0.1' 7 | 8 | defaultConfig { 9 | minSdkVersion 14 10 | targetSdkVersion 22 11 | versionCode 1 12 | versionName "1.1.0" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | compile 'com.android.support:support-v4:22.1.1' 24 | } 25 | 26 | buildscript { 27 | repositories { 28 | jcenter() 29 | } 30 | 31 | dependencies { 32 | classpath 'com.novoda:bintray-release:0.3.4' 33 | } 34 | } 35 | 36 | // https://github.com/novoda/bintray-release/wiki/Configuration-of-the-publish-closure 37 | publish { 38 | userOrg = 'justasm' 39 | groupId = 'com.jmedeisis' 40 | artifactId = 'draglinearlayout' 41 | version = "1.1.0" 42 | licences = ['MIT'] 43 | description = "Android LinearLayout with drag and drop to reorder." 44 | website = 'https://github.com/justasm/DragLinearLayout' 45 | } -------------------------------------------------------------------------------- /sample/src/main/java/com/jmedeisis/example/draglinearlayout/DemoActivity.java: -------------------------------------------------------------------------------- 1 | package com.jmedeisis.example.draglinearlayout; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | import android.support.v7.app.AppCompatActivity; 6 | import android.view.View; 7 | 8 | import com.jmedeisis.draglinearlayout.DragLinearLayout; 9 | 10 | public class DemoActivity extends AppCompatActivity { 11 | 12 | @Override 13 | protected void onCreate(Bundle savedInstanceState) { 14 | super.onCreate(savedInstanceState); 15 | setContentView(R.layout.activity_demo); 16 | 17 | DragLinearLayout dragLinearLayout = (DragLinearLayout) findViewById(R.id.container); 18 | // set all children draggable except the first (the header) 19 | for(int i = 1; i < dragLinearLayout.getChildCount(); i++){ 20 | View child = dragLinearLayout.getChildAt(i); 21 | dragLinearLayout.setViewDraggable(child, child); // the child is its own drag handle 22 | } 23 | 24 | findViewById(R.id.noteDemoButton).setOnClickListener(new View.OnClickListener() { 25 | @Override 26 | public void onClick(View v) { 27 | startActivity(new Intent(DemoActivity.this, NoteActivity.class)); 28 | } 29 | }); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /sample/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | DragLinearLayout Demo 5 | Simple linear layout 6 | Drag me! Drop me! 7 | Swap with me! Swap with me! 8 | I\'m quite sensitive\nabout my height. 9 | I heard that one of us is a Button! 10 | Someone forgot to make me draggable… 11 | Linear layout within ScrollView 12 | Icon. 13 | Add new note 14 | Write note 15 | View DragLinearLayout inside ScrollView demo 16 | Demo image 17 | 18 | 19 | I am an EditText. Tap me to edit me! 20 | I deserve priority! Grab my handle on the left and drag me higher! 21 | 22 | 23 | Drag&Drop Notes Demo 24 | 25 | 26 | -------------------------------------------------------------------------------- /sample/src/main/res/layout/activity_note.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 9 | 10 | 11 | 16 | 17 | 23 | 24 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /sample/src/main/res/layout/activity_demo.xml: -------------------------------------------------------------------------------- 1 | 9 | 10 | 15 | 16 | 21 | 22 | 27 | 28 | 33 | 34 | 40 | 41 | 46 | 47 |