Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delaying marquee for 4 seconds. #1390 #1391

Merged
merged 1 commit into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import androidx.annotation.StringRes
import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.animation.core.tween
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.basicMarquee
import androidx.compose.foundation.clickable
import androidx.compose.foundation.combinedClickable
import androidx.compose.foundation.interaction.MutableInteractionSource
Expand Down Expand Up @@ -78,7 +77,7 @@ fun SimpleTopAppBar(
Text(
text = text,
maxLines = 1,
modifier = Modifier.basicMarquee(),
modifier = Modifier.customMarquee(),
)
},
navigationIcon = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.jerboa.ui.components.common

import android.os.Build
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.basicMarquee
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
Expand Down Expand Up @@ -65,3 +67,8 @@ fun Modifier.onAutofill(
}
}
}

@OptIn(ExperimentalFoundationApi::class)
fun Modifier.customMarquee(): Modifier {
return this.basicMarquee(delayMillis = 4_000)
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.jerboa.ui.components.common

import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.background
import androidx.compose.foundation.basicMarquee
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
Expand Down Expand Up @@ -47,7 +46,7 @@ fun TextBadge(
modifier =
Modifier
.padding(horizontalTextPadding.dp, verticalTextPadding.dp)
.basicMarquee(),
.customMarquee(),
)
}
}
Expand Down Expand Up @@ -97,6 +96,6 @@ fun ItemAndInstanceTitle(
Text(
text = text,
maxLines = 1,
modifier = modifier.basicMarquee(),
modifier = modifier.customMarquee(),
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.jerboa.ui.components.community

import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.background
import androidx.compose.foundation.basicMarquee
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
Expand Down Expand Up @@ -54,6 +53,7 @@ import com.jerboa.feat.needBlur
import com.jerboa.ui.components.common.LargerCircularIcon
import com.jerboa.ui.components.common.PictrsBannerImage
import com.jerboa.ui.components.common.SortOptionsDropdown
import com.jerboa.ui.components.common.customMarquee
import com.jerboa.ui.theme.ACTION_BAR_ICON_SIZE
import com.jerboa.ui.theme.DRAWER_BANNER_SIZE
import com.jerboa.ui.theme.MEDIUM_PADDING
Expand Down Expand Up @@ -257,7 +257,7 @@ fun CommunityHeaderTitle(
text = communityName,
style = MaterialTheme.typography.titleLarge,
maxLines = 1,
modifier = Modifier.basicMarquee(),
modifier = Modifier.customMarquee(),
)
Text(
text = ctx.getString(selectedSortType.data.shortForm),
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/java/com/jerboa/ui/components/drawer/Drawer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import androidx.compose.animation.AnimatedVisibility
import androidx.compose.animation.expandVertically
import androidx.compose.animation.shrinkVertically
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.basicMarquee
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
Expand Down Expand Up @@ -57,6 +56,7 @@ import com.jerboa.model.AccountViewModelFactory
import com.jerboa.ui.components.common.IconAndTextDrawerItem
import com.jerboa.ui.components.common.LargerCircularIcon
import com.jerboa.ui.components.common.PictrsBannerImage
import com.jerboa.ui.components.common.customMarquee
import com.jerboa.ui.components.common.getCurrentAccount
import com.jerboa.ui.components.common.simpleVerticalScrollbar
import com.jerboa.ui.components.community.CommunityLinkLarger
Expand Down Expand Up @@ -463,13 +463,13 @@ fun AvatarAndAccountName(
text = myPerson?.getDisplayName() ?: account.name,
style = MaterialTheme.typography.bodyMedium,
color = MaterialTheme.colorScheme.onSurface,
modifier = Modifier.basicMarquee(),
modifier = Modifier.customMarquee(),
)
Text(
text = if (account.isAnon()) "" else "${account.name}@${account.instance}",
color = MaterialTheme.colorScheme.tertiary,
style = MaterialTheme.typography.bodyMedium,
modifier = Modifier.basicMarquee(),
modifier = Modifier.customMarquee(),
maxLines = 2,
)
}
Expand Down