Skip to content

Commit

Permalink
Rework user interface, including all sliders (#23)
Browse files Browse the repository at this point in the history
* Sliders are improved to also include a text field where possible so that the user may choose to use the slider or use the text field.
* Material colors used throughout the app.
* Spacing between each section when editing art.
  • Loading branch information
Tyler-Lopez authored Feb 14, 2023
1 parent 667af89 commit c329ae9
Show file tree
Hide file tree
Showing 73 changed files with 1,564 additions and 1,595 deletions.
1 change: 1 addition & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ android {
applicationId "com.activityartapp"
minSdk 26
targetSdk 33
versionCode 8
versionName "1.2.0"
versionCode 9
versionName "1.2.1"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
xmlns:tools="http://schemas.android.com/tools"
package="com.activityartapp">

<uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_MEDIA_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
Expand All @@ -27,6 +26,7 @@
<activity
android:name=".presentation.MainActivity"
android:exported="true"
android:windowSoftInputMode="adjustResize"
android:hardwareAccelerated="true"
android:label="@string/app_name"
android:theme="@style/Theme.App.Starting">
Expand Down
5 changes: 2 additions & 3 deletions app/src/main/java/com/activityartapp/di/AppModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import com.activityartapp.domain.useCase.athleteUsage.InsertAthleteUsageIntoRemo
import com.activityartapp.domain.useCase.authentication.ClearAccessTokenFromDisk
import com.activityartapp.presentation.editArtScreen.subscreens.resize.ResolutionListFactoryImpl
import com.activityartapp.util.*
import com.activityartapp.util.constants.StringConstants.BASE_URL
import com.activityartapp.util.constants.TokenConstants
import com.google.firebase.database.FirebaseDatabase
import com.google.firebase.firestore.FirebaseFirestore
import com.google.firebase.firestore.FirebaseFirestoreSettings
Expand All @@ -37,7 +37,6 @@ import javax.inject.Singleton
@Module
@InstallIn(SingletonComponent::class)
object AppModule {

@Singleton
@Provides
fun provideAthleteDatabase(@ApplicationContext appContext: Context): AthleteDatabase {
Expand Down Expand Up @@ -126,7 +125,7 @@ object AppModule {
fun provideAthleteApi(): AthleteApi {
return Retrofit.Builder()
.addConverterFactory(GsonConverterFactory.create())
.baseUrl(BASE_URL)
.baseUrl(TokenConstants.BASE_URL)
.build()
.create(AthleteApi::class.java) // Creates singleton implementation of interface
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package com.activityartapp.domain.useCase.version

import com.activityartapp.BuildConfig
import com.activityartapp.domain.repository.VersionRepository
import com.activityartapp.domain.models.Version
import com.activityartapp.util.Response
import com.activityartapp.util.constants.StringConstants.APP_VERSION
import javax.inject.Inject

/** Determines whether the currently-installed [Version] of the client application
* is the latest and if it is supported. **/
class GetVersionFromRemote @Inject constructor(private val versionRepository: VersionRepository) {
suspend operator fun invoke(): Response<Version> {
return versionRepository.getVersion(APP_VERSION)
return versionRepository.getVersion(BuildConfig.VERSION_NAME)
}
}
54 changes: 26 additions & 28 deletions app/src/main/java/com/activityartapp/presentation/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -49,36 +49,34 @@ class MainActivity : ComponentActivity(), Router<MainDestination> {
// Install Splash Screen before content is setContent
val splashScreen = installSplashScreen()
setContent {
AthleteApiArtTheme {
viewModel = hiltViewModel()
viewModel = hiltViewModel()

viewModel.apply {
/** Set splash screen to on while loading authentication **/
splashScreen.setKeepOnScreenCondition {
viewState.value == null
}
/** Push event to [MainViewModel] to determine authentication **/
LaunchedEffect(key1 = intentUri) {
println("Intent uri is $intentUri")
onEvent(LoadAuthentication(intentUri))
viewModel.apply {
/** Set splash screen to on while loading authentication **/
splashScreen.setKeepOnScreenCondition {
viewState.value == null
}
/** Push event to [MainViewModel] to determine authentication **/
LaunchedEffect(key1 = intentUri) {
println("Intent uri is $intentUri")
onEvent(LoadAuthentication(intentUri))
}
/** Set global nav controller for [routeTo] **/
navController = rememberAnimatedNavController()


viewState.collectAsState().value?.let {
val startScreen = if (it is Authenticated) {
Welcome.route
} else {
Login.route
}
/** Set global nav controller for [routeTo] **/
navController = rememberAnimatedNavController()


viewState.collectAsState().value?.let {
val startScreen = if (it is Authenticated) {
Welcome.route
} else {
Login.route
}
AthleteApiArtTheme {
MainNavHost(
navController = navController,
startRoute = startScreen,
router = this@MainActivity,
)
}
AthleteApiArtTheme {
MainNavHost(
navController = navController,
startRoute = startScreen,
router = this@MainActivity,
)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package com.activityartapp.presentation.aboutScreen

import androidx.compose.foundation.layout.padding
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Surface
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState
import androidx.compose.ui.Modifier
Expand All @@ -11,7 +14,6 @@ import com.activityartapp.presentation.AppLogo
import com.activityartapp.presentation.aboutScreen.AboutViewEvent.NavigateUpClicked
import com.activityartapp.presentation.common.AppBarScaffold
import com.activityartapp.presentation.common.ScreenBackground
import com.activityartapp.presentation.common.type.Body
import com.activityartapp.presentation.ui.theme.spacing

@Composable
Expand All @@ -22,11 +24,17 @@ fun AboutScreen(
text = stringResource(R.string.action_bar_about_header),
onNavigateUp = { viewModel.onEventDebounced(NavigateUpClicked) }
) {
ScreenBackground {
viewModel.viewState.collectAsState().value?.apply {
AppLogo()
stringArrayResource(id = R.array.about_screen_content).forEach {
Body(text = it, modifier = Modifier.padding(horizontal = spacing.medium))
viewModel.viewState.collectAsState().value?.apply {
Surface {
ScreenBackground {
AppLogo()
stringArrayResource(id = R.array.about_screen_content).forEach {
Text(
text = it,
modifier = Modifier.padding(horizontal = spacing.medium),
style = MaterialTheme.typography.body1
)
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ import androidx.compose.material.*
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ArrowBack
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.colorResource
import androidx.compose.ui.res.stringResource
import com.activityartapp.presentation.common.type.TitleFour
import com.activityartapp.R

@Composable
Expand All @@ -31,17 +28,16 @@ fun AppBarScaffold(
Column {
TopAppBar(
title = {
TitleFour(
Text(
text = text,
textColor = colorResource(id = R.color.white)
style = MaterialTheme.typography.h6
)
},
navigationIcon = {
IconButton(onClick = { onNavigateUp() }) {
Icon(
imageVector = Icons.Filled.ArrowBack,
contentDescription = stringResource(id = R.string.navigate_up_cd),
tint = Color.White
)
}
},
Expand Down

This file was deleted.

Loading

0 comments on commit c329ae9

Please sign in to comment.