Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
FloEdelmann committed May 6, 2024
1 parent 82ee0be commit 5c41733
Show file tree
Hide file tree
Showing 14 changed files with 6 additions and 22 deletions.
1 change: 0 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ dependencies {
implementation("androidx.compose.ui:ui-tooling-preview")
debugImplementation("androidx.compose.ui:ui-tooling")


implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.7.0")
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.7.0")
// photos
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ package de.westnordost.streetcomplete.quests.max_height

import android.os.Bundle
import android.view.View
import android.widget.TextView
import androidx.appcompat.app.AlertDialog
import androidx.core.view.isGone
import de.westnordost.streetcomplete.R
import de.westnordost.streetcomplete.data.osm.mapdata.ElementType
import de.westnordost.streetcomplete.quests.AbstractOsmQuestForm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import android.view.LayoutInflater
import android.view.View
import androidx.annotation.DrawableRes
import androidx.appcompat.app.AlertDialog
import androidx.core.view.isGone
import de.westnordost.streetcomplete.R
import de.westnordost.streetcomplete.databinding.QuestGenericListBinding
import de.westnordost.streetcomplete.osm.surface.Surface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package de.westnordost.streetcomplete.quests.step_count

import android.os.Bundle
import android.view.View
import androidx.core.os.bundleOf
import androidx.core.widget.doAfterTextChanged
import de.westnordost.streetcomplete.R
import de.westnordost.streetcomplete.databinding.QuestStepCountBinding
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import android.view.ViewGroup
import android.view.animation.AnimationUtils
import androidx.annotation.UiThread
import androidx.appcompat.app.AlertDialog
import androidx.core.view.isGone
import androidx.core.view.updateLayoutParams
import androidx.core.view.updatePadding
import androidx.fragment.app.Fragment
Expand All @@ -17,12 +16,9 @@ import com.google.android.material.bottomsheet.BottomSheetBehavior.STATE_EXPANDE
import de.westnordost.streetcomplete.R
import de.westnordost.streetcomplete.data.osm.mapdata.LatLon
import de.westnordost.streetcomplete.util.ktx.updateMargins
import de.westnordost.streetcomplete.util.ktx.viewLifecycleScope
import de.westnordost.streetcomplete.view.RoundRectOutlineProvider
import de.westnordost.streetcomplete.view.SlidingRelativeLayout
import de.westnordost.streetcomplete.view.insets_animation.respectSystemInsets
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import kotlin.math.min

/** Abstract base class for expandable and closeable bottom sheets. In detail, it does manage the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ abstract class UserViewModel : ViewModel() {

class UserViewModelImpl(
private val userLoginStatusSource: UserLoginStatusSource
): UserViewModel() {
) : UserViewModel() {
override val isLoggedIn = MutableStateFlow(userLoginStatusSource.isLoggedIn)

private val loginStatusListener = object : UserLoginStatusSource.Listener {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ private fun ContentWithIconPortraitOrLandscape(
if (isLandscape) PaddingValues(start = iconSize * 0.75f)
else PaddingValues(top = iconSize * 0.75f)


val dialogModifier = modifier
.backgroundWithPadding(
color = MaterialTheme.colors.surface,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fun LazyGroupedLinksColumn(
// TODO Compose: revisit animate-in of list items when androidx.compose.animation 1.7 is stable
// probably Modifier.animateItem or Modifier.animateEnterExit
LazyLinksGrid(modifier, contentPadding = contentPadding) {
val groupedLinks = allLinks.groupBy { it.category }.map { (k,v) -> k to v }
val groupedLinks = allLinks.groupBy { it.category }.map { (k, v) -> k to v }
for ((category, links) in groupedLinks) {
item(
span = { GridItemSpan(maxLineSpan) },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import de.westnordost.streetcomplete.R
import de.westnordost.streetcomplete.data.user.achievements.Link
import de.westnordost.streetcomplete.data.user.achievements.LinkCategory
import de.westnordost.streetcomplete.ui.theme.titleLarge
import de.westnordost.streetcomplete.ui.theme.titleMedium
import de.westnordost.streetcomplete.ui.theme.titleSmall

@Composable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ fun DatesActiveTable(
}
if (horizontalCells < 1) return@Canvas
// grid + months
for (i in 0 ..< datesActiveRange) {
for (i in 0..<datesActiveRange) {
val time = systemTimeNow().minus(i, DateTimeUnit.DAY, TimeZone.UTC)
val date = time.toLocalDateTime(TimeZone.UTC).date

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ fun LaurelWreath(
}

// leaves left and right
for (i in 0 ..< leafs) {
for (i in 0..<leafs) {
drawLeaf(
leaf = if (i == leafs -1) leafPairGrowing else leafPair,
leaf = if (i == leafs - 1) leafPairGrowing else leafPair,
angle = (i + 1f) * maxLeafAngle / maxLeafs - 90f,
scale = if (i == leafs - 1) maxLeafs * progress % 1f else 1f
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ fun ProfileScreen(viewModel: ProfileViewModel) {
horizontalArrangement = Arrangement.SpaceAround,
verticalArrangement = Arrangement.spacedBy(16.dp)
) {

val localStats = biggestSolvedCountCountryStatistics
if (localStats?.rank != null) {
LocalRankBadge(localStats.rank, localStats.countryCode, getAnimationDelay(delay++))
Expand Down Expand Up @@ -194,7 +193,7 @@ fun ProfileScreen(viewModel: ProfileViewModel) {
private fun LocalRankBadge(rank: Int, countryCode: String?, delay: Int) {
LaurelWreathBadge(
label = getLocalRankText(countryCode),
value = "#${rank}",
value = "#$rank",
// 2024-05: rank 850 is about top 50% of users (~20 edits), rank 200 top 5% (~1500 edits)
// in Italy, which is the top 5 country in terms of contributions
progress = getRankProgress(rank, maxProgressAtRank = 200, minProgressAtRank = 850),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ abstract class ProfileViewModel : ViewModel() {
abstract val biggestSolvedCountCountryStatistics: StateFlow<CountryStatistics?>
abstract val biggestSolvedCountCurrentWeekCountryStatistics: StateFlow<CountryStatistics?>


abstract fun logOutUser()
}

Expand Down Expand Up @@ -68,7 +67,6 @@ class ProfileViewModelImpl(
override val biggestSolvedCountCountryStatistics = MutableStateFlow<CountryStatistics?>(null)
override val biggestSolvedCountCurrentWeekCountryStatistics = MutableStateFlow<CountryStatistics?>(null)


override fun logOutUser() {
launch { userLoginStatusController.logOut() }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import androidx.compose.material.lightColors
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Color


/* Colors as they could be found on (illustrations of) traffic signs. */
val TrafficRed = Color(0xffc1121c)
val TrafficBlue = Color(0xff2255bb)
Expand Down Expand Up @@ -38,7 +37,6 @@ val GrassGreen = Color(0xff80b158)
val GrassGray = Color(0xffb1b1b1)
val LeafGreen = Color(0xff006a00)


val LightColors = lightColors(
primary = Color(0xff4141ba),
primaryVariant = Color(0xff3939a3),
Expand Down

0 comments on commit 5c41733

Please sign in to comment.