Skip to content

Commit

Permalink
KtLint format.
Browse files Browse the repository at this point in the history
  • Loading branch information
Akashkamble committed Aug 29, 2020
1 parent 12445c7 commit f495efd
Show file tree
Hide file tree
Showing 14 changed files with 19 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ class NewzzApplication : BaseApplication() {
override fun onCreate() {
super.onCreate()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ object NewzzActivityModule {
@Provides
@ActivityScoped
fun provideMoshi(): Moshi = Moshi.Builder().build()
}
}
2 changes: 0 additions & 2 deletions app/src/main/java/com/akash/newzz_compose/other/Category.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ class NewzzActivity : AppCompatActivity() {
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,4 @@ fun RemoteImage(
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,4 @@ fun ArticleList(articles: List<NewsArticle>) {
)
}
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ data class ArticleListUiState(
val isLoading: Boolean = true,
val list: List<NewsArticle>? = emptyList(),
val error: Result.Error? = null
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,3 @@ fun BottomBar(
}
}
}



Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,8 @@ fun BodyContent(
uiState = activeCategoryUiState,
retry = {
retryFetchingArticles(activeCategory)
},
}
)
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -50,7 +50,7 @@ fun NewzzListContainer(
}
uiState.list?.isEmpty() == false -> {
ArticleList(
articles = uiState.list,
articles = uiState.list
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ fun ThemeSwitcher(onThemeSwitch: () -> Unit) {
tint = Color.White
)
}
}
}
12 changes: 6 additions & 6 deletions app/src/main/java/com/akash/newzz_compose/ui/style/TextStyle.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
fontWeight = FontWeight.ExtraLight,
fontSize = 12.sp
)
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ object CustomTabUtil {
builder?.launchUrl(context, Uri.parse(url))
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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()
}
}
}

0 comments on commit f495efd

Please sign in to comment.