Skip to content

Commit 8fa9eb2

Browse files
committed
Migrate to AndroidX
1 parent cca41aa commit 8fa9eb2

File tree

9 files changed

+27
-27
lines changed

9 files changed

+27
-27
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ If you use the `customLayout` attribute, the layout is expected to have a `TextV
9999
License
100100
--------
101101

102-
Copyright 2018 Savvy Apps
102+
Copyright 2019 Savvy Apps
103103

104104
Licensed under the Apache License, Version 2.0 (the "License");
105105
you may not use this file except in compliance with the License.

app/build.gradle

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ android {
1414
versionCode 1
1515
versionName "1.0"
1616

17-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
17+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1818
}
1919

2020
buildTypes {
@@ -32,9 +32,10 @@ android {
3232
dependencies {
3333
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
3434

35-
implementation "com.android.support:appcompat-v7:$supportLibVersion"
36-
implementation "com.android.support:cardview-v7:$supportLibVersion"
37-
implementation "com.android.support:design:$supportLibVersion"
35+
implementation 'androidx.appcompat:appcompat:1.0.2'
36+
implementation 'androidx.cardview:cardview:1.0.0'
37+
38+
implementation 'com.google.android.material:material:1.0.0'
3839

3940
implementation project(':togglebuttonlayout')
4041
}

app/src/main/java/com/savvyapps/togglebuttonlayout/sample/ToggleButtonLayoutActivity.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ package com.savvyapps.togglebuttonlayout.sample
22

33
import android.graphics.Color
44
import android.os.Bundle
5-
import android.support.design.widget.Snackbar
6-
import android.support.v4.content.ContextCompat
7-
import android.support.v7.app.AppCompatActivity
5+
import com.google.android.material.snackbar.Snackbar
6+
import androidx.core.content.ContextCompat
7+
import androidx.appcompat.app.AppCompatActivity
88
import kotlinx.android.synthetic.main.activity_toggle_button.*
99

1010
class ToggleButtonLayoutActivity : AppCompatActivity() {

app/src/main/res/layout/activity_toggle_button.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:app="http://schemas.android.com/apk/res-auto"
44
android:id="@+id/root"
55
android:layout_width="match_parent"
66
android:layout_height="match_parent"
77
android:fitsSystemWindows="true">
88

9-
<android.support.design.widget.AppBarLayout
9+
<com.google.android.material.appbar.AppBarLayout
1010
android:id="@+id/appbar"
1111
android:layout_width="match_parent"
1212
android:layout_height="wrap_content">
1313

14-
<android.support.v7.widget.Toolbar
14+
<androidx.appcompat.widget.Toolbar
1515
android:id="@+id/toolbar"
1616
style="@style/Toolbar"
1717
android:layout_width="match_parent"
1818
android:layout_height="?attr/actionBarSize" />
1919

20-
</android.support.design.widget.AppBarLayout>
20+
</com.google.android.material.appbar.AppBarLayout>
2121

22-
<android.support.v4.widget.NestedScrollView
22+
<androidx.core.widget.NestedScrollView
2323
android:layout_width="match_parent"
2424
android:layout_height="match_parent"
2525
app:layout_behavior="@string/appbar_scrolling_view_behavior">
@@ -81,6 +81,6 @@
8181

8282
</LinearLayout>
8383

84-
</android.support.v4.widget.NestedScrollView>
84+
</androidx.core.widget.NestedScrollView>
8585

86-
</android.support.design.widget.CoordinatorLayout>
86+
</androidx.coordinatorlayout.widget.CoordinatorLayout>

build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ task clean(type: Delete) {
2323
}
2424

2525
ext {
26-
compileSdkVersion = 27
26+
compileSdkVersion = 28
2727
targetSdkVersion = compileSdkVersion
28-
supportLibVersion = '27.1.1'
2928
}

togglebuttonlayout/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ android {
1111
versionCode 1
1212
versionName "1.0"
1313

14-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
14+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1515

1616
}
1717
buildTypes {
@@ -28,8 +28,8 @@ android {
2828
dependencies {
2929
api "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
3030

31-
api "com.android.support:appcompat-v7:$supportLibVersion"
32-
api "com.android.support:cardview-v7:$supportLibVersion"
31+
api 'androidx.appcompat:appcompat:1.0.2'
32+
api 'androidx.cardview:cardview:1.0.0'
3333
}
3434

3535
apply from: 'https://raw.githubusercontent.com/Commit451/gradle-android-javadocs/1.0.0/gradle-android-javadocs.gradle'

togglebuttonlayout/src/main/java/com/savvyapps/togglebuttonlayout/ToggleButtonLayout.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import android.annotation.SuppressLint
44
import android.content.Context
55
import android.graphics.Color
66
import android.graphics.drawable.ColorDrawable
7-
import android.support.annotation.ColorInt
8-
import android.support.annotation.LayoutRes
9-
import android.support.annotation.MenuRes
10-
import android.support.v7.view.menu.MenuBuilder
11-
import android.support.v7.widget.CardView
7+
import androidx.annotation.ColorInt
8+
import androidx.annotation.LayoutRes
9+
import androidx.annotation.MenuRes
10+
import androidx.appcompat.view.menu.MenuBuilder
11+
import androidx.cardview.widget.CardView
1212
import android.util.AttributeSet
1313
import android.view.MenuInflater
1414
import android.view.View

togglebuttonlayout/src/main/java/com/savvyapps/togglebuttonlayout/ToggleView.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package com.savvyapps.togglebuttonlayout
22

33
import android.annotation.SuppressLint
44
import android.content.Context
5-
import android.support.annotation.LayoutRes
5+
import androidx.annotation.LayoutRes
66
import android.view.View
77
import android.widget.FrameLayout
88
import android.widget.ImageView

togglebuttonlayout/src/main/java/com/savvyapps/togglebuttonlayout/Utils.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package com.savvyapps.togglebuttonlayout
33
import android.content.Context
44
import android.graphics.Color
55
import android.graphics.drawable.Drawable
6-
import android.support.annotation.AttrRes
6+
import androidx.annotation.AttrRes
77
import android.util.DisplayMetrics
88

99
internal object Utils {

0 commit comments

Comments
 (0)