Formatting

This commit is contained in:
arkon
2022-04-08 16:44:23 -04:00
parent 2dfafa387b
commit 5afff31f72
197 changed files with 481 additions and 483 deletions

View File

@@ -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())

View File

@@ -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)
}

View File

@@ -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")

View File

@@ -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,
)
}

View File

@@ -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())
}
}
},
)
}

View File

@@ -39,7 +39,7 @@ object AuthenticatorUtil {
subtitle = subtitle,
confirmationRequired = confirmationRequired,
executor = ContextCompat.getMainExecutor(this),
callback = callback
callback = callback,
)
}

View File

@@ -380,7 +380,7 @@ object ImageUtil {
return GradientDrawable(
GradientDrawable.Orientation.TOP_BOTTOM,
gradient
gradient,
)
}

View File

@@ -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,
)
}
}

View File

@@ -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) },
)
}
}

View File

@@ -211,7 +211,7 @@ fun RecyclerView.onAnimationsFinished(callback: (RecyclerView) -> Unit) = post(
callback(this@onAnimationsFinished)
}
}
}
},
)
/**

View File

@@ -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,
)
}
}