Skip to content

Commit 6f9dc02

Browse files
committedDec 18, 2018
Updating versions. Targetting SDK 28. Using kotlin 1.3 and AndroidX.
1 parent 208b908 commit 6f9dc02

16 files changed

+86
-79
lines changed
 

‎CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
# 1.0.1
4+
5+
* Update to latest versions of dependencies.
6+
37
# 1.0
48

59
* Parameters were wrong for the Java example.

‎app/build.gradle

+13-13
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ apply plugin: 'kotlin-android'
55
apply plugin: 'kotlin-android-extensions'
66

77
android {
8-
compileSdkVersion 27
8+
compileSdkVersion 28
99
defaultConfig {
1010
applicationId "dae.gdprtest"
1111
minSdkVersion 16
12-
targetSdkVersion 27
13-
versionCode 1
14-
versionName "1.0"
15-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
12+
targetSdkVersion 28
13+
versionCode 2
14+
versionName "1.0.1"
15+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1616
}
1717
buildTypes {
1818
release {
@@ -34,18 +34,18 @@ android {
3434

3535
dependencies {
3636
implementation fileTree(dir: 'libs', include: ['*.jar'])
37-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
38-
implementation 'com.android.support:appcompat-v7:27.1.1'
37+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
38+
implementation 'androidx.appcompat:appcompat:1.0.2'
3939
testImplementation 'junit:junit:4.12'
40-
androidTestImplementation 'com.android.support.test:runner:1.0.2'
41-
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
40+
androidTestImplementation 'androidx.test:runner:1.1.1'
41+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
4242

4343
// The GDPR library
4444
implementation project(":library")
4545

4646
// Required for the GDPR library
47-
implementation 'com.android.support:design:27.1.1'
48-
implementation "com.android.support:cardview-v7:27.1.1"
49-
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
50-
implementation "android.arch.lifecycle:extensions:1.1.1"
47+
implementation 'com.google.android.material:material:1.0.0'
48+
implementation 'androidx.cardview:cardview:1.0.0'
49+
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
50+
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
5151
}

‎app/src/androidTest/java/dae/gdprtest/ExampleInstrumentedTest.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package dae.gdprtest
22

3-
import android.support.test.InstrumentationRegistry
4-
import android.support.test.runner.AndroidJUnit4
3+
import androidx.test.InstrumentationRegistry
4+
import androidx.test.runner.AndroidJUnit4
55

66
import org.junit.Test
77
import org.junit.runner.RunWith

‎app/src/main/java/dae/gdprtest/MainActivity.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import android.app.PendingIntent
66
import android.content.Context
77
import android.content.Intent
88
import android.os.Bundle
9-
import android.support.v7.app.AppCompatActivity
9+
import androidx.appcompat.app.AppCompatActivity
1010
import android.util.Log
1111
import dae.gdprconsent.ConsentHelper
1212
import dae.gdprconsent.ConsentRequest

‎app/src/main/java/dae/gdprtest/MainJavaActivity.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
import android.content.Context;
77
import android.content.Intent;
88
import android.os.Bundle;
9-
import android.support.annotation.Nullable;
10-
import android.support.v7.app.AppCompatActivity;
9+
import androidx.annotation.Nullable;
10+
import androidx.appcompat.app.AppCompatActivity;
1111
import android.util.Log;
1212

1313
import java.util.ArrayList;

‎app/src/main/res/layout/activity_main.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:app="http://schemas.android.com/apk/res-auto"
44
xmlns:tools="http://schemas.android.com/tools"
55
android:layout_width="match_parent"
@@ -27,4 +27,4 @@
2727
android:layout_width="wrap_content"
2828
android:layout_height="wrap_content" />
2929

30-
</android.support.constraint.ConstraintLayout>
30+
</androidx.constraintlayout.widget.ConstraintLayout>

‎build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22

33
buildscript {
4-
ext.kotlin_version = '1.2.21'
4+
ext.kotlin_version = '1.3.11'
55

66
repositories {
77
google()
88
jcenter()
99
}
1010
dependencies {
11-
classpath 'com.android.tools.build:gradle:3.2.0-alpha15'
11+
classpath 'com.android.tools.build:gradle:3.4.0-alpha08'
1212
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1313

1414
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'

‎gradle.properties

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
# http://www.gradle.org/docs/current/userguide/build_environment.html
77
# Specifies the JVM arguments used for the daemon process.
88
# The setting is particularly useful for tweaking memory settings.
9+
android.enableJetifier=true
10+
android.useAndroidX=true
911
org.gradle.jvmargs=-Xmx1536m
1012
# When configured, Gradle will run in incubating parallel mode.
1113
# This option should only be used with decoupled projects. More details, visit
+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
#Tue Dec 18 15:20:49 CET 2018
12
distributionBase=GRADLE_USER_HOME
23
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1-milestone-1-all.zip

‎library/build.gradle

+12-12
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ apply plugin: 'com.github.dcendents.android-maven'
88
group='com.github.DavidEdwards'
99

1010
android {
11-
compileSdkVersion 27
11+
compileSdkVersion 28
1212
defaultConfig {
1313
minSdkVersion 14
14-
targetSdkVersion 27
14+
targetSdkVersion 28
1515
versionCode 15
1616
versionName "1.0"
17-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
17+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1818
}
1919
buildTypes {
2020
release {
@@ -36,20 +36,20 @@ dependencies {
3636

3737
// Support
3838
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
39-
implementation 'com.android.support:appcompat-v7:27.1.1'
40-
implementation 'com.android.support:design:27.1.1'
39+
implementation 'androidx.appcompat:appcompat:1.0.2'
40+
implementation 'com.google.android.material:material:1.0.0'
4141

4242
// Testing
4343
testImplementation 'junit:junit:4.12'
44-
androidTestImplementation 'com.android.support.test:runner:1.0.2'
45-
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
44+
androidTestImplementation 'androidx.test:runner:1.1.1'
45+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
4646

4747
// Android Lifecycle
48-
implementation "android.arch.lifecycle:common-java8:1.1.1"
49-
implementation "android.arch.lifecycle:extensions:1.1.1"
50-
kapt "android.arch.lifecycle:compiler:1.1.1"
48+
implementation 'androidx.lifecycle:lifecycle-common-java8:2.0.0'
49+
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
50+
kapt 'androidx.lifecycle:lifecycle-compiler:2.0.0'
5151

5252
// Android Additional Views
53-
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
54-
implementation "com.android.support:cardview-v7:27.1.1"
53+
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
54+
implementation 'androidx.cardview:cardview:1.0.0'
5555
}

‎library/src/androidTest/java/dae/gdprconsent/ExampleInstrumentedTest.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package dae.gdprconsent
22

3-
import android.support.test.InstrumentationRegistry
4-
import android.support.test.runner.AndroidJUnit4
3+
import androidx.test.InstrumentationRegistry
4+
import androidx.test.runner.AndroidJUnit4
55

66
import org.junit.Test
77
import org.junit.runner.RunWith

‎library/src/main/java/dae/gdprconsent/ConsentActivity.kt

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
package dae.gdprconsent
22

33
import android.app.Activity
4-
import android.arch.lifecycle.ViewModelProviders
4+
import androidx.lifecycle.ViewModelProviders
55
import android.content.Context
66
import android.content.Intent
77
import android.os.Bundle
8-
import android.support.design.widget.Snackbar
9-
import android.support.v4.app.Fragment
10-
import android.support.v4.app.FragmentManager
11-
import android.support.v4.app.FragmentPagerAdapter
12-
import android.support.v4.view.ViewPager
13-
import android.support.v7.app.AppCompatActivity
8+
import com.google.android.material.snackbar.Snackbar
9+
import androidx.fragment.app.Fragment
10+
import androidx.fragment.app.FragmentManager
11+
import androidx.fragment.app.FragmentPagerAdapter
12+
import androidx.viewpager.widget.ViewPager
13+
import androidx.appcompat.app.AppCompatActivity
1414
import android.util.Log
1515
import android.view.MenuItem
1616
import android.view.View
@@ -47,7 +47,7 @@ class ConsentActivity : AppCompatActivity() {
4747
next()
4848
}
4949

50-
container.addOnPageChangeListener(object : ViewPager.OnPageChangeListener {
50+
container.addOnPageChangeListener(object : androidx.viewpager.widget.ViewPager.OnPageChangeListener {
5151
override fun onPageScrollStateChanged(state: Int) {
5252
}
5353

@@ -215,24 +215,24 @@ class ConsentActivity : AppCompatActivity() {
215215
return super.onOptionsItemSelected(item)
216216
}
217217

218-
inner class ConsentPagerAdapter(fm: FragmentManager) : FragmentPagerAdapter(fm) {
218+
inner class ConsentPagerAdapter(fm: androidx.fragment.app.FragmentManager) : androidx.fragment.app.FragmentPagerAdapter(fm) {
219219

220220
private var firstRun = true
221-
private lateinit var mCurrentFragment: Fragment
221+
private lateinit var mCurrentFragment: androidx.fragment.app.Fragment
222222

223-
val currentFragment: Fragment
223+
val currentFragment: androidx.fragment.app.Fragment
224224
get() = mCurrentFragment
225225

226226
override fun setPrimaryItem(container: ViewGroup, position: Int, obj: Any) {
227227
if (firstRun || mCurrentFragment != obj) {
228228
firstRun = false
229-
mCurrentFragment = obj as Fragment
229+
mCurrentFragment = obj as androidx.fragment.app.Fragment
230230
}
231231

232232
super.setPrimaryItem(container, position, obj)
233233
}
234234

235-
override fun getItem(position: Int): Fragment {
235+
override fun getItem(position: Int): androidx.fragment.app.Fragment {
236236
return ConsentRequestDetailFragment.newInstance(viewModel.consentRequests[position])
237237
}
238238

‎library/src/main/java/dae/gdprconsent/ConsentRequestDetailFragment.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package dae.gdprconsent
22

3-
import android.arch.lifecycle.ViewModelProviders
3+
import androidx.lifecycle.ViewModelProviders
44
import android.content.ActivityNotFoundException
55
import android.content.Intent
66
import android.net.Uri
77
import android.os.Bundle
8-
import android.support.v4.app.Fragment
8+
import androidx.fragment.app.Fragment
99
import android.text.TextUtils
1010
import android.view.LayoutInflater
1111
import android.view.View
@@ -14,7 +14,7 @@ import dae.gdprconsent.databinding.FragmentGdprConsentBinding
1414
import java.net.MalformedURLException
1515
import java.net.URL
1616

17-
class ConsentRequestDetailFragment : Fragment() {
17+
class ConsentRequestDetailFragment : androidx.fragment.app.Fragment() {
1818

1919
lateinit var request: ConsentRequest
2020
lateinit var binding: FragmentGdprConsentBinding

‎library/src/main/java/dae/gdprconsent/ConsentViewModel.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package dae.gdprconsent
22

33
import android.app.Application
4-
import android.arch.lifecycle.AndroidViewModel
4+
import androidx.lifecycle.AndroidViewModel
55
import java.util.*
66

77
class ConsentViewModel(application: Application) : AndroidViewModel(application) {
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
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
xmlns:tools="http://schemas.android.com/tools"
55
android:id="@+id/coordinator"
@@ -9,14 +9,14 @@
99
android:fitsSystemWindows="true"
1010
tools:context=".ConsentActivity">
1111

12-
<android.support.design.widget.AppBarLayout
12+
<com.google.android.material.appbar.AppBarLayout
1313
android:id="@+id/appbar"
1414
android:layout_width="match_parent"
1515
android:layout_height="wrap_content"
1616
android:paddingTop="@dimen/appbar_padding_top"
1717
android:theme="@style/AppTheme.AppBarOverlay">
1818

19-
<android.support.v7.widget.Toolbar
19+
<androidx.appcompat.widget.Toolbar
2020
android:id="@+id/toolbar"
2121
android:layout_width="match_parent"
2222
android:layout_height="?attr/actionBarSize"
@@ -26,17 +26,17 @@
2626
app:popupTheme="@style/AppTheme.PopupOverlay"
2727
app:title="@string/gdpr_consent">
2828

29-
</android.support.v7.widget.Toolbar>
29+
</androidx.appcompat.widget.Toolbar>
3030

31-
</android.support.design.widget.AppBarLayout>
31+
</com.google.android.material.appbar.AppBarLayout>
3232

33-
<android.support.v4.view.ViewPager
33+
<androidx.viewpager.widget.ViewPager
3434
android:id="@+id/container"
3535
android:layout_width="match_parent"
3636
android:layout_height="match_parent"
3737
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
3838

39-
<android.support.design.widget.FloatingActionButton
39+
<com.google.android.material.floatingactionbutton.FloatingActionButton
4040
android:id="@+id/next"
4141
android:layout_width="wrap_content"
4242
android:layout_height="wrap_content"
@@ -45,7 +45,7 @@
4545
app:fabSize="mini"
4646
app:srcCompat="@drawable/ic_chevron_right_white_48dp" />
4747

48-
<android.support.design.widget.FloatingActionButton
48+
<com.google.android.material.floatingactionbutton.FloatingActionButton
4949
android:id="@+id/previous"
5050
android:layout_width="wrap_content"
5151
android:layout_height="wrap_content"
@@ -54,4 +54,4 @@
5454
app:fabSize="mini"
5555
app:srcCompat="@drawable/ic_chevron_left_white_48dp" />
5656

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

‎library/src/main/res/layout/fragment_gdpr_consent.xml

+16-16
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<import type="android.view.View" />
1313
</data>
1414

15-
<android.support.constraint.ConstraintLayout
15+
<androidx.constraintlayout.widget.ConstraintLayout
1616
android:layout_width="match_parent"
1717
android:layout_height="match_parent"
1818
tools:context=".ConsentActivity"
@@ -69,7 +69,7 @@
6969
app:layout_constraintBottom_toBottomOf="parent"
7070
app:layout_constraintTop_toBottomOf="@+id/category">
7171

72-
<android.support.constraint.ConstraintLayout
72+
<androidx.constraintlayout.widget.ConstraintLayout
7373
android:layout_width="match_parent"
7474
android:layout_height="wrap_content"
7575
android:orientation="vertical"
@@ -87,7 +87,7 @@
8787
<!--android:text="@{request.isConsented ? @string/gdpr_withdraw_consent : @string/gdpr_give_consent, default=@string/gdpr_give_consent}"-->
8888
<!--android:textColor="@color/colorGdprPrimary" />-->
8989

90-
<android.support.v7.widget.CardView
90+
<androidx.cardview.widget.CardView
9191
android:layout_width="match_parent"
9292
android:layout_height="wrap_content"
9393
android:id="@+id/consentCard"
@@ -97,7 +97,7 @@
9797
app:cardBackgroundColor="@color/colorGdprPrimary"
9898
app:layout_constraintTop_toTopOf="parent">
9999

100-
<android.support.constraint.ConstraintLayout
100+
<androidx.constraintlayout.widget.ConstraintLayout
101101
android:layout_width="match_parent"
102102
android:padding="8dp"
103103
android:layout_height="match_parent"
@@ -130,7 +130,7 @@
130130
app:layout_constraintTop_toBottomOf="@+id/consentLabel" />
131131

132132

133-
<android.support.v7.widget.SwitchCompat
133+
<androidx.appcompat.widget.SwitchCompat
134134
android:id="@+id/consent"
135135
android:layout_width="wrap_content"
136136
android:layout_height="wrap_content"
@@ -153,10 +153,10 @@
153153
app:layout_constraintRight_toRightOf="parent"
154154
app:layout_constraintTop_toTopOf="@+id/consent"
155155
app:layout_constraintVertical_bias="0.5" />
156-
</android.support.constraint.ConstraintLayout>
157-
</android.support.v7.widget.CardView>
156+
</androidx.constraintlayout.widget.ConstraintLayout>
157+
</androidx.cardview.widget.CardView>
158158

159-
<android.support.v7.widget.CardView
159+
<androidx.cardview.widget.CardView
160160
android:id="@+id/whyNeededCard"
161161
android:layout_width="match_parent"
162162
android:layout_height="wrap_content"
@@ -186,9 +186,9 @@
186186
/>
187187
</LinearLayout>
188188

189-
</android.support.v7.widget.CardView>
189+
</androidx.cardview.widget.CardView>
190190

191-
<android.support.v7.widget.CardView
191+
<androidx.cardview.widget.CardView
192192
android:id="@+id/whatCard"
193193
android:layout_width="match_parent"
194194
android:layout_height="wrap_content"
@@ -219,9 +219,9 @@
219219
android:text="@{request.what, default=`What does consenting entail`}" />
220220
</LinearLayout>
221221

222-
</android.support.v7.widget.CardView>
222+
</androidx.cardview.widget.CardView>
223223

224-
<android.support.v7.widget.CardView
224+
<androidx.cardview.widget.CardView
225225
android:id="@+id/moreInformationCard"
226226
android:layout_width="match_parent"
227227
android:layout_height="wrap_content"
@@ -259,10 +259,10 @@
259259

260260
</LinearLayout>
261261

262-
</android.support.v7.widget.CardView>
262+
</androidx.cardview.widget.CardView>
263263

264264

265-
<android.support.design.widget.FloatingActionButton
265+
<com.google.android.material.floatingactionbutton.FloatingActionButton
266266
android:id="@+id/toTop"
267267
android:layout_width="wrap_content"
268268
android:layout_height="wrap_content"
@@ -275,7 +275,7 @@
275275
app:layout_constraintTop_toBottomOf="@+id/moreInformationCard"
276276
app:srcCompat="@drawable/ic_chevron_double_up_white_48dp" />
277277

278-
</android.support.constraint.ConstraintLayout>
278+
</androidx.constraintlayout.widget.ConstraintLayout>
279279
</ScrollView>
280280

281281

@@ -290,5 +290,5 @@
290290
<!--app:layout_constraintBottom_toBottomOf="parent"-->
291291
<!--app:layout_constraintLeft_toLeftOf="parent"-->
292292
<!--app:layout_constraintRight_toRightOf="parent" />-->
293-
</android.support.constraint.ConstraintLayout>
293+
</androidx.constraintlayout.widget.ConstraintLayout>
294294
</layout>

0 commit comments

Comments
 (0)
Please sign in to comment.