Skip to content

Commit

Permalink
Migration to ViewBinding part 1
Browse files Browse the repository at this point in the history
  • Loading branch information
bialger committed Aug 19, 2023
1 parent 9805fed commit d971863
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
11 changes: 10 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion 33

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

kotlin {
jvmToolchain(17)
}

buildFeatures {
viewBinding true
}
Expand All @@ -26,6 +34,7 @@ android {
}
}
namespace 'com.bigri239.easymusic'
buildToolsVersion '33.0.1'

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.bigri239.easymusic.adapter.CustomAdapter
import com.bigri239.easymusic.adapter.CustomConnector
import kotlinx.android.synthetic.main.activity_addfiles.*
import java.io.*
import kotlin.math.abs

Expand Down Expand Up @@ -44,6 +43,7 @@ class AddingfilesActivity : AppCompatActivity() {
private val customList = arrayListOf<String>()
private lateinit var defaultAdapter: CustomAdapter
private lateinit var customAdapter: CustomAdapter
private lateinit var binding: AddingfilesActivityBinding

private val connectorSound = object : CustomConnector {
override fun function(string: String) {
Expand All @@ -53,6 +53,10 @@ class AddingfilesActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = AddingfilesActivityBinding.inflate(layoutInflater)
val view = binding.root.also {
setContentView(it)
}
setContentView(R.layout.activity_addfiles)
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES)
val path = filesDir
Expand Down

0 comments on commit d971863

Please sign in to comment.