Skip to content

Commit afc2fa6

Browse files
Use newer loader
1 parent ddef20b commit afc2fa6

File tree

4 files changed

+7
-11
lines changed

4 files changed

+7
-11
lines changed

app/src/legacy/kotlin/app/fyreplace/fyreplace/legacy/ui/ImageSelector.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ import dagger.assisted.Assisted
2828
import dagger.assisted.AssistedInject
2929
import kotlinx.coroutines.Dispatchers
3030
import kotlinx.coroutines.cancel
31+
import kotlinx.coroutines.currentCoroutineContext
3132
import kotlinx.coroutines.ensureActive
3233
import kotlinx.coroutines.withContext
3334
import java.io.ByteArrayOutputStream
3435
import java.io.File
3536
import java.io.IOException
3637
import java.io.InputStream
37-
import kotlin.coroutines.coroutineContext
3838
import kotlin.math.sqrt
3939

4040
class ImageSelector @AssistedInject constructor(
@@ -133,7 +133,7 @@ class ImageSelector @AssistedInject constructor(
133133

134134
private suspend fun onImageLoadingBegin() {
135135
val view = fragment.view ?: return
136-
val context = coroutineContext
136+
val context = currentCoroutineContext()
137137
snackbar = Snackbar.make(
138138
view, R.string.image_selector_snackbar_upload,
139139
Snackbar.LENGTH_INDEFINITE
@@ -200,7 +200,6 @@ class ImageSelector @AssistedInject constructor(
200200

201201
compress()
202202

203-
@Suppress("AssignedValueIsNeverRead")
204203
if (os.size() > maxImageByteSize && compressFormat != CompressFormat.JPEG) {
205204
compressFormat = CompressFormat.JPEG
206205
compress()

app/src/legacy/kotlin/app/fyreplace/fyreplace/legacy/ui/views/ChaptersView.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import app.fyreplace.protos.Chapter
1313
import app.fyreplace.protos.Post
1414
import com.bumptech.glide.Glide
1515
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions
16-
import com.google.android.material.progressindicator.CircularProgressIndicator
16+
import com.google.android.material.loadingindicator.LoadingIndicator
1717

1818
@Suppress("unused")
1919
class ChaptersView : LinearLayout {
@@ -42,7 +42,7 @@ class ChaptersView : LinearLayout {
4242
removeAllViews()
4343

4444
if (post.isPreview) {
45-
val loader = CircularProgressIndicator(context).apply { isIndeterminate = true }
45+
val loader = LoadingIndicator(context)
4646
val layoutParams = LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)
4747
layoutParams.gravity = Gravity.CENTER_HORIZONTAL
4848
loader.layoutParams = layoutParams

app/src/legacy/res/layout/fragment_login.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,10 @@
111111
android:text="@{vm.isRegistering ? @string/settings_register : @string/settings_login}"
112112
android:visibility="@{vm.isLoading ? View.GONE : View.VISIBLE}" />
113113

114-
<com.google.android.material.progressindicator.CircularProgressIndicator
114+
<com.google.android.material.loadingindicator.LoadingIndicator
115115
android:layout_width="wrap_content"
116116
android:layout_height="wrap_content"
117117
android:layout_marginTop="@dimen/gap"
118-
android:indeterminate="true"
119118
android:visibility="@{vm.isLoading ? View.VISIBLE : View.GONE}" />
120119
</LinearLayout>
121120
</ScrollView>

app/src/legacy/res/layout/item_comment_loader.xml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@
44
android:layout_height="wrap_content"
55
android:minHeight="@dimen/comment_height">
66

7-
<com.google.android.material.progressindicator.CircularProgressIndicator
8-
style="@style/Widget.Material3.CircularProgressIndicator.Small"
7+
<com.google.android.material.loadingindicator.LoadingIndicator
98
android:layout_width="wrap_content"
109
android:layout_height="wrap_content"
11-
android:layout_gravity="center"
12-
android:indeterminate="true" />
10+
android:layout_gravity="center" />
1311
</FrameLayout>

0 commit comments

Comments
 (0)