parent
254a1e3381
commit
8c6aff1623
|
@ -12,7 +12,6 @@ import androidx.core.content.ContextCompat
|
||||||
import androidx.recyclerview.widget.GridLayoutManager
|
import androidx.recyclerview.widget.GridLayoutManager
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import com.orhanobut.logger.Logger
|
|
||||||
import com.zhpan.bannerview.BaseBannerAdapter
|
import com.zhpan.bannerview.BaseBannerAdapter
|
||||||
import com.zhpan.indicator.enums.IndicatorSlideMode
|
import com.zhpan.indicator.enums.IndicatorSlideMode
|
||||||
import com.zhpan.indicator.enums.IndicatorStyle
|
import com.zhpan.indicator.enums.IndicatorStyle
|
||||||
|
@ -194,6 +193,11 @@ class AudioContentMainFragment : BaseFragment<FragmentAudioContentMainBinding>(
|
||||||
recommendSeriesViewModel.toastLiveData.observe(viewLifecycleOwner) {
|
recommendSeriesViewModel.toastLiveData.observe(viewLifecycleOwner) {
|
||||||
it?.let { Toast.makeText(requireContext(), it, Toast.LENGTH_LONG).show() }
|
it?.let { Toast.makeText(requireContext(), it, Toast.LENGTH_LONG).show() }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
binding.llRecommendSeriesRefresh.setOnClickListener {
|
||||||
|
seriesAdapter.clear()
|
||||||
|
recommendSeriesViewModel.getRecommendSeriesList()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setupBanner() {
|
private fun setupBanner() {
|
||||||
|
@ -468,6 +472,11 @@ class AudioContentMainFragment : BaseFragment<FragmentAudioContentMainBinding>(
|
||||||
newContentViewModel.toastLiveData.observe(viewLifecycleOwner) {
|
newContentViewModel.toastLiveData.observe(viewLifecycleOwner) {
|
||||||
it?.let { Toast.makeText(requireContext(), it, Toast.LENGTH_LONG).show() }
|
it?.let { Toast.makeText(requireContext(), it, Toast.LENGTH_LONG).show() }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
binding.llNewContentRefresh.setOnClickListener {
|
||||||
|
newContentViewModel.getThemeList()
|
||||||
|
newContentViewModel.getNewContentOfTheme("전체")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setupContentRankingSortType() {
|
private fun setupContentRankingSortType() {
|
||||||
|
|
|
@ -61,6 +61,7 @@ class AudioContentMainNewContentViewModel(
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getNewContentOfTheme(theme: String) {
|
fun getNewContentOfTheme(theme: String) {
|
||||||
|
_isLoading.value = true
|
||||||
compositeDisposable.add(
|
compositeDisposable.add(
|
||||||
repository.getNewContentOfTheme(
|
repository.getNewContentOfTheme(
|
||||||
theme = if (theme == "전체") {
|
theme = if (theme == "전체") {
|
||||||
|
@ -85,10 +86,13 @@ class AudioContentMainNewContentViewModel(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_isLoading.value = false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
it.message?.let { message -> Logger.e(message) }
|
it.message?.let { message -> Logger.e(message) }
|
||||||
_toastLiveData.postValue("알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.")
|
_toastLiveData.postValue("알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.")
|
||||||
|
_isLoading.value = false
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 886 B |
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<solid android:color="@android:color/transparent" />
|
||||||
|
<corners android:radius="26.7dp" />
|
||||||
|
<stroke
|
||||||
|
android:width="1dp"
|
||||||
|
android:color="@color/color_909090" />
|
||||||
|
</shape>
|
|
@ -50,6 +50,31 @@
|
||||||
android:layout_marginTop="13.3dp"
|
android:layout_marginTop="13.3dp"
|
||||||
android:clipToPadding="false"
|
android:clipToPadding="false"
|
||||||
android:paddingHorizontal="13.3dp" />
|
android:paddingHorizontal="13.3dp" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/ll_recommend_series_refresh"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="13.3dp"
|
||||||
|
android:layout_marginHorizontal="13.3dp"
|
||||||
|
android:background="@drawable/bg_round_corner_26_7_transparent_909090"
|
||||||
|
android:gravity="center"
|
||||||
|
android:paddingVertical="11dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:contentDescription="@null"
|
||||||
|
android:src="@drawable/ic_refresh" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:fontFamily="@font/gmarket_sans_medium"
|
||||||
|
android:text="새로고침"
|
||||||
|
android:textSize="14.7sp" />
|
||||||
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<com.zhpan.bannerview.BannerViewPager
|
<com.zhpan.bannerview.BannerViewPager
|
||||||
|
@ -202,6 +227,31 @@
|
||||||
android:layout_marginTop="13.3dp"
|
android:layout_marginTop="13.3dp"
|
||||||
android:clipToPadding="false"
|
android:clipToPadding="false"
|
||||||
android:paddingHorizontal="13.3dp" />
|
android:paddingHorizontal="13.3dp" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/ll_new_content_refresh"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="13.3dp"
|
||||||
|
android:layout_marginHorizontal="13.3dp"
|
||||||
|
android:background="@drawable/bg_round_corner_26_7_transparent_909090"
|
||||||
|
android:gravity="center"
|
||||||
|
android:paddingVertical="11dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:contentDescription="@null"
|
||||||
|
android:src="@drawable/ic_refresh" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:fontFamily="@font/gmarket_sans_medium"
|
||||||
|
android:text="새로고침"
|
||||||
|
android:textSize="14.7sp" />
|
||||||
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<ProgressBar
|
<ProgressBar
|
||||||
|
|
Loading…
Reference in New Issue