Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update v3.6.1 #396

Merged
merged 26 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
f98f41e
version up
ThirFir Aug 14, 2024
c3a8c81
Merge pull request #353 from BCSDLab/feature/update-3.5.0
ThirFir Aug 14, 2024
f38d2f5
version up
ThirFir Aug 14, 2024
7a8c06b
Merge pull request #354 from BCSDLab/feature/update-3.5.1
ThirFir Aug 14, 2024
86ffe81
식단목록 짤림이슈 fix
ThirFir Aug 31, 2024
d5302b0
Merge pull request #368 from BCSDLab/fix/dining-ui
ThirFir Aug 31, 2024
5827447
update v3.5.2
ThirFir Aug 31, 2024
30f2a9d
Merge pull request #369 from BCSDLab/fix/dining-ui
ThirFir Aug 31, 2024
f731e74
Merge branch 'release' into production
ThirFir Sep 4, 2024
938cc26
Merge branch 'release' of https://github.com/BCSDLab/KOIN_ANDROID int…
skdud0629 Sep 9, 2024
c1b5e58
Merge pull request #377 from BCSDLab/feature/update-3.5.3
skdud0629 Sep 9, 2024
dbcc2f5
Merge pull request #379 from BCSDLab/release
ThirFir Sep 13, 2024
0ea09df
Merge pull request #382 from BCSDLab/develop
hsgo2430 Sep 20, 2024
7b57777
Merge pull request #384 from BCSDLab/develop
hsgo2430 Sep 20, 2024
4cb19e1
Merge pull request #388 from BCSDLab/release
hsgo2430 Sep 23, 2024
69c6f47
Merge pull request #394 from BCSDLab/develop
ThirFir Sep 29, 2024
aea5313
식단 UI/UX 개선
ThirFir Sep 4, 2024
8038ca4
빈 검색어 로딩 버그 수정
ThirFir Sep 29, 2024
532e57a
Update v3.6.0
ThirFir Sep 29, 2024
2bb1ebd
Fix viewPager + swipeRefresh
ThirFir Sep 29, 2024
5bc1cdb
로그인 상태 버그 수정
ThirFir Sep 30, 2024
a115a6e
Fix PlayStore Library Incompatible Issue
ThirFir Sep 30, 2024
78168ec
Fix Incompatible play features library
ThirFir Sep 30, 2024
3c42f56
Fix permission check
ThirFir Sep 30, 2024
6cf038a
Fix 주변상점
ThirFir Sep 30, 2024
bbbb93f
Merge pull request #395 from BCSDLab/release
ThirFir Sep 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ buildscript {
}

