Skip to content

Commit cbbcbbe

Browse files
committed
Update androidTest dependencies; Clean up
1 parent 4620435 commit cbbcbbe

File tree

4 files changed

+18
-21
lines changed

4 files changed

+18
-21
lines changed

app/src/main/kotlin/com/w2sv/autocrop/activities/main/fragments/flowfield/FlowFieldFragment.kt

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -172,19 +172,19 @@ class FlowFieldFragment :
172172
}
173173

174174
private fun ViewModel.setLiveDataObservers() {
175-
hideForegroundLive.observe(viewLifecycleOwner) {
176-
if (it) {
177-
requireActivity().hideSystemBars()
178-
with(binding.foregroundLayout) {
175+
hideForegroundLive.observe(viewLifecycleOwner) { hideForeground ->
176+
binding.highAlphaForegroundLayout.let {
177+
if (hideForeground) {
178+
requireActivity().hideSystemBars()
179179
if (lifecycle.currentState == Lifecycle.State.STARTED)
180-
hide()
180+
it.hide()
181181
else
182-
foregroundToggleAnimation = fadeOut()
182+
foregroundToggleAnimation = it.fadeOut()
183+
}
184+
else {
185+
requireActivity().showSystemBars()
186+
foregroundToggleAnimation = it.fadeIn()
183187
}
184-
}
185-
else {
186-
requireActivity().showSystemBars()
187-
foregroundToggleAnimation = binding.foregroundLayout.fadeIn()
188188
}
189189
}
190190
}
@@ -194,12 +194,7 @@ class FlowFieldFragment :
194194
?: false
195195

196196
if (!viewModel.fadedInButtons) {
197-
fadeIn(
198-
binding.navigationViewToggleButton,
199-
binding.imageSelectionButton,
200-
binding.foregroundToggleButton,
201-
duration = resources.getLong(R.integer.duration_flowfield_buttons_fade_in)
202-
)
197+
binding.foregroundLayout.fadeIn(resources.getLong(R.integer.duration_flowfield_buttons_fade_in))
203198

204199
if (savedAnyCrops)
205200
lifecycleScope.launchDelayed(resources.getLong(R.integer.duration_flowfield_buttons_half_faded_in)) {

app/src/main/res/layout-land/fragment_flowfield.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
android:layout_height="match_parent">
1717

1818
<RelativeLayout
19+
android:id="@+id/foreground_layout"
1920
android:layout_width="match_parent"
2021
android:layout_height="match_parent">
2122

@@ -32,7 +33,7 @@
3233
android:backgroundTint="@color/low_alpha_gray" />
3334

3435
<RelativeLayout
35-
android:id="@+id/foreground_layout"
36+
android:id="@+id/high_alpha_foreground_layout"
3637
android:layout_width="match_parent"
3738
android:layout_height="match_parent">
3839

app/src/main/res/layout/fragment_flowfield.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
android:layout_height="match_parent">
1717

1818
<RelativeLayout
19+
android:id="@+id/foreground_layout"
1920
android:layout_width="match_parent"
2021
android:layout_height="match_parent">
2122

@@ -32,7 +33,7 @@
3233
android:backgroundTint="@color/low_alpha_gray" />
3334

3435
<RelativeLayout
35-
android:id="@+id/foreground_layout"
36+
android:id="@+id/high_alpha_foreground_layout"
3637
android:layout_width="match_parent"
3738
android:layout_height="match_parent">
3839

gradle/libs.versions.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ lottie = 'com.airbnb.android:lottie:5.2.0'
3535

3636
## unitTest
3737
junit5 = 'org.junit.jupiter:junit-jupiter:5.9.1'
38-
androidx-junit = 'androidx.test.ext:junit:1.1.4'
38+
androidx-junit = 'androidx.test.ext:junit:1.1.5'
3939

4040
## androidTest
4141
androidx-testrunner = 'androidx.test:runner:1.5.1'
@@ -45,8 +45,8 @@ junit5-mannodermaus-runner = 'de.mannodermaus.junit5:android-test-runner:1.3.0'
4545
junit5-params = 'org.junit.jupiter:junit-jupiter-params:5.9.1'
4646

4747
# espresso
48-
androidx-espresso-core = 'androidx.test.espresso:espresso-core:3.5.0'
49-
androidx-espresso-intents = 'androidx.test.espresso:espresso-intents:3.5.0'
48+
androidx-espresso-core = 'androidx.test.espresso:espresso-core:3.5.1'
49+
androidx-espresso-intents = 'androidx.test.espresso:espresso-intents:3.5.1'
5050

5151
[bundles]
5252
unitTest = ["junit5", "androidx-junit"]

0 commit comments

Comments
 (0)