Android Studio refactor to API 28 and AndroidX

pull/256/head
Adam Niederer 3 years ago committed by Adam Niederer
parent 2d77670343
commit e1a78ddf36
  1. 8
      app/build.gradle
  2. 2
      app/src/main/java/com/jmstudios/redmoon/Changelog.kt
  3. 2
      app/src/main/java/com/jmstudios/redmoon/Intro.kt
  4. 2
      app/src/main/java/com/jmstudios/redmoon/MainActivity.kt
  5. 10
      app/src/main/java/com/jmstudios/redmoon/ScheduleFragment.kt
  6. 2
      app/src/main/java/com/jmstudios/redmoon/ThemedAppCompatActivity.kt
  7. 4
      app/src/main/java/com/jmstudios/redmoon/filter/Notification.kt
  8. 2
      app/src/main/java/com/jmstudios/redmoon/schedule/ScheduleReceiver.kt
  9. 6
      app/src/main/java/com/jmstudios/redmoon/util/Permission.kt
  10. 2
      app/src/main/java/com/jmstudios/redmoon/util/Util.kt
  11. 2
      app/src/main/res/layout/activity_main.xml
  12. 2
      app/src/main/res/layout/preference_profile_selector.xml
  13. 2
      app/src/main/res/layout/switch_bar.xml
  14. 2
      app/src/main/res/layout/switch_layout.xml
  15. 2
      build.gradle
  16. 4
      gradle.properties
  17. 4
      gradle/wrapper/gradle-wrapper.properties

@ -38,7 +38,7 @@ android {
defaultConfig {
applicationId "com.jmstudios.redmoon"
minSdkVersion 14
targetSdkVersion 25
targetSdkVersion 28
versionCode 37
versionName "3.4.0"
}
@ -78,9 +78,9 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "com.android.support:support-compat:$android_support_version"
implementation "com.android.support:appcompat-v7:$android_support_version"
implementation "com.android.support:design:$android_support_version"
implementation 'androidx.core:core:1.0.0'
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'com.luckycatlabs:SunriseSunsetCalculator:1.2'
implementation 'com.github.paolorotolo:appintro:4.1.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

@ -8,7 +8,7 @@ package com.jmstudios.redmoon
import android.app.Activity
import android.app.Dialog
import android.support.v7.app.AlertDialog
import androidx.appcompat.app.AlertDialog
import com.jmstudios.redmoon.model.Config

@ -5,7 +5,7 @@
package com.jmstudios.redmoon
import android.os.Bundle
import android.support.v4.app.Fragment
import androidx.fragment.app.Fragment
import com.github.paolorotolo.appintro.AppIntro2
import com.github.paolorotolo.appintro.AppIntroFragment

@ -28,7 +28,7 @@ import android.content.Intent
import android.os.Bundle
import android.view.Menu
import android.view.MenuItem
import android.support.v7.widget.SwitchCompat
import androidx.appcompat.widget.SwitchCompat
import com.jmstudios.redmoon.R
import com.jmstudios.redmoon.filter.Command

@ -8,12 +8,10 @@ package com.jmstudios.redmoon
import android.os.Bundle
import android.preference.PreferenceFragment
import android.preference.SwitchPreference
import android.support.design.widget.Snackbar
import com.google.android.material.snackbar.Snackbar
import android.view.ViewGroup
import android.widget.TextView
import com.jmstudios.redmoon.R
import com.jmstudios.redmoon.model.Config
import com.jmstudios.redmoon.schedule.*
import com.jmstudios.redmoon.util.*
@ -97,10 +95,8 @@ class ScheduleFragment : PreferenceFragment() {
if (Config.darkThemeFlag) {
val group = this.view as ViewGroup
group.setBackgroundColor(getColor(R.color.snackbar_color_dark_theme))
val snackbarTextId = android.support.design.R.id.snackbar_text
val textView = group.findViewById<TextView>(snackbarTextId)
textView.setTextColor(getColor(R.color.text_color_dark_theme))
group.findViewById<TextView>(R.id.snackbar_text)
.setTextColor(getColor(R.color.text_color_dark_theme))
}
}
mSnackbar?.show()

@ -7,7 +7,7 @@ package com.jmstudios.redmoon
import android.os.Bundle
import android.preference.PreferenceFragment
import android.support.v7.app.AppCompatActivity
import androidx.appcompat.app.AppCompatActivity
import android.view.MenuItem
import com.jmstudios.redmoon.R

@ -11,8 +11,8 @@ import android.app.NotificationManager
import android.app.PendingIntent
import android.content.Context
import android.content.Intent
import android.support.v4.app.NotificationCompat
import android.support.v4.content.ContextCompat
import androidx.core.app.NotificationCompat
import androidx.core.content.ContextCompat
import com.jmstudios.redmoon.R
import com.jmstudios.redmoon.MainActivity

@ -11,7 +11,7 @@ import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.net.Uri
import android.support.v4.app.AlarmManagerCompat
import androidx.core.app.AlarmManagerCompat
import com.jmstudios.redmoon.filter.Command
import com.jmstudios.redmoon.model.Config

@ -11,9 +11,9 @@ import android.content.Intent
import android.content.pm.PackageManager
import android.net.Uri
import android.provider.Settings
import android.support.v4.app.ActivityCompat
import android.support.v4.content.ContextCompat
import android.support.v7.app.AlertDialog
import androidx.core.app.ActivityCompat
import androidx.core.content.ContextCompat
import androidx.appcompat.app.AlertDialog
import com.jmstudios.redmoon.R

@ -27,7 +27,7 @@ package com.jmstudios.redmoon.util
import android.content.Intent
import android.preference.Preference
import android.preference.PreferenceFragment
import android.support.v4.content.ContextCompat
import androidx.core.content.ContextCompat
import com.jmstudios.redmoon.RedMoonApplication
import com.jmstudios.redmoon.model.Profile

@ -16,7 +16,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent" />
<android.support.design.widget.FloatingActionButton
<com.google.android.material.floatingactionbutton.FloatingActionButton
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toggle_fab"
android:layout_width="wrap_content"

@ -13,7 +13,7 @@
android:layout_height="wrap_content"
android:orientation="horizontal" >
<android.support.v7.widget.AppCompatSpinner
<androidx.appcompat.widget.AppCompatSpinner
android:id="@+id/profile_spinner"
android:layout_width="0dp"
android:layout_height="wrap_content"

@ -10,7 +10,7 @@
android:minHeight="?android:attr/actionBarSize"
android:gravity="center_vertical"
android:background="@color/switch_bar_background">
<android.support.v7.widget.AppCompatTextView
<androidx.appcompat.widget.AppCompatTextView
android:id="@android:id/title"
android:layout_height="wrap_content"
android:layout_width="0dp"

@ -3,7 +3,7 @@
* Copyright (c) 2016 Marien Raat <marienraat@riseup.net>
* SPDX-License-Identifier: GPL3.0+
-->
<android.support.v7.widget.SwitchCompat
<androidx.appcompat.widget.SwitchCompat
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/switch_for_action_bar"
android:layout_width="wrap_content"

@ -8,7 +8,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0'
classpath 'com.android.tools.build:gradle:3.4.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.github.ben-manes:gradle-versions-plugin:0.20.0'
classpath "org.ajoberstar.grgit:grgit-core:$grgit_version"

@ -15,4 +15,6 @@
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# org.gradle.parallel=true
android.enableJetifier=true
android.useAndroidX=true

@ -1,6 +1,6 @@
#Thu Jan 24 11:39:37 EST 2019
#Sat Aug 17 22:04:47 EDT 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip

Loading…
Cancel
Save