Skip to content

Commit

Permalink
Merge pull request #300 from Scents-Note/release/1.5.6
Browse files Browse the repository at this point in the history
Release 1.5.6
  • Loading branch information
Haeeul authored Feb 19, 2024
2 parents cfea5c6 + f4d6e22 commit d4962a2
Show file tree
Hide file tree
Showing 17 changed files with 134 additions and 62 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/release_tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Release Tag
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: 버전 정보 추출
run: echo "##[set-output name=version;]$(echo '${{ github.event.head_commit.message }}' | egrep -o '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}')"
id: extract_version_name
- name: Release 생성
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.extract_version_name.outputs.version }}
release_name: ${{ steps.extract_version_name.outputs.version }}
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,5 @@ interface RemoteDataSource {
suspend fun getRecommendPerfumeList(token: String) : MutableList<RecommendPerfumeItem>
suspend fun getCommonPerfumeList(token: String) : MutableList<HomePerfumeItem>
suspend fun getRecentPerfumeList(token: String) : MutableList<HomePerfumeItem>
suspend fun getNewPerfumeList() : MutableList<HomePerfumeItem>
suspend fun getNewPerfumeList(requestSize: Int?) : MutableList<HomePerfumeItem>
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ class RemoteDataSourceImpl : RemoteDataSource{
return api.getRecentList(token).data.rows
}

override suspend fun getNewPerfumeList(): MutableList<HomePerfumeItem> {
return api.getNewPerfumeList().data.rows
override suspend fun getNewPerfumeList(requestSize: Int?): MutableList<HomePerfumeItem> {
return api.getNewPerfumeList(requestSize).data.rows
}

override suspend fun getReview(reviewIdx: Int): ResponseReview {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ interface ScentsNoteService {
// Home - New Perfume List
@GET("perfume/new")
suspend fun getNewPerfumeList(

@Query("requestSize") requestSize : Int?
):ResponseBase<ResponseHomePerfumeList>

@GET("perfume/{perfumeIdx}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class HomeRepository {
suspend fun getRecommendPerfumeList(token : String) = remoteDataSource.getRecommendPerfumeList(token)
suspend fun getCommonPerfumeList(token : String) = remoteDataSource.getCommonPerfumeList(token)
suspend fun getRecentPerfumeList(token : String) = remoteDataSource.getRecentPerfumeList(token)
suspend fun getNewPerfumeList() = remoteDataSource.getNewPerfumeList()
suspend fun getNewPerfumeList(requestSize: Int?) = remoteDataSource.getNewPerfumeList(requestSize)
fun postPerfumeLike(token: String, perfumeIdx: Int): Single<ResponseBase<Boolean>> =
ScentsNoteServiceImpl.service.postPerfumeLike(token, perfumeIdx).map { it }
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class FilterFragment : Fragment() {
override fun onResume() {
super.onResume()

binding.tabFilter.changeTabsFont(0)
firebaseAnalytics.setPageViewEvent("Filter", this::class.java.name)
}

Expand All @@ -96,13 +97,7 @@ class FilterFragment : Fragment() {

firebaseAnalytics.setClickEvent("FilterActionButton")

reqFilterGa("apply_filter", seriesViewModel.getSelectedSeries())
reqFilterGa("apply_brand", brandViewModel.getSelectedBrands())
reqFilterGa("apply_bonding", keywordViewModel.getSelectedKeywords())

Log.d("GA 필터 - 계열", seriesViewModel.getSelectedSeries().map { it.name }.toString())
Log.d("GA 필터 - 브랜드", brandViewModel.getSelectedBrands().map { it.name }.toString())
Log.d("GA 필터 - 키워드", keywordViewModel.getSelectedKeywords().map { it.name }.toString())
setFilterGa()
}
binding.toolbarFilter.toolbarBtn.setOnSafeClickListener {
closeSelfWithAnimation()
Expand All @@ -125,6 +120,23 @@ class FilterFragment : Fragment() {
}
}

private fun setFilterGa(){
if(seriesViewModel.getSelectedSeries().isNotEmpty()){
reqFilterGa("apply_filter", seriesViewModel.getSelectedSeries())
Log.d("GA 필터 - 계열", seriesViewModel.getSelectedSeries().map { it.name }.toString())
}

if(brandViewModel.getSelectedBrands().isNotEmpty()){
reqFilterGa("apply_brand", brandViewModel.getSelectedBrands())
Log.d("GA 필터 - 브랜드", brandViewModel.getSelectedBrands().map { it.name }.toString())
}

if(keywordViewModel.getSelectedKeywords().isNotEmpty()){
reqFilterGa("apply_bonding", keywordViewModel.getSelectedKeywords())
Log.d("GA 필터 - 키워드", keywordViewModel.getSelectedKeywords().map { it.name }.toString())
}
}

private fun reqFilterGa(type: String, list : List<FilterInfoP>){
list.forEach {
firebaseAnalytics.setOneParamClickEvent("kind_of_filter", type, it.name)
Expand Down Expand Up @@ -156,7 +168,6 @@ class FilterFragment : Fragment() {
filterCategoryList.forEachIndexed { index, filterCategory ->
val tab = getTabAt(index)
tab?.text = filterCategory.nameText
tab?.orCreateBadge?.backgroundColor = context.getColor(R.color.black)
}
addOnTabSelectedListener(TabSelectedListener(binding.tabFilter))
changeTabsFont(0)
Expand All @@ -166,26 +177,35 @@ class FilterFragment : Fragment() {
private fun observeViewModel() {
seriesViewModel.selectedCount.observe(viewLifecycleOwner) { count ->
val tab = binding.tabFilter.getTabAt(FilterCategory.Series.index)
tab?.orCreateBadge?.let {
updateCategoryBadge(it, count)
if(count != 0){
tab?.text = FilterCategory.Series.nameText+"($count)"
}else{
tab?.text = FilterCategory.Series.nameText
}
updateApplyBtnText()
binding.tabFilter.changeTabsFont(FilterCategory.Series.index)
}

brandViewModel.selectedCount.observe(viewLifecycleOwner) { count ->
val tab = binding.tabFilter.getTabAt(FilterCategory.Brand.index)
tab?.orCreateBadge?.let {
updateCategoryBadge(it, count)
if(count != 0){
tab?.text = FilterCategory.Brand.nameText+"($count)"
}else{
tab?.text = FilterCategory.Brand.nameText
}
updateApplyBtnText()
binding.tabFilter.changeTabsFont(FilterCategory.Brand.index)
}

keywordViewModel.selectedCount.observe(viewLifecycleOwner) { count ->
val tab = binding.tabFilter.getTabAt(FilterCategory.Keyword.index)
tab?.orCreateBadge?.let {
updateCategoryBadge(it, count)
if(count != 0){
tab?.text = FilterCategory.Keyword.nameText+"($count)"
}else{
tab?.text = FilterCategory.Keyword.nameText
}
updateApplyBtnText()
binding.tabFilter.changeTabsFont(FilterCategory.Keyword.index)
}
}

Expand Down
24 changes: 18 additions & 6 deletions app/src/main/java/com/scentsnote/android/ui/home/HomeFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.fragment.app.viewModels
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.lifecycleScope
import androidx.lifecycle.repeatOnLifecycle
import com.scentsnote.android.ScentsNoteApplication
import com.scentsnote.android.R
import com.scentsnote.android.ScentsNoteApplication.Companion.firebaseAnalytics
Expand All @@ -22,6 +24,7 @@ import com.scentsnote.android.utils.extension.setHeartBtnClickEvent
import com.scentsnote.android.viewmodel.home.HomeViewModel
import com.scentsnote.android.utils.extension.setOnSafeClickListener
import com.scentsnote.android.utils.extension.setPageViewEvent
import kotlinx.coroutines.launch
import java.util.*

/**
Expand Down Expand Up @@ -60,7 +63,7 @@ class HomeFragment : Fragment() {
override fun onActivityCreated(savedInstanceState: Bundle?) {
super.onActivityCreated(savedInstanceState)

observe()
initObserve()

initRecommendList()
initPopularList()
Expand All @@ -71,8 +74,11 @@ class HomeFragment : Fragment() {
override fun onResume() {
super.onResume()

viewLifecycleOwner.lifecycleScope.launchWhenCreated {
homeViewModel.getHomePerfumeList()
viewLifecycleOwner.lifecycleScope.launch {
homeViewModel.run {
getHomePerfumeList()
getNewPerfumeList(10)
}
}

firebaseAnalytics.setPageViewEvent("HomePage",this::class.java.name)
Expand Down Expand Up @@ -135,16 +141,22 @@ class HomeFragment : Fragment() {
binding.vpHomeRecommend.adapter = recommendAdapter
}

private fun observe() {
homeViewModel.recommendPerfumeList.observe(requireActivity(), androidx.lifecycle.Observer {
private fun initObserve() {
homeViewModel.recommendPerfumeList.observe(requireActivity()){

recommendAdapter.run {
replaceAll(ArrayList(it))
notifyDataSetChanged()
}

binding.indicatorHome.setViewPager(binding.vpHomeRecommend)
})
}

homeViewModel.recentPerfumeList.observe(requireActivity()) {
binding.clHomeRecent.visibility =
if(it.isNotEmpty()) View.VISIBLE
else View.GONE
}
}

private fun initPopularList() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import android.view.View
import androidx.activity.viewModels
import androidx.appcompat.app.AppCompatActivity
import androidx.databinding.DataBindingUtil
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.lifecycleScope
import androidx.lifecycle.repeatOnLifecycle
import com.scentsnote.android.R
import com.scentsnote.android.ScentsNoteApplication.Companion.firebaseAnalytics
import com.scentsnote.android.databinding.ActivityMoreNewPerfumeBinding
Expand All @@ -14,6 +17,7 @@ import com.scentsnote.android.viewmodel.home.HomeViewModel
import com.scentsnote.android.utils.base.BaseWebViewActivity
import com.scentsnote.android.utils.extension.setHeartBtnClickEvent
import com.scentsnote.android.utils.extension.setPageViewEvent
import kotlinx.coroutines.launch

/**
* 홈 화면 - 새로운 향수 더보기
Expand All @@ -31,6 +35,10 @@ class MoreNewPerfumeActivity : AppCompatActivity() {
binding.lifecycleOwner = this
binding.viewModel = homeViewModel

lifecycleScope.launch {
homeViewModel.getNewPerfumeList(null)
}

initNewList()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,14 @@ class HomeViewModel : ViewModel(){
val recentPerfumeList : LiveData<MutableList<HomePerfumeItem>>
get() = _recentPerfumeList

private val _isValidRecentList = MutableLiveData<Boolean>(true)
val isValidRecentList : LiveData<Boolean>
get() = _isValidRecentList

private val _newPerfumeList : MutableLiveData<MutableList<HomePerfumeItem>> = MutableLiveData()
val newPerfumeList : LiveData<MutableList<HomePerfumeItem>>
get() = _newPerfumeList

init {
viewModelScope.launch {
getHomePerfumeList()
}
}

suspend fun getHomePerfumeList(){
getRecommendPerfumeList()
getCommonPerfumeList()
getRecentPerfumeList()
getNewPerfumeList()
}

private suspend fun getRecommendPerfumeList(){
Expand All @@ -73,22 +62,17 @@ class HomeViewModel : ViewModel(){

private suspend fun getRecentPerfumeList(){
try{
_isValidRecentList.postValue(true)
_recentPerfumeList.value = homeRepository.getRecentPerfumeList(ScentsNoteApplication.prefManager.accessToken)
Log.d("getRecentPerfumeList", _recentPerfumeList.value.toString())

if(_recentPerfumeList.value!!.isEmpty()){
_isValidRecentList.postValue(false)
}
}catch (e : HttpException){
_isValidRecentList.postValue(false)
_recentPerfumeList.value = mutableListOf()
Log.d("getRecentPerfumeList error", e.message())
}
}

private suspend fun getNewPerfumeList(){
suspend fun getNewPerfumeList(requestSize: Int?){
try{
_newPerfumeList.value = homeRepository.getNewPerfumeList()
_newPerfumeList.value = homeRepository.getNewPerfumeList(requestSize)
Log.d("getNewPerfumeList", _newPerfumeList.value.toString())
}catch (e : HttpException){
Log.d("getNewPerfumeList error", e.message())
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/drawable/background_white_circle_fill.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="@color/white"/>
</shape>
2 changes: 1 addition & 1 deletion app/src/main/res/layout/fragment_filter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@color/gray_cd" />
app:srcCompat="@color/light_gray_ec" />

<com.google.android.material.button.MaterialButton
android:id="@+id/btn_filter_refresh"
Expand Down
15 changes: 13 additions & 2 deletions app/src/main/res/layout/fragment_filter_brand.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,27 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:listitem="@layout/rv_item_filter_brand_tab"/>
tools:listitem="@layout/rv_item_filter_brand_tab">
</androidx.recyclerview.widget.RecyclerView>

<ImageView
android:id="@+id/imageView57"
android:layout_width="1dp"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/rv_filter_brand_tab"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@color/light_gray_ec" />

<androidx.core.widget.NestedScrollView
android:id="@+id/nestedScrollView"
android:layout_width="0dp"
android:layout_height="0dp"
android:fillViewport="true"
android:overScrollMode="never"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/rv_filter_brand_tab"
app:layout_constraintStart_toEndOf="@+id/imageView57"
app:layout_constraintTop_toTopOf="parent">

<androidx.constraintlayout.widget.ConstraintLayout
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/layout/fragment_home.xml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="42dp"
android:visibility="@{viewModel.isValidRecentList? View.VISIBLE : View.GONE}"
android:background="@color/light_gray_f9"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand Down
13 changes: 7 additions & 6 deletions app/src/main/res/layout/rv_item_filter_brand.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
android:layout_height="wrap_content"
android:layout_marginStart="18dp"
android:layout_marginTop="15dp"
android:layout_marginEnd="19dp"
android:layout_marginEnd="32dp"
android:layout_marginBottom="15dp"
android:checkMark="@drawable/selector_icon_check"
android:checked="@{item.check}"
android:fontFamily="@font/notosans_regular"
android:textSize="15dp"
android:includeFontPadding="false"
android:textColor="@color/black_text"
android:text="@{item.name}"
android:checked="@{item.check}"
android:textColor="@color/black_text"
android:textSize="15dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand All @@ -35,10 +35,11 @@
<ImageView
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_marginEnd="14dp"
android:src="@color/light_gray_f0"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@+id/rv_item_txt_brand"
app:layout_constraintStart_toStartOf="@+id/rv_item_txt_brand" />
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
Loading

0 comments on commit d4962a2

Please sign in to comment.