diff --git a/README.md b/README.md index 89074e2..dfc61b1 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,27 @@ AndroidTreeView ==================== +This is a fork of the original AndroidTreeView Project. + +I have added collapseNodeWithSubnodes method in the main class to have the functionality to collapse a node including it's subnodes in a single method call. + +You can use the gradle dependency, you have to add these lines in your build.gradle file: + +```xml +repositories { + maven { url "https://jitpack.io" } +} + +dependencies { + compile 'com.github.vajro:AndroidTreeView:1.3.1' +} +``` +Kindly ensure you add Jitpack's maven repo url in your gradle file. + +#ORIGINAL README + +AndroidTreeView +==================== ### Recent changes diff --git a/app/build.gradle b/app/build.gradle index 6d144bb..705080c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,13 +1,13 @@ apply plugin: 'com.android.application' android { - compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION) - buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION + compileSdkVersion 23 + buildToolsVersion "23.0.2" defaultConfig { applicationId "com.unnamed.b.atv.demo" minSdkVersion Integer.parseInt(project.ANDROID_BUILD_MIN_SDK_VERSION) - targetSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION) + targetSdkVersion 21 versionName project.VERSION_NAME versionCode Integer.parseInt(project.VERSION_CODE) } @@ -20,7 +20,7 @@ android { dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) - compile 'com.android.support:appcompat-v7:21.0.3' + compile 'com.android.support:appcompat-v7:23.1.1' compile 'com.github.johnkil.print:print:1.2.2' compile project(':library') } diff --git a/gradle.properties b/gradle.properties index ddb8205..4bee48b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -22,7 +22,7 @@ VERSION_CODE=11 ANDROID_BUILD_MIN_SDK_VERSION=11 -ANDROID_BUILD_TARGET_SDK_VERSION=21 +ANDROID_BUILD_TARGET_SDK_VERSION=22 ANDROID_BUILD_SDK_VERSION=21 ANDROID_BUILD_TOOLS_VERSION=21.1.2 diff --git a/library/build.gradle b/library/build.gradle index 92ecb9f..7bb1b50 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -1,12 +1,12 @@ apply plugin: 'com.android.library' android { - compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION) - buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION + compileSdkVersion 23 + buildToolsVersion "23.0.2" defaultConfig { minSdkVersion Integer.parseInt(project.ANDROID_BUILD_MIN_SDK_VERSION) - targetSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION) + targetSdkVersion 23 versionName project.VERSION_NAME versionCode Integer.parseInt(project.VERSION_CODE) } @@ -19,7 +19,7 @@ android { dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) - compile 'com.android.support:appcompat-v7:21.0.3' + compile 'com.android.support:appcompat-v7:23.1.1' } apply from: '../maven_push.gradle' diff --git a/library/src/main/java/com/unnamed/b/atv/view/AndroidTreeView.java b/library/src/main/java/com/unnamed/b/atv/view/AndroidTreeView.java index 222a43a..53f8803 100644 --- a/library/src/main/java/com/unnamed/b/atv/view/AndroidTreeView.java +++ b/library/src/main/java/com/unnamed/b/atv/view/AndroidTreeView.java @@ -166,6 +166,10 @@ public void collapseNode(TreeNode node) { collapseNode(node, false); } + public void collapseNodeWithSubnodes(TreeNode node) { + collapseNode(node, true); + } + public String getSaveState() { final StringBuilder builder = new StringBuilder(); getSaveState(mRoot, builder);