Skip to content

Commit

Permalink
Feature: Enhance lint.
Browse files Browse the repository at this point in the history
  • Loading branch information
chepsi authored and kibettheophilus committed Jun 12, 2023
1 parent c8b4c24 commit 4afde98
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ fun DroidconAppBar(
verticalAlignment = Alignment.CenterVertically
) {
Image(
painter = painterResource(id = if (isSystemInDarkTheme()) R.drawable.droidcon_logo_dark else R.drawable.droidcon_logo),
painter = painterResource(id = if (isSystemInDarkTheme()) R.drawable.droidcon_logo_dark else R.drawable.droidcon_logo),
contentDescription = stringResource(id = R.string.logo)
)
Spacer(modifier = Modifier.weight(1f))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ fun DroidconAppBarWithFeedbackButton(
verticalAlignment = Alignment.CenterVertically
) {
Image(
painter = painterResource(id = if (isSystemInDarkTheme()) R.drawable.droidcon_logo_dark else R.drawable.droidcon_logo),
painter = painterResource(id = if (isSystemInDarkTheme()) R.drawable.droidcon_logo_dark else R.drawable.droidcon_logo),
contentDescription = stringResource(id = R.string.logo)
)
Spacer(modifier = Modifier.weight(1f))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ fun DroidconAppBarWithFilter(
verticalAlignment = Alignment.CenterVertically
) {
Image(
painter = painterResource(id = if (isSystemInDarkTheme()) R.drawable.droidcon_logo_dark else R.drawable.droidcon_logo),
painter = painterResource(id = if (isSystemInDarkTheme()) R.drawable.droidcon_logo_dark else R.drawable.droidcon_logo),
contentDescription = stringResource(id = R.string.logo)
)
Spacer(modifier = Modifier.weight(1f))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,20 @@
*/
package com.android254.presentation.common.components

import android.os.Build
import androidx.annotation.RequiresApi
import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.RowScope
import androidx.compose.foundation.layout.defaultMinSize
import androidx.compose.foundation.layout.offset
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.CornerBasedShape
import androidx.compose.foundation.shape.CornerSize
import androidx.compose.material3.*
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.ButtonElevation
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.OutlinedButton
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
Expand All @@ -34,7 +41,6 @@ import com.android254.presentation.common.theme.Montserrat
import com.android254.presentation.models.SessionsFilterOption
import com.droidconke.chai.atoms.MontserratBold

@RequiresApi(Build.VERSION_CODES.O)
@Composable
fun MultiToggleButton(
currentSelections: List<SessionsFilterOption>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,21 @@ package com.android254.presentation.sessions.components

import android.content.Context
import android.content.res.Resources
import android.os.Build
import androidx.annotation.RequiresApi
import androidx.compose.foundation.layout.*
import androidx.compose.material3.*
import androidx.compose.runtime.*
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.painterResource
Expand All @@ -39,7 +49,6 @@ import com.droidconke.chai.atoms.MontserratBold
import com.droidconke.chai.atoms.MontserratSemiBold
import com.droidconke.chai.components.CButton
import ke.droidcon.kotlin.presentation.R
import java.util.*

private fun loadFilters(context: Context): List<SessionsFilterOption> {
val resources: Resources = context.resources
Expand Down Expand Up @@ -108,7 +117,6 @@ private fun loadFilters(context: Context): List<SessionsFilterOption> {
)
}

@RequiresApi(Build.VERSION_CODES.O)
@Composable
fun SessionsFilterPanel(
onDismiss: () -> Unit,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,9 @@ fun CustomSwitch(
private fun animateAlignmentAsState(
targetBiasValue: Float
): State<BiasAlignment> {
val bias by animateFloatAsState(targetBiasValue)
return derivedStateOf { BiasAlignment(horizontalBias = bias, verticalBias = 0f) }
val bias by animateFloatAsState(targetValue = targetBiasValue, label = "")

return remember {
derivedStateOf { BiasAlignment(horizontalBias = bias, verticalBias = 0f) }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import androidx.compose.ui.test.junit4.createComposeRule
import androidx.compose.ui.test.onNodeWithTag
import androidx.compose.ui.test.performScrollTo
import androidx.lifecycle.SavedStateHandle
import androidx.test.ext.junit.runners.AndroidJUnit4
import com.android254.domain.models.ResourceResult
import com.android254.domain.models.Speaker
import com.android254.domain.repos.SpeakersRepo
Expand All @@ -30,11 +31,8 @@ import io.mockk.mockk
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.RobolectricTestRunner
import org.robolectric.annotation.Config

@RunWith(RobolectricTestRunner::class)
@Config(instrumentedPackages = ["androidx.loader.content"])
@RunWith(AndroidJUnit4::class)
class SpeakerDetailsScreenTest {
private val speakersRepo = mockk<SpeakersRepo>()
private val mockSavedStateHandle = mockk<SavedStateHandle>()
Expand Down

0 comments on commit 4afde98

Please sign in to comment.