Преглед на файлове

updated many dependencies

yattoz преди 2 години
родител
ревизия
63d18856f1
променени са 7 файла, в които са добавени 52 реда и са изтрити 36 реда
  1. 1 0
      .idea/gradle.xml
  2. 5 0
      .idea/jarRepositories.xml
  3. 1 1
      .idea/misc.xml
  4. 18 11
      app/build.gradle
  5. 9 7
      app/src/main/AndroidManifest.xml
  6. 15 15
      app/src/main/java/fr/forum_thalie/tsumugi/preferences/AlarmFragment.kt
  7. 3 2
      build.gradle

+ 1 - 0
.idea/gradle.xml Целия файл

@@ -7,6 +7,7 @@
7 7
         <option name="testRunner" value="GRADLE" />
8 8
         <option name="distributionType" value="DEFAULT_WRAPPED" />
9 9
         <option name="externalProjectPath" value="$PROJECT_DIR$" />
10
+        <option name="gradleJvm" value="Android Studio default JDK" />
10 11
         <option name="modules">
11 12
           <set>
12 13
             <option value="$PROJECT_DIR$" />

+ 5 - 0
.idea/jarRepositories.xml Целия файл

@@ -26,5 +26,10 @@
26 26
       <option name="name" value="Google" />
27 27
       <option name="url" value="https://dl.google.com/dl/android/maven2/" />
28 28
     </remote-repository>
29
+    <remote-repository>
30
+      <option name="id" value="MavenRepo" />
31
+      <option name="name" value="MavenRepo" />
32
+      <option name="url" value="https://repo.maven.apache.org/maven2/" />
33
+    </remote-repository>
29 34
   </component>
30 35
 </project>

+ 1 - 1
.idea/misc.xml Целия файл

@@ -1,6 +1,6 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 2
 <project version="4">
3
-  <component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="11" project-jdk-type="JavaSDK">
3
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_11" project-jdk-name="1.8" project-jdk-type="JavaSDK">
4 4
     <output url="file://$PROJECT_DIR$/build/classes" />
5 5
   </component>
6 6
   <component name="ProjectType">

+ 18 - 11
app/build.gradle Целия файл

@@ -16,20 +16,21 @@ configurations.all {
16 16
 }
17 17
 
