-
Notifications
You must be signed in to change notification settings - Fork 206
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
Feature/546 apply the correct icon for floormap #620
Merged
takahirom
merged 4 commits into
DroidKaigi:main
from
shinya-tan:feature/546_apply_the_correct_icon_for_floormap
Aug 17, 2023
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
package io.github.droidkaigi.confsched2023.main | ||
|
||
import androidx.annotation.DrawableRes | ||
import androidx.compose.animation.EnterTransition | ||
import androidx.compose.animation.ExitTransition | ||
import androidx.compose.animation.core.FastOutLinearInEasing | ||
|
@@ -16,7 +17,6 @@ import androidx.compose.material.icons.filled.Approval | |
import androidx.compose.material.icons.filled.CalendarMonth | ||
import androidx.compose.material.icons.filled.Group | ||
import androidx.compose.material.icons.filled.Info | ||
import androidx.compose.material.icons.filled.Map | ||
import androidx.compose.material.icons.outlined.Approval | ||
import androidx.compose.material.icons.outlined.CalendarMonth | ||
import androidx.compose.material.icons.outlined.Group | ||
|
@@ -37,6 +37,7 @@ import androidx.navigation.compose.NavHost | |
import androidx.navigation.compose.composable | ||
import androidx.navigation.compose.currentBackStackEntryAsState | ||
import androidx.navigation.compose.rememberNavController | ||
import io.github.droidkaigi.confsched2023.feature.main.R | ||
import io.github.droidkaigi.confsched2023.main.component.KaigiBottomBar | ||
import io.github.droidkaigi.confsched2023.main.strings.MainStrings | ||
import io.github.droidkaigi.confsched2023.ui.SnackbarMessageEffect | ||
|
@@ -84,40 +85,45 @@ fun MainScreen( | |
) | ||
} | ||
|
||
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: ImageVector, | ||
val selectedIcon: IconRepresentation, | ||
val label: String, | ||
val contentDescription: String, | ||
val testTag: String = "mainScreenTab:$label", | ||
) { | ||
Timetable( | ||
icon = Icons.Outlined.CalendarMonth, | ||
selectedIcon = Icons.Filled.CalendarMonth, | ||
selectedIcon = IconRepresentation.Vector(Icons.Filled.CalendarMonth), | ||
label = MainStrings.Timetable.asString(), | ||
contentDescription = MainStrings.Timetable.asString(), | ||
), | ||
FloorMap( | ||
icon = Icons.Outlined.Map, | ||
selectedIcon = Icons.Filled.Map, | ||
selectedIcon = IconRepresentation.Drawable(drawableId = R.drawable.icon_map_fill), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since Icons.Filled.Map did not align with the Figma design, I added the map_fill SVG to display. |
||
label = MainStrings.FloorMap.asString(), | ||
contentDescription = MainStrings.FloorMap.asString(), | ||
), | ||
Badges( | ||
icon = Icons.Outlined.Approval, | ||
selectedIcon = Icons.Filled.Approval, | ||
selectedIcon = IconRepresentation.Vector(Icons.Filled.Approval), | ||
label = MainStrings.Badges.asString(), | ||
contentDescription = MainStrings.Badges.asString(), | ||
), | ||
About( | ||
icon = Icons.Outlined.Info, | ||
selectedIcon = Icons.Filled.Info, | ||
selectedIcon = IconRepresentation.Vector(Icons.Filled.Info), | ||
label = MainStrings.About.asString(), | ||
contentDescription = MainStrings.About.asString(), | ||
), | ||
Contributor( | ||
icon = Icons.Outlined.Group, | ||
selectedIcon = Icons.Filled.Group, | ||
selectedIcon = IconRepresentation.Vector(Icons.Filled.Group), | ||
label = MainStrings.Contributors.asString(), | ||
contentDescription = MainStrings.Contributors.asString(), | ||
), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="24dp" | ||
android:height="24dp" | ||
android:viewportWidth="960" | ||
android:viewportHeight="960"> | ||
<path | ||
android:fillColor="#FF000000" | ||
android:pathData="m600,840 l-240,-84 -186,72q-20,8 -37,-4.5T120,790v-560q0,-13 7.5,-23t20.5,-15l212,-72 240,84 186,-72q20,-8 37,4.5t17,33.5v560q0,13 -7.5,23T812,768l-212,72ZM560,742v-468l-160,-56v468l160,56Z"/> | ||
</vector> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implement the selectedIcon of MainScreenTab to make it work with drawable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