feat: Upgrade to build gradle 7.0.2

This commit is contained in:
2021-09-03 20:46:26 +02:00
parent 07fe54560c
commit 0c5f41c8c7
22 changed files with 320 additions and 185 deletions

View File

@ -1,15 +1,14 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
compileSdkVersion 31
buildToolsVersion "31.0.0"
defaultConfig {
applicationId "com.github.adriankuta"
minSdkVersion 23
targetSdkVersion 29
targetSdkVersion 31
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@ -20,6 +19,9 @@ android {
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
buildFeatures {
viewBinding true
}
dataBinding {
enabled = true
}
@ -28,11 +30,11 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.core:core-ktx:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'androidx.core:core-ktx:1.6.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
implementation 'com.github.adriankuta:expandable-recyclerView:1.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}

View File

@ -9,7 +9,8 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<activity android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

View File

@ -4,15 +4,17 @@ import android.os.Bundle
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.expandable_recyclerview.expandableTree
import kotlinx.android.synthetic.main.activity_main.*
class MainActivity : AppCompatActivity() {
private lateinit var binding: ActivityMainBinding
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
binding = ActivityMainBinding.inflate(layoutInflater)
val tree = expandableTree("World") {
child("North America") {
@ -29,10 +31,12 @@ class MainActivity : AppCompatActivity() {
}
}
val adapter = ExpandableAdapter()
recyclerView.layoutManager = LinearLayoutManager(this, RecyclerView.VERTICAL, false)
recyclerView.adapter = adapter
with(binding) {
val adapter = ExpandableAdapter()
recyclerView.layoutManager = LinearLayoutManager(this@MainActivity, RecyclerView.VERTICAL, false)
recyclerView.adapter = adapter
adapter.setTree(tree)
adapter.setTree(tree)
}
}
}

View File

@ -14,7 +14,8 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
tools:viewBindingIgnore="true">
<ImageView
android:id="@+id/expand_icon"

View File

@ -2,6 +2,7 @@
<layout>
<data>
<variable
name="node"
type="com.github.adriankuta.expandable_recyclerview.ExpandableTreeNode&lt;String>" />
@ -13,7 +14,8 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
tools:viewBindingIgnore="true">
<ImageView
android:id="@+id/expand_icon"

View File

@ -2,6 +2,7 @@
<layout>
<data>
<variable
name="node"
type="com.github.adriankuta.expandable_recyclerview.ExpandableTreeNode&lt;String>" />
@ -13,7 +14,8 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
tools:viewBindingIgnore="true">
<ImageView
android:id="@+id/expand_icon"
@ -33,12 +35,12 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:padding="8dp"
app:layout_goneMarginStart="96dp"
android:text="@{node.value}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/expand_icon"
app:layout_constraintTop_toTopOf="parent"
app:layout_goneMarginStart="96dp"
tools:text="@tools:sample/full_names" />
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>