18 18
 android {
19
-    compileSdkVersion 30
19
+    compileSdkVersion 32
20 20
     compileOptions {
21
-        sourceCompatibility JavaVersion.VERSION_1_8
22
-        targetCompatibility JavaVersion.VERSION_1_8
21
+        sourceCompatibility JavaVersion.VERSION_11
22
+        targetCompatibility JavaVersion.VERSION_11
23 23
     }
24 24
     kotlinOptions {
25
-        jvmTarget = "1.8"
25
+        jvmTarget = "11"
26 26
     }
27 27
     defaultConfig {
28 28
         applicationId "fr.forum_thalie.tsumugi"
29 29
         minSdkVersion 16
30
-        targetSdkVersion 30
31
-        versionCode 120
32
-        versionName "1.2.0"
30
+        targetSdkVersion 32
31
+        multiDexEnabled true
32
+        versionCode 121
33
+        versionName "1.2.1"
33 34
         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
34 35
         vectorDrawables.useSupportLibrary = true
35 36
     }
@@ -47,6 +48,9 @@ android {
47 48
 }
48 49
 
49 50
 dependencies {
51
+    def multidex_version = "2.0.1"
52
+    implementation "androidx.multidex:multidex:$multidex_version"
53
+
50 54
     implementation fileTree(dir: 'libs', include: ['*.jar'])
51 55
     /*
52 56
     implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
@@ -67,15 +71,18 @@ dependencies {
67 71
 
68 72
      */
69 73
 
70
-    implementation "androidx.media:media:1.1.0"
74
+    implementation "androidx.media:media:1.5.0"
75
+
76
+    //noinspection GradleDependency
71 77
     implementation 'com.google.android.exoplayer:exoplayer:2.11.3'
78
+
72 79
     //implementation project(':exoplayer-library') // uses local ExoPlayer clone, from dev-v2 branch (fixes ISO-8859-1 ICY metadata
73 80
 
74 81
     implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
75
-    implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0'
82
+    implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.1'
76 83
 
77
-    implementation 'androidx.recyclerview:recyclerview:1.1.0'
78
-    implementation 'androidx.preference:preference:1.1.0'
84
+    implementation 'androidx.recyclerview:recyclerview:1.2.1'
85
+    implementation 'androidx.preference:preference-ktx:1.2.0'
79 86
 
80 87
     // jsoup HTML parser library @ https://jsoup.org/
81 88
     // implementation 'org.jsoup:jsoup:1.12.1'

+ 9 - 7
app/src/main/AndroidManifest.xml Целия файл

@@ -10,7 +10,7 @@
10 10
     <uses-permission android:name="android.permission.BLUETOOTH" />
11 11
     <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
12 12
     <uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> <!-- needed for API 28 -->
13
-    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
13
+
14 14
     <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
15 15
     <uses-permission android:name="android.permission.SET_ALARM"/>
16 16
     <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
@@ -22,8 +22,8 @@
22 22
         android:label="@string/app_name"
23 23
         android:supportsRtl="true"
24 24
         android:theme="@style/AppTheme.Launcher"
25
-        tools:ignore="AllowBackup,GoogleAppIndexingWarning">
26
-
25
+        tools:ignore="AllowBackup,GoogleAppIndexingWarning"
26
+        android:name="androidx.multidex.MultiDexApplication">
27 27
         <service
28 28
             android:name=".RadioService"
29 29
             android:enabled="true"
@@ -35,7 +35,8 @@
35 35
 
36 36
         <receiver android:name=".BootBroadcastReceiver"
37 37
             android:directBootAware="true"
38
-            tools:targetApi="n">
38
+            tools:targetApi="n"
39
+            android:exported="true">
39 40
             <intent-filter>
40 41
                 <action android:name="android.intent.action.BOOT_COMPLETED" />
41 42
                 <action android:name="fr.forum_thalie.tsumugi.PLAY_OR_FALLBACK" />
@@ -47,9 +48,9 @@
47 48
         <activity
48 49
             android:name=".MainActivity"
49 50
             android:configChanges="orientation|screenSize"
50
-            android:label="@string/app_name"
51 51
             android:launchMode="singleTask"
52
-            android:screenOrientation="fullUser">
52
+            android:screenOrientation="fullUser"
53
+            android:exported="true">
53 54
             <intent-filter>
54 55
                 <action android:name="android.intent.action.MAIN" />
55 56
 
@@ -63,7 +64,8 @@
63 64
             android:parentActivityName=".MainActivity"
64 65
             android:screenOrientation="fullUser" />
65 66
 
66
-        <receiver android:name="androidx.media.session.MediaButtonReceiver">
67
+        <receiver android:name="androidx.media.session.MediaButtonReceiver"
68
+            android:exported="true">
67 69
             <intent-filter>
68 70
                 <action android:name="android.intent.action.MEDIA_BUTTON" />
69 71
             </intent-filter>

+ 15 - 15
app/src/main/java/fr/forum_thalie/tsumugi/preferences/AlarmFragment.kt Целия файл

@@ -47,7 +47,7 @@ class AlarmFragment : PreferenceFragmentCompat() {
47 47
 
48 48
         fun updateIsWakingUpSummary(preference: SwitchPreferenceCompat?, newValue: Boolean? = true,  forceTime: Int? = null, forceDays: Set<String>? = null)
49 49
         {
50
-            val dateLong = RadioAlarm.instance.findNextAlarmTime(context!!, forceTime, forceDays)
50
+            val dateLong = RadioAlarm.instance.findNextAlarmTime(requireContext(), forceTime, forceDays)
51 51
             val calendar = Calendar.getInstance()
52 52
             calendar.timeInMillis = dateLong
53 53
             if (newValue == true && calendar.timeInMillis > 0)
@@ -65,14 +65,14 @@ class AlarmFragment : PreferenceFragmentCompat() {
65 65
 
66 66
         val hourOfDayDefault = 7
67 67
         val minuteDefault = 0
68
-        if (!PreferenceManager.getDefaultSharedPreferences(context!!).contains("alarmTimeFromMidnight"))
68
+        if (!PreferenceManager.getDefaultSharedPreferences(requireContext()).contains("alarmTimeFromMidnight"))
69 69
         {
70
-            PreferenceManager.getDefaultSharedPreferences(context!!).edit {
70
+            PreferenceManager.getDefaultSharedPreferences(requireContext()).edit {
71 71
                 putInt("alarmTimeFromMidnight", (60*hourOfDayDefault+minuteDefault))
72 72
                 commit()
73 73
             }
74 74
         }
75
-        val time = PreferenceManager.getDefaultSharedPreferences(context!!).getInt("alarmTimeFromMidnight", (60*hourOfDayDefault+minuteDefault))
75
+        val time = PreferenceManager.getDefaultSharedPreferences(requireContext()).getInt("alarmTimeFromMidnight", (60*hourOfDayDefault+minuteDefault))
76 76
         val hourOfDay = time / 60
77 77
         val minute = time % 60
78 78
         timeSet?.summary = "${if (hourOfDay < 10) "0" else ""}$hourOfDay:${if (minute < 10) "0" else ""}$minute"
@@ -80,16 +80,16 @@ class AlarmFragment : PreferenceFragmentCompat() {
80 80
 
81 81
         timeSet?.setOnPreferenceClickListener {
82 82
             val timePickerOnTimeSetListener = TimePickerDialog.OnTimeSetListener { _, hourOfDay, minute ->
83
-                PreferenceManager.getDefaultSharedPreferences(context!!).edit {
83
+                PreferenceManager.getDefaultSharedPreferences(requireContext()).edit {
84 84
                     putInt("alarmTimeFromMidnight", (60*hourOfDay+minute))
85 85
                     commit()
86 86
                 }
87 87
                 timeSet.summary = "${if (hourOfDay < 10) "0" else ""}$hourOfDay:${if (minute < 10) "0" else ""}$minute"
88
-                RadioAlarm.instance.cancelAlarm(context!!)
89
-                RadioAlarm.instance.setNextAlarm(context!!, isForce = true, forceTime = hourOfDay*60+minute)
88
+                RadioAlarm.instance.cancelAlarm(requireContext())
89
+                RadioAlarm.instance.setNextAlarm(requireContext(), isForce = true, forceTime = hourOfDay*60+minute)
90 90
                 updateIsWakingUpSummary(isWakingUp, isWakingUp?.isChecked, forceTime = hourOfDay*60+minute)
91 91
             }
92
-            val timeNew = PreferenceManager.getDefaultSharedPreferences(context!!).getInt("alarmTimeFromMidnight", 7*60)
92
+            val timeNew = PreferenceManager.getDefaultSharedPreferences(requireContext()).getInt("alarmTimeFromMidnight", 7*60)
93 93
             val hourOfDayNew = timeNew / 60
94 94
             val minuteNew = timeNew % 60
95 95
             val timePicker = TimePickerDialog(context, timePickerOnTimeSetListener, hourOfDayNew, minuteNew, true)
@@ -103,8 +103,8 @@ class AlarmFragment : PreferenceFragmentCompat() {
103 103
             val fullWeek = weekdays.toSet()
104 104
             val workingWeek = weekdays.toSet().minusElement(weekdays.last()).minusElement(weekdays.elementAt(weekdays.size - 2))
105 105
             val listOfDays = when (newValue) {
106
-                fullWeek -> context!!.getString(R.string.every_day)
107
-                workingWeek -> context!!.getString(R.string.working_days)
106
+                fullWeek -> requireContext().getString(R.string.every_day)
107
+                workingWeek -> requireContext().getString(R.string.working_days)
108 108
                 else -> {
109 109
                     // build ORDERED LIST of days... I don't know why the original one is in shambles!!
110 110
                     val fullWeekOrdered = weekdays
@@ -119,12 +119,12 @@ class AlarmFragment : PreferenceFragmentCompat() {
119 119
             preference?.summary = listOfDays
120 120
         }
121 121
 
122
-        updateDays(alarmDays, PreferenceManager.getDefaultSharedPreferences(context).getStringSet("alarmDays", setOf()))
122
+        updateDays(alarmDays, PreferenceManager.getDefaultSharedPreferences(requireContext()).getStringSet("alarmDays", setOf()))
123 123
         alarmDays?.setOnPreferenceChangeListener { preference, newValue ->
124 124
             @Suppress("UNCHECKED_CAST")
125 125
             updateDays(preference as MultiSelectListPreference, newValue as Set<String>)
126
-            RadioAlarm.instance.cancelAlarm(context!!)
127
-            RadioAlarm.instance.setNextAlarm(context!!, isForce = true, forceDays = newValue)
126
+            RadioAlarm.instance.cancelAlarm(requireContext())
127
+            RadioAlarm.instance.setNextAlarm(requireContext(), isForce = true, forceDays = newValue)
128 128
             updateIsWakingUpSummary(isWakingUp, isWakingUp?.isChecked, forceDays = newValue)
129 129
             true
130 130
         }
@@ -133,9 +133,9 @@ class AlarmFragment : PreferenceFragmentCompat() {
133 133
 
134 134
         isWakingUp?.setOnPreferenceChangeListener { _, newValue ->
135 135
             if (newValue as Boolean)
136
-                RadioAlarm.instance.setNextAlarm(context!!, isForce = true)
136
+                RadioAlarm.instance.setNextAlarm(requireContext(), isForce = true)
137 137
             else
138
-                RadioAlarm.instance.cancelAlarm(context!!)
138
+                RadioAlarm.instance.cancelAlarm(requireContext())
139 139
             timeSet?.isEnabled = newValue
140 140
             alarmDays?.isEnabled = newValue
141 141
             snoozeDuration?.isEnabled = newValue

+ 3 - 2
build.gradle Целия файл

@@ -1,16 +1,17 @@
1 1
 // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 2
 
3 3
 buildscript {
4
-    ext.kotlin_version = '1.3.72'
4
+    ext.kotlin_version = '1.6.10'
5 5
     repositories {
6 6
         google()
7 7
         jcenter()
8 8
     }
9 9
     dependencies {
10
-        classpath 'com.android.tools.build:gradle:7.1.1'
10
+        classpath 'com.android.tools.build:gradle:7.1.2'
11 11
         classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
12 12
         // NOTE: Do not place your application dependencies here; they belong
13 13
         // in the individual module build.gradle files
14
+
14 15
     }
15 16
 }
16 17