Skip to content

Commit

Permalink
Merge pull request #420 from hyeeyoung/dev
Browse files Browse the repository at this point in the history
1.2.1 버전 업데이트
  • Loading branch information
youngjinc authored Jul 23, 2023
2 parents 557d874 + 2fb2c1b commit 5fc028d
Show file tree
Hide file tree
Showing 14 changed files with 98 additions and 161 deletions.
33 changes: 14 additions & 19 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ android {
applicationId "com.hyeeyoung.wishboard"
minSdkVersion 24
targetSdkVersion 33
versionCode 22
versionName "1.2.0"
versionCode 30
versionName "1.2.1"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
Expand Down Expand Up @@ -82,6 +82,7 @@ dependencies {
implementation 'androidx.security:security-crypto-ktx:1.1.0-alpha04'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.4.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.0'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.1'
implementation 'androidx.fragment:fragment-ktx:1.5.4'
implementation 'androidx.preference:preference-ktx:1.2.0'
implementation 'androidx.navigation:navigation-ui-ktx:2.4.0'
Expand All @@ -91,12 +92,7 @@ dependencies {
implementation 'io.coil-kt:coil:2.1.0'

// jsoup
implementation 'org.jsoup:jsoup:1.14.1'

// glide
implementation 'com.github.bumptech.glide:glide:4.12.0'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.1'
kapt 'com.github.bumptech.glide:compiler:4.12.0'
implementation 'org.jsoup:jsoup:1.14.1' // TODO delete

// Network
implementation platform('com.squareup.okhttp3:okhttp-bom:4.10.0')
Expand All @@ -111,11 +107,6 @@ dependencies {
kapt "com.google.dagger:hilt-compiler:$hilt_version"
implementation "androidx.hilt:hilt-navigation-fragment:1.0.0"

// AWS S3
implementation 'com.amplifyframework:aws-storage-s3:1.31.1'
implementation 'com.amplifyframework:aws-auth-cognito:1.31.1'
implementation 'com.amplifyframework:core-kotlin:0.15.1'

// Firebase FCM
implementation 'com.google.firebase:firebase-messaging-ktx'
implementation 'com.google.firebase:firebase-analytics-ktx'
Expand All @@ -130,11 +121,15 @@ dependencies {
implementation "com.airbnb.android:lottie:$lottie_version"

// Calendar View
implementation 'joda-time:joda-time:2.10.14'
implementation 'joda-time:joda-time:2.10.14' // TODO delete

// Timber
implementation 'com.jakewharton.timber:timber:5.0.1'

// In App Update
implementation 'com.google.android.play:app-update:2.1.0'
implementation 'com.google.android.play:app-update-ktx:2.1.0'

// Compose
def composeBom = platform('androidx.compose:compose-bom:2023.05.01')
implementation composeBom
Expand All @@ -144,15 +139,15 @@ dependencies {
implementation 'androidx.compose.runtime:runtime-livedata'
implementation 'androidx.lifecycle:lifecycle-viewmodel-compose'

implementation "androidx.compose.ui:ui"
implementation "androidx.compose.ui:ui-tooling-preview"
implementation 'androidx.compose.ui:ui'
implementation 'androidx.compose.ui:ui-tooling-preview'
implementation 'androidx.compose.material3:material3'
implementation 'androidx.constraintlayout:constraintlayout-compose:1.0.1'
implementation 'io.coil-kt:coil-compose:2.4.0'

androidTestImplementation "androidx.compose.ui:ui-test-junit4"
debugImplementation "androidx.compose.ui:ui-tooling"
debugImplementation "androidx.compose.ui:ui-test-manifest"
androidTestImplementation 'androidx.compose.ui:ui-test-junit4'
debugImplementation 'androidx.compose.ui:ui-tooling'
debugImplementation 'androidx.compose.ui:ui-test-manifest'

testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
Expand Down
16 changes: 0 additions & 16 deletions app/src/main/java/com/hyeeyoung/wishboard/WishBoardApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ package com.hyeeyoung.wishboard

import android.app.Application
import androidx.appcompat.app.AppCompatDelegate
import com.amplifyframework.AmplifyException
import com.amplifyframework.auth.cognito.AWSCognitoAuthPlugin
import com.amplifyframework.core.Amplify
import com.amplifyframework.storage.s3.AWSS3StoragePlugin
import com.hyeeyoung.wishboard.util.WishBoardDebugTree
import dagger.hilt.android.HiltAndroidApp
import timber.log.Timber
Expand All @@ -17,18 +13,6 @@ class WishBoardApp : Application() {
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO)

setUpTimber()
setUpAmplify()
}

private fun setUpAmplify() {
try {
Amplify.addPlugin(AWSCognitoAuthPlugin())
Amplify.addPlugin(AWSS3StoragePlugin())
Amplify.configure(applicationContext)
Timber.d("Initialized Amplify")
} catch (error: AmplifyException) {
Timber.e("Could not initialize Amplify", error)
}
}

private fun setUpTimber() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import timber.log.Timber
import javax.inject.Inject

class AuthInterceptor @Inject constructor(
private val gson: Gson,
private val gson: Gson, // TODO json으로 변경
private val context: Application,
private val localStorage: WishBoardPreference,
) : Interceptor {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class CalendarActivity : ComponentActivity() {
val notiList by viewModel.calendarNotiList.collectAsState()

CalendarScreen(
notiList = notiList,
notiList = notiList ?: emptyList(),
onClickBack = { finish() },
onClickNotiWithLink = { shopUrl ->
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(shopUrl)))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
package com.hyeeyoung.wishboard.presentation.calendar.screen

import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.pager.rememberPagerState
import androidx.compose.material3.Scaffold
import androidx.compose.material3.SnackbarHostState
import androidx.compose.runtime.*
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import com.hyeeyoung.wishboard.R
Expand All @@ -26,11 +29,10 @@ private const val INITIAL_PAGE = PAGE_COUNT / 2
@OptIn(ExperimentalFoundationApi::class)
@Composable
fun CalendarScreen(
notiList: List<NotiItem>?,
notiList: List<NotiItem>,
onClickBack: () -> Unit,
onClickNotiWithLink: (String) -> Unit
) {
if (notiList == null) return
WishboardTheme {
var selectedDate by remember { mutableStateOf(LocalDate.now()) }
var prevPage by remember { mutableStateOf(INITIAL_PAGE) }
Expand All @@ -44,7 +46,7 @@ fun CalendarScreen(
val snackbarMsgForNotiLink = stringResource(id = R.string.noti_item_url_snackbar_text)

Scaffold(snackbarHost = { WishboardSnackbarHost(hostState = snackbarHostState) }) {
Column {
Column(modifier = Modifier.background(Color.White)) {
CalendarHeader(selectedDate = selectedDate, onClickBack = onClickBack)
CalendarTable(
selectedDate = selectedDate,
Expand Down Expand Up @@ -156,3 +158,13 @@ fun CalendarPreview() {
onClickNotiWithLink = {}
)
}

@Preview(showBackground = true)
@Composable
fun EmmptyCalendarPreview() {
CalendarScreen(
notiList = emptyList(),
onClickBack = {},
onClickNotiWithLink = {}
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package com.hyeeyoung.wishboard.presentation.my.screens
import android.net.Uri
import android.os.Bundle
import android.view.View
import androidx.activity.result.contract.ActivityResultContracts
import androidx.core.os.bundleOf
import androidx.hilt.navigation.fragment.hiltNavGraphViewModels
import androidx.navigation.fragment.findNavController
Expand All @@ -14,8 +13,7 @@ import com.hyeeyoung.wishboard.presentation.my.MyViewModel
import com.hyeeyoung.wishboard.presentation.wishitem.WishItemStatus
import com.hyeeyoung.wishboard.util.BaseFragment
import com.hyeeyoung.wishboard.util.UiState
import com.hyeeyoung.wishboard.util.extension.collectFlow
import com.hyeeyoung.wishboard.util.extension.showPhotoDialog
import com.hyeeyoung.wishboard.util.extension.*
import com.hyeeyoung.wishboard.util.showKeyboard
import dagger.hilt.android.AndroidEntryPoint

Expand All @@ -25,23 +23,14 @@ class MyProfileEditFragment :
private val viewModel: MyViewModel by hiltNavGraphViewModels(R.id.my_nav_graph)
private var photoUri: Uri? = null

private val requestSelectPicture =
registerForActivityResult(ActivityResultContracts.PickVisualMedia()) { uri ->
if (uri != null) viewModel.setSelectedUserProfileImage(uri)
}

private val requestCamera =
registerForActivityResult(ActivityResultContracts.RequestPermission()) { isGranted ->
if (isGranted) {
photoUri = viewModel.createCameraImageUri()
takePicture.launch(photoUri)
}
}

private val takePicture =
registerForActivityResult(ActivityResultContracts.TakePicture()) { success ->
if (success && (photoUri != null)) viewModel.setSelectedUserProfileImage(photoUri!!)
}
private val requestSelectPicture = requestSelectPicture { uri -> viewModel.setSelectedUserProfileImage(uri) }
private val requestCamera = requestCamera {
photoUri = viewModel.createCameraImageUri()
takePicture.launch(photoUri)
}
private val takePicture = takePicture {
viewModel.setSelectedUserProfileImage(photoUri ?: return@takePicture)
}

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,48 +3,46 @@ package com.hyeeyoung.wishboard.presentation.splash
import android.content.Intent
import android.net.Uri
import android.os.Bundle
import androidx.activity.viewModels
import androidx.lifecycle.lifecycleScope
import com.google.android.play.core.appupdate.AppUpdateManagerFactory
import com.google.android.play.core.install.model.AppUpdateType
import com.google.android.play.core.install.model.UpdateAvailability
import com.hyeeyoung.wishboard.BuildConfig
import com.hyeeyoung.wishboard.R
import com.hyeeyoung.wishboard.data.local.WishBoardPreference
import com.hyeeyoung.wishboard.databinding.ActivitySplashBinding
import com.hyeeyoung.wishboard.presentation.common.screens.TwoButtonDialogFragment
import com.hyeeyoung.wishboard.presentation.common.types.DialogButtonReplyType
import com.hyeeyoung.wishboard.presentation.main.MainActivity
import com.hyeeyoung.wishboard.presentation.sign.screens.SignActivity
import com.hyeeyoung.wishboard.util.BaseActivity
import com.hyeeyoung.wishboard.util.DialogListener
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch

@AndroidEntryPoint
class SplashActivity : BaseActivity<ActivitySplashBinding>(R.layout.activity_splash) {
private var job: Job? = null
private val viewModel: SplashViewModel by viewModels()

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

lifecycleScope.launch(Dispatchers.Main) {
job = launch {
delay(2000)
checkForNewVersionUpdate()
}
lifecycleScope.launch() {
delay(2000)
checkForNewVersionUpdate()
}
}

private fun moveToNext() {
val isLogin = WishBoardPreference(this).isLogin
val isLogin = viewModel.isLogin()
val nextScreen = if (isLogin) MainActivity::class.java else SignActivity::class.java
startActivity(Intent(this@SplashActivity, nextScreen))
finish()
}

private fun checkForNewVersionUpdate() {
val appUpdateManager = AppUpdateManagerFactory.create(this)
val appUpdateManager = AppUpdateManagerFactory.create(this@SplashActivity)
val appUpdateInfoTask = appUpdateManager.appUpdateInfo

appUpdateInfoTask.addOnSuccessListener { appUpdateInfo ->
Expand All @@ -53,6 +51,8 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>(R.layout.activity_spl
&& appUpdateInfo.availableVersionCode() != BuildConfig.VERSION_CODE
) {
showUpdateDialog()
} else {
moveToNext()
}
}.addOnFailureListener {
moveToNext()
Expand Down Expand Up @@ -83,9 +83,4 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>(R.layout.activity_spl
startActivity(it)
}
}

override fun onPause() {
job?.cancel()
super.onPause()
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.hyeeyoung.wishboard.presentation.splash

import androidx.lifecycle.ViewModel
import com.hyeeyoung.wishboard.data.local.WishBoardPreference
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@HiltViewModel
class SplashViewModel @Inject constructor(
private val localStorage: WishBoardPreference,
) : ViewModel() {
fun isLogin() = localStorage.isLogin
}
Loading

0 comments on commit 5fc028d

Please sign in to comment.