extra.apply {
set("versionName", "3.5.4")
set("versionCode", 30504)
set("versionName", "3.6.1")
set("versionCode", 30601)
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ class UserRepositoryImpl @Inject constructor(
override suspend fun deleteUser() {
try {
userRemoteDataSource.deleteUser()
userLocalDataSource.updateUserInfo(User.Anonymous)
userLocalDataSource.updateIsLogin(false)
tokenLocalDataSource.removeAccessToken()
tokenLocalDataSource.removeRefreshToken()
} catch (e: HttpException) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import `in`.koreatech.koin.domain.repository.UserRepository
import javax.inject.Inject

class UserLogoutUseCase @Inject constructor(
private val tokenRepository: TokenRepository,
private val userRepository: UserRepository,
private val tokenErrorHandler: TokenErrorHandler
private val tokenErrorHandler: TokenErrorHandler,
private val deleteUserRefreshTokenUseCase: DeleteUserRefreshTokenUseCase
){
suspend operator fun invoke() : Pair<Unit, ErrorHandler?> {
return try {
userRepository.deleteDeviceToken()
tokenRepository.removeToken()
deleteUserRefreshTokenUseCase()
Unit to null
} catch (t: Throwable) {
Unit to tokenErrorHandler.handleLogoutError(t)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package `in`.koreatech.koin.domain.util

import java.text.ParseException
import java.text.SimpleDateFormat
import java.time.LocalDate
import java.time.format.DateTimeFormatter
import java.util.*

object TimeUtil {
Expand All @@ -10,6 +12,12 @@ object TimeUtil {
return Calendar.getInstance().time
}

fun isWeekend(dateString: String): Boolean {
val formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd")
val date = LocalDate.parse(dateString, formatter)
return date.dayOfWeek.value == 6 || date.dayOfWeek.value == 7
}

fun getNextDayDate(date: Date): Date {
val calendar = Calendar.getInstance()
calendar.time = date
Expand Down
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
activityComposeVersion = "1.8.2"
activityKtxVersion = "1.5.0"
cardviewVersion = "1.0.0"
featureDeliveryKtxVersion = "2.1.0"
firebaseBomVersion = "30.1.0"
fragmentKtxVersion = "1.5.0"
jetbrainsAnnotationsVersion = "23.0.0"
Expand Down Expand Up @@ -74,6 +75,7 @@ androidx-runner = { module = "androidx.test:runner", version.ref = "runnerVersio
androidx-security-crypto = { module = "androidx.security:security-crypto", version.ref = "securityCryptoVersion" }
activity-compose = { module = "androidx.activity:activity-compose", version.ref = "activityComposeVersion" }

feature-delivery-ktx = { module = "com.google.android.play:feature-delivery-ktx", version.ref = "featureDeliveryKtxVersion" }
napier = {module = "io.github.aakira:napier", version.ref="napier"}

jetbrains-annotations = { module = "org.jetbrains:annotations", version.ref = "jetbrainsAnnotationsVersion" }
Expand Down
2 changes: 2 additions & 0 deletions koin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,6 @@ dependencies {
implementation(libs.nav.fragment.ktx)
implementation(libs.nav.ui.ktx)
implementation(libs.nav.dynamic.features.fragment)

implementation(libs.feature.delivery.ktx)
}
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ class ArticleKeywordFragment : Fragment() {
viewModel::deleteKeyword
)
)
binding.chipGroupSuggestionKeywords.children.forEach { chip ->
if ((chip as Chip).text == keyword) {
chipGroupSuggestionKeywords.removeView(chip)
}
}
}
}
}
Expand All @@ -152,6 +157,7 @@ class ArticleKeywordFragment : Fragment() {
viewLifecycleOwner.lifecycleScope.launch {
repeatOnLifecycle(Lifecycle.State.STARTED) {
viewModel.suggestedKeywords.collect { suggests ->
binding.chipGroupSuggestionKeywords.removeAllViews()
suggests.forEach { keyword ->
binding.run {
if (chipGroupSuggestionKeywords.childCount >= ArticleKeywordViewModel.MAX_SUGGEST_KEYWORD_COUNT)
Expand Down Expand Up @@ -306,13 +312,11 @@ class ArticleKeywordFragment : Fragment() {

private fun initKeywordNotification() {
notificationViewModel.getPermissionInfo()
if (requireContext().checkNotificationPermission().not()) {
binding.notificationKeyword.disableAll()
}

binding.notificationKeyword.setOnSwitchClickListener { isChecked ->
if (requireContext().checkNotificationPermission().not()) {
ToastUtil.getInstance().makeShort(R.string.request_notification_permission)
binding.notificationKeyword.isChecked = false
return@setOnSwitchClickListener
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ class ArticleSearchViewModel @Inject constructor(
}

fun search() {
_isLoading.value = true
val trimmedQuery = query.value.trim()
if (trimmedQuery.isEmpty()) {
_searchResultUiState.tryEmit(SearchUiState.RequireInput)
Expand All @@ -68,6 +67,7 @@ class ArticleSearchViewModel @Inject constructor(

articleRepository.fetchSearchedArticles(trimmedQuery, 4, 1, 20)
.onStart {
_isLoading.value = true
_searchResultUiState.tryEmit(SearchUiState.Loading)
}.onEach {
if (it.articleHeaders.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import androidx.lifecycle.Lifecycle
import androidx.lifecycle.lifecycleScope
import androidx.lifecycle.repeatOnLifecycle
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.viewpager.widget.ViewPager
import androidx.viewpager2.widget.ViewPager2.OnPageChangeCallback
import com.google.android.material.tabs.TabLayout
import com.google.android.material.tabs.TabLayoutMediator
import dagger.hilt.android.AndroidEntryPoint
import `in`.koreatech.koin.R
Expand Down Expand Up @@ -46,6 +49,12 @@ class DiningActivity : KoinNavigationDrawerActivity() {
private val diningOnBoardingBottomSheet by lazy {
DiningNotificationOnBoardingFragment()
}
private val diningPageChangeListener = object: OnPageChangeCallback() {
override fun onPageScrollStateChanged(state: Int) {
super.onPageScrollStateChanged(state)
binding.swipeRefreshLayoutDining.setEnabled(state == ViewPager.SCROLL_STATE_IDLE);
}
}

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
Expand Down Expand Up @@ -148,6 +157,7 @@ class DiningActivity : KoinNavigationDrawerActivity() {
tabsDiningTime.getTabAt(it)?.text.toString()
)
}
registerOnPageChangeCallback(diningPageChangeListener)
}
TabLayoutMediator(tabsDiningTime, diningViewPager) { tab, position ->
tab.text = when (position) {
Expand Down Expand Up @@ -229,4 +239,9 @@ class DiningActivity : KoinNavigationDrawerActivity() {
onActionView()
selectInitialPositions()
}

override fun onPause() {
super.onPause()
binding.diningViewPager.unregisterOnPageChangeCallback(diningPageChangeListener)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import `in`.koreatech.koin.domain.model.dining.Dining
import `in`.koreatech.koin.domain.model.dining.LikeActionType
import `in`.koreatech.koin.domain.model.dining.DiningPlace
import `in`.koreatech.koin.domain.util.DiningUtil
import `in`.koreatech.koin.domain.util.TimeUtil
import `in`.koreatech.koin.ui.dining.DiningActivity
import `in`.koreatech.koin.ui.login.LoginActivity
import `in`.koreatech.koin.util.ext.toStringWithComma
Expand Down Expand Up @@ -68,6 +69,7 @@ class DiningAdapter(
textViewNoPhoto.visibility = View.INVISIBLE
imageViewNoPhoto.visibility = View.INVISIBLE
imageViewDining.visibility = View.VISIBLE

Glide.with(context)
.load(dining.imageUrl)
.listener(object : RequestListener<Drawable> {
Expand All @@ -87,6 +89,7 @@ class DiningAdapter(
dataSource: DataSource?,
isFirstResource: Boolean
): Boolean {
binding.lottieImageLoading.pauseAnimation()
binding.lottieImageLoading.visibility = View.GONE
return false
}
Expand All @@ -106,6 +109,10 @@ class DiningAdapter(
} else {
cardViewDining.strokeWidth =
TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 1f, context.resources.displayMetrics).toInt()
textViewNoPhoto.text = if(TimeUtil.isWeekend(dining.date)) context.getString(
R.string.photo_not_provided_on_weekend
) else context.getString(R.string.no_photo)

textViewNoPhoto.visibility = View.VISIBLE
imageViewNoPhoto.visibility = View.VISIBLE
imageViewDining.visibility = View.INVISIBLE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,14 +326,6 @@ abstract class KoinNavigationDrawerActivity : ActivityBase(),
lifecycleScope.launch {
repeatOnLifecycle(Lifecycle.State.STARTED) {
userInfoFlow.collect { user ->
when (menuState) {
MenuState.Main, MenuState.Notification -> {
if (!checkMainPermission()) requestMainPermissionLauncher.launch(MAIN_REQUIRED_PERMISSION)
koinNavigationDrawerViewModel.updateDeviceToken()
}

else -> Unit
}
when (user) {
User.Anonymous -> {
nameTextView.visibility = View.GONE
Expand All @@ -346,6 +338,15 @@ abstract class KoinNavigationDrawerActivity : ActivityBase(),
nameTextView.visibility = View.VISIBLE
helloMessageTextView.text = getString(R.string.navigation_hello_message)
loginOrLogoutTextView.text = getString(R.string.navigation_item_logout)

when (menuState) {
MenuState.Main, MenuState.Notification -> {
if (!checkMainPermission()) requestMainPermissionLauncher.launch(MAIN_REQUIRED_PERMISSION)
koinNavigationDrawerViewModel.updateDeviceToken()
}

else -> Unit
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import androidx.lifecycle.LiveData
import androidx.lifecycle.viewModelScope
import com.google.firebase.messaging.FirebaseMessaging
import dagger.hilt.android.lifecycle.HiltViewModel
import `in`.koreatech.koin.core.analytics.EventLogger
import `in`.koreatech.koin.core.constant.AnalyticsConstant
import `in`.koreatech.koin.core.viewmodel.BaseViewModel
import `in`.koreatech.koin.core.viewmodel.SingleLiveEvent
import `in`.koreatech.koin.domain.model.user.User
Expand Down
Loading
Loading