Skip to content

Commit

Permalink
Change to IconRepresentation
Browse files Browse the repository at this point in the history
  • Loading branch information
shinya-tan committed Aug 17, 2023
1 parent b0884e0 commit 1746efc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,45 +85,45 @@ fun MainScreen(
)
}

sealed class IconType {
data class Vector(val imageVector: ImageVector) : IconType()
data class Drawable(@DrawableRes val drawableId: Int) : IconType()
sealed class IconRepresentation {
data class Vector(val imageVector: ImageVector) : IconRepresentation()
data class Drawable(@DrawableRes val drawableId: Int) : IconRepresentation()
}

enum class MainScreenTab(
val icon: ImageVector,
val selectedIcon: IconType,
val selectedIcon: IconRepresentation,
val label: String,
val contentDescription: String,
val testTag: String = "mainScreenTab:$label",
) {
Timetable(
icon = Icons.Outlined.CalendarMonth,
selectedIcon = IconType.Vector(Icons.Filled.CalendarMonth),
selectedIcon = IconRepresentation.Vector(Icons.Filled.CalendarMonth),
label = MainStrings.Timetable.asString(),
contentDescription = MainStrings.Timetable.asString(),
),
FloorMap(
icon = Icons.Outlined.Map,
selectedIcon = IconType.Drawable(drawableId = R.drawable.icon_map_fill),
selectedIcon = IconRepresentation.Drawable(drawableId = R.drawable.icon_map_fill),
label = MainStrings.FloorMap.asString(),
contentDescription = MainStrings.FloorMap.asString(),
),
Badges(
icon = Icons.Outlined.Approval,
selectedIcon = IconType.Vector(Icons.Filled.Approval),
selectedIcon = IconRepresentation.Vector(Icons.Filled.Approval),
label = MainStrings.Badges.asString(),
contentDescription = MainStrings.Badges.asString(),
),
About(
icon = Icons.Outlined.Info,
selectedIcon = IconType.Vector(Icons.Filled.Info),
selectedIcon = IconRepresentation.Vector(Icons.Filled.Info),
label = MainStrings.About.asString(),
contentDescription = MainStrings.About.asString(),
),
Contributor(
icon = Icons.Outlined.Group,
selectedIcon = IconType.Vector(Icons.Filled.Group),
selectedIcon = IconRepresentation.Vector(Icons.Filled.Group),
label = MainStrings.Contributors.asString(),
contentDescription = MainStrings.Contributors.asString(),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.style.TextOverflow
import io.github.droidkaigi.confsched2023.main.IconType.Drawable
import io.github.droidkaigi.confsched2023.main.IconType.Vector
import io.github.droidkaigi.confsched2023.main.IconRepresentation.Drawable
import io.github.droidkaigi.confsched2023.main.IconRepresentation.Vector
import io.github.droidkaigi.confsched2023.main.MainScreenTab

@Composable
Expand Down

0 comments on commit 1746efc

Please sign in to comment.