Skip to content

Commit

Permalink
update dependency's
Browse files Browse the repository at this point in the history
  • Loading branch information
Hcnc100 committed Jul 28, 2022
1 parent ce13a54 commit 2956625
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 112 deletions.
22 changes: 8 additions & 14 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ kotlin {
}
}
android {
compileSdk 31
compileSdk 32

defaultConfig {
applicationId "com.nullpointer.userscompose"
minSdk 21
targetSdk 31
targetSdk 32
versionCode 1
versionName "1.0"

Expand Down Expand Up @@ -57,11 +57,6 @@ android {
excludes += '/META-INF/{AL2.0,LGPL2.1}'
}
}

// * clear advertising experimentalAnnotation
kotlin.sourceSets.all {
languageSettings.useExperimentalAnnotation("kotlin.RequiresOptIn")
}
}

dependencies {
Expand All @@ -70,8 +65,8 @@ dependencies {
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.5.0'
implementation 'androidx.activity:activity-compose:1.5.0'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.5.1'
implementation 'androidx.activity:activity-compose:1.5.1'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
Expand All @@ -83,7 +78,7 @@ dependencies {
implementation("io.coil-kt:coil-compose:2.1.0")

// * room
def roomVersion = "2.4.2"
def roomVersion = "2.4.3"
implementation "androidx.room:room-runtime:$roomVersion"
kapt "androidx.room:room-compiler:$roomVersion"
implementation "androidx.room:room-ktx:$roomVersion"
Expand Down Expand Up @@ -122,13 +117,13 @@ dependencies {
implementation "com.airbnb.android:lottie-compose:5.1.1"

// * navigation compose
implementation "androidx.navigation:navigation-compose:2.5.0"
implementation "androidx.navigation:navigation-compose:2.5.1"
implementation 'io.github.raamcosta.compose-destinations:core:1.5.12-beta'
ksp 'io.github.raamcosta.compose-destinations:ksp:1.5.12-beta'


// * splash screen
implementation 'androidx.core:core-splashscreen:1.0.0-rc01'
implementation 'androidx.core:core-splashscreen:1.0.0'

// ? android test
testImplementation("androidx.arch.core:core-testing:2.1.0")
Expand All @@ -137,8 +132,7 @@ dependencies {

implementation 'com.valentinilk.shimmer:compose-shimmer:1.0.3'

// * permissions
implementation "com.google.accompanist:accompanist-permissions:0.24.9-beta"



}
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ package com.nullpointer.userscompose.ui.activitys
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.displayCutoutPadding
import androidx.compose.material.MaterialTheme
import androidx.compose.ui.Modifier
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import androidx.lifecycle.lifecycleScope
import androidx.navigation.compose.rememberNavController
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,16 @@ fun DetailsScreen(
when ( LocalConfiguration.current.orientation) {

Configuration.ORIENTATION_LANDSCAPE -> {
Row(modifier = Modifier.fillMaxWidth()) {
Row(modifier = Modifier.fillMaxWidth().padding(it)) {
HeaderUserPhoto(imgUser = user.imgUser, modifier = Modifier.weight(.3f))
InfoUser(user = user, Modifier.weight(.7f).fillMaxHeight())
}
}
Configuration.ORIENTATION_PORTRAIT -> {
else -> {
Column(
modifier = Modifier
.fillMaxSize()
.verticalScroll(rememberScrollState())
.verticalScroll(rememberScrollState()).padding(it)
) {
HeaderUserPhoto(imgUser = user.imgUser)
Spacer(modifier = Modifier.height(20.dp))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.nullpointer.userscompose.ui.screens.users


import androidx.activity.compose.BackHandler
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
Expand Down Expand Up @@ -32,7 +33,6 @@ import com.nullpointer.userscompose.ui.screens.destinations.DetailsScreenDestina
import com.nullpointer.userscompose.ui.screens.empty.EmptyScreen
import com.nullpointer.userscompose.ui.screens.users.components.LoadingUsers
import com.nullpointer.userscompose.ui.screens.users.components.UserItem
import com.nullpointer.userscompose.ui.share.BackHandler
import com.nullpointer.userscompose.ui.share.ButtonToggleAddRemove
import com.nullpointer.userscompose.ui.share.FabAnimation
import com.nullpointer.userscompose.ui.share.SelectToolbar
Expand Down Expand Up @@ -95,29 +95,29 @@ fun UsersScreen(
userViewModel.deleterUser(selectViewModel.getListSelectionAndClear())
})
}
) {
) { padding ->

when (val listUsers = stateListUsers) {
Resource.Failure -> {
EmptyScreen(
animation = R.raw.empty,
textEmpty = stringResource(R.string.text_empty_users),
modifier = Modifier.padding(it)
modifier = Modifier.padding(padding)
)
}
Resource.Loading -> {
LoadingUsers(modifier = Modifier.padding(it))
LoadingUsers(modifier = Modifier.padding(padding))
}
is Resource.Success -> {
if (listUsers.data.isEmpty()) {
EmptyScreen(
animation = R.raw.empty,
textEmpty = stringResource(R.string.text_empty_users),
modifier = Modifier.padding(it)
modifier = Modifier.padding(padding)
)
} else {
ListUsers(
modifier = Modifier.padding(it),
modifier = Modifier.padding(padding),
listUsers = listUsers.data,
gridState = usersScreenState.lazyListState,
isSelectedEnable = selectViewModel.isSelectedEnable,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import com.nullpointer.userscompose.R
import com.nullpointer.userscompose.core.utils.getPlural
import timber.log.Timber


@Composable
Expand Down Expand Up @@ -86,44 +85,3 @@ fun SelectToolbar(
)
}


@Composable
fun SelectionMenuToolbar(
titleDefault: String,
titleSelection: String,
numberSelection: Int,
actionClear: () -> Unit,
deleterAll: () -> Unit,
) {
val (showMenu, changeVisibleMenu) = rememberSaveable { mutableStateOf(false) }
TopAppBar(
backgroundColor = if (numberSelection == 0) MaterialTheme.colors.primarySurface else MaterialTheme.colors.primary,
title = {
Text(if (numberSelection == 0) titleDefault else titleSelection)
},
actions = {
if (numberSelection != 0) {
IconButton(onClick = actionClear) {
Icon(painterResource(id = R.drawable.ic_clear),
contentDescription = stringResource(R.string.description_clear_selection))
}
} else {
IconButton(onClick = { changeVisibleMenu(!showMenu) }) {
Icon(painterResource(id = R.drawable.ic_menu),
contentDescription = stringResource(R.string.description_icon_options))
}
DropdownMenu(
expanded = showMenu,
onDismissRequest = { changeVisibleMenu(false) }
) {
DropdownMenuItem(onClick = {
deleterAll()
changeVisibleMenu(false)
}) {
Text(text = stringResource(R.string.deleter_all))
}
}
}
}
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,15 @@ package com.nullpointer.userscompose.ui.states

import android.content.Context
import androidx.annotation.StringRes
import androidx.compose.foundation.lazy.LazyListState
import androidx.compose.foundation.lazy.grid.LazyGridState
import androidx.compose.foundation.lazy.grid.rememberLazyGridState
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.material.ScaffoldState
import androidx.compose.material.rememberScaffoldState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.focus.FocusManager
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalFocusManager

class UsersScreenState(
class UsersScreenState(
val scaffoldState: ScaffoldState,
val context: Context,
val lazyListState: LazyGridState,
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
buildscript {
ext {
compose_version = '1.1.1'
compose_version = '1.2.0'
}
}// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '7.2.1' apply false
id 'com.android.library' version '7.2.1' apply false
id 'org.jetbrains.kotlin.android' version '1.6.10' apply false
id 'org.jetbrains.kotlin.android' version '1.7.0' apply false
}

task clean(type: Delete) {
Expand Down

0 comments on commit 2956625

Please sign in to comment.