-
Notifications
You must be signed in to change notification settings - Fork 0
UI をブラッシュアップ #27
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
Merged
Merged
UI をブラッシュアップ #27
Changes from 15 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
69aec0d
add:jetpackComposeに追加
harutiro 6d3bfc6
fix: Activityの名前をMainActivityに変更
harutiro 7ade9d7
fix: デフォルトのテーマを反映
harutiro 5ceb594
add: 検索画面作成
harutiro 21e0dd3
add: ローディング画面の作成
harutiro 15c7546
add: 詳細画面に遷移できるようにした。
harutiro 3d295eb
fix: レポジトリのリストを取得するものはそのような名前にするように変更
harutiro 3ca8e44
add: 詳細を押した時に、詳細が表示されるyouni
harutiro e01f44c
add: 詳細画面に行くときに、AppBarに戻るボタンを用意した。
harutiro 5f6e98c
add: エラーを表示させる時に、スナックバーに変更
harutiro acd828f
ref: リンターの変更
harutiro 9baaee1
ref: material3の警告解除を消去
harutiro 5c3c9e2
add: 詳細分のUnitTestを追加した。
harutiro 23d3050
delete: fragmentの時の記述をすべて消去した。
harutiro d67d4a5
ref: リンターの修正
harutiro c30c479
ref: リンターの修正
harutiro 3c5024e
fix: タイポグラフィーの完全の実装を行なった
harutiro d026e54
fix: アクセシビリティとローカライゼーションの改善
harutiro bedab2d
fix: エラーハンドリングの改善
harutiro 99b1860
fix: アクセシビリティの改善
harutiro 1942c47
fix: 画像読み込みの改善
harutiro 0c89774
fix: エラーメッセージのリソース化
harutiro 39c75af
fix: 状態管理とエラーハンドリングの改善
harutiro 8513674
fix: エラーハンドリングとユーザー体験の改善
harutiro e9a1c79
fix: 統計情報のテキストをリソース化
harutiro 230ba6c
fix: 初期ローディング状態の設定とUI表示の制御
harutiro e6cfc32
fix:文字列リソースの重複の解消
harutiro a94b51d
fix:カウント表示文字列の重複と不整合の修正
harutiro 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 hidden or 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,2 +1,4 @@ | ||
| [*.{kt,kts}] | ||
| ktlint_standard_package-name = disabled | ||
| ktlint_function_naming_ignore_when_annotated_with = Composable | ||
|
|
This file contains hidden or 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 hidden or 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
23 changes: 23 additions & 0 deletions
23
app/src/main/kotlin/jp/co/yumemi/android/code_check/MainActivity.kt
This file contains hidden or 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,23 @@ | ||
| /* | ||
| * Copyright © 2021 YUMEMI Inc. All rights reserved. | ||
| */ | ||
| package jp.co.yumemi.android.code_check | ||
|
|
||
| import android.os.Bundle | ||
| import androidx.activity.ComponentActivity | ||
| import androidx.activity.compose.setContent | ||
| import dagger.hilt.android.AndroidEntryPoint | ||
| import jp.co.yumemi.android.code_check.core.presenter.MainScreen | ||
| import jp.co.yumemi.android.code_check.core.presenter.theme.CodeCheckAppTheme | ||
|
|
||
| @AndroidEntryPoint | ||
| class MainActivity : ComponentActivity() { | ||
| override fun onCreate(savedInstanceState: Bundle?) { | ||
| super.onCreate(savedInstanceState) | ||
| setContent { | ||
| CodeCheckAppTheme { | ||
| MainScreen() | ||
| } | ||
| } | ||
| } | ||
| } |
10 changes: 0 additions & 10 deletions
10
app/src/main/kotlin/jp/co/yumemi/android/code_check/TopActivity.kt
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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
126 changes: 126 additions & 0 deletions
126
app/src/main/kotlin/jp/co/yumemi/android/code_check/core/presenter/MainScreen.kt
This file contains hidden or 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,126 @@ | ||
| package jp.co.yumemi.android.code_check.core.presenter | ||
|
|
||
| import androidx.compose.foundation.layout.padding | ||
| import androidx.compose.material.icons.Icons | ||
| import androidx.compose.material.icons.automirrored.outlined.ArrowBack | ||
| import androidx.compose.material.icons.outlined.ArrowBack | ||
| import androidx.compose.material3.ExperimentalMaterial3Api | ||
| import androidx.compose.material3.Icon | ||
| import androidx.compose.material3.IconButton | ||
| import androidx.compose.material3.MaterialTheme | ||
| import androidx.compose.material3.Scaffold | ||
| import androidx.compose.material3.Snackbar | ||
| import androidx.compose.material3.SnackbarHost | ||
| import androidx.compose.material3.SnackbarHostState | ||
| import androidx.compose.material3.Text | ||
| import androidx.compose.material3.TopAppBar | ||
| import androidx.compose.material3.TopAppBarDefaults | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.runtime.getValue | ||
| import androidx.compose.runtime.mutableStateOf | ||
| import androidx.compose.runtime.remember | ||
| import androidx.compose.runtime.rememberCoroutineScope | ||
| import androidx.compose.runtime.setValue | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.platform.LocalContext | ||
| import androidx.compose.ui.text.font.FontWeight | ||
| import androidx.navigation.compose.currentBackStackEntryAsState | ||
| import androidx.navigation.compose.rememberNavController | ||
| import jp.co.yumemi.android.code_check.R | ||
| import jp.co.yumemi.android.code_check.core.presenter.router.BottomNavigationBarRoute | ||
| import jp.co.yumemi.android.code_check.core.presenter.router.MainRouter | ||
| import jp.co.yumemi.android.code_check.core.presenter.widget.EmptyCompose | ||
| import kotlinx.coroutines.launch | ||
|
|
||
| @OptIn(ExperimentalMaterial3Api::class) | ||
| @Composable | ||
| fun MainScreen() { | ||
| val context = LocalContext.current | ||
| val appName = context.getString(R.string.app_name) | ||
|
|
||
| val navController = rememberNavController() | ||
| val navBackStackEntry by navController.currentBackStackEntryAsState() | ||
| var topBarTitle by remember { | ||
| mutableStateOf(appName) | ||
| } | ||
|
|
||
| val hostState = remember { SnackbarHostState() } | ||
| var isErrorMessage by remember { mutableStateOf(false) } | ||
| val scope = rememberCoroutineScope() | ||
|
|
||
| val navigationIcon: @Composable () -> Unit = | ||
| if (navBackStackEntry?.destination?.route != BottomNavigationBarRoute.SEARCH.route) { | ||
| { | ||
| IconButton(onClick = { | ||
| navController.popBackStack() | ||
| }) { | ||
| Icon( | ||
| imageVector = Icons.AutoMirrored.Outlined.ArrowBack, | ||
| contentDescription = "Back", | ||
| ) | ||
| } | ||
| } | ||
| } else { | ||
| { | ||
| EmptyCompose() | ||
| } | ||
| } | ||
|
|
||
| Scaffold( | ||
| topBar = { | ||
| TopAppBar( | ||
| title = { | ||
| Text( | ||
| text = topBarTitle, | ||
| fontWeight = FontWeight.Bold, | ||
| ) | ||
| }, | ||
| colors = | ||
| TopAppBarDefaults.topAppBarColors( | ||
| containerColor = MaterialTheme.colorScheme.primaryContainer, | ||
| titleContentColor = MaterialTheme.colorScheme.primary, | ||
| ), | ||
| navigationIcon = navigationIcon, | ||
| ) | ||
| }, | ||
| snackbarHost = { CustomSnackbarHost(hostState = hostState, isErrorMessage = isErrorMessage) }, | ||
| ) { innerPadding -> | ||
| MainRouter( | ||
| toDetailScreen = { id -> | ||
| navController.navigate("${BottomNavigationBarRoute.DETAIL.route}/$id") | ||
| }, | ||
| toBackScreen = { | ||
| navController.popBackStack() | ||
| }, | ||
| changeTopBarTitle = { | ||
| topBarTitle = it | ||
| }, | ||
| showSnackbar = { message, isError -> | ||
| scope.launch { | ||
| isErrorMessage = isError | ||
| hostState.showSnackbar(message) | ||
| } | ||
| }, | ||
| navController = navController, | ||
| modifier = | ||
| Modifier | ||
| .padding(innerPadding), | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| @Composable | ||
| fun CustomSnackbarHost( | ||
| hostState: SnackbarHostState, | ||
| isErrorMessage: Boolean, | ||
| ) { | ||
| SnackbarHost( | ||
| hostState = hostState, | ||
| ) { snackbarData -> | ||
| Snackbar( | ||
| snackbarData = snackbarData, | ||
| containerColor = if (isErrorMessage) MaterialTheme.colorScheme.error else MaterialTheme.colorScheme.primaryContainer, | ||
| contentColor = if (isErrorMessage) MaterialTheme.colorScheme.onError else MaterialTheme.colorScheme.onPrimaryContainer, | ||
| ) | ||
| } | ||
| } |
49 changes: 0 additions & 49 deletions
49
.../kotlin/jp/co/yumemi/android/code_check/core/presenter/detail/RepositoryDetailFragment.kt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.