Skip to content

Commit

Permalink
v0.3.1
Browse files Browse the repository at this point in the history
πŸš€ Feature Updates

- System Navigation Bar 색상도 ν…Œλ§ˆμ— λ°”λ€Œκ²Œλ” μˆ˜μ •
- μƒν’ˆ 상세 ν™”λ©΄μ—μ„œ Graph μ˜μ—­μ΄ μ„Έλ‘œλ‘œ μŠ¬λΌμ΄λ“œν•  경우 슀크둀 μ˜μ—­μ— μ μš©λ˜λ„λ‘ λ³€κ²½ (μ΄μ œλΆ€ν„°λŠ” 길게 λˆ„λ₯Ό μ‹œ κ·Έλž˜ν”„ 라벨이 ν™œμ„±ν™”λ©λ‹ˆλ‹€)
- 일뢀 νŽ˜μ΄μ§€μ—μ„œ μ ‘κ·Όμ„± κ°œμ„ 

πŸ”§ Bug Fixes

- μƒν’ˆ λͺ©λ‘ ν™”λ©΄μ—μ„œ μ•Œλ¦Ό 토글을 껐닀가 μΌ°μ„λ•Œ ν™œμ„±ν™” μƒνƒœμ—μ„œ 꺼짐 μƒνƒœμ— μ•„μ΄μ½˜μ΄ λœ¨λŠ” 였λ₯˜ μˆ˜μ •
- μƒν’ˆ λͺ©λ‘ ν™”λ©΄μ—μ„œ ν™”λ©΄μ˜ 토글값을 λ³€κ²½ν•œ ν›„, μƒˆλ‘œκ³ μΉ¨μ„ ν–ˆμ„λ•Œ μ›λž˜λŒ€λ‘œ λŒμ•„μ˜€λŠ” 문제 μˆ˜μ •
- λ‘œλ”©μ€‘μΌλ•Œ μƒν’ˆ 상세 ν™”λ©΄μ—μ„œ λ²„νŠΌλ“€ λΉ„ν™œμ„±ν™”
- Dynamic Theme을 μ§€μ›ν•˜μ§€ μ•ŠλŠ” OS의 경우 ν•΄λ‹Ή ν…Œλ§ˆ μ„€μ • View λΉ„ν™œμ„±ν™”
- μƒν’ˆ, μƒν’ˆ μΆ”μ²œ λͺ©λ‘ μ „ν™˜μ‹œ 슀크둀 / λ‹Ήκ²¨μ„œ μƒˆλ‘œκ³ μΉ¨ 였λ₯˜ μˆ˜μ •
- ν™”λ©΄ νšŒμ „ μ‹œ λ‹€μ΄μ–Όλ‘œκ·Έκ°€ μ‚¬λΌμ§€λŠ” ν˜„μƒ μˆ˜μ •
- μƒν’ˆ 상세 νŽ˜μ΄μ§€μ—μ„œ ν™”λ©΄ νšŒμ „ μ‹œ Scroll Stateκ°€ μ΄ˆκΈ°ν™”λ˜λŠ” ν˜„μƒ μˆ˜μ •
- λͺ¨λ“  νŽ˜μ΄μ§€μ—μ„œ λ²„νŠΌ 연속 μž…λ ₯ 방지 처리
- λͺ¨λ“  νŽ˜μ΄μ§€μ—μ„œ λ©”λͺ¨λ¦¬ λˆ„μˆ˜κ°€ μΌμ–΄λ‚˜λŠ” 일뢀 ν•­λͺ©λ“€ μˆ˜μ •
- μ‹œμŠ€ν…œ 글꼴을 ν‚€μ› μ„λ•Œ UIκ°€ κΉ¨μ§€λŠ” 문제 μˆ˜μ •
- ν…Œλ§ˆ λ³€κ²½ ν›„ μ•± μž¬μ‹œμž‘ μ‹œ ν…Œλ§ˆ 변경이 μ•ˆλ˜λŠ” 였λ₯˜ μˆ˜μ •
- λͺ©ν‘œ 가격 μˆ˜μ • μ‹œ 가격 μˆ˜μ • ν™”λ©΄ 초기 κ°’ κΈ°μ‘΄ λͺ©ν‘œ κ°€κ²©μœΌλ‘œ μˆ˜μ •
- λ‚΄ 정보 νŽ˜μ΄μ§€μ—μ„œ 이름에 문자만 λ‚˜μ˜¬ 수 μžˆλ„λ‘ μˆ˜μ •

