|
1 | 1 | package com.simplemobiletools.filemanager.pro.activities |
2 | 2 |
|
| 3 | +import android.annotation.SuppressLint |
| 4 | +import android.os.Environment |
3 | 5 | import com.simplemobiletools.commons.activities.BaseSimpleActivity |
| 6 | +import com.simplemobiletools.commons.extensions.hasPermission |
| 7 | +import com.simplemobiletools.commons.helpers.PERMISSION_WRITE_STORAGE |
| 8 | +import com.simplemobiletools.commons.helpers.isRPlus |
4 | 9 | import com.simplemobiletools.filemanager.pro.R |
5 | 10 |
|
6 | 11 | open class SimpleActivity : BaseSimpleActivity() { |
7 | 12 | override fun getAppIconIDs() = arrayListOf( |
8 | | - R.mipmap.ic_launcher_red, |
9 | | - R.mipmap.ic_launcher_pink, |
10 | | - R.mipmap.ic_launcher_purple, |
11 | | - R.mipmap.ic_launcher_deep_purple, |
12 | | - R.mipmap.ic_launcher_indigo, |
13 | | - R.mipmap.ic_launcher_blue, |
14 | | - R.mipmap.ic_launcher_light_blue, |
15 | | - R.mipmap.ic_launcher_cyan, |
16 | | - R.mipmap.ic_launcher_teal, |
17 | | - R.mipmap.ic_launcher_green, |
18 | | - R.mipmap.ic_launcher_light_green, |
19 | | - R.mipmap.ic_launcher_lime, |
20 | | - R.mipmap.ic_launcher_yellow, |
21 | | - R.mipmap.ic_launcher_amber, |
22 | | - R.mipmap.ic_launcher, |
23 | | - R.mipmap.ic_launcher_deep_orange, |
24 | | - R.mipmap.ic_launcher_brown, |
25 | | - R.mipmap.ic_launcher_blue_grey, |
26 | | - R.mipmap.ic_launcher_grey_black |
| 13 | + R.mipmap.ic_launcher_red, |
| 14 | + R.mipmap.ic_launcher_pink, |
| 15 | + R.mipmap.ic_launcher_purple, |
| 16 | + R.mipmap.ic_launcher_deep_purple, |
| 17 | + R.mipmap.ic_launcher_indigo, |
| 18 | + R.mipmap.ic_launcher_blue, |
| 19 | + R.mipmap.ic_launcher_light_blue, |
| 20 | + R.mipmap.ic_launcher_cyan, |
| 21 | + R.mipmap.ic_launcher_teal, |
| 22 | + R.mipmap.ic_launcher_green, |
| 23 | + R.mipmap.ic_launcher_light_green, |
| 24 | + R.mipmap.ic_launcher_lime, |
| 25 | + R.mipmap.ic_launcher_yellow, |
| 26 | + R.mipmap.ic_launcher_amber, |
| 27 | + R.mipmap.ic_launcher, |
| 28 | + R.mipmap.ic_launcher_deep_orange, |
| 29 | + R.mipmap.ic_launcher_brown, |
| 30 | + R.mipmap.ic_launcher_blue_grey, |
| 31 | + R.mipmap.ic_launcher_grey_black |
27 | 32 | ) |
28 | 33 |
|
29 | 34 | override fun getAppLauncherName() = getString(R.string.app_launcher_name) |
| 35 | + |
| 36 | + @SuppressLint("NewApi") |
| 37 | + fun hasStoragePermission(): Boolean { |
| 38 | + return if (isRPlus()) { |
| 39 | + Environment.isExternalStorageManager() |
| 40 | + } else { |
| 41 | + hasPermission(PERMISSION_WRITE_STORAGE) |
| 42 | + } |
| 43 | + } |
30 | 44 | } |
0 commit comments