From 138ae8c027f59c9f6e3c3cd601bac8afaf04e4ff Mon Sep 17 00:00:00 2001 From: MichaelFlisar Date: Fri, 1 Mar 2019 10:10:08 +0100 Subject: [PATCH] * android x migration * version updates * color fix --- app/build.gradle | 24 ++++++++----- .../gdprdialog/demo/DemoActivity.java | 3 +- .../gdprdialog/demo/MinimalDemoActivity.java | 2 +- .../gdprdialog/demo/SetupActivity.java | 10 +++--- app/src/main/res/layout/activity_setup.xml | 6 ++-- build.gradle | 13 +++---- gradle.properties | 2 ++ gradle/wrapper/gradle-wrapper.properties | 4 +-- library/build.gradle | 34 +++++++------------ .../com/michaelflisar/gdprdialog/GDPR.java | 4 +-- .../gdprdialog/GDPRActivity.java | 4 +-- .../michaelflisar/gdprdialog/GDPRDialog.java | 14 ++++---- .../gdprdialog/helper/GDPRUtils.java | 7 ++-- .../gdprdialog/helper/GDPRViewManager.java | 15 ++++---- .../helper/PreperationAsyncTask.java | 3 +- library/src/main/res/layout/gdpr_dialog.xml | 2 +- versions.gradle | 19 +++++++++++ 17 files changed, 89 insertions(+), 77 deletions(-) create mode 100644 versions.gradle diff --git a/app/build.gradle b/app/build.gradle index d289012..eb02c3c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,16 +1,13 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 27 - - dataBinding { - enabled = true - } + compileSdkVersion setup.compileSdk + dataBinding.enabled = setup.enableDataBinding defaultConfig { + minSdkVersion setup.minSdk + targetSdkVersion setup.targetSdk applicationId "com.michaelflisar.gdprdialog.demo" - minSdkVersion 16 - targetSdkVersion 27 versionCode 1 versionName "1.0" } @@ -29,8 +26,17 @@ android { } dependencies { - implementation 'com.android.support:appcompat-v7:27.1.1' - implementation 'com.android.support:design:27.1.1' + + // ------------------------ + // AndroidX + // ------------------------ + + implementation "androidx.appcompat:appcompat:${androidx.appcompat}" + implementation "com.google.android.material:material:${androidx.material}" + + // ------------------------ + // Library + // ------------------------ implementation project(':library') // implementation 'com.github.MFlisar:GDPRDialog:-SNAPSHOT' diff --git a/app/src/main/java/com/michaelflisar/gdprdialog/demo/DemoActivity.java b/app/src/main/java/com/michaelflisar/gdprdialog/demo/DemoActivity.java index 9909569..63ad0c7 100644 --- a/app/src/main/java/com/michaelflisar/gdprdialog/demo/DemoActivity.java +++ b/app/src/main/java/com/michaelflisar/gdprdialog/demo/DemoActivity.java @@ -2,7 +2,7 @@ import android.content.Intent; import android.os.Bundle; -import android.support.v7.app.AppCompatActivity; +import androidx.appcompat.app.AppCompatActivity; import android.view.View; import android.widget.TextView; import android.widget.Toast; @@ -11,7 +11,6 @@ import com.michaelflisar.gdprdialog.GDPRConsent; import com.michaelflisar.gdprdialog.GDPRConsentState; import com.michaelflisar.gdprdialog.GDPRDefinitions; -import com.michaelflisar.gdprdialog.GDPRLocation; import com.michaelflisar.gdprdialog.GDPRSetup; import com.michaelflisar.gdprdialog.demo.app.App; import com.michaelflisar.gdprdialog.demo.gdpr.DemoGDPRActivity; diff --git a/app/src/main/java/com/michaelflisar/gdprdialog/demo/MinimalDemoActivity.java b/app/src/main/java/com/michaelflisar/gdprdialog/demo/MinimalDemoActivity.java index 17a1c8e..4eeda0d 100644 --- a/app/src/main/java/com/michaelflisar/gdprdialog/demo/MinimalDemoActivity.java +++ b/app/src/main/java/com/michaelflisar/gdprdialog/demo/MinimalDemoActivity.java @@ -1,7 +1,7 @@ package com.michaelflisar.gdprdialog.demo; import android.os.Bundle; -import android.support.v7.app.AppCompatActivity; +import androidx.appcompat.app.AppCompatActivity; import android.view.View; import android.widget.Toast; diff --git a/app/src/main/java/com/michaelflisar/gdprdialog/demo/SetupActivity.java b/app/src/main/java/com/michaelflisar/gdprdialog/demo/SetupActivity.java index 1cfdbff..3bd7134 100644 --- a/app/src/main/java/com/michaelflisar/gdprdialog/demo/SetupActivity.java +++ b/app/src/main/java/com/michaelflisar/gdprdialog/demo/SetupActivity.java @@ -1,12 +1,12 @@ package com.michaelflisar.gdprdialog.demo; import android.content.Intent; -import android.databinding.DataBindingUtil; +import androidx.databinding.DataBindingUtil; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.design.widget.Snackbar; -import android.support.v4.view.PagerAdapter; -import android.support.v7.app.AppCompatActivity; +import androidx.annotation.NonNull; +import com.google.android.material.snackbar.Snackbar; +import androidx.viewpager.widget.PagerAdapter; +import androidx.appcompat.app.AppCompatActivity; import android.view.View; import android.view.ViewGroup; diff --git a/app/src/main/res/layout/activity_setup.xml b/app/src/main/res/layout/activity_setup.xml index 66e7654..77e5f32 100644 --- a/app/src/main/res/layout/activity_setup.xml +++ b/app/src/main/res/layout/activity_setup.xml @@ -11,14 +11,14 @@ android:orientation="vertical" tools:context=".DemoActivity"> - - - +