Browse Source

updated many dependencies

yattoz 2 years ago
parent
commit
63d18856f1

+ 1 - 0
.idea/gradle.xml View File

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

+ 5 - 0
.idea/jarRepositories.xml View File

26
       <option name="name" value="Google" />
26
       <option name="name" value="Google" />
27
       <option name="url" value="https://dl.google.com/dl/android/maven2/" />
27
       <option name="url" value="https://dl.google.com/dl/android/maven2/" />
28
     </remote-repository>
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
   </component>
34
   </component>
30
 </project>
35
 </project>

+ 1 - 1
.idea/misc.xml View File

1
 <?xml version="1.0" encoding="UTF-8"?>
1
 <?xml version="1.0" encoding="UTF-8"?>
2
 <project version="4">
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
     <output url="file://$PROJECT_DIR$/build/classes" />
4
     <output url="file://$PROJECT_DIR$/build/classes" />
5
   </component>
5
   </component>
6
   <component name="ProjectType">
6
   <component name="ProjectType">

+ 18 - 11
app/build.gradle View File

16
 }
16
 }
17
 
17
 
18
 android {
18
 android {
19
-    compileSdkVersion 30
19
+    compileSdkVersion 32
20
     compileOptions {
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
     kotlinOptions {
24
     kotlinOptions {
25
-        jvmTarget = "1.8"
25
+        jvmTarget = "11"
26
     }
26
     }
27
     defaultConfig {
27
     defaultConfig {
28
         applicationId "fr.forum_thalie.tsumugi"
28
         applicationId "fr.forum_thalie.tsumugi"
29
         minSdkVersion 16
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
         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
34
         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
34
         vectorDrawables.useSupportLibrary = true
35
         vectorDrawables.useSupportLibrary = true
35
     }
36
     }
47
 }
48
 }
48
 
49
 
49
 dependencies {
50
 dependencies {
51
+    def multidex_version = "2.0.1"
52
+    implementation "androidx.multidex:multidex:$multidex_version"
53
+
50
     implementation fileTree(dir: 'libs', include: ['*.jar'])
54
     implementation fileTree(dir: 'libs', include: ['*.jar'])
51
     /*
55
     /*
52
     implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
56
     implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
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
     implementation 'com.google.android.exoplayer:exoplayer:2.11.3'
77
     implementation 'com.google.android.exoplayer:exoplayer:2.11.3'
78
+
72
     //implementation project(':exoplayer-library') // uses local ExoPlayer clone, from dev-v2 branch (fixes ISO-8859-1 ICY metadata
79
     //implementation project(':exoplayer-library') // uses local ExoPlayer clone, from dev-v2 branch (fixes ISO-8859-1 ICY metadata
73
 
80
 
74
     implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
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
     // jsoup HTML parser library @ https://jsoup.org/
87
     // jsoup HTML parser library @ https://jsoup.org/
81
     // implementation 'org.jsoup:jsoup:1.12.1'
88
     // implementation 'org.jsoup:jsoup:1.12.1'

+ 9 - 7
app/src/main/AndroidManifest.xml View File

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

+ 15 - 15
app/src/main/java/fr/forum_thalie/tsumugi/preferences/AlarmFragment.kt View File

47
 
47
 
48
         fun updateIsWakingUpSummary(preference: SwitchPreferenceCompat?, newValue: Boolean? = true,  forceTime: Int? = null, forceDays: Set<String>? = null)
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
             val calendar = Calendar.getInstance()
51
             val calendar = Calendar.getInstance()
52
             calendar.timeInMillis = dateLong
52
             calendar.timeInMillis = dateLong
53
             if (newValue == true && calendar.timeInMillis > 0)
53
             if (newValue == true && calendar.timeInMillis > 0)
65
 
65
 
66
         val hourOfDayDefault = 7
66
         val hourOfDayDefault = 7
67
         val minuteDefault = 0
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
                 putInt("alarmTimeFromMidnight", (60*hourOfDayDefault+minuteDefault))
71
                 putInt("alarmTimeFromMidnight", (60*hourOfDayDefault+minuteDefault))
72
                 commit()
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
         val hourOfDay = time / 60
76
         val hourOfDay = time / 60
77
         val minute = time % 60
77
         val minute = time % 60
78
         timeSet?.summary = "${if (hourOfDay < 10) "0" else ""}$hourOfDay:${if (minute < 10) "0" else ""}$minute"
78
         timeSet?.summary = "${if (hourOfDay < 10) "0" else ""}$hourOfDay:${if (minute < 10) "0" else ""}$minute"
80
 
80
 
81
         timeSet?.setOnPreferenceClickListener {
81
         timeSet?.setOnPreferenceClickListener {
82
             val timePickerOnTimeSetListener = TimePickerDialog.OnTimeSetListener { _, hourOfDay, minute ->
82
             val timePickerOnTimeSetListener = TimePickerDialog.OnTimeSetListener { _, hourOfDay, minute ->
83
-                PreferenceManager.getDefaultSharedPreferences(context!!).edit {
83
+                PreferenceManager.getDefaultSharedPreferences(requireContext()).edit {
84
                     putInt("alarmTimeFromMidnight", (60*hourOfDay+minute))
84
                     putInt("alarmTimeFromMidnight", (60*hourOfDay+minute))
85
                     commit()
85
                     commit()
86
                 }
86
                 }
87
                 timeSet.summary = "${if (hourOfDay < 10) "0" else ""}$hourOfDay:${if (minute < 10) "0" else ""}$minute"
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
                 updateIsWakingUpSummary(isWakingUp, isWakingUp?.isChecked, forceTime = hourOfDay*60+minute)
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
             val hourOfDayNew = timeNew / 60
93
             val hourOfDayNew = timeNew / 60
94
             val minuteNew = timeNew % 60
94
             val minuteNew = timeNew % 60
95
             val timePicker = TimePickerDialog(context, timePickerOnTimeSetListener, hourOfDayNew, minuteNew, true)
95
             val timePicker = TimePickerDialog(context, timePickerOnTimeSetListener, hourOfDayNew, minuteNew, true)
103
             val fullWeek = weekdays.toSet()
103
             val fullWeek = weekdays.toSet()
104
             val workingWeek = weekdays.toSet().minusElement(weekdays.last()).minusElement(weekdays.elementAt(weekdays.size - 2))
104
             val workingWeek = weekdays.toSet().minusElement(weekdays.last()).minusElement(weekdays.elementAt(weekdays.size - 2))
105
             val listOfDays = when (newValue) {
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
                 else -> {
108
                 else -> {
109
                     // build ORDERED LIST of days... I don't know why the original one is in shambles!!
109
                     // build ORDERED LIST of days... I don't know why the original one is in shambles!!
110
                     val fullWeekOrdered = weekdays
110
                     val fullWeekOrdered = weekdays
119
             preference?.summary = listOfDays
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
         alarmDays?.setOnPreferenceChangeListener { preference, newValue ->
123
         alarmDays?.setOnPreferenceChangeListener { preference, newValue ->
124
             @Suppress("UNCHECKED_CAST")
124
             @Suppress("UNCHECKED_CAST")
125
             updateDays(preference as MultiSelectListPreference, newValue as Set<String>)
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
             updateIsWakingUpSummary(isWakingUp, isWakingUp?.isChecked, forceDays = newValue)
128
             updateIsWakingUpSummary(isWakingUp, isWakingUp?.isChecked, forceDays = newValue)
129
             true
129
             true
130
         }
130
         }
133
 
133
 
134
         isWakingUp?.setOnPreferenceChangeListener { _, newValue ->
134
         isWakingUp?.setOnPreferenceChangeListener { _, newValue ->
135
             if (newValue as Boolean)
135
             if (newValue as Boolean)
136
-                RadioAlarm.instance.setNextAlarm(context!!, isForce = true)
136
+                RadioAlarm.instance.setNextAlarm(requireContext(), isForce = true)
137
             else
137
             else
138
-                RadioAlarm.instance.cancelAlarm(context!!)
138
+                RadioAlarm.instance.cancelAlarm(requireContext())
139
             timeSet?.isEnabled = newValue
139
             timeSet?.isEnabled = newValue
140
             alarmDays?.isEnabled = newValue
140
             alarmDays?.isEnabled = newValue
141
             snoozeDuration?.isEnabled = newValue
141
             snoozeDuration?.isEnabled = newValue

+ 3 - 2
build.gradle View File

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