Skip to content

Commit 70c20f1

Browse files
Copilotfaruktoptas
andauthored
Update Kotlin to 1.8.20 and bump library version to 1.5.0 (#250)
* Initial plan * Update Kotlin to 1.8.20, Gradle to 8.0, AGP to 8.0.2, and library version to 1.5.0 Co-authored-by: faruktoptas <1595227+faruktoptas@users.noreply.github.com> * Fix JVM target compatibility by setting Java and Kotlin to 1.8 Co-authored-by: faruktoptas <1595227+faruktoptas@users.noreply.github.com> * Remove deprecated kotlin-android-extensions plugin Co-authored-by: faruktoptas <1595227+faruktoptas@users.noreply.github.com> * Migrate all activities to ViewBinding Co-authored-by: faruktoptas <1595227+faruktoptas@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: faruktoptas <1595227+faruktoptas@users.noreply.github.com>
1 parent c52db48 commit 70c20f1

12 files changed

Lines changed: 100 additions & 68 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ allprojects {
4444
Then, add the library to your module `build.gradle`
4545
```gradle
4646
dependencies {
47-
implementation 'com.github.faruktoptas:FancyShowCaseView:1.4.0'
47+
implementation 'com.github.faruktoptas:FancyShowCaseView:1.5.0'
4848
}
4949
```
5050

app/build.gradle

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616

1717
apply plugin: 'com.android.application'
1818
apply plugin: 'kotlin-android'
19-
apply plugin: 'kotlin-android-extensions'
2019

2120
android {
21+
namespace 'me.toptas.fancyshowcasesample'
2222
compileSdkVersion compile_sdk_version
2323

2424
defaultConfig {
@@ -46,6 +46,16 @@ android {
4646
signingConfig signingConfigs.release
4747
}
4848
}
49+
compileOptions {
50+
sourceCompatibility JavaVersion.VERSION_1_8
51+
targetCompatibility JavaVersion.VERSION_1_8
52+
}
53+
kotlinOptions {
54+
jvmTarget = '1.8'
55+
}
56+
buildFeatures {
57+
viewBinding = true
58+
}
4959
}
5060

5161
dependencies {

app/src/main/java/me/toptas/fancyshowcasesample/AnimatedActivity.kt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,25 +22,26 @@ import android.view.View
2222
import android.view.animation.AnimationUtils
2323
import android.widget.TextView
2424

25-
import kotlinx.android.synthetic.main.activity_main.*
2625
import me.toptas.fancyshowcase.FancyShowCaseQueue
2726
import me.toptas.fancyshowcase.FancyShowCaseView
2827
import me.toptas.fancyshowcase.listener.OnViewInflateListener
28+
import me.toptas.fancyshowcasesample.databinding.ActivityAnimatedBinding
2929

3030

3131
class AnimatedActivity : BaseActivity() {
3232

33-
33+
private lateinit var binding: ActivityAnimatedBinding
3434
private lateinit var queue: FancyShowCaseQueue
3535
private lateinit var fancyView: FancyShowCaseView
3636
private lateinit var fancyView2: FancyShowCaseView
3737

3838
override fun onCreate(savedInstanceState: Bundle?) {
3939
super.onCreate(savedInstanceState)
40-
setContentView(R.layout.activity_animated)
40+
binding = ActivityAnimatedBinding.inflate(layoutInflater)
41+
setContentView(binding.root)
4142

4243
fancyView = FancyShowCaseView.Builder(this)
43-
.focusOn(btn_focus)
44+
.focusOn(binding.btnFocus)
4445
.customView(R.layout.layout_animated_view, object : OnViewInflateListener {
4546
override fun onViewInflated(view: View) {
4647
setAnimatedContent(view, fancyView)
@@ -49,15 +50,15 @@ class AnimatedActivity : BaseActivity() {
4950
.build()
5051

5152
fancyView2 = FancyShowCaseView.Builder(this)
52-
.focusOn(btn_focus2)
53+
.focusOn(binding.btnFocus2)
5354
.customView(R.layout.layout_animated_view, object : OnViewInflateListener {
5455
override fun onViewInflated(view: View) {
5556
setAnimatedContent(view, fancyView2)
5657
}
5758
})
5859
.build()
5960

60-
btn_focus.setOnClickListener {
61+
binding.btnFocus.setOnClickListener {
6162
queue = FancyShowCaseQueue().apply {
6263
add(fancyView)
6364
add(fancyView2)

app/src/main/java/me/toptas/fancyshowcasesample/CustomQueueActivity.kt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,15 @@ import android.os.Bundle
2020
import android.util.Log
2121
import android.view.View
2222

23-
import kotlinx.android.synthetic.main.activity_queue.*
2423
import me.toptas.fancyshowcase.FancyShowCaseQueue
2524
import me.toptas.fancyshowcase.FancyShowCaseView
2625
import me.toptas.fancyshowcase.listener.DismissListener
2726
import me.toptas.fancyshowcase.listener.OnViewInflateListener
27+
import me.toptas.fancyshowcasesample.databinding.ActivityQueueBinding
2828

2929
class CustomQueueActivity : BaseActivity() {
3030

31+
private lateinit var binding: ActivityQueueBinding
3132
private lateinit var queue: FancyShowCaseQueue
3233

3334
private var mClickListener: View.OnClickListener = View.OnClickListener {
@@ -48,11 +49,12 @@ class CustomQueueActivity : BaseActivity() {
4849

4950
override fun onCreate(savedInstanceState: Bundle?) {
5051
super.onCreate(savedInstanceState)
51-
setContentView(R.layout.activity_queue)
52+
binding = ActivityQueueBinding.inflate(layoutInflater)
53+
setContentView(binding.root)
5254

5355
val fancyShowCaseView1 = FancyShowCaseView.Builder(this)
5456
.title("First Queue Item")
55-
.focusOn(btn_queue_1)
57+
.focusOn(binding.btnQueue1)
5658
.customView(R.layout.layout_my_custom_view, object : OnViewInflateListener {
5759
override fun onViewInflated(view: View) {
5860
view.findViewById<View>(R.id.btn_action_1).setOnClickListener(mClickListener)
@@ -64,7 +66,7 @@ class CustomQueueActivity : BaseActivity() {
6466

6567
val fancyShowCaseView2 = FancyShowCaseView.Builder(this)
6668
.title("Second Queue Item")
67-
.focusOn(btn_queue_2)
69+
.focusOn(binding.btnQueue2)
6870
.customView(R.layout.layout_my_custom_view, object : OnViewInflateListener {
6971
override fun onViewInflated(view: View) {
7072
view.findViewById<View>(R.id.btn_action_1).setOnClickListener(mClickListener)
@@ -76,7 +78,7 @@ class CustomQueueActivity : BaseActivity() {
7678

7779
val fancyShowCaseView3 = FancyShowCaseView.Builder(this)
7880
.title("Third Queue Item")
79-
.focusOn(btn_queue_3!!)
81+
.focusOn(binding.btnQueue3)
8082
.customView(R.layout.layout_my_custom_view, object : OnViewInflateListener {
8183
override fun onViewInflated(view: View) {
8284
view.findViewById<View>(R.id.btn_action_1).setOnClickListener(mClickListener)

app/src/main/java/me/toptas/fancyshowcasesample/MainActivity.kt

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,15 @@ import android.widget.ImageView
3232
import android.widget.RelativeLayout
3333
import android.widget.Toast
3434
import androidx.core.content.res.ResourcesCompat
35-
import kotlinx.android.synthetic.main.activity_main.*
3635
import me.toptas.fancyshowcase.FancyShowCaseView
3736
import me.toptas.fancyshowcase.FocusShape
3837
import me.toptas.fancyshowcase.listener.DismissListener
3938
import me.toptas.fancyshowcase.listener.OnViewInflateListener
39+
import me.toptas.fancyshowcasesample.databinding.ActivityMainBinding
4040

4141
class MainActivity : BaseActivity() {
4242

43+
private lateinit var binding: ActivityMainBinding
4344
private var mFancyShowCaseView: FancyShowCaseView? = null
4445

4546
private var mClickListener: View.OnClickListener = View.OnClickListener {
@@ -49,17 +50,18 @@ class MainActivity : BaseActivity() {
4950

5051
override fun onCreate(savedInstanceState: Bundle?) {
5152
super.onCreate(savedInstanceState)
52-
setContentView(R.layout.activity_main)
53+
binding = ActivityMainBinding.inflate(layoutInflater)
54+
setContentView(binding.root)
5355

54-
btn_simple.setOnClickListener {
56+
binding.btnSimple.setOnClickListener {
5557
FancyShowCaseView.Builder(this)
5658
.title("No Focus")
5759
.build()
5860
.show()
5961
}
6062

6163
//Shows a FancyShowCaseView that focus on a vie
62-
btn_focus.setOnClickListener {
64+
binding.btnFocus.setOnClickListener {
6365
FancyShowCaseView.Builder(this)
6466
.focusOn(it)
6567
.title("Circle Focus on View")
@@ -69,7 +71,7 @@ class MainActivity : BaseActivity() {
6971

7072
// Set title with spanned
7173
val spanned: Spanned = Html.fromHtml("<font color='#ff0000'>Spanned</font>")
72-
btn_spanned.setOnClickListener {
74+
binding.btnSpanned.setOnClickListener {
7375
FancyShowCaseView.Builder(this)
7476
.focusOn(it)
7577
.title(spanned)
@@ -81,7 +83,7 @@ class MainActivity : BaseActivity() {
8183
}
8284

8385
// Set title size
84-
btn_title_size.setOnClickListener {
86+
binding.btnTitleSize.setOnClickListener {
8587
FancyShowCaseView.Builder(this)
8688
.focusOn(it)
8789
.title("Title size")
@@ -91,7 +93,7 @@ class MainActivity : BaseActivity() {
9193
}
9294

9395
// Set title typeface
94-
btn_title_typeface.setOnClickListener {
96+
binding.btnTitleTypeface.setOnClickListener {
9597
val typeface =
9698
ResourcesCompat.getFont(this, R.font.pacifico_regular)
9799
FancyShowCaseView.Builder(this)
@@ -103,7 +105,7 @@ class MainActivity : BaseActivity() {
103105
}
104106

105107
//Shows a FancyShowCaseView with rounded rect focus shape
106-
btn_rounded_rect.setOnClickListener {
108+
binding.btnRoundedRect.setOnClickListener {
107109
FancyShowCaseView.Builder(this)
108110
.focusOn(it)
109111
.focusShape(FocusShape.ROUNDED_RECTANGLE)
@@ -115,7 +117,7 @@ class MainActivity : BaseActivity() {
115117

116118

117119
//Shows a FancyShowCaseView that focus on a view
118-
btn_focus_dismiss_on_focus_area.setOnClickListener {
120+
binding.btnFocusDismissOnFocusArea.setOnClickListener {
119121
if (FancyShowCaseView.isVisible(this)) {
120122
Toast.makeText(this, "Clickable button", Toast.LENGTH_SHORT).show()
121123
FancyShowCaseView.hideCurrent(this)
@@ -130,7 +132,7 @@ class MainActivity : BaseActivity() {
130132
}
131133

132134
//Shows a FancyShowCaseView with rounded rect focus shape
133-
btn_rounded_rect_dismiss_on_focus_area.setOnClickListener {
135+
binding.btnRoundedRectDismissOnFocusArea.setOnClickListener {
134136
if (FancyShowCaseView.isVisible(this)) {
135137
Toast.makeText(this, "Clickable button", Toast.LENGTH_SHORT).show()
136138
FancyShowCaseView.hideCurrent(this)
@@ -148,7 +150,7 @@ class MainActivity : BaseActivity() {
148150
}
149151

150152
//Shows FancyShowCaseView with focusCircleRadiusFactor 1.5 and title gravity
151-
btn_focus2.setOnClickListener {
153+
binding.btnFocus2.setOnClickListener {
152154
FancyShowCaseView.Builder(this)
153155
.focusOn(it)
154156
.focusCircleRadiusFactor(1.5)
@@ -160,7 +162,7 @@ class MainActivity : BaseActivity() {
160162
}
161163

162164
//Shows FancyShowCaseView at specific position (round rectangle shape)
163-
btn_rect_position.setOnClickListener {
165+
binding.btnRectPosition.setOnClickListener {
164166
FancyShowCaseView.Builder(this)
165167
.title("Focus on larger view")
166168
.focusRectAtPosition(260, 85, 480, 80)
@@ -180,7 +182,7 @@ class MainActivity : BaseActivity() {
180182
}
181183

182184
//Shows a FancyShowCaseView that focuses on a larger view
183-
btn_focus_rect_color.setOnClickListener {
185+
binding.btnFocusRectColor.setOnClickListener {
184186
FancyShowCaseView.Builder(this)
185187
.focusOn(it)
186188
.title("Focus on larger view")
@@ -194,7 +196,7 @@ class MainActivity : BaseActivity() {
194196
}
195197

196198
//Shows a FancyShowCaseView that has dashed rectangle border
197-
btn_focus_dashed_rect.setOnClickListener {
199+
binding.btnFocusDashedRect.setOnClickListener {
198200
FancyShowCaseView.Builder(this)
199201
.focusOn(it)
200202
.title("Focus with dashed line")
@@ -209,7 +211,7 @@ class MainActivity : BaseActivity() {
209211
}
210212

211213
//Shows a FancyShowCaseView that has dashed circle border
212-
btn_focus_dashed_circle.setOnClickListener {
214+
binding.btnFocusDashedCircle.setOnClickListener {
213215
FancyShowCaseView.Builder(this)
214216
.focusOn(it)
215217
.title("Focus with dashed line")
@@ -224,7 +226,7 @@ class MainActivity : BaseActivity() {
224226
}
225227

226228
//Shows a FancyShowCaseView with background color and title style
227-
btn_background_color.setOnClickListener {
229+
binding.btnBackgroundColor.setOnClickListener {
228230
FancyShowCaseView.Builder(this)
229231
.focusOn(it)
230232
.backgroundColor(Color.parseColor("#AAff0000"))
@@ -235,7 +237,7 @@ class MainActivity : BaseActivity() {
235237
}
236238

237239
//Shows a FancyShowCaseView with border color
238-
btn_border_color.setOnClickListener {
240+
binding.btnBorderColor.setOnClickListener {
239241
FancyShowCaseView.Builder(this)
240242
.focusOn(it)
241243
.title("Focus border color can be changed")
@@ -247,7 +249,7 @@ class MainActivity : BaseActivity() {
247249
}
248250

249251
//Shows a FancyShowCaseView with custom enter, exit animations
250-
btn_anim.setOnClickListener {
252+
binding.btnAnim.setOnClickListener {
251253
val enterAnimation = AnimationUtils.loadAnimation(this, R.anim.slide_in_top)
252254
val exitAnimation = AnimationUtils.loadAnimation(this, R.anim.slide_out_bottom)
253255

@@ -274,7 +276,7 @@ class MainActivity : BaseActivity() {
274276
}
275277

276278
//Shows a FancyShowCaseView view custom view inflation
277-
btn_custom_view.setOnClickListener {
279+
binding.btnCustomView.setOnClickListener {
278280
mFancyShowCaseView = FancyShowCaseView.Builder(this)
279281
.focusOn(it)
280282
.enableTouchOnFocusedView(true)
@@ -298,11 +300,11 @@ class MainActivity : BaseActivity() {
298300

299301
}
300302

301-
btn_custom_view2.setOnClickListener {
303+
binding.btnCustomView2.setOnClickListener {
302304
startActivity(Intent(this, AnimatedActivity::class.java))
303305
}
304306

305-
btn_no_anim.setOnClickListener {
307+
binding.btnNoAnim.setOnClickListener {
306308
mFancyShowCaseView = FancyShowCaseView.Builder(this)
307309
.focusOn(it)
308310
.disableFocusAnimation()
@@ -311,31 +313,31 @@ class MainActivity : BaseActivity() {
311313

312314
}
313315

314-
btn_queue.setOnClickListener {
316+
binding.btnQueue.setOnClickListener {
315317
startActivity(Intent(this, QueueActivity::class.java))
316318
}
317319

318-
btn_custom_queue.setOnClickListener {
320+
binding.btnCustomQueue.setOnClickListener {
319321
startActivity(Intent(this, CustomQueueActivity::class.java))
320322
}
321323

322-
btn_another_activity.setOnClickListener {
324+
binding.btnAnotherActivity.setOnClickListener {
323325
startActivity(Intent(this, SecondActivity::class.java))
324326
}
325327

326-
btn_recycler_view.setOnClickListener {
328+
binding.btnRecyclerView.setOnClickListener {
327329
startActivity(Intent(this, RecyclerViewActivity::class.java))
328330
}
329331

330-
btn_scaled_view.setOnClickListener {
332+
binding.btnScaledView.setOnClickListener {
331333
FancyShowCaseView.Builder(this)
332334
.focusOn(it)
333335
.title("Focus on Scaled View")
334336
.build()
335337
.show()
336338
}
337339

338-
btn_focus_delay.setOnClickListener {
340+
binding.btnFocusDelay.setOnClickListener {
339341
FancyShowCaseView.Builder(this)
340342
.title("Focus with delay")
341343
.focusOn(it)
@@ -344,7 +346,7 @@ class MainActivity : BaseActivity() {
344346
.show()
345347
}
346348

347-
btn_show_once.setOnClickListener {
349+
binding.btnShowOnce.setOnClickListener {
348350
FancyShowCaseView.Builder(this)
349351
.focusOn(it)
350352
.title("Clean storage to see this again")

0 commit comments

Comments
 (0)