Skip to content

Commit 0f33973

Browse files
committed
Get rid of Kotlin synthetic imports
1 parent a4622a9 commit 0f33973

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

example/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
apply plugin: 'com.android.application'
22
apply plugin: 'kotlin-android'
3-
apply plugin: 'kotlin-android-extensions'
43

54
android {
65
compileSdkVersion compile_sdk

example/src/main/java/com/livermor/dumchev/delegateadapters/base/BaseExampleActivity.kt

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ import android.view.View
55
import androidx.appcompat.app.AppCompatActivity
66
import androidx.recyclerview.widget.LinearLayoutManager
77
import com.livermor.delegateadapter.delegate.CompositeDelegateAdapter
8-
import com.livermor.dumchev.delegateadapters.R
98
import com.livermor.dumchev.delegateadapters.base.adapter.CheckDelegateAdapter
109
import com.livermor.dumchev.delegateadapters.base.adapter.GenerateItemsDelegateAdapter
1110
import com.livermor.dumchev.delegateadapters.base.adapter.TxtDelegateAdapter
12-
import kotlinx.android.synthetic.main.activity_main.*
11+
import com.livermor.dumchev.delegateadapters.databinding.ActivityBaseExampleBinding
1312

1413
/**
15-
* @author dumchev on 28.11.17.
14+
15+
@author dumchev on 28.11.17.
1616
*/
1717
class BaseExampleActivity : AppCompatActivity() {
1818

@@ -21,12 +21,14 @@ class BaseExampleActivity : AppCompatActivity() {
2121
CheckDelegateAdapter(),
2222
GenerateItemsDelegateAdapter { generateNewData() }
2323
)
24+
private lateinit var binding: ActivityBaseExampleBinding
2425

2526
override fun onCreate(savedInstanceState: Bundle?) {
2627
super.onCreate(savedInstanceState)
27-
setContentView(R.layout.activity_base_example)
28-
rv.layoutManager = LinearLayoutManager(this)
29-
rv.adapter = adapter
28+
binding = ActivityBaseExampleBinding.inflate(layoutInflater)
29+
setContentView(binding.root)
30+
binding.rv.layoutManager = LinearLayoutManager(this)
31+
binding.rv.adapter = adapter
3032
adapter.swapData(MockDataFactory.prepareData())
3133
}
3234

@@ -36,6 +38,6 @@ class BaseExampleActivity : AppCompatActivity() {
3638

3739
private fun generateNewData() {
3840
adapter.swapData(MockDataFactory.prepareData())
39-
rv.scrollToPosition(0)
41+
binding.rv.scrollToPosition(0)
4042
}
41-
}
43+
}

0 commit comments

Comments
 (0)