Skip to content

Commit

Permalink
improved pics (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
shalva97 authored Jun 19, 2022
1 parent a6364ad commit 40e65fd
Show file tree
Hide file tree
Showing 86 changed files with 41 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ import androidx.constraintlayout.compose.ConstraintLayout
import androidx.constraintlayout.compose.Dimension
import androidx.hilt.navigation.compose.hiltViewModel
import com.earth.testomania.core.helper.defaultTechQuizWrapper
import com.earth.testomania.core.log
import com.earth.testomania.technical.domain.model.TechQuizWrapper
import com.earth.testomania.technical.presentation.ui_parts.*
import com.earth.testomania.technical.presentation.ui_parts.CategoryIllustration
import com.earth.testomania.technical.presentation.ui_parts.CreateQuizAnswerUI
import com.earth.testomania.technical.presentation.ui_parts.CreateQuizUI
import com.earth.testomania.technical.presentation.ui_parts.OverallProgress
import com.google.accompanist.pager.ExperimentalPagerApi
import com.google.accompanist.pager.HorizontalPager
import com.google.accompanist.pager.PagerState
Expand Down Expand Up @@ -85,14 +87,18 @@ private fun QuestionAndAnswers(
state = pagerState,
) { page ->
ConstraintLayout(modifier = Modifier.fillMaxSize()) {
val (question, answers) = createRefs()
val (question, answers, illustration) = createRefs()

CreateQuizUI(modifier = Modifier
.constrainAs(question) {
top.linkTo(parent.top)
}
.fillMaxWidth(), techQuizList[page])

CategoryIllustration(modifier = Modifier.constrainAs(illustration) {
top.linkTo(question.bottom)
}, techQuizList[page].quiz.category)

LazyColumn(
modifier = Modifier
.fillMaxWidth()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package com.earth.testomania.technical.presentation.ui_parts

import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.res.painterResource
import com.earth.testomania.R

@Composable
fun CategoryIllustration(modifier: Modifier, category: String) {
Image(modifier = modifier.fillMaxWidth(), contentScale = ContentScale.Crop,
painter = painterResource(id = findImageCategory(category)), contentDescription = "")
}

private fun findImageCategory(category: String): Int {
category.contains("asdf")
return when {
category.contains("Linux", ignoreCase = true) -> R.drawable.il_os
category.contains("JS", ignoreCase = true) -> R.drawable.il_js
category.contains("PHP", ignoreCase = true) -> R.drawable.il_php
category.contains("Networking", ignoreCase = true) -> R.drawable.il_networking
category.contains("Cloud", ignoreCase = true) -> R.drawable.il_cloud
category.contains("Docker", ignoreCase = true) -> R.drawable.il_docker
category.contains("Kubernetes", ignoreCase = true) -> R.drawable.il_kubernetes
category.contains("html", ignoreCase = true) -> R.drawable.il_html
category.contains("sql", ignoreCase = true) -> R.drawable.il_sql
category.contains("wordpress", ignoreCase = true) -> R.drawable.il_wordpress
else -> R.drawable.il_unknown
}
}
Binary file removed testomania/src/main/res/drawable-hdpi/il_cloud.png
Binary file not shown.
Binary file removed testomania/src/main/res/drawable-hdpi/il_css.png
Binary file not shown.
Binary file removed testomania/src/main/res/drawable-hdpi/il_docker.png
Binary file not shown.
Binary file removed testomania/src/main/res/drawable-hdpi/il_html.png
Binary file not shown.
Binary file removed testomania/src/main/res/drawable-hdpi/il_it.png
Binary file not shown.
Binary file removed testomania/src/main/res/drawable-hdpi/il_it_2.png
Binary file not shown.
Binary file removed testomania/src/main/res/drawable-hdpi/il_it_3.png
Binary file not shown.
Binary file removed testomania/src/main/res/drawable-hdpi/il_js.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed testomania/src/main/res/drawable-hdpi/il_os.png
Binary file not shown.
Binary file removed testomania/src/main/res/drawable-hdpi/il_php.png
Binary file not shown.
Binary file removed testomania/src/main/res/drawable-hdpi/il_sql.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed testomania/src/main/res/drawable-mdpi/il_css.png
Binary file not shown.
Binary file removed testomania/src/main/res/drawable-mdpi/il_docker.png
Binary file not shown.
Binary file removed testomania/src/main/res/drawable-mdpi/il_html.png
Binary file not shown.
Binary file removed testomania/src/main/res/drawable-mdpi/il_it.png
Binary file not shown.
Binary file removed testomania/src/main/res/drawable-mdpi/il_it_2.png
Binary file not shown.
Binary file removed testomania/src/main/res/drawable-mdpi/il_it_3.png
Binary file not shown.
Binary file removed testomania/src/main/res/drawable-mdpi/il_js.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed testomania/src/main/res/drawable-mdpi/il_os.png
Binary file not shown.
Binary file removed testomania/src/main/res/drawable-mdpi/il_php.png
Diff not rendered.
Binary file removed testomania/src/main/res/drawable-mdpi/il_sql.png
Diff not rendered.
Diff not rendered.
Binary file removed testomania/src/main/res/drawable-xhdpi/il_cloud.png
Diff not rendered.
Binary file removed testomania/src/main/res/drawable-xhdpi/il_css.png
Diff not rendered.
Binary file removed testomania/src/main/res/drawable-xhdpi/il_docker.png
Diff not rendered.
Binary file removed testomania/src/main/res/drawable-xhdpi/il_html.png
Diff not rendered.
Binary file removed testomania/src/main/res/drawable-xhdpi/il_it.png
Diff not rendered.
Binary file removed testomania/src/main/res/drawable-xhdpi/il_it_2.png
Diff not rendered.
Binary file removed testomania/src/main/res/drawable-xhdpi/il_it_3.png
Diff not rendered.
Binary file removed testomania/src/main/res/drawable-xhdpi/il_js.png
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file removed testomania/src/main/res/drawable-xhdpi/il_os.png
Diff not rendered.
Binary file removed testomania/src/main/res/drawable-xhdpi/il_php.png
Diff not rendered.
Binary file removed testomania/src/main/res/drawable-xhdpi/il_sql.png
Diff not rendered.
Diff not rendered.
Binary file removed testomania/src/main/res/drawable-xxhdpi/il_cloud.png
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file removed testomania/src/main/res/drawable-xxhdpi/il_html.png
Diff not rendered.
Binary file removed testomania/src/main/res/drawable-xxhdpi/il_it.png
Diff not rendered.
Binary file removed testomania/src/main/res/drawable-xxhdpi/il_it_2.png
Diff not rendered.
Binary file removed testomania/src/main/res/drawable-xxhdpi/il_it_3.png
Diff not rendered.
Binary file removed testomania/src/main/res/drawable-xxhdpi/il_js.png
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file removed testomania/src/main/res/drawable-xxhdpi/il_os.png
Diff not rendered.
Binary file removed testomania/src/main/res/drawable-xxhdpi/il_php.png
Diff not rendered.
Binary file removed testomania/src/main/res/drawable-xxhdpi/il_sql.png
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file not shown.
Binary file not shown.
Binary file removed testomania/src/main/res/drawable-xxxhdpi/il_css.png
Diff not rendered.
Binary file not shown.
Diff not rendered.
Binary file not shown.
Binary file removed testomania/src/main/res/drawable-xxxhdpi/il_html.png
Diff not rendered.
Binary file not shown.
Binary file removed testomania/src/main/res/drawable-xxxhdpi/il_it.png
Diff not rendered.
Diff not rendered.
Binary file removed testomania/src/main/res/drawable-xxxhdpi/il_it_3.png
Diff not rendered.
Binary file removed testomania/src/main/res/drawable-xxxhdpi/il_js.png
Diff not rendered.
Binary file not shown.
Diff not rendered.
Binary file not shown.
Diff not rendered.
Binary file not shown.
Binary file removed testomania/src/main/res/drawable-xxxhdpi/il_os.png
Diff not rendered.
Binary file not shown.
Binary file removed testomania/src/main/res/drawable-xxxhdpi/il_php.png
Diff not rendered.
Binary file not shown.
Binary file removed testomania/src/main/res/drawable-xxxhdpi/il_sql.png
Diff not rendered.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Diff not rendered.
Binary file not shown.

0 comments on commit 40e65fd

Please sign in to comment.