Skip to content

Commit cbe33c7

Browse files
committed
Incorporate android.permission.READ_MEDIA_IMAGES
1 parent f181cc3 commit cbe33c7

File tree

6 files changed

+28
-13
lines changed

6 files changed

+28
-13
lines changed

.idea/workspace.xml

Lines changed: 5 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/src/main/AndroidManifest.xml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,23 @@
1515
@see
1616
https://stackoverflow.com/questions/64221188/write-external-storage-when-targeting-android-10 -->
1717

18-
<uses-permission
19-
android:name="android.permission.POST_NOTIFICATIONS"/>
2018
<uses-permission
2119
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
2220
android:maxSdkVersion="29"/>
21+
22+
<!-- ScreenCaptureListening -->
23+
24+
<uses-permission
25+
android:name="android.permission.FOREGROUND_SERVICE"/> <!-- System Permission -> granted automatically -->
26+
2327
<uses-permission
2428
android:name="android.permission.READ_EXTERNAL_STORAGE"
25-
android:maxSdkVersion="32" /> <!-- Required by ScreenCaptureListeningService -->
29+
android:maxSdkVersion="32" />
30+
2631
<uses-permission
27-
android:name="android.permission.FOREGROUND_SERVICE"/> <!-- System Permission -> granted automatically -->
32+
android:name="android.permission.READ_MEDIA_IMAGES"/> <!-- SDK >= 33 -->
33+
<uses-permission
34+
android:name="android.permission.POST_NOTIFICATIONS"/> <!-- SDK >= 33 -->
2835

2936
<!-- Application -->
3037

app/src/main/java/com/autocrop/activities/main/MainActivity.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ class MainActivity :
5151

5252
val screenshotListeningPermissions = listOf(
5353
PermissionHandler(
54-
Manifest.permission.READ_EXTERNAL_STORAGE,
54+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU)
55+
Manifest.permission.READ_MEDIA_IMAGES
56+
else
57+
Manifest.permission.READ_EXTERNAL_STORAGE,
5558
this,
5659
"Media file access required for listening to screen captures",
5760
"Go to app settings and grant media file access for screen capture listening to work"
@@ -102,7 +105,7 @@ class MainActivity :
102105
{
103106
showIOSynopsisSnackbar(viewModel.ioResults!!)
104107
},
105-
resources.getInteger(R.integer.duration_fade_in_flowfield_fragment_buttons).toLong() / 2
108+
resources.getInteger(R.integer.duration_flowfield_buttons_fade_in_halve).toLong()
106109
)
107110
}
108111

app/src/main/java/com/autocrop/activities/main/fragments/flowfield/sketch/FlowFieldSketch.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ private void alphaDrop(){
6464
for (int i = 0; i < g.pixels.length; i++) {
6565
int pixel = g.pixels[i];
6666
g.pixels[i] = color(
67-
red(pixel) * REDUCTION_COEFF,
68-
green(pixel) * REDUCTION_COEFF,
69-
blue(pixel) * REDUCTION_COEFF
67+
red(pixel) * REDUCTION_COEFF,
68+
green(pixel) * REDUCTION_COEFF,
69+
blue(pixel) * REDUCTION_COEFF
7070
);
7171
}
7272
g.updatePixels();

app/src/main/java/com/autocrop/activities/main/fragments/flowfield/views/ButtonsLayout.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class ButtonsLayout(context: Context, attributeSet: AttributeSet):
1919
ifNotInEditMode {
2020
with(activityViewModel<MainActivityViewModel>()){
2121
if (fadeInFlowFieldButtons){
22-
fadeIn(resources.getInteger(R.integer.duration_fade_in_flowfield_fragment_buttons).toLong())
22+
fadeIn(resources.getInteger(R.integer.duration_flowfield_buttons_fade_in).toLong())
2323
fadeInFlowFieldButtons = false
2424
}
2525
else

app/src/main/res/values/integers.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
<integer name="card_flip_time_full">650</integer>
55
<integer name="card_flip_time_half">400</integer>
66

7-
<integer name="duration_fade_in_flowfield_fragment_buttons">3500</integer>
7+
<integer name="duration_flowfield_buttons_fade_in">3500</integer>
8+
<integer name="duration_flowfield_buttons_fade_in_halve">1750</integer>
9+
810
<integer name="duration_snackbar_long">4000</integer>
911
<integer name="duration_snackbar_extra_long">5000</integer>
1012

0 commit comments

Comments
 (0)