Cleanup code
This commit is contained in:
1 parent
2e4935715f
commit
bf4d39421b
6 files changed
+9
-18
No files matched your search
@@ -308,7 +308,7 @@ spotless {
|
||||
}
|
||||
|
||||
tasks.configureEach {
|
||||
if ((name == "mergeDebugJniLibFolders" || name == "mergeReleaseJniLibFolders")) {
|
||||
if (name == "mergeDebugJniLibFolders" || name == "mergeReleaseJniLibFolders") {
|
||||
dependsOn("cargoBuild")
|
||||
// fix mergeDebugJniLibFolders UP-TO-DATE
|
||||
inputs.dir(layout.buildDirectory.dir("rustJniLibs/android"))
|
||||
|
||||
@@ -21,7 +21,7 @@ import android.content.DialogInterface
|
||||
import android.content.Intent
|
||||
import android.content.pm.PackageManager
|
||||
import android.content.pm.verify.domain.DomainVerificationManager
|
||||
import android.content.pm.verify.domain.DomainVerificationUserState
|
||||
import android.content.pm.verify.domain.DomainVerificationUserState.DOMAIN_STATE_NONE
|
||||
import android.graphics.Bitmap
|
||||
import android.graphics.ImageDecoder
|
||||
import android.net.Uri
|
||||
@@ -237,16 +237,7 @@ class MainActivity : EhActivity() {
|
||||
private fun checkAppLinkVerify() {
|
||||
val manager = getSystemService(DomainVerificationManager::class.java)
|
||||
val userState = manager.getDomainVerificationUserState(packageName) ?: return
|
||||
var hasUnverified = false
|
||||
val hostToStateMap = userState.hostToStateMap
|
||||
for (key in hostToStateMap.keys) {
|
||||
val stateValue = hostToStateMap[key]
|
||||
if (stateValue == null || stateValue == DomainVerificationUserState.DOMAIN_STATE_VERIFIED || stateValue == DomainVerificationUserState.DOMAIN_STATE_SELECTED) {
|
||||
continue
|
||||
}
|
||||
hasUnverified = true
|
||||
break
|
||||
}
|
||||
val hasUnverified = userState.hostToStateMap.values.any { it == DOMAIN_STATE_NONE }
|
||||
if (hasUnverified) {
|
||||
BaseDialogBuilder(this)
|
||||
.setTitle(R.string.app_link_not_verified_title)
|
||||
|
||||
@@ -76,7 +76,7 @@ fun NormalSearch(
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
) {
|
||||
RadioButton(
|
||||
selected = (it.first == searchMode),
|
||||
selected = it.first == searchMode,
|
||||
onClick = { onSearchModeChanged(it.first) },
|
||||
)
|
||||
Text(
|
||||
|
||||
@@ -159,7 +159,7 @@ class FavoritesScene : SearchBarScene() {
|
||||
updateJumpFab() // index: 0, 2
|
||||
binding.fabLayout.run {
|
||||
setSecondaryFabVisibilityAt(1, true)
|
||||
(3..6).forEach { setSecondaryFabVisibilityAt(it, false) }
|
||||
for (i in 3..6) { setSecondaryFabVisibilityAt(i, false) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -530,8 +530,8 @@ class FavoritesScene : SearchBarScene() {
|
||||
private fun showSelectionFab() {
|
||||
SimpleHandler.removeCallbacks(showNormalFabsRunnable)
|
||||
binding.fabLayout.run {
|
||||
(0..2).forEach { setSecondaryFabVisibilityAt(it, false) }
|
||||
(3..6).forEach { setSecondaryFabVisibilityAt(it, true) }
|
||||
for (i in 0..2) { setSecondaryFabVisibilityAt(i, false) }
|
||||
for (i in 3..6) { setSecondaryFabVisibilityAt(i, true) }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ fun CircularLayout(
|
||||
val itemConstraints = constraints.copy(minWidth = 0, minHeight = 0)
|
||||
val placeables = measurables.map { measurable -> measurable.measure(itemConstraints) }
|
||||
val outPlaceables = if (placeFirstItemInCenter) placeables.drop(1) else placeables
|
||||
val theta = FullCircle / (outPlaceables.count())
|
||||
val theta = FullCircle / outPlaceables.count()
|
||||
|
||||
layout(
|
||||
width = constraints.minWidth,
|
||||
|
||||
@@ -60,7 +60,7 @@ fun Context.addTextToClipboard(text: CharSequence?, isSensitive: Boolean, useToa
|
||||
|
||||
fun ClipboardManager.getUrlFromClipboard(context: Context): String? {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S && primaryClipDescription?.classificationStatus == ClipDescription.CLASSIFICATION_COMPLETE) {
|
||||
if ((primaryClipDescription?.getConfidenceScore(TextClassifier.TYPE_URL)?.let { it <= 0 }) == true) return null
|
||||
if (primaryClipDescription?.getConfidenceScore(TextClassifier.TYPE_URL)?.let { it <= 0 } == true) return null
|
||||
}
|
||||
val item = primaryClip?.getItemAt(0)
|
||||
val string = item?.coerceToText(context).toString()
|
||||
|
||||
Reference in new issue
Block a user