From f495efd4077ff9948f74421094c28b2786a95370 Mon Sep 17 00:00:00 2001 From: Akashkamble Date: Sat, 29 Aug 2020 18:00:54 +0530 Subject: [PATCH] KtLint format. --- .../java/com/akash/newzz_compose/NewzzApplication.kt | 2 +- .../akash/newzz_compose/di/NewzzActivityModule.kt | 2 +- .../java/com/akash/newzz_compose/other/Category.kt | 2 -- .../java/com/akash/newzz_compose/ui/NewzzActivity.kt | 2 +- .../ui/commoncomposable/CommonComposables.kt | 2 +- .../akash/newzz_compose/ui/newzzappui/ArticleList.kt | 2 +- .../ui/newzzappui/ArticleListUiState.kt | 2 +- .../akash/newzz_compose/ui/newzzappui/BottomBar.kt | 3 --- .../akash/newzz_compose/ui/newzzappui/NewzzAppUI.kt | 3 +-- .../ui/newzzappui/NewzzListContainer.kt | 4 ++-- .../akash/newzz_compose/ui/newzzappui/TopAppBar.kt | 2 +- .../com/akash/newzz_compose/ui/style/TextStyle.kt | 12 ++++++------ .../com/akash/newzz_compose/util/CustomTabUtil.kt | 2 +- .../akash/newzz_compose/viewmodel/NewzzViewModel.kt | 5 ++--- 14 files changed, 19 insertions(+), 26 deletions(-) diff --git a/app/src/main/java/com/akash/newzz_compose/NewzzApplication.kt b/app/src/main/java/com/akash/newzz_compose/NewzzApplication.kt index 4847151..d41e8de 100644 --- a/app/src/main/java/com/akash/newzz_compose/NewzzApplication.kt +++ b/app/src/main/java/com/akash/newzz_compose/NewzzApplication.kt @@ -11,4 +11,4 @@ class NewzzApplication : BaseApplication() { override fun onCreate() { super.onCreate() } -} \ No newline at end of file +} diff --git a/app/src/main/java/com/akash/newzz_compose/di/NewzzActivityModule.kt b/app/src/main/java/com/akash/newzz_compose/di/NewzzActivityModule.kt index 3b7ff40..9eb4249 100644 --- a/app/src/main/java/com/akash/newzz_compose/di/NewzzActivityModule.kt +++ b/app/src/main/java/com/akash/newzz_compose/di/NewzzActivityModule.kt @@ -32,4 +32,4 @@ object NewzzActivityModule { @Provides @ActivityScoped fun provideMoshi(): Moshi = Moshi.Builder().build() -} \ No newline at end of file +} diff --git a/app/src/main/java/com/akash/newzz_compose/other/Category.kt b/app/src/main/java/com/akash/newzz_compose/other/Category.kt index 40b533a..1082eba 100644 --- a/app/src/main/java/com/akash/newzz_compose/other/Category.kt +++ b/app/src/main/java/com/akash/newzz_compose/other/Category.kt @@ -11,7 +11,6 @@ interface Category { val icon: Int } - data class General( override val category: String = "general", override val icon: Int = R.drawable.ic_general @@ -27,7 +26,6 @@ data class Technology( override val icon: Int = R.drawable.ic_tech ) : Category - fun getTitleResource(activeCategory: Category): Int = when (activeCategory) { is General -> R.string.title_general is Business -> R.string.title_business diff --git a/app/src/main/java/com/akash/newzz_compose/ui/NewzzActivity.kt b/app/src/main/java/com/akash/newzz_compose/ui/NewzzActivity.kt index ffa5370..072f087 100644 --- a/app/src/main/java/com/akash/newzz_compose/ui/NewzzActivity.kt +++ b/app/src/main/java/com/akash/newzz_compose/ui/NewzzActivity.kt @@ -29,4 +29,4 @@ class NewzzActivity : AppCompatActivity() { } } } -} \ No newline at end of file +} diff --git a/app/src/main/java/com/akash/newzz_compose/ui/commoncomposable/CommonComposables.kt b/app/src/main/java/com/akash/newzz_compose/ui/commoncomposable/CommonComposables.kt index 046de7c..6c09b6a 100644 --- a/app/src/main/java/com/akash/newzz_compose/ui/commoncomposable/CommonComposables.kt +++ b/app/src/main/java/com/akash/newzz_compose/ui/commoncomposable/CommonComposables.kt @@ -78,4 +78,4 @@ fun RemoteImage( } } } -} \ No newline at end of file +} diff --git a/app/src/main/java/com/akash/newzz_compose/ui/newzzappui/ArticleList.kt b/app/src/main/java/com/akash/newzz_compose/ui/newzzappui/ArticleList.kt index 517fe0c..e2af57e 100644 --- a/app/src/main/java/com/akash/newzz_compose/ui/newzzappui/ArticleList.kt +++ b/app/src/main/java/com/akash/newzz_compose/ui/newzzappui/ArticleList.kt @@ -83,4 +83,4 @@ fun ArticleList(articles: List) { ) } ) -} \ No newline at end of file +} diff --git a/app/src/main/java/com/akash/newzz_compose/ui/newzzappui/ArticleListUiState.kt b/app/src/main/java/com/akash/newzz_compose/ui/newzzappui/ArticleListUiState.kt index c27d044..3a145ee 100644 --- a/app/src/main/java/com/akash/newzz_compose/ui/newzzappui/ArticleListUiState.kt +++ b/app/src/main/java/com/akash/newzz_compose/ui/newzzappui/ArticleListUiState.kt @@ -11,4 +11,4 @@ data class ArticleListUiState( val isLoading: Boolean = true, val list: List? = emptyList(), val error: Result.Error? = null -) \ No newline at end of file +) diff --git a/app/src/main/java/com/akash/newzz_compose/ui/newzzappui/BottomBar.kt b/app/src/main/java/com/akash/newzz_compose/ui/newzzappui/BottomBar.kt index f2960a8..5fb41e8 100644 --- a/app/src/main/java/com/akash/newzz_compose/ui/newzzappui/BottomBar.kt +++ b/app/src/main/java/com/akash/newzz_compose/ui/newzzappui/BottomBar.kt @@ -46,6 +46,3 @@ fun BottomBar( } } } - - - diff --git a/app/src/main/java/com/akash/newzz_compose/ui/newzzappui/NewzzAppUI.kt b/app/src/main/java/com/akash/newzz_compose/ui/newzzappui/NewzzAppUI.kt index 42cc710..9370667 100644 --- a/app/src/main/java/com/akash/newzz_compose/ui/newzzappui/NewzzAppUI.kt +++ b/app/src/main/java/com/akash/newzz_compose/ui/newzzappui/NewzzAppUI.kt @@ -66,9 +66,8 @@ fun BodyContent( uiState = activeCategoryUiState, retry = { retryFetchingArticles(activeCategory) - }, + } ) } } } - diff --git a/app/src/main/java/com/akash/newzz_compose/ui/newzzappui/NewzzListContainer.kt b/app/src/main/java/com/akash/newzz_compose/ui/newzzappui/NewzzListContainer.kt index 3c66a32..303451a 100644 --- a/app/src/main/java/com/akash/newzz_compose/ui/newzzappui/NewzzListContainer.kt +++ b/app/src/main/java/com/akash/newzz_compose/ui/newzzappui/NewzzListContainer.kt @@ -26,7 +26,7 @@ import com.akash.newzz_compose.ui.style.articleTitleStyle @Composable fun NewzzListContainer( uiState: ArticleListUiState, - retry: () -> Unit, + retry: () -> Unit ) { Surface( color = NewzzTheme.colors.backGroundColor, @@ -50,7 +50,7 @@ fun NewzzListContainer( } uiState.list?.isEmpty() == false -> { ArticleList( - articles = uiState.list, + articles = uiState.list ) } } diff --git a/app/src/main/java/com/akash/newzz_compose/ui/newzzappui/TopAppBar.kt b/app/src/main/java/com/akash/newzz_compose/ui/newzzappui/TopAppBar.kt index aa50760..6f9997d 100644 --- a/app/src/main/java/com/akash/newzz_compose/ui/newzzappui/TopAppBar.kt +++ b/app/src/main/java/com/akash/newzz_compose/ui/newzzappui/TopAppBar.kt @@ -59,4 +59,4 @@ fun ThemeSwitcher(onThemeSwitch: () -> Unit) { tint = Color.White ) } -} \ No newline at end of file +} diff --git a/app/src/main/java/com/akash/newzz_compose/ui/style/TextStyle.kt b/app/src/main/java/com/akash/newzz_compose/ui/style/TextStyle.kt index b548206..57bf83d 100644 --- a/app/src/main/java/com/akash/newzz_compose/ui/style/TextStyle.kt +++ b/app/src/main/java/com/akash/newzz_compose/ui/style/TextStyle.kt @@ -17,15 +17,15 @@ val categoryTitleStyle = TextStyle( ) val articleTitleStyle = TextStyle( - fontWeight = FontWeight.Medium, - fontSize = 16.sp, + fontWeight = FontWeight.Medium, + fontSize = 16.sp ) val sourceTextStyle = TextStyle( - fontSize = 14.sp, + fontSize = 14.sp ) val dateTextStyle = TextStyle( - fontWeight = FontWeight.ExtraLight, - fontSize = 12.sp, -) \ No newline at end of file + fontWeight = FontWeight.ExtraLight, + fontSize = 12.sp +) diff --git a/app/src/main/java/com/akash/newzz_compose/util/CustomTabUtil.kt b/app/src/main/java/com/akash/newzz_compose/util/CustomTabUtil.kt index 713ac42..c0033dc 100644 --- a/app/src/main/java/com/akash/newzz_compose/util/CustomTabUtil.kt +++ b/app/src/main/java/com/akash/newzz_compose/util/CustomTabUtil.kt @@ -57,4 +57,4 @@ object CustomTabUtil { builder?.launchUrl(context, Uri.parse(url)) } } -} \ No newline at end of file +} diff --git a/app/src/main/java/com/akash/newzz_compose/viewmodel/NewzzViewModel.kt b/app/src/main/java/com/akash/newzz_compose/viewmodel/NewzzViewModel.kt index e082f64..83f3bd8 100644 --- a/app/src/main/java/com/akash/newzz_compose/viewmodel/NewzzViewModel.kt +++ b/app/src/main/java/com/akash/newzz_compose/viewmodel/NewzzViewModel.kt @@ -50,7 +50,7 @@ class NewzzViewModel @ViewModelInject constructor(private val repo: NewsReposito private fun getArticlesByCategory( category: Category, - page: Int = 1, + page: Int = 1 ) { viewModelScope.launch { setLoadingState(category) @@ -163,10 +163,9 @@ class NewzzViewModel @ViewModelInject constructor(private val repo: NewsReposito } } - sealed class Action { data class ChangePageTo(val category: Category) : Action() data class FetchArticles(val category: Category) : Action() object SwitchTheme : Action() } -} \ No newline at end of file +}