Material Chart Changelog: https://github.com/Taewan-P/material-android-chart/releases/tag/v0.2.0

Co-Authored-By: EunhoKang <[email protected]>
Co-Authored-By: ootr47 <[email protected]>
Co-Authored-By: 손문기 <[email protected]>
Co-Authored-By: ByeongIk Choi <[email protected]>
  • Loading branch information
5 people committed Dec 12, 2023
1 parent fd7b149 commit 5cd2c8d
Show file tree
Hide file tree
Showing 57 changed files with 1,056 additions and 535 deletions.
6 changes: 3 additions & 3 deletions android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ android {
applicationId = "app.priceguard"
minSdk = 29
targetSdk = 34
versionCode = 4
versionName = "0.3.0"
versionCode = 5
versionName = "0.3.1"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down Expand Up @@ -111,7 +111,7 @@ dependencies {
kapt("androidx.hilt:hilt-compiler:1.1.0")

// Material chart
implementation("app.priceguard:materialchart:0.1.2")
implementation("app.priceguard:materialchart:0.2.0")
}

kapt {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ class ProductRepositoryImpl @Inject constructor(
dto.imageUrl ?: "",
dto.price ?: 0,
dto.rank ?: 0,
GraphDataConverter().toDataset(dto.priceData)
graphDataConverter.toDataset(dto.priceData)
)
} ?: listOf()
)
Expand Down
44 changes: 44 additions & 0 deletions android/app/src/main/java/app/priceguard/ui/ErrorDialogFragment.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package app.priceguard.ui

import android.app.Dialog
import android.content.Intent
import android.os.Bundle
import androidx.fragment.app.DialogFragment
import app.priceguard.R
import app.priceguard.data.repository.token.TokenRepository
import app.priceguard.ui.login.LoginActivity
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import javax.inject.Inject
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch

class ErrorDialogFragment : DialogFragment() {

@Inject
lateinit var tokenRepository: TokenRepository

override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
return MaterialAlertDialogBuilder(
requireActivity(),
R.style.ThemeOverlay_App_MaterialAlertDialog
).apply {
setTitle(getString(R.string.permission_denied_title))
setMessage(getString(R.string.permission_denied_message))
setPositiveButton(getString(R.string.confirm)) { _, _ -> goBackToLoginActivity(tokenRepository) }
}.create()
}

override fun onStart() {
super.onStart()
dialog?.setCancelable(false)
}

private fun goBackToLoginActivity(tokenRepository: TokenRepository) {
CoroutineScope(Dispatchers.IO).launch { tokenRepository.clearTokens() }
val intent = Intent(requireActivity(), LoginActivity::class.java)
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK
startActivity(intent)
requireActivity().finish()
}
}
22 changes: 6 additions & 16 deletions android/app/src/main/java/app/priceguard/ui/PriceGuardApp.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package app.priceguard.ui

import android.app.Application
import android.app.UiModeManager
import android.content.Context
import androidx.appcompat.app.AppCompatDelegate
import androidx.hilt.work.HiltWorkerFactory
import androidx.work.Configuration
Expand Down Expand Up @@ -47,23 +45,15 @@ class PriceGuardApp : Application(), Configuration.Provider {

when (darkMode) {
MODE_LIGHT -> {
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.S) {
val uiModeManager =
getSystemService(Context.UI_MODE_SERVICE) as UiModeManager
uiModeManager.setApplicationNightMode(UiModeManager.MODE_NIGHT_NO)
} else {
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO)
}
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO)
}

MODE_DARK -> {
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.S) {
val uiModeManager =
getSystemService(Context.UI_MODE_SERVICE) as UiModeManager
uiModeManager.setApplicationNightMode(UiModeManager.MODE_NIGHT_YES)
} else {
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES)
}
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES)
}

