-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: clickable area incorrect in settings In the settings screen the clickable area is too small, fix the order of modifiers to fix this. * fix: hide the plus one icon on completed series * fix: rating dialog not taking material colours * fix: throw auth error if we get a 401 If we get a 401 during normal operation, then attempt to refresh and throw an error if we cant. * feat: add autofill to the login screen Add a new extension method to allow autofill and use this on the credentials screen. * style: fix ktlint issues * chore: add gitignore line for deployment targets * style: fix code style difference * fix: incorrect clickable height on rating preference * fix: whole line not selectable in config Update padding to include the whole line in the config screen. * fix: rating dialog buttons in wrong location Move the dialog buttons to be end aligned like the other dialogs.
- Loading branch information
Showing
9 changed files
with
165 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
core/compose/src/main/java/com/chesire/nekome/core/compose/ModifierExtensions.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
@file:OptIn(ExperimentalComposeUiApi::class) | ||
|
||
package com.chesire.nekome.core.compose | ||
|
||
import androidx.compose.ui.ExperimentalComposeUiApi | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.autofill.AutofillNode | ||
import androidx.compose.ui.autofill.AutofillType | ||
import androidx.compose.ui.composed | ||
import androidx.compose.ui.focus.onFocusChanged | ||
import androidx.compose.ui.layout.boundsInWindow | ||
import androidx.compose.ui.layout.onGloballyPositioned | ||
import androidx.compose.ui.platform.LocalAutofill | ||
import androidx.compose.ui.platform.LocalAutofillTree | ||
|
||
/** | ||
* Provides autofill to a view. | ||
* This should be removed once compose completely supports autofill nicely. | ||
*/ | ||
fun Modifier.autofill( | ||
autofillTypes: List<AutofillType>, | ||
onFill: ((String) -> Unit) | ||
) = composed { | ||
val autofill = LocalAutofill.current | ||
val autofillNode = AutofillNode(onFill = onFill, autofillTypes = autofillTypes) | ||
LocalAutofillTree.current += autofillNode | ||
|
||
this | ||
.onGloballyPositioned { autofillNode.boundingBox = it.boundsInWindow() } | ||
.onFocusChanged { focusState -> | ||
autofill?.run { | ||
if (focusState.isFocused) { | ||
requestAutofillForNode(autofillNode) | ||
} else { | ||
cancelAutofillForNode(autofillNode) | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.