File tree Expand file tree Collapse file tree 7 files changed +12
-149
lines changed
Expand file tree Collapse file tree 7 files changed +12
-149
lines changed Original file line number Diff line number Diff line change @@ -52,11 +52,11 @@ fun buildInfo(): String {
5252 timeZone = TimeZone .getTimeZone(" UTC" )
5353 }.format(Date (System .currentTimeMillis()))
5454 writer.append(" Builder: ${gitUserOrCIName} \\ n" )
55- writer.append(" Build Time: ${ time} UTC\\ n" )
55+ writer.append(" Build Time: $time UTC\\ n" )
5656 writer.append(" Build Version Name: ${gitVersionName} \\ n" )
5757 writer.append(" Git Hash: ${gitHashShort} \\ n" )
5858 writer.append(" Git Branch: ${gitWorkingOrCIBranch} \\ n" )
59- writer.append(" Git Repo: ${ gitRemoteUrl} " )
59+ writer.append(" Git Repo: $gitRemoteUrl " )
6060 val info = writer.toString()
6161 println (info)
6262 return info
@@ -69,7 +69,7 @@ android {
6969 defaultConfig {
7070 applicationId = " com.osfans.trime"
7171 minSdk = 21
72- targetSdk = 29
72+ targetSdk = 33
7373 versionCode = 20230301
7474 versionName = " 3.2.11"
7575
Original file line number Diff line number Diff line change 2626 <uses-permission android : name =" android.permission.VIBRATE" />
2727 <uses-permission android : name =" android.permission.READ_EXTERNAL_STORAGE" />
2828 <uses-permission android : name =" android.permission.WRITE_EXTERNAL_STORAGE" />
29+ <uses-permission android : name =" android.permission.MANAGE_EXTERNAL_STORAGE" />
2930 <uses-permission android : name =" android.permission.RECORD_AUDIO" />
3031
3132 <application
Original file line number Diff line number Diff line change @@ -7,11 +7,10 @@ import android.util.AttributeSet
77import android.view.LayoutInflater
88import androidx.activity.result.ActivityResultLauncher
99import androidx.appcompat.app.AlertDialog
10- import androidx.core.net.toUri
1110import androidx.preference.Preference
11+ import com.blankj.utilcode.util.UriUtils
1212import com.osfans.trime.R
1313import com.osfans.trime.databinding.FolderPickerDialogBinding
14- import com.osfans.trime.util.UriUtils.toUri
1514import java.io.File
1615
1716class FolderPickerPreference : Preference {
@@ -53,7 +52,7 @@ class FolderPickerPreference : Preference {
5352 dialogView = FolderPickerDialogBinding .inflate(LayoutInflater .from(context))
5453 dialogView.editText.setText(initValue)
5554 dialogView.button.setOnClickListener {
56- documentTreeLauncher.launch(File (initValue).toUri( ))
55+ documentTreeLauncher.launch(UriUtils .file2Uri( File (initValue)))
5756 }
5857 AlertDialog .Builder (context)
5958 .setTitle(this @FolderPickerPreference.title)
Original file line number Diff line number Diff line change @@ -11,14 +11,14 @@ import androidx.preference.SwitchPreferenceCompat
1111import androidx.preference.get
1212import com.blankj.utilcode.util.ResourceUtils
1313import com.blankj.utilcode.util.ToastUtils
14+ import com.blankj.utilcode.util.UriUtils
1415import com.osfans.trime.R
1516import com.osfans.trime.core.Rime
1617import com.osfans.trime.data.AppPrefs
1718import com.osfans.trime.data.DataManager
1819import com.osfans.trime.ui.components.FolderPickerPreference
1920import com.osfans.trime.ui.components.PaddingPreferenceFragment
2021import com.osfans.trime.ui.main.MainViewModel
21- import com.osfans.trime.util.UriUtils.toFile
2222import com.osfans.trime.util.appContext
2323import com.osfans.trime.util.formatDateTime
2424import com.osfans.trime.util.withLoadingDialog
@@ -37,8 +37,7 @@ class ProfileFragment : PaddingPreferenceFragment() {
3737 it,
3838 DocumentsContract .getTreeDocumentId(it)
3939 )
40- val file = uri.toFile()
41- dialogView.editText.setText(file?.toURI()?.normalize()?.path)
40+ dialogView.editText.setText(UriUtils .uri2File(uri).absolutePath)
4241 }
4342 }
4443
Original file line number Diff line number Diff line change @@ -142,16 +142,16 @@ class PrefMainActivity : AppCompatActivity() {
142142
143143 private fun requestExternalStoragePermission () {
144144 XXPermissions .with (this )
145- .permission(Permission .Group . STORAGE )
145+ .permission(Permission .MANAGE_EXTERNAL_STORAGE )
146146 .request(object : OnPermissionCallback {
147- override fun onGranted (permissions : MutableList <String >? , all : Boolean ) {
147+ override fun onGranted (permissions : List <String >, all : Boolean ) {
148148 if (all) {
149149 ToastUtils .showShort(R .string.external_storage_permission_granted)
150150 SoundThemeManager .init ()
151151 }
152152 }
153153
154- override fun onDenied (permissions : MutableList <String >? , never : Boolean ) {
154+ override fun onDenied (permissions : List <String >, never : Boolean ) {
155155 if (never) {
156156 ToastUtils .showShort(R .string.external_storage_permission_denied)
157157 XXPermissions .startPermissionActivity(
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 99plugins {
1010 id(" com.android.application" ) version " 7.4.0" apply false
1111 id(" com.android.library" ) version " 7.4.0" apply false
12- kotlin(" android" ) version " ${ Extra .kotlinVersion} " apply false
12+ kotlin(" android" ) version Extra .kotlinVersion apply false
1313 id(" com.diffplug.spotless" ) version " 6.3.0"
1414}
1515
You can’t perform that action at this time.
0 commit comments