mirror of
				https://github.com/AdrianKuta/Expandable-RecyclerView.git
				synced 2025-10-31 00:43:39 +01:00 
			
		
		
		
	fix-7 Fix displaying items by recyclewVIew. Update dependencies (#8)
This commit is contained in:
		
							
								
								
									
										1
									
								
								.idea/gradle.xml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										1
									
								
								.idea/gradle.xml
									
									
									
										generated
									
									
									
								
							| @@ -15,7 +15,6 @@ | |||||||
|             <option value="$PROJECT_DIR$/expandable-recyclerview" /> |             <option value="$PROJECT_DIR$/expandable-recyclerview" /> | ||||||
|           </set> |           </set> | ||||||
|         </option> |         </option> | ||||||
|         <option name="resolveModulePerSourceSet" value="false" /> |  | ||||||
|       </GradleProjectSettings> |       </GradleProjectSettings> | ||||||
|     </option> |     </option> | ||||||
|   </component> |   </component> | ||||||
|   | |||||||
							
								
								
									
										2
									
								
								.idea/misc.xml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										2
									
								
								.idea/misc.xml
									
									
									
										generated
									
									
									
								
							| @@ -10,7 +10,7 @@ | |||||||
|       </map> |       </map> | ||||||
|     </option> |     </option> | ||||||
|   </component> |   </component> | ||||||
|   <component name="ProjectRootManager" version="2" languageLevel="JDK_11" project-jdk-name="1.8" project-jdk-type="JavaSDK"> |   <component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="11" project-jdk-type="JavaSDK"> | ||||||
|     <output url="file://$PROJECT_DIR$/build/classes" /> |     <output url="file://$PROJECT_DIR$/build/classes" /> | ||||||
|   </component> |   </component> | ||||||
|   <component name="ProjectType"> |   <component name="ProjectType"> | ||||||
|   | |||||||
| @@ -3,12 +3,13 @@ apply plugin: 'kotlin-android' | |||||||
| apply plugin: 'kotlin-kapt' | apply plugin: 'kotlin-kapt' | ||||||
|  |  | ||||||
| android { | android { | ||||||
|     compileSdkVersion 31 |     namespace 'com.github.adriankuta' | ||||||
|     buildToolsVersion "31.0.0" |     compileSdkVersion 33 | ||||||
|  |     buildToolsVersion "33.0.0" | ||||||
|     defaultConfig { |     defaultConfig { | ||||||
|         applicationId "com.github.adriankuta" |         applicationId "com.github.adriankuta" | ||||||
|         minSdkVersion 23 |         minSdkVersion 23 | ||||||
|         targetSdkVersion 31 |         targetSdkVersion 33 | ||||||
|         versionCode 1 |         versionCode 1 | ||||||
|         versionName "1.0" |         versionName "1.0" | ||||||
|         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" |         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | ||||||
| @@ -30,11 +31,13 @@ android { | |||||||
| dependencies { | dependencies { | ||||||
|     implementation fileTree(dir: 'libs', include: ['*.jar']) |     implementation fileTree(dir: 'libs', include: ['*.jar']) | ||||||
|     implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" |     implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" | ||||||
|     implementation 'androidx.appcompat:appcompat:1.3.1' |     implementation 'androidx.appcompat:appcompat:1.5.1' | ||||||
|     implementation 'androidx.core:core-ktx:1.6.0' |     implementation 'androidx.core:core-ktx:1.9.0' | ||||||
|     implementation 'androidx.constraintlayout:constraintlayout:2.1.0' |     implementation 'androidx.constraintlayout:constraintlayout:2.1.4' | ||||||
|     implementation 'com.github.adriankuta:expandable-recyclerView:1.0.0' |  | ||||||
|  |     implementation project(path: ':expandable-recyclerview') | ||||||
|  |  | ||||||
|     testImplementation 'junit:junit:4.13.2' |     testImplementation 'junit:junit:4.13.2' | ||||||
|     androidTestImplementation 'androidx.test.ext:junit:1.1.3' |     androidTestImplementation 'androidx.test.ext:junit:1.1.4' | ||||||
|     androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' |     androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0' | ||||||
| } | } | ||||||
|   | |||||||
| @@ -1,6 +1,5 @@ | |||||||
| <?xml version="1.0" encoding="utf-8"?> | <?xml version="1.0" encoding="utf-8"?> | ||||||
| <manifest xmlns:android="http://schemas.android.com/apk/res/android" | <manifest xmlns:android="http://schemas.android.com/apk/res/android"> | ||||||
|     package="com.github.adriankuta"> |  | ||||||
|  |  | ||||||
|     <application |     <application | ||||||
|         android:allowBackup="true" |         android:allowBackup="true" | ||||||
|   | |||||||
| @@ -2,8 +2,6 @@ package com.github.adriankuta | |||||||
|  |  | ||||||
| import android.os.Bundle | import android.os.Bundle | ||||||
| import androidx.appcompat.app.AppCompatActivity | import androidx.appcompat.app.AppCompatActivity | ||||||
| import androidx.recyclerview.widget.LinearLayoutManager |  | ||||||
| import androidx.recyclerview.widget.RecyclerView |  | ||||||
| import com.github.adriankuta.databinding.ActivityMainBinding | import com.github.adriankuta.databinding.ActivityMainBinding | ||||||
| import com.github.adriankuta.expandable_recyclerview.expandableTree | import com.github.adriankuta.expandable_recyclerview.expandableTree | ||||||
|  |  | ||||||
| @@ -13,8 +11,8 @@ class MainActivity : AppCompatActivity() { | |||||||
|  |  | ||||||
|     override fun onCreate(savedInstanceState: Bundle?) { |     override fun onCreate(savedInstanceState: Bundle?) { | ||||||
|         super.onCreate(savedInstanceState) |         super.onCreate(savedInstanceState) | ||||||
|         setContentView(R.layout.activity_main) |  | ||||||
|         binding = ActivityMainBinding.inflate(layoutInflater) |         binding = ActivityMainBinding.inflate(layoutInflater) | ||||||
|  |         setContentView(binding.root) | ||||||
|  |  | ||||||
|         val tree = expandableTree("World") { |         val tree = expandableTree("World") { | ||||||
|             child("North America") { |             child("North America") { | ||||||
| @@ -31,12 +29,8 @@ class MainActivity : AppCompatActivity() { | |||||||
|             } |             } | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         with(binding) { |         val adapter = ExpandableAdapter() | ||||||
|             val adapter = ExpandableAdapter() |         binding.recyclerView.adapter = adapter | ||||||
|             recyclerView.layoutManager = LinearLayoutManager(this@MainActivity, RecyclerView.VERTICAL, false) |         adapter.setTree(tree) | ||||||
|             recyclerView.adapter = adapter |  | ||||||
|  |  | ||||||
|             adapter.setTree(tree) |  | ||||||
|         } |  | ||||||
|     } |     } | ||||||
| } | } | ||||||
|   | |||||||
| @@ -10,6 +10,8 @@ | |||||||
|         android:id="@+id/recyclerView" |         android:id="@+id/recyclerView" | ||||||
|         android:layout_width="0dp" |         android:layout_width="0dp" | ||||||
|         android:layout_height="0dp" |         android:layout_height="0dp" | ||||||
|  |         android:orientation="vertical" | ||||||
|  |         app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" | ||||||
|         app:layout_constraintBottom_toBottomOf="parent" |         app:layout_constraintBottom_toBottomOf="parent" | ||||||
|         app:layout_constraintEnd_toEndOf="parent" |         app:layout_constraintEnd_toEndOf="parent" | ||||||
|         app:layout_constraintStart_toStartOf="parent" |         app:layout_constraintStart_toStartOf="parent" | ||||||
|   | |||||||
| @@ -1,14 +1,14 @@ | |||||||
| // Top-level build file where you can add configuration options common to all sub-projects/modules. | // Top-level build file where you can add configuration options common to all sub-projects/modules. | ||||||
|  |  | ||||||
| buildscript { | buildscript { | ||||||
|     ext.kotlin_version = '1.5.30' |     ext.kotlin_version = '1.7.20' | ||||||
|     repositories { |     repositories { | ||||||
|         google() |         google() | ||||||
|         mavenCentral() |         mavenCentral() | ||||||
|  |  | ||||||
|     } |     } | ||||||
|     dependencies { |     dependencies { | ||||||
|         classpath 'com.android.tools.build:gradle:7.0.2' |         classpath 'com.android.tools.build:gradle:7.3.1' | ||||||
|         classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" |         classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" | ||||||
|         // NOTE: Do not place your application dependencies here; they belong |         // NOTE: Do not place your application dependencies here; they belong | ||||||
|         // in the individual module build.gradle files |         // in the individual module build.gradle files | ||||||
|   | |||||||
| @@ -6,14 +6,14 @@ afterEvaluate { | |||||||
| } | } | ||||||
|  |  | ||||||
| android { | android { | ||||||
|     compileSdkVersion 31 |     namespace 'com.github.adriankuta.expandable_recyclerview' | ||||||
|     buildToolsVersion "31.0.0" |     compileSdkVersion 33 | ||||||
|  |     buildToolsVersion "33.0.0" | ||||||
|  |  | ||||||
|  |  | ||||||
|     defaultConfig { |     defaultConfig { | ||||||
|         minSdkVersion 23 |         minSdkVersion 23 | ||||||
|         targetSdkVersion 31 |         targetSdkVersion 33 | ||||||
|         versionName "2.0.0" |  | ||||||
|  |  | ||||||
|         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" |         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | ||||||
|         consumerProguardFiles 'consumer-rules.pro' |         consumerProguardFiles 'consumer-rules.pro' | ||||||
| @@ -30,14 +30,14 @@ android { | |||||||
|  |  | ||||||
| dependencies { | dependencies { | ||||||
|     implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" |     implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" | ||||||
|     implementation 'androidx.appcompat:appcompat:1.3.1' |     implementation 'androidx.appcompat:appcompat:1.5.1' | ||||||
|     implementation 'androidx.core:core-ktx:1.6.0' |     implementation 'androidx.core:core-ktx:1.9.0' | ||||||
|     implementation "androidx.recyclerview:recyclerview:1.2.1" |     api "androidx.recyclerview:recyclerview:1.2.1" | ||||||
|     implementation "com.github.adriankuta:tree-structure:2.0.3" |     api "com.github.adriankuta:tree-structure:2.0.3" | ||||||
|  |  | ||||||
|     testImplementation 'junit:junit:4.13.2' |     testImplementation 'junit:junit:4.13.2' | ||||||
|     androidTestImplementation 'androidx.test.ext:junit:1.1.3' |     androidTestImplementation 'androidx.test.ext:junit:1.1.4' | ||||||
|     androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' |     androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0' | ||||||
| } | } | ||||||
|  |  | ||||||
| ext { | ext { | ||||||
|   | |||||||
| @@ -1,13 +1,11 @@ | |||||||
| package com.github.adriankuta.expandable_recyclerview | package com.github.adriankuta.expandable_recyclerview | ||||||
|  |  | ||||||
| import androidx.test.platform.app.InstrumentationRegistry |  | ||||||
| import androidx.test.ext.junit.runners.AndroidJUnit4 | import androidx.test.ext.junit.runners.AndroidJUnit4 | ||||||
|  | import androidx.test.platform.app.InstrumentationRegistry | ||||||
|  | import org.junit.Assert.* | ||||||
| import org.junit.Test | import org.junit.Test | ||||||
| import org.junit.runner.RunWith | import org.junit.runner.RunWith | ||||||
|  |  | ||||||
| import org.junit.Assert.* |  | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * Instrumented test, which will execute on an Android device. |  * Instrumented test, which will execute on an Android device. | ||||||
|  * |  * | ||||||
|   | |||||||
| @@ -1,2 +1 @@ | |||||||
| <manifest xmlns:android="http://schemas.android.com/apk/res/android" | <manifest /> | ||||||
|     package="com.github.adriankuta.expandable_recyclerview" /> |  | ||||||
|   | |||||||
| @@ -7,7 +7,7 @@ class ExpandableTreeNode<T>(value: T) : TreeNode<T>(value) { | |||||||
|  |  | ||||||
|     var expanded: Boolean = true |     var expanded: Boolean = true | ||||||
|  |  | ||||||
|     override fun child(value: T, childDeclaration: ChildDeclaration<T>?) : ExpandableTreeNode<T> { |     override fun child(value: T, childDeclaration: ChildDeclaration<T>?): ExpandableTreeNode<T> { | ||||||
|         val newChild = ExpandableTreeNode(value) |         val newChild = ExpandableTreeNode(value) | ||||||
|         if (childDeclaration != null) |         if (childDeclaration != null) | ||||||
|             newChild.childDeclaration() |             newChild.childDeclaration() | ||||||
|   | |||||||
| @@ -1,9 +1,8 @@ | |||||||
| package com.github.adriankuta.expandable_recyclerview | package com.github.adriankuta.expandable_recyclerview | ||||||
|  |  | ||||||
|  | import org.junit.Assert.assertEquals | ||||||
| import org.junit.Test | import org.junit.Test | ||||||
|  |  | ||||||
| import org.junit.Assert.* |  | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * Example local unit test, which will execute on the development machine (host). |  * Example local unit test, which will execute on the development machine (host). | ||||||
|  * |  * | ||||||
|   | |||||||
							
								
								
									
										2
									
								
								gradle/wrapper/gradle-wrapper.properties
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								gradle/wrapper/gradle-wrapper.properties
									
									
									
									
										vendored
									
									
								
							| @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME | |||||||
| distributionPath=wrapper/dists | distributionPath=wrapper/dists | ||||||
| zipStoreBase=GRADLE_USER_HOME | zipStoreBase=GRADLE_USER_HOME | ||||||
| zipStorePath=wrapper/dists | zipStorePath=wrapper/dists | ||||||
| distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip | distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Adrian Kuta
						Adrian Kuta