else -> {
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ package app.priceguard.ui.additem
import android.content.Intent
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.navigation.NavController
import androidx.navigation.NavDirections
import androidx.navigation.fragment.NavHostFragment
import app.priceguard.R
import app.priceguard.databinding.ActivityAddItemBinding
import app.priceguard.ui.additem.link.RegisterItemLinkFragmentDirections
import app.priceguard.ui.util.SystemNavigationColorState
import app.priceguard.ui.util.applySystemNavigationBarColor
import app.priceguard.ui.util.safeNavigate
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
Expand All @@ -18,7 +19,7 @@ class AddItemActivity : AppCompatActivity() {

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

this.applySystemNavigationBarColor(SystemNavigationColorState.SURFACE)
binding = ActivityAddItemBinding.inflate(layoutInflater)
setStartDestination()
setContentView(binding.root)
Expand All @@ -43,13 +44,10 @@ class AddItemActivity : AppCompatActivity() {
intent.getStringExtra("productCode") ?: "",
intent.getStringExtra("productTitle") ?: "",
intent.getIntExtra("productPrice", 0),
intent.getBooleanExtra("isAdding", true)
intent.getBooleanExtra("isAdding", true),
intent.getIntExtra("productTargetPrice", (intent.getIntExtra("productPrice", 0) * 0.8).toInt())
)
navController.safeNavigate(action)
}
}

private fun NavController.safeNavigate(direction: NavDirections) {
currentDestination?.getAction(direction.actionId)?.run { navigate(direction) }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ class ConfirmItemLinkFragment : Fragment() {
arguments.getString("productCode") ?: "",
arguments.getString("productName") ?: "",
arguments.getInt("productPrice"),
true
true,
(arguments.getInt("productPrice") * 0.8).toInt()
)
findNavController().navigate(action)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,32 @@
package app.priceguard.ui.additem.link

import android.os.Bundle
import android.webkit.WebView
import androidx.appcompat.app.AppCompatActivity
import app.priceguard.databinding.ActivityLinkHelperWebViewBinding

class LinkHelperWebViewActivity : AppCompatActivity() {

private lateinit var binding: ActivityLinkHelperWebViewBinding
private lateinit var webView: WebView

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

binding = ActivityLinkHelperWebViewBinding.inflate(layoutInflater)
setContentView(binding.root)

binding.wbLinkHelper.loadUrl("https://info-kr.priceguard.app/")
webView = WebView(this)
webView.loadUrl("https://info-kr.priceguard.app/")
binding.wbLinkHelper.addView(webView)
}

override fun onDestroy() {
super.onDestroy()
binding.wbLinkHelper.removeAllViews()
webView.clearHistory()
webView.clearCache(true)
webView.loadUrl("about:blank")
webView.pauseTimers()
webView.destroy()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,15 @@ import android.view.ViewGroup
import androidx.activity.addCallback
import androidx.fragment.app.Fragment
import androidx.fragment.app.viewModels
import androidx.navigation.NavController
import androidx.navigation.NavDirections
import androidx.navigation.fragment.findNavController
import app.priceguard.R
import app.priceguard.data.repository.product.ProductErrorState
import app.priceguard.data.repository.token.TokenRepository
import app.priceguard.databinding.FragmentRegisterItemLinkBinding
import app.priceguard.ui.home.HomeActivity
import app.priceguard.ui.util.lifecycle.repeatOnStarted
import app.priceguard.ui.util.ui.showPermissionDeniedDialog
import app.priceguard.ui.util.safeNavigate
import app.priceguard.ui.util.showDialogWithLogout
import dagger.hilt.android.AndroidEntryPoint
import javax.inject.Inject

Expand Down Expand Up @@ -111,7 +110,7 @@ class RegisterItemLinkFragment : Fragment() {
is RegisterItemLinkViewModel.RegisterLinkEvent.FailureVerification -> {
when (event.errorType) {
ProductErrorState.PERMISSION_DENIED -> {
requireActivity().showPermissionDeniedDialog(tokenRepository)
showDialogWithLogout()
}

ProductErrorState.INVALID_REQUEST -> {
Expand All @@ -132,10 +131,6 @@ class RegisterItemLinkFragment : Fragment() {
binding.tvRegisterItemError.text = message
}

private fun NavController.safeNavigate(direction: NavDirections) {
currentDestination?.getAction(direction.actionId)?.run { navigate(direction) }
}

override fun onDestroyView() {
super.onDestroyView()
_binding = null
Expand Down
Loading

0 comments on commit 5cd2c8d

Please sign in to comment.