Skip to content

Commit

Permalink
chore: target sdk 33, remove jcenter repo & `kotlin-android-extension…
Browse files Browse the repository at this point in the history
…s` plugin
  • Loading branch information
hyuwah committed Jul 19, 2023
1 parent f54dc97 commit b497e94
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 29 deletions.
8 changes: 3 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ buildscript {
ext.kotlin_version = '1.4.21'
repositories {
google()
jcenter()

mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.2'
classpath 'com.android.tools.build:gradle:4.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -18,8 +17,7 @@ buildscript {
allprojects {
repositories {
google()
jcenter()

mavenCentral()
}
}

Expand Down
5 changes: 2 additions & 3 deletions draggableviewlib/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion 29
compileSdkVersion 33

defaultConfig {
minSdkVersion 19
targetSdkVersion 29
targetSdkVersion 33
versionCode 1
versionName "1.0"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class DraggableView<T : View> private constructor(
.setInterpolator(AccelerateInterpolator())
.setDuration(durationMs.toLong())
.setListener(object : AnimatorListenerAdapter() {
override fun onAnimationEnd(animation: Animator?) {
override fun onAnimationEnd(animation: Animator) {
super.onAnimationEnd(animation)
visibility = View.GONE
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ internal fun View.setupDraggable(
)
val gestureDetector =
GestureDetectorCompat(this.context, object : GestureDetector.SimpleOnGestureListener() {
override fun onLongPress(e: MotionEvent?) {
override fun onLongPress(e: MotionEvent) {
if (viewState.isMoving) return
viewState.isLongPressRegistered = true
draggableListener?.onLongPress(this@setupDraggable)
Expand Down Expand Up @@ -111,7 +111,7 @@ internal fun View.setupDraggable(
// minimizeBtnListener.onPositionChanged(v, StickyRestSide.RIGHT)
}
.setListener(object : AnimatorListenerAdapter() {
override fun onAnimationEnd(animation: Animator?) {
override fun onAnimationEnd(animation: Animator) {
super.onAnimationEnd(animation)
Log.d("drg", "Animate END Sticky X RIGHT")
}
Expand Down
7 changes: 3 additions & 4 deletions example/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
buildFeatures {
viewBinding = true
}
compileSdkVersion 29
compileSdkVersion 33
defaultConfig {
applicationId "io.github.hyuwah.draggableview"
minSdkVersion 19
targetSdkVersion 29
targetSdkVersion 33
versionCode 1
versionName "1.0"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
Expand Down Expand Up @@ -41,7 +40,7 @@ dependencies {
implementation "androidx.fragment:fragment-ktx:1.2.5"
implementation "androidx.activity:activity-ktx:1.1.0"

implementation "io.coil-kt:coil:1.0.0"
implementation "io.coil-kt:coil:1.4.0"

testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
Expand Down
26 changes: 14 additions & 12 deletions example/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,25 @@
android:theme="@style/AppTheme">

<service
android:name=".overlay.OverlayService"
android:enabled="true"
android:exported="false" />
android:name=".overlay.OverlayService"
android:enabled="true"
android:exported="false" />

<activity
android:name=".ScrollingActivity"
android:parentActivityName=".MainActivity" />
android:name=".ScrollingActivity"
android:parentActivityName=".MainActivity" />
<activity
android:name=".BasicExampleActivity"
android:parentActivityName=".MainActivity" />
android:name=".BasicExampleActivity"
android:parentActivityName=".MainActivity" />
<activity
android:name=".OverlayDraggableActivity"
android:parentActivityName=".MainActivity" />
android:name=".OverlayDraggableActivity"
android:parentActivityName=".MainActivity" />
<activity
android:name=".JavaMainActivity"
android:parentActivityName=".MainActivity" />
<activity android:name=".MainActivity">
android:name=".JavaMainActivity"
android:parentActivityName=".MainActivity" />
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,21 @@ import android.os.Build
import android.os.Bundle
import android.provider.Settings
import androidx.appcompat.app.AppCompatActivity
import io.github.hyuwah.draggableview.databinding.ActivityDraggableOverlayBinding
import io.github.hyuwah.draggableview.overlay.OverlayService
import kotlinx.android.synthetic.main.activity_draggable_overlay.*
import io.github.hyuwah.draggableview.utils.viewBinding

class OverlayDraggableActivity : AppCompatActivity() {

private val binding by viewBinding(ActivityDraggableOverlayBinding::inflate)

private var isOverlayOn = false

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
title = "Overlay Draggable Activity"
setContentView(R.layout.activity_draggable_overlay)
btn_show_overlay.setOnClickListener {
binding.btnShowOverlay.setOnClickListener {
toggleOverlay()
}
}
Expand Down

0 comments on commit b497e94

Please sign in to comment.