mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-17 06:27:29 +01:00
Formatting
This commit is contained in:
@@ -58,12 +58,12 @@ class CrashLogUtil(private val context: Context) {
|
||||
addAction(
|
||||
R.drawable.ic_folder_24dp,
|
||||
context.getString(R.string.action_open_log),
|
||||
NotificationReceiver.openErrorLogPendingActivity(context, uri)
|
||||
NotificationReceiver.openErrorLogPendingActivity(context, uri),
|
||||
)
|
||||
addAction(
|
||||
R.drawable.ic_share_24dp,
|
||||
context.getString(R.string.action_share),
|
||||
NotificationReceiver.shareCrashLogPendingBroadcast(context, uri, Notifications.ID_CRASH_LOGS)
|
||||
NotificationReceiver.shareCrashLogPendingBroadcast(context, uri, Notifications.ID_CRASH_LOGS),
|
||||
)
|
||||
|
||||
context.notificationManager.notify(Notifications.ID_CRASH_LOGS, build())
|
||||
|
||||
@@ -67,7 +67,7 @@ fun Long.toUtcCalendar(): Calendar? {
|
||||
rawCalendar.get(Calendar.DAY_OF_MONTH),
|
||||
rawCalendar.get(Calendar.HOUR_OF_DAY),
|
||||
rawCalendar.get(Calendar.MINUTE),
|
||||
rawCalendar.get(Calendar.SECOND)
|
||||
rawCalendar.get(Calendar.SECOND),
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -92,7 +92,7 @@ fun Long.toLocalCalendar(): Calendar? {
|
||||
rawCalendar.get(Calendar.DAY_OF_MONTH),
|
||||
rawCalendar.get(Calendar.HOUR_OF_DAY),
|
||||
rawCalendar.get(Calendar.MINUTE),
|
||||
rawCalendar.get(Calendar.SECOND)
|
||||
rawCalendar.get(Calendar.SECOND),
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -116,7 +116,7 @@ fun Date.toRelativeString(
|
||||
difference < MILLISECONDS_IN_DAY.times(range) -> context.resources.getQuantityString(
|
||||
R.plurals.relative_time,
|
||||
days,
|
||||
days
|
||||
days,
|
||||
)
|
||||
else -> dateFormat.format(this)
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ object Hash {
|
||||
|
||||
private val chars = charArrayOf(
|
||||
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
|
||||
'a', 'b', 'c', 'd', 'e', 'f'
|
||||
'a', 'b', 'c', 'd', 'e', 'f',
|
||||
)
|
||||
|
||||
private val MD5 get() = MessageDigest.getInstance("MD5")
|
||||
|
||||
@@ -35,8 +35,8 @@ private suspend fun <T> Observable<T>.awaitOne(): T = suspendCancellableCoroutin
|
||||
override fun onCompleted() {
|
||||
if (cont.isActive) cont.resumeWithException(
|
||||
IllegalStateException(
|
||||
"Should have invoked onNext"
|
||||
)
|
||||
"Should have invoked onNext",
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -51,8 +51,8 @@ private suspend fun <T> Observable<T>.awaitOne(): T = suspendCancellableCoroutin
|
||||
cont.completeResume(token)
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
},
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -80,6 +80,6 @@ fun <T> runAsObservable(
|
||||
}
|
||||
emitter.setCancellation { job.cancel() }
|
||||
},
|
||||
backpressureMode
|
||||
backpressureMode,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ inline fun PreferenceGroup.infoPreference(@StringRes infoRes: Int): Preference {
|
||||
iconTint = context.getResourceColor(android.R.attr.textColorHint)
|
||||
summaryRes = infoRes
|
||||
isSelectable = false
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
@@ -156,7 +156,7 @@ inline fun SwitchPreferenceCompat.requireAuthentication(activity: FragmentActivi
|
||||
super.onAuthenticationError(activity, errorCode, errString)
|
||||
activity?.toast(errString.toString())
|
||||
}
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ object AuthenticatorUtil {
|
||||
subtitle = subtitle,
|
||||
confirmationRequired = confirmationRequired,
|
||||
executor = ContextCompat.getMainExecutor(this),
|
||||
callback = callback
|
||||
callback = callback,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -380,7 +380,7 @@ object ImageUtil {
|
||||
|
||||
return GradientDrawable(
|
||||
GradientDrawable.Orientation.TOP_BOTTOM,
|
||||
gradient
|
||||
gradient,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ abstract class WebViewClientCompat : WebViewClient() {
|
||||
error.errorCode,
|
||||
error.description?.toString(),
|
||||
request.url.toString(),
|
||||
request.isForMainFrame
|
||||
request.isForMainFrame,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ abstract class WebViewClientCompat : WebViewClient() {
|
||||
error.reasonPhrase,
|
||||
request.url
|
||||
.toString(),
|
||||
request.isForMainFrame
|
||||
request.isForMainFrame,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ fun ImageView.loadAutoPause(
|
||||
},
|
||||
onStart = { request -> originalListener?.onStart(request) },
|
||||
onCancel = { request -> originalListener?.onCancel(request) },
|
||||
onError = { request, throwable -> originalListener?.onError(request, throwable) }
|
||||
onError = { request, throwable -> originalListener?.onError(request, throwable) },
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -211,7 +211,7 @@ fun RecyclerView.onAnimationsFinished(callback: (RecyclerView) -> Unit) = post(
|
||||
callback(this@onAnimationsFinished)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
/**
|
||||
|
||||
@@ -22,7 +22,7 @@ fun Window.setNavigationBarTransparentCompat(context: Context, elevation: Float
|
||||
// Set navbar scrim 70% of navigationBarColor
|
||||
ElevationOverlayProvider(context).compositeOverlayIfNeeded(
|
||||
context.getResourceColor(android.R.attr.navigationBarColor, 0.7F),
|
||||
elevation
|
||||
elevation,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user