Clearing more warnings

This commit is contained in:
Vitor Pamplona
2026-03-28 15:46:59 -04:00
parent f3cefe0e13
commit 3c01c17d59
11 changed files with 72 additions and 65 deletions
@@ -35,7 +35,7 @@ object PushNotificationUtils {
accounts: List<AccountInfo>,
okHttpClient: (String) -> OkHttpClient,
) = with(Dispatchers.IO) {
if (!pushHandler.savedDistributorExists()) return
if (!pushHandler.savedDistributorExists()) return@with
val currentDistributor = PushDistributorHandler.getSavedDistributor()
PushDistributorHandler.saveDistributor(currentDistributor)
@@ -18,6 +18,8 @@
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
@file:Suppress("DEPRECATION")
package com.vitorpamplona.amethyst.model
import android.util.LruCache
@@ -42,6 +42,7 @@ open class GenericRelayListCache<T : PrivateTagArrayEvent>(
suspend fun relays(event: T) = cachedPrivateLists.mergeTagList(event).relaySet()
@Suppress("UNCHECKED_CAST")
fun fastStartValueForRelayList(note: Note): RelayListCard {
val noteEvent = note.event as? T
return if (noteEvent != null) {
@@ -52,6 +53,7 @@ open class GenericRelayListCache<T : PrivateTagArrayEvent>(
}
@OptIn(ExperimentalCoroutinesApi::class)
@Suppress("UNCHECKED_CAST")
fun observeDecryptedRelayList(note: Note): Flow<RelayListCard> =
note
.flow()
@@ -41,6 +41,7 @@ import kotlinx.coroutines.flow.onStart
import kotlinx.coroutines.flow.sample
import kotlinx.coroutines.flow.stateIn
@Suppress("UNCHECKED_CAST")
class MergedFollowListsState(
val kind3List: Kind3FollowListState,
val peopleList: PeopleListsState,
@@ -18,6 +18,8 @@
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
@file:Suppress("DEPRECATION")
package com.vitorpamplona.amethyst.service.relayClient.reqCommand.account.nip01Notifications
import com.vitorpamplona.quartz.experimental.attestations.recommendation.AttestorRecommendationEvent
@@ -44,7 +44,6 @@ fun SetDialogToEdgeToEdge() {
attributes.copyFrom(activityWindow.attributes)
attributes.type = dialogWindow.attributes.type
dialogWindow.attributes = attributes
dialogWindow.statusBarColor
parentView.layoutParams =
FrameLayout.LayoutParams(
activityWindow.decorView.width,
@@ -66,71 +66,67 @@ fun BadgeCompose(
val context = LocalContext.current.applicationContext
if (note == null) {
BlankNote(Modifier)
} else {
val backgroundColor =
calculateBackgroundColor(
createdAt = likeSetCard.createdAt(),
routeForLastRead = routeForLastRead,
accountViewModel = accountViewModel,
)
val backgroundColor =
calculateBackgroundColor(
createdAt = likeSetCard.createdAt(),
routeForLastRead = routeForLastRead,
accountViewModel = accountViewModel,
)
Column(
Column(
modifier =
Modifier
.background(backgroundColor.value)
.clickable(
onClick = {
routeFor(
note,
accountViewModel.account,
)?.let { nav.nav(it) }
},
),
) {
Row(
modifier =
Modifier
.background(backgroundColor.value)
.clickable(
onClick = {
routeFor(
note,
accountViewModel.account,
)?.let { nav.nav(it) }
},
),
Modifier.padding(
start = if (!isInnerNote) 12.dp else 0.dp,
end = if (!isInnerNote) 12.dp else 0.dp,
top = 10.dp,
),
) {
Row(
modifier =
Modifier.padding(
start = if (!isInnerNote) 12.dp else 0.dp,
end = if (!isInnerNote) 12.dp else 0.dp,
top = 10.dp,
),
) {
// Draws the like picture outside the boosted card.
if (!isInnerNote) {
Box(
modifier = Modifier.width(55.dp).padding(0.dp),
) {
Icon(
imageVector = Icons.Default.MilitaryTech,
null,
modifier = Modifier.size(25.dp).align(Alignment.TopEnd),
tint = MaterialTheme.colorScheme.primary,
)
}
// Draws the like picture outside the boosted card.
if (!isInnerNote) {
Box(
modifier = Modifier.width(55.dp).padding(0.dp),
) {
Icon(
imageVector = Icons.Default.MilitaryTech,
null,
modifier = Modifier.size(25.dp).align(Alignment.TopEnd),
tint = MaterialTheme.colorScheme.primary,
)
}
}
Column(modifier = Modifier.padding(start = if (!isInnerNote) 10.dp else 0.dp)) {
Row {
Text(
stringRes(R.string.new_badge_award_notif),
fontWeight = FontWeight.Bold,
modifier = Modifier.padding(bottom = 5.dp).weight(1f),
)
Text(
timeAgo(note.createdAt(), context = context),
color = MaterialTheme.colorScheme.placeholderText,
maxLines = 1,
)
MoreOptionsButton(note, null, accountViewModel, nav)
}
Column(modifier = Modifier.padding(start = if (!isInnerNote) 10.dp else 0.dp)) {
Row {
Text(
stringRes(R.string.new_badge_award_notif),
fontWeight = FontWeight.Bold,
modifier = Modifier.padding(bottom = 5.dp).weight(1f),
)
Text(
timeAgo(note.createdAt(), context = context),
color = MaterialTheme.colorScheme.placeholderText,
maxLines = 1,
)
MoreOptionsButton(note, null, accountViewModel, nav)
}
note.replyTo?.firstOrNull()?.let {
BadgeDisplay(baseNote = it, accountViewModel)
}
note.replyTo?.firstOrNull()?.let {
BadgeDisplay(baseNote = it, accountViewModel)
}
}
}
@@ -22,6 +22,7 @@ package com.vitorpamplona.amethyst.ui.note.elements
import android.content.Intent
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.outlined.PlaylistAdd
import androidx.compose.material.icons.outlined.Bookmark
import androidx.compose.material.icons.outlined.BookmarkAdd
import androidx.compose.material.icons.outlined.BookmarkRemove
@@ -185,7 +186,7 @@ fun NoteDropDownMenu(
onDismiss()
}
}
M3ActionRow(icon = Icons.Outlined.PlaylistAdd, text = stringRes(R.string.follow_set_add_author_from_note_action)) {
M3ActionRow(icon = Icons.AutoMirrored.Outlined.PlaylistAdd, text = stringRes(R.string.follow_set_add_author_from_note_action)) {
val authorHexKey = note.author?.pubkeyHex ?: return@M3ActionRow
nav.nav(Route.PeopleListManagement(authorHexKey))
onDismiss()
@@ -34,6 +34,7 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.Send
import androidx.compose.material.icons.filled.CheckCircle
import androidx.compose.material.icons.filled.Close
import androidx.compose.material.icons.filled.ErrorOutline
@@ -308,7 +309,7 @@ fun RenderAttestationRequest(
horizontalArrangement = Arrangement.spacedBy(8.dp),
) {
Icon(
imageVector = Icons.Default.Send,
imageVector = Icons.AutoMirrored.Filled.Send,
contentDescription = stringRes(R.string.attestation_request),
tint = MaterialTheme.colorScheme.primary,
modifier = Modifier.size(24.dp),
@@ -18,6 +18,8 @@
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
@file:Suppress("DEPRECATION")
package com.vitorpamplona.amethyst.ui.screen.loggedIn.relays
import androidx.compose.foundation.clickable
@@ -26,6 +26,7 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.FormatListBulleted
import androidx.compose.material.icons.filled.Checklist
import androidx.compose.material.icons.filled.Code
import androidx.compose.material.icons.filled.FormatBold
@@ -83,7 +84,7 @@ fun MarkdownToolbar(
Separator()
// --- Lists ---
ToolbarIconButton(Icons.Default.FormatListBulleted, "Bullet list", state.isUnorderedList) { state.toggleUnorderedList() }
ToolbarIconButton(Icons.AutoMirrored.Filled.FormatListBulleted, "Bullet list", state.isUnorderedList) { state.toggleUnorderedList() }
ToolbarIconButton(Icons.Default.FormatListNumbered, "Numbered list", state.isOrderedList) { state.toggleOrderedList() }
ToolbarIconButton(Icons.Default.Checklist, "Task list", state.isTaskList) { state.toggleTaskList() }