Compare commits
No commits in common. "512153242e6a05b9fa230e3140635c149e213850" and "d1f68d53f54a40b2604f1ab4b5bdbadc416ee8a6" have entirely different histories.
512153242e
...
d1f68d53f5
@ -2,7 +2,6 @@ package com.jia.er.nebuluxe.app.basics
|
|||||||
|
|
||||||
import android.app.Dialog
|
import android.app.Dialog
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
|
||||||
import android.content.pm.ActivityInfo
|
import android.content.pm.ActivityInfo
|
||||||
import android.graphics.Color
|
import android.graphics.Color
|
||||||
import android.graphics.drawable.ColorDrawable
|
import android.graphics.drawable.ColorDrawable
|
||||||
@ -22,7 +21,6 @@ import androidx.core.view.WindowInsetsCompat
|
|||||||
import androidx.viewbinding.ViewBinding
|
import androidx.viewbinding.ViewBinding
|
||||||
import com.blankj.utilcode.util.BarUtils
|
import com.blankj.utilcode.util.BarUtils
|
||||||
import com.jia.er.nebuluxe.app.R
|
import com.jia.er.nebuluxe.app.R
|
||||||
import com.jia.er.nebuluxe.app.utils.singleClick
|
|
||||||
|
|
||||||
abstract class BaseActivity<BV : ViewBinding> : AppCompatActivity() {
|
abstract class BaseActivity<BV : ViewBinding> : AppCompatActivity() {
|
||||||
lateinit var binding: BV
|
lateinit var binding: BV
|
||||||
@ -70,11 +68,6 @@ abstract class BaseActivity<BV : ViewBinding> : AppCompatActivity() {
|
|||||||
BarUtils.transparentStatusBar(this)
|
BarUtils.transparentStatusBar(this)
|
||||||
BarUtils.setStatusBarLightMode(this, false)
|
BarUtils.setStatusBarLightMode(this, false)
|
||||||
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
|
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
|
||||||
if (findViewById<View>(R.id.example_iv_back) != null) {
|
|
||||||
findViewById<View>(R.id.example_iv_back)?.setOnClickListener {
|
|
||||||
finish()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
top()
|
top()
|
||||||
center()
|
center()
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM) {
|
||||||
@ -86,13 +79,7 @@ abstract class BaseActivity<BV : ViewBinding> : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
protected fun skip2Activity(clazz: Class<out BaseActivity<*>>) {
|
|
||||||
singleClick {
|
|
||||||
startActivity(
|
|
||||||
Intent(this, clazz)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
protected abstract fun top()
|
protected abstract fun top()
|
||||||
protected abstract fun center()
|
protected abstract fun center()
|
||||||
protected abstract fun getViewBinding(): BV
|
protected abstract fun getViewBinding(): BV
|
||||||
|
@ -13,8 +13,6 @@ import androidx.appcompat.widget.AppCompatTextView
|
|||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
import androidx.viewbinding.ViewBinding
|
import androidx.viewbinding.ViewBinding
|
||||||
import com.jia.er.nebuluxe.app.R
|
import com.jia.er.nebuluxe.app.R
|
||||||
import com.jia.er.nebuluxe.app.utils.LOG
|
|
||||||
import com.jia.er.nebuluxe.app.utils.singleClick
|
|
||||||
|
|
||||||
abstract class BaseFragment<VB : ViewBinding> : Fragment() {
|
abstract class BaseFragment<VB : ViewBinding> : Fragment() {
|
||||||
lateinit var binding: VB
|
lateinit var binding: VB
|
||||||
@ -55,29 +53,6 @@ abstract class BaseFragment<VB : ViewBinding> : Fragment() {
|
|||||||
protected open fun onRetry() {
|
protected open fun onRetry() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated(message = "Use onPageResume() instead")
|
|
||||||
override fun onResume() {
|
|
||||||
super.onResume()
|
|
||||||
resume()
|
|
||||||
}
|
|
||||||
|
|
||||||
fun resume() {
|
|
||||||
singleClick {
|
|
||||||
onPageResume()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
open fun onPageResume() {
|
|
||||||
LOG.d("BaseFragment", this::class.java.simpleName + ".onResume")
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onHiddenChanged(hidden: Boolean) {
|
|
||||||
super.onHiddenChanged(hidden)
|
|
||||||
if (!hidden) {
|
|
||||||
resume()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun showNetError() {
|
fun showNetError() {
|
||||||
networkErrorView?.visibility = View.VISIBLE
|
networkErrorView?.visibility = View.VISIBLE
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,24 @@
|
|||||||
|
package com.jia.er.nebuluxe.app.home;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
|
import com.chad.library.adapter4.BaseQuickAdapter;
|
||||||
|
import com.chad.library.adapter4.viewholder.QuickViewHolder;
|
||||||
|
import com.jia.er.nebuluxe.app.R;
|
||||||
|
|
||||||
|
public class InputHistoryAdapter extends BaseQuickAdapter<String, QuickViewHolder> {
|
||||||
|
@Override
|
||||||
|
protected void onBindViewHolder(@NonNull QuickViewHolder quickAdapterHelper, int i, @Nullable String s) {
|
||||||
|
quickAdapterHelper.setText(R.id.tv_con, s);
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
protected QuickViewHolder onCreateViewHolder(@NonNull Context context, @NonNull ViewGroup viewGroup, int i) {
|
||||||
|
return new QuickViewHolder(R.layout.item_input_history, viewGroup);
|
||||||
|
}
|
||||||
|
}
|
@ -1,21 +0,0 @@
|
|||||||
package com.jia.er.nebuluxe.app.home
|
|
||||||
|
|
||||||
import android.content.Context
|
|
||||||
import android.view.ViewGroup
|
|
||||||
import com.chad.library.adapter4.BaseQuickAdapter
|
|
||||||
import com.chad.library.adapter4.viewholder.QuickViewHolder
|
|
||||||
import com.jia.er.nebuluxe.app.R
|
|
||||||
|
|
||||||
class InputHistoryAdapter : BaseQuickAdapter<String, QuickViewHolder>() {
|
|
||||||
override fun onBindViewHolder(quickAdapterHelper: QuickViewHolder, i: Int, s: String?) {
|
|
||||||
quickAdapterHelper.setText(R.id.tv_con, s)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onCreateViewHolder(
|
|
||||||
context: Context,
|
|
||||||
viewGroup: ViewGroup,
|
|
||||||
i: Int
|
|
||||||
): QuickViewHolder {
|
|
||||||
return QuickViewHolder(R.layout.item_input_history, viewGroup)
|
|
||||||
}
|
|
||||||
}
|
|
@ -0,0 +1,33 @@
|
|||||||
|
package com.jia.er.nebuluxe.app.home;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
|
import com.chad.library.adapter4.BaseQuickAdapter;
|
||||||
|
import com.chad.library.adapter4.viewholder.QuickViewHolder;
|
||||||
|
import com.jia.er.nebuluxe.app.R;
|
||||||
|
import com.jia.er.nebuluxe.app.utils.TextViewUtil;
|
||||||
|
|
||||||
|
public class InputResultAdapter extends BaseQuickAdapter<String, QuickViewHolder> {
|
||||||
|
String keyword;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onBindViewHolder(@NonNull QuickViewHolder quickAdapterHelper, int i, @Nullable String s) {
|
||||||
|
quickAdapterHelper.setText(R.id.tv_con, s);
|
||||||
|
quickAdapterHelper.setText(R.id.tv_title, TextViewUtil.getTextColor(s, keyword, R.color.text_color_pink_dark));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
protected QuickViewHolder onCreateViewHolder(@NonNull Context context, @NonNull ViewGroup viewGroup, int i) {
|
||||||
|
return new QuickViewHolder(R.layout.item_search_result, viewGroup);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setKeyword(String input) {
|
||||||
|
keyword = input;
|
||||||
|
}
|
||||||
|
}
|
@ -1,40 +0,0 @@
|
|||||||
package com.jia.er.nebuluxe.app.home
|
|
||||||
|
|
||||||
import android.content.Context
|
|
||||||
import android.view.View
|
|
||||||
import android.view.ViewGroup
|
|
||||||
import android.widget.ImageView
|
|
||||||
import com.bumptech.glide.Glide
|
|
||||||
import com.chad.library.adapter4.BaseQuickAdapter
|
|
||||||
import com.chad.library.adapter4.viewholder.QuickViewHolder
|
|
||||||
import com.jia.er.nebuluxe.app.R
|
|
||||||
import com.jia.er.nebuluxe.app.data.VideoListDataRes.VideoListData
|
|
||||||
import com.jia.er.nebuluxe.app.utils.StringUtil
|
|
||||||
import com.jia.er.nebuluxe.app.utils.TextViewUtil
|
|
||||||
|
|
||||||
class InputResultAdapter : BaseQuickAdapter<VideoListData, QuickViewHolder>() {
|
|
||||||
var keyword: String? = null
|
|
||||||
|
|
||||||
override fun onBindViewHolder(holder: QuickViewHolder, i: Int, item: VideoListData?) {
|
|
||||||
holder.setText(R.id.tv_tip, item!!.categoryList.get(0).name)
|
|
||||||
holder.setText(
|
|
||||||
R.id.tv_title,
|
|
||||||
TextViewUtil.getTextColor(item.name, keyword, R.color.text_color_pink_dark)
|
|
||||||
)
|
|
||||||
holder.setText(R.id.tv_num, StringUtil.getWatchNum(item.watch_total))
|
|
||||||
holder.setText(R.id.tv_con, item.description)
|
|
||||||
Glide.with(context).load(item.image_url).into(holder.getView(R.id.iv) as ImageView)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onCreateViewHolder(
|
|
||||||
context: Context,
|
|
||||||
viewGroup: ViewGroup,
|
|
||||||
i: Int
|
|
||||||
): QuickViewHolder {
|
|
||||||
return QuickViewHolder(R.layout.item_search_result, viewGroup)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun setKeyword(input: String?) {
|
|
||||||
keyword = input
|
|
||||||
}
|
|
||||||
}
|
|
@ -16,28 +16,34 @@ import com.chad.library.adapter4.viewholder.QuickViewHolder
|
|||||||
import com.google.android.material.imageview.ShapeableImageView
|
import com.google.android.material.imageview.ShapeableImageView
|
||||||
import com.google.android.material.shape.RelativeCornerSize
|
import com.google.android.material.shape.RelativeCornerSize
|
||||||
import com.jia.er.nebuluxe.app.R
|
import com.jia.er.nebuluxe.app.R
|
||||||
import com.jia.er.nebuluxe.app.data.CollectionRes.CollectionData
|
|
||||||
import com.jia.er.nebuluxe.app.data.HomeBannerBean
|
import com.jia.er.nebuluxe.app.data.HomeBannerBean
|
||||||
|
|
||||||
class SaveFavoritesAdapter :
|
class SaveFavoritesAdapter :
|
||||||
BaseQuickAdapter<CollectionData, QuickViewHolder>() {
|
BaseQuickAdapter<String, QuickViewHolder>() {
|
||||||
var currentPosition = 0
|
var currentPosition = 0
|
||||||
override fun onBindViewHolder(
|
override fun onBindViewHolder(
|
||||||
holder: QuickViewHolder,
|
holder: QuickViewHolder,
|
||||||
position: Int,
|
position: Int,
|
||||||
item: CollectionData?
|
item: String?
|
||||||
) {
|
) {
|
||||||
val view = holder.getView<ShapeableImageView>(R.id.iv)
|
holder.getView<AppCompatSeekBar>(R.id.progress_bar).setProgress(position * 13)
|
||||||
Glide.with(context).load(item?.image_url).placeholder(R.drawable.iv_placeholder_v)
|
// val view = holder.getView<ShapeableImageView>(R.id.example_iv_icon_ceo)
|
||||||
.into(view)
|
// Glide.with(context).load(item?.image_url).placeholder(R.drawable.iv_placeholder_v)
|
||||||
holder.getView<AppCompatSeekBar>(R.id.sk_play_progress).progress =
|
// .into(view)
|
||||||
if (item != null) {
|
// view.scaleType = ImageView.ScaleType.CENTER_CROP
|
||||||
val current = item.current_episode
|
// view.shapeAppearanceModel = view.shapeAppearanceModel
|
||||||
val total = item.episode_total.takeIf { it > 0 } ?: 100
|
// .toBuilder()
|
||||||
current * 100 / total
|
// .setAllCornerSizes(RelativeCornerSize(0.5f))
|
||||||
} else {
|
// .build()
|
||||||
0
|
// view.elevation = 0f
|
||||||
}
|
// view.clipToOutline = true
|
||||||
|
// view.outlineProvider = object : ViewOutlineProvider() {
|
||||||
|
// override fun getOutline(view: View, outline: Outline) {
|
||||||
|
// val size = minOf(view.width, view.height)
|
||||||
|
// outline.setOval(0, 0, size, size)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
// if (currentPosition == position) {
|
// if (currentPosition == position) {
|
||||||
// holder.setVisible(R.id.view, false)
|
// holder.setVisible(R.id.view, false)
|
||||||
// } else {
|
// } else {
|
||||||
|
@ -9,43 +9,53 @@ import android.view.ViewGroup
|
|||||||
import android.view.ViewOutlineProvider
|
import android.view.ViewOutlineProvider
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import android.widget.SeekBar
|
import android.widget.SeekBar
|
||||||
import androidx.appcompat.widget.AppCompatSeekBar
|
|
||||||
import com.bumptech.glide.Glide
|
import com.bumptech.glide.Glide
|
||||||
import com.chad.library.adapter4.BaseQuickAdapter
|
import com.chad.library.adapter4.BaseQuickAdapter
|
||||||
import com.chad.library.adapter4.viewholder.QuickViewHolder
|
import com.chad.library.adapter4.viewholder.QuickViewHolder
|
||||||
import com.google.android.material.imageview.ShapeableImageView
|
import com.google.android.material.imageview.ShapeableImageView
|
||||||
import com.google.android.material.shape.RelativeCornerSize
|
import com.google.android.material.shape.RelativeCornerSize
|
||||||
import com.jia.er.nebuluxe.app.R
|
import com.jia.er.nebuluxe.app.R
|
||||||
import com.jia.er.nebuluxe.app.data.HistoryDataRes
|
|
||||||
import com.jia.er.nebuluxe.app.data.HomeBannerBean
|
import com.jia.er.nebuluxe.app.data.HomeBannerBean
|
||||||
import com.jia.er.nebuluxe.app.utils.LOG
|
|
||||||
|
|
||||||
class SaveHistoryAdapter :
|
class SaveHistoryAdapter :
|
||||||
BaseQuickAdapter<HistoryDataRes.Data, QuickViewHolder>() {
|
BaseQuickAdapter<String, QuickViewHolder>() {
|
||||||
|
var currentPosition = 0
|
||||||
override fun onBindViewHolder(
|
override fun onBindViewHolder(
|
||||||
holder: QuickViewHolder,
|
holder: QuickViewHolder,
|
||||||
position: Int,
|
position: Int,
|
||||||
item: HistoryDataRes.Data?
|
item: String?
|
||||||
) {
|
) {
|
||||||
holder.getView<View>(R.id.line).visibility = if (position == 0) View.GONE else View.VISIBLE
|
holder.getView<View>(R.id.line).visibility = if (position == 0) View.GONE else View.VISIBLE
|
||||||
holder.setSelected(R.id.iv_star, item?.is_collect == 1)
|
holder.getView<SeekBar>(R.id.progress_bar).setProgress(position * 10)
|
||||||
holder.setText(R.id.tv_name, item?.name)
|
holder.setSelected(R.id.iv_star, position % 2 == 0)
|
||||||
val progress = if (item != null) {
|
holder.setText(R.id.tv_name, "Name " + position)
|
||||||
val current = item.current_episode
|
holder.setText(R.id.tv_con, "Content " + position)
|
||||||
val total = item.episode_total.takeIf { it > 0 } ?: 1
|
|
||||||
current * 100 / total
|
|
||||||
} else {
|
|
||||||
0
|
|
||||||
}
|
|
||||||
holder.getView<AppCompatSeekBar>(R.id.progress_bar).progress = progress
|
|
||||||
holder.setText(R.id.tv_con, item?.category.let { it?.joinToString(", ") ?: "" })
|
|
||||||
holder.setText(
|
holder.setText(
|
||||||
R.id.tv_viewed,
|
R.id.tv_viewed,
|
||||||
String.format(context.getString(R.string.viewed_format), progress.toString())
|
String.format(context.getString(R.string.viewed_format), position.toString())
|
||||||
)
|
)
|
||||||
val view = holder.getView<ShapeableImageView>(R.id.iv)
|
// val view = holder.getView<ShapeableImageView>(R.id.example_iv_icon_ceo)
|
||||||
Glide.with(context).load(item?.image_url).placeholder(R.drawable.iv_placeholder_v)
|
// Glide.with(context).load(item?.image_url).placeholder(R.drawable.iv_placeholder_v)
|
||||||
.into(view)
|
// .into(view)
|
||||||
|
// view.scaleType = ImageView.ScaleType.CENTER_CROP
|
||||||
|
// view.shapeAppearanceModel = view.shapeAppearanceModel
|
||||||
|
// .toBuilder()
|
||||||
|
// .setAllCornerSizes(RelativeCornerSize(0.5f))
|
||||||
|
// .build()
|
||||||
|
// view.elevation = 0f
|
||||||
|
// view.clipToOutline = true
|
||||||
|
// view.outlineProvider = object : ViewOutlineProvider() {
|
||||||
|
// override fun getOutline(view: View, outline: Outline) {
|
||||||
|
// val size = minOf(view.width, view.height)
|
||||||
|
// outline.setOval(0, 0, size, size)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if (currentPosition == position) {
|
||||||
|
// holder.setVisible(R.id.view, false)
|
||||||
|
// } else {
|
||||||
|
// holder.setVisible(R.id.view, true)
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCreateViewHolder(
|
override fun onCreateViewHolder(
|
||||||
|
@ -1,173 +1,179 @@
|
|||||||
package com.jia.er.nebuluxe.app.home
|
package com.jia.er.nebuluxe.app.home
|
||||||
|
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
|
import android.graphics.Color
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import androidx.lifecycle.ViewModelProvider
|
import androidx.lifecycle.ViewModelProvider
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import com.blankj.utilcode.util.GsonUtils
|
import com.jia.er.nebuluxe.app.data.CollectionRes
|
||||||
import com.blankj.utilcode.util.NetworkUtils
|
import com.blankj.utilcode.util.NetworkUtils
|
||||||
import com.chad.library.adapter4.BaseQuickAdapter
|
|
||||||
import com.chad.library.adapter4.layoutmanager.QuickGridLayoutManager
|
import com.chad.library.adapter4.layoutmanager.QuickGridLayoutManager
|
||||||
import com.jia.er.nebuluxe.app.R
|
import com.jia.er.nebuluxe.app.R
|
||||||
import com.jia.er.nebuluxe.app.basics.BaseFragment
|
import com.jia.er.nebuluxe.app.basics.BaseFragment
|
||||||
import com.jia.er.nebuluxe.app.basics.Constants
|
|
||||||
import com.jia.er.nebuluxe.app.data.CollectionRes.CollectionData
|
|
||||||
import com.jia.er.nebuluxe.app.data.HistoryDataRes
|
|
||||||
import com.jia.er.nebuluxe.app.databinding.FragmentSavedBinding
|
import com.jia.er.nebuluxe.app.databinding.FragmentSavedBinding
|
||||||
import com.jia.er.nebuluxe.app.net.MainViewModel
|
import com.jia.er.nebuluxe.app.net.MainViewModel
|
||||||
import com.jia.er.nebuluxe.app.utils.DialogUtils
|
import com.jia.er.nebuluxe.app.utils.DialogUtils
|
||||||
import com.jia.er.nebuluxe.app.utils.LOG
|
|
||||||
import com.jia.er.nebuluxe.app.utils.singleClick
|
import com.jia.er.nebuluxe.app.utils.singleClick
|
||||||
import com.jia.er.nebuluxe.app.utils.toast
|
import com.jia.er.nebuluxe.app.utils.toast
|
||||||
import com.jia.er.nebuluxe.app.video.PlayerDetailActivity
|
|
||||||
|
|
||||||
class SavedFragment : BaseFragment<FragmentSavedBinding>() {
|
class SavedFragment : BaseFragment<FragmentSavedBinding>() {
|
||||||
private var page: Int = 1
|
private var page: Int = 1
|
||||||
|
|
||||||
private var favorAdapter: SaveFavoritesAdapter? = null
|
// private var myListAdapter: MyListAdapter? = null
|
||||||
private var historyAdapter: SaveHistoryAdapter? = null
|
|
||||||
private var edit = false
|
private var edit = false
|
||||||
private var mode = 0//0-收藏 1-历史
|
|
||||||
private var current: Int = 0
|
private var current: Int = 0
|
||||||
private val mViewModel by lazy { ViewModelProvider(this)[MainViewModel::class.java] }
|
private val mViewModel by lazy { ViewModelProvider(this)[MainViewModel::class.java] }
|
||||||
override fun top() {
|
override fun top() {
|
||||||
showLoading()
|
|
||||||
binding.btnFavor.isSelected = true
|
binding.btnFavor.isSelected = true
|
||||||
binding.btnFavor.setOnClickListener {
|
binding.btnFavor.setOnClickListener {
|
||||||
binding.btnFavor.isSelected = true
|
binding.btnFavor.isSelected = true
|
||||||
binding.btnHistory.isSelected = false
|
binding.btnHistory.isSelected = false
|
||||||
binding.rvFavor.visibility = View.VISIBLE
|
binding.rvFavor.visibility = View.VISIBLE
|
||||||
binding.rvHistory.visibility = View.GONE
|
binding.rvHistory.visibility = View.GONE
|
||||||
mode = 0
|
|
||||||
onPageResume()
|
|
||||||
}
|
}
|
||||||
binding.btnHistory.setOnClickListener {
|
binding.btnHistory.setOnClickListener {
|
||||||
binding.btnFavor.isSelected = false
|
binding.btnFavor.isSelected = false
|
||||||
binding.btnHistory.isSelected = true
|
binding.btnHistory.isSelected = true
|
||||||
binding.rvFavor.visibility = View.GONE
|
binding.rvFavor.visibility = View.GONE
|
||||||
binding.rvHistory.visibility = View.VISIBLE
|
binding.rvHistory.visibility = View.VISIBLE
|
||||||
mode = 1
|
|
||||||
onPageResume()
|
|
||||||
}
|
}
|
||||||
val layoutManager = QuickGridLayoutManager(requireContext(), 3)
|
val layoutManager = QuickGridLayoutManager(requireContext(), 3)
|
||||||
binding.rvFavor.layoutManager = layoutManager
|
binding.rvFavor.layoutManager = layoutManager
|
||||||
favorAdapter = SaveFavoritesAdapter()
|
val adapter = SaveFavoritesAdapter()
|
||||||
binding.rvFavor.adapter = favorAdapter
|
binding.rvFavor.adapter = adapter
|
||||||
|
val debug = listOf(
|
||||||
|
"a",
|
||||||
|
"b",
|
||||||
|
"c",
|
||||||
|
"d",
|
||||||
|
"e",
|
||||||
|
"f"
|
||||||
|
)
|
||||||
|
adapter.items = debug
|
||||||
val layoutManager1 = LinearLayoutManager(requireContext())
|
val layoutManager1 = LinearLayoutManager(requireContext())
|
||||||
binding.rvHistory.layoutManager = layoutManager1
|
binding.rvHistory.layoutManager = layoutManager1
|
||||||
historyAdapter = SaveHistoryAdapter()
|
val adapter1 = SaveHistoryAdapter()
|
||||||
binding.rvHistory.adapter = historyAdapter
|
binding.rvHistory.adapter = adapter1
|
||||||
favorAdapter?.addOnItemChildClickListener(
|
adapter1.items = debug
|
||||||
R.id.iv_favorites_delete, { adapter, view, position ->
|
adapter.addOnItemChildClickListener(R.id.iv_favorites_delete, { adapter, view, position ->
|
||||||
val item = adapter.getItem(position) as CollectionData
|
DialogUtils.showDoubleBtnDialog(
|
||||||
current = position
|
requireContext(),
|
||||||
showRemoveDialog(item.short_play_id, item.short_play_video_id)
|
"Remove from Favorites?",
|
||||||
})
|
"This drama will be removed from your favorites.",
|
||||||
favorAdapter?.addOnItemChildClickListener(
|
"Remove",
|
||||||
R.id.item_pan, { adapter, view, position ->
|
"Cancel",
|
||||||
val item = adapter.getItem(position) as CollectionData
|
R.drawable.ic_star_remove,
|
||||||
skip2Detail(item.short_play_id)
|
object : DialogUtils.DialogOnClickListener {
|
||||||
})
|
|
||||||
historyAdapter?.addOnItemChildClickListener(
|
override fun onConfirmClick() {
|
||||||
R.id.iv_star, { adapter, view, position ->
|
toast("确认移除接口")
|
||||||
val item = adapter.getItem(position) as HistoryDataRes.Data
|
|
||||||
current = position
|
|
||||||
if (item.is_collect == 0) {
|
|
||||||
mViewModel.doCollect(item.short_play_id, item.short_play_video_id)
|
|
||||||
} else {
|
|
||||||
showRemoveDialog(item.short_play_id, item.short_play_video_id)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
historyAdapter?.addOnItemChildClickListener(R.id.item_pan, { adapter, view, position ->
|
|
||||||
val item = adapter.getItem(position) as HistoryDataRes.Data
|
|
||||||
skip2Detail(item.short_play_id)
|
|
||||||
})
|
|
||||||
mViewModel.collectionsData.observe(this) {
|
|
||||||
if (it != null) {
|
|
||||||
if (page == 1) {
|
|
||||||
favorAdapter?.submitList(it.data?.list)
|
|
||||||
hideLoading()
|
|
||||||
hideNetError()
|
|
||||||
} else if (it.data?.list?.isNotEmpty() == true) {
|
|
||||||
favorAdapter?.addAll(it.data.list)
|
|
||||||
hideLoading()
|
|
||||||
hideNetError()
|
|
||||||
} else {
|
|
||||||
hideLoading()
|
|
||||||
toast(getString(R.string.no_more_data))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
mViewModel.historysData.observe(this) {
|
|
||||||
if (it != null) {
|
|
||||||
if (page == 1) {
|
|
||||||
historyAdapter?.submitList(it.data?.list)
|
|
||||||
hideLoading()
|
|
||||||
hideNetError()
|
|
||||||
} else if (it.data?.list?.isNotEmpty() == true) {
|
|
||||||
historyAdapter?.addAll(it.data.list)
|
|
||||||
hideLoading()
|
|
||||||
hideNetError()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
mViewModel.collectData.observe(this) {
|
|
||||||
if (it != null) {
|
|
||||||
toast(getString(R.string.success))
|
|
||||||
val item = historyAdapter?.getItem(current) as HistoryDataRes.Data
|
|
||||||
item.is_collect = 1 - item.is_collect
|
|
||||||
historyAdapter?.notifyItemChanged(current)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
mViewModel.cancelCollectData.observe(this) {
|
|
||||||
if (it != null) {
|
|
||||||
toast(getString(R.string.success))
|
|
||||||
if (mode == 0) {
|
|
||||||
favorAdapter?.removeAt(current)
|
|
||||||
} else {
|
|
||||||
val item = historyAdapter?.getItem(current) as HistoryDataRes.Data
|
|
||||||
item.is_collect = 1 - item.is_collect
|
|
||||||
historyAdapter?.notifyItemChanged(current)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
toast(R.string.network_error)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
binding.srMyList.setOnRefreshListener {
|
|
||||||
onPageResume()
|
|
||||||
}
|
|
||||||
binding.srMyList.setOnLoadMoreListener {
|
|
||||||
page++
|
|
||||||
mViewModel.getCollections(page)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun skip2Detail(shortPlayId: Int) {
|
override fun onCancelClick() {
|
||||||
startActivity(
|
}
|
||||||
Intent(requireContext(), PlayerDetailActivity::class.java).apply {
|
|
||||||
putExtra(
|
|
||||||
Constants.CONSTANTS_short_play_id,
|
|
||||||
shortPlayId
|
|
||||||
)
|
|
||||||
})
|
})
|
||||||
}
|
})
|
||||||
|
// if (NetworkUtils.isConnected()) {
|
||||||
override fun onPageResume() {
|
// showLoading()
|
||||||
super.onPageResume()
|
// mViewModel.getCollections(page)
|
||||||
if (NetworkUtils.isConnected()) {
|
// } else {
|
||||||
page = 1
|
// showNetError()
|
||||||
if (mode == 0) {
|
// }
|
||||||
mViewModel.getCollections(page)
|
// binding?.srMyList?.setOnRefreshListener {
|
||||||
} else {
|
// page = 1
|
||||||
mViewModel.myHistorys(page)
|
// mViewModel.getCollections(page)
|
||||||
}
|
// }
|
||||||
} else {
|
// binding?.srMyList?.setOnLoadMoreListener {
|
||||||
showNetError()
|
// page++
|
||||||
}
|
// mViewModel.getCollections(page)
|
||||||
|
// }
|
||||||
|
// binding?.exampleIvEditMyFavorites?.setOnClickListener {
|
||||||
|
// if (!edit) {
|
||||||
|
// edit = true
|
||||||
|
// binding?.exampleIvEditMyFavorites?.setImageResource(R.drawable.iv_edit_favorites_complete)
|
||||||
|
// myListAdapter?.eidt = true
|
||||||
|
// binding?.tvTitle?.text = "Delete"
|
||||||
|
// binding.tvTitle.background = context?.getDrawable(R.drawable.iv_list_title_bg_h)
|
||||||
|
// myListAdapter?.notifyDataSetChanged()
|
||||||
|
// } else {
|
||||||
|
// edit = false
|
||||||
|
// binding?.exampleIvEditMyFavorites?.setImageResource(R.drawable.iv_edit_favorites)
|
||||||
|
// binding.tvTitle.background = context?.getDrawable(R.drawable.iv_list_title_bg)
|
||||||
|
// myListAdapter?.eidt = false
|
||||||
|
// binding?.tvTitle?.text = "Favorites"
|
||||||
|
// myListAdapter?.notifyDataSetChanged()
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// binding.ivHis.setOnClickListener {
|
||||||
|
// startActivity(
|
||||||
|
// Intent(
|
||||||
|
// requireContext(),
|
||||||
|
// HistoryActivity::class.java
|
||||||
|
// ))
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun center() {
|
override fun center() {
|
||||||
|
// mViewModel.collectionsData.observe(this) {
|
||||||
|
// if (it != null) {
|
||||||
|
// if (page == 1) {
|
||||||
|
// myListAdapter = MyListAdapter()
|
||||||
|
// val manager = QuickGridLayoutManager(requireContext(), 3)
|
||||||
|
// binding?.rvMyList?.layoutManager = manager
|
||||||
|
// binding?.rvMyList?.adapter = myListAdapter
|
||||||
|
// myListAdapter?.submitList(it.data?.list)
|
||||||
|
// myListAdapter?.isStateViewEnable = true
|
||||||
|
// myListAdapter?.setStateViewLayout(requireContext(), R.layout.layout_emptyview)
|
||||||
|
// myListAdapter?.addOnItemChildClickListener(R.id.iv_favorites_delete) { adapter, view, position ->
|
||||||
|
// current = position
|
||||||
|
// val collectionData =
|
||||||
|
// adapter.getItem(position) as CollectionRes.CollectionData
|
||||||
|
// DialogUtils.unFavoriteDialog(
|
||||||
|
// requireContext(),
|
||||||
|
// collectionData.short_play_id,
|
||||||
|
// collectionData.short_play_video_id,
|
||||||
|
// mViewModel
|
||||||
|
// )
|
||||||
|
// }
|
||||||
|
// myListAdapter?.setOnItemClickListener { adapter, view, position ->
|
||||||
|
// val data = adapter.getItem(position) as CollectionRes.CollectionData
|
||||||
|
// startActivity(
|
||||||
|
// Intent(
|
||||||
|
// requireContext(),
|
||||||
|
// PlayerDetailActivity::class.java
|
||||||
|
// ).apply {
|
||||||
|
// putExtra(
|
||||||
|
// Constants.CONSTANTS_short_play_id,
|
||||||
|
// data.short_play_id
|
||||||
|
// )
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// if (it.data?.list?.isNotEmpty() == true) {
|
||||||
|
// myListAdapter?.addAll(it.data.list)
|
||||||
|
// } else {
|
||||||
|
// toast(getString(R.string.no_more_data))
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// hideLoading()
|
||||||
|
// hideNetError()
|
||||||
|
// } else {
|
||||||
|
// hideLoading()
|
||||||
|
// toast(R.string.network_error)
|
||||||
|
// }
|
||||||
|
// binding?.srMyList?.finishRefresh()
|
||||||
|
// binding?.srMyList?.finishLoadMore()
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// mViewModel.cancelCollectData.observe(this) {
|
||||||
|
// if (it != null) {
|
||||||
|
// toast(getString(R.string.success))
|
||||||
|
// myListAdapter?.removeAt(current)
|
||||||
|
// myListAdapter?.notifyDataSetChanged()
|
||||||
|
// } else {
|
||||||
|
// toast(R.string.network_error)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getViewBinding(): FragmentSavedBinding {
|
override fun getViewBinding(): FragmentSavedBinding {
|
||||||
@ -187,23 +193,4 @@ class SavedFragment : BaseFragment<FragmentSavedBinding>() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun showRemoveDialog(shortPlayId: Int, shortPlayVideoId: Int) {
|
|
||||||
DialogUtils.showDoubleBtnDialog(
|
|
||||||
requireContext(),
|
|
||||||
R.string.dialog_title_remove_favorites,
|
|
||||||
R.string.dialog_content_remove_favorites,
|
|
||||||
R.string.dialog_confirm_btn_remove_favorites,
|
|
||||||
R.string.dialog_cancel_btn_remove_favorites,
|
|
||||||
R.drawable.ic_star_remove,
|
|
||||||
object : DialogUtils.DialogOnClickListener {
|
|
||||||
|
|
||||||
override fun onConfirmClick() {
|
|
||||||
mViewModel.doCancelCollect(shortPlayId, shortPlayVideoId)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCancelClick() {
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
@ -0,0 +1,85 @@
|
|||||||
|
package com.jia.er.nebuluxe.app.home;
|
||||||
|
|
||||||
|
import static com.blankj.utilcode.util.KeyboardUtils.hideSoftInput;
|
||||||
|
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.view.KeyEvent;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.inputmethod.EditorInfo;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
import androidx.viewbinding.ViewBinding;
|
||||||
|
|
||||||
|
import com.jia.er.nebuluxe.app.basics.BaseActivity;
|
||||||
|
import com.jia.er.nebuluxe.app.databinding.ActivityMainBinding;
|
||||||
|
import com.jia.er.nebuluxe.app.databinding.ActivitySearchBinding;
|
||||||
|
import com.jia.er.nebuluxe.app.utils.AppUtil;
|
||||||
|
import com.jia.er.nebuluxe.app.utils.LOG;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class SearchActivity extends BaseActivity<ActivitySearchBinding> {
|
||||||
|
InputResultAdapter adapter2;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void top() {
|
||||||
|
InputHistoryAdapter adapter = new InputHistoryAdapter();
|
||||||
|
LinearLayoutManager manager = new LinearLayoutManager(this);
|
||||||
|
manager.setOrientation(LinearLayoutManager.HORIZONTAL);
|
||||||
|
binding.rvInputHistory.setLayoutManager(manager);
|
||||||
|
binding.rvInputHistory.setAdapter(adapter);
|
||||||
|
|
||||||
|
LinearLayoutManager manager2 = new LinearLayoutManager(this);
|
||||||
|
manager2.setOrientation(LinearLayoutManager.VERTICAL);
|
||||||
|
adapter2 = new InputResultAdapter();
|
||||||
|
binding.rvResult.setLayoutManager(manager2);
|
||||||
|
binding.rvResult.setAdapter(adapter2);
|
||||||
|
List<String> debug = new ArrayList<>();
|
||||||
|
debug.add("Love");
|
||||||
|
debug.add("CEO");
|
||||||
|
debug.add("Recersal Of Fate");
|
||||||
|
adapter.setItems(debug);
|
||||||
|
binding.tvInput.setOnEditorActionListener((textView, actionId, keyEvent) -> {
|
||||||
|
String input = binding.tvInput.getText() == null ? "" : binding.tvInput.getText().toString();
|
||||||
|
LOG.d("SearchActivity.actionId", String.valueOf(actionId));
|
||||||
|
LOG.d("SearchActivity.input", input);
|
||||||
|
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_SEND) {
|
||||||
|
if (TextUtils.isEmpty(input)) {
|
||||||
|
binding.emptyPan.setVisibility(View.VISIBLE);
|
||||||
|
binding.resultPan.setVisibility(View.GONE);
|
||||||
|
} else {
|
||||||
|
binding.emptyPan.setVisibility(View.GONE);
|
||||||
|
binding.resultPan.setVisibility(View.VISIBLE);
|
||||||
|
onSearch(input);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void onSearch(String input) {
|
||||||
|
adapter2.setKeyword(input);
|
||||||
|
List<String> debug = new ArrayList<>();
|
||||||
|
for (int i = 0; i < input.length(); i++) {
|
||||||
|
debug.add(input + " : DEBUG " + i);
|
||||||
|
}
|
||||||
|
adapter2.setItems(debug);
|
||||||
|
adapter2.notifyDataSetChanged();
|
||||||
|
hideSoftInput(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void center() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
protected ActivitySearchBinding getViewBinding() {
|
||||||
|
return ActivitySearchBinding.inflate(getLayoutInflater());
|
||||||
|
}
|
||||||
|
}
|
@ -1,142 +0,0 @@
|
|||||||
package com.jia.er.nebuluxe.app.home
|
|
||||||
|
|
||||||
import android.content.Intent
|
|
||||||
import android.text.TextUtils
|
|
||||||
import android.view.KeyEvent
|
|
||||||
import android.view.View
|
|
||||||
import android.view.inputmethod.EditorInfo
|
|
||||||
import android.widget.TextView
|
|
||||||
import androidx.lifecycle.ViewModelProvider
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
|
||||||
import com.blankj.utilcode.util.KeyboardUtils
|
|
||||||
import com.bumptech.glide.Glide
|
|
||||||
import com.jia.er.nebuluxe.app.R
|
|
||||||
import com.jia.er.nebuluxe.app.basics.BaseActivity
|
|
||||||
import com.jia.er.nebuluxe.app.basics.Constants
|
|
||||||
import com.jia.er.nebuluxe.app.data.ExampleKeywordDataRes
|
|
||||||
import com.jia.er.nebuluxe.app.databinding.ActivitySearchBinding
|
|
||||||
import com.jia.er.nebuluxe.app.net.MainViewModel
|
|
||||||
import com.jia.er.nebuluxe.app.utils.Memory
|
|
||||||
import com.jia.er.nebuluxe.app.utils.toast
|
|
||||||
import com.jia.er.nebuluxe.app.video.PlayerDetailActivity
|
|
||||||
|
|
||||||
class SearchActivity : BaseActivity<ActivitySearchBinding>() {
|
|
||||||
var searchResultAdapter: InputResultAdapter? = null
|
|
||||||
private val mViewModel by lazy { ViewModelProvider(this)[MainViewModel::class.java] }
|
|
||||||
|
|
||||||
override fun top() {
|
|
||||||
val adapter = InputHistoryAdapter()
|
|
||||||
val manager = LinearLayoutManager(this)
|
|
||||||
manager.setOrientation(LinearLayoutManager.HORIZONTAL)
|
|
||||||
binding.rvInputHistory.setLayoutManager(manager)
|
|
||||||
binding.rvInputHistory.setAdapter(adapter)
|
|
||||||
val manager2 = LinearLayoutManager(this)
|
|
||||||
manager2.setOrientation(LinearLayoutManager.VERTICAL)
|
|
||||||
searchResultAdapter = InputResultAdapter()
|
|
||||||
binding.rvResult.setLayoutManager(manager2)
|
|
||||||
binding.rvResult.setAdapter(searchResultAdapter)
|
|
||||||
val searchHistory: MutableList<String> = Memory.getSearch()
|
|
||||||
val hasHistory = !searchHistory.isEmpty()
|
|
||||||
binding.btnDelete.visibility = if (hasHistory) View.VISIBLE else View.GONE
|
|
||||||
binding.rvInputHistory.visibility = if (hasHistory) View.VISIBLE else View.GONE
|
|
||||||
adapter.items = searchHistory
|
|
||||||
adapter.setOnItemClickListener { adapter, view, position ->
|
|
||||||
val data = adapter.getItem(position) as String
|
|
||||||
binding.tvInput.setText(data)
|
|
||||||
onSearch(data)
|
|
||||||
}
|
|
||||||
binding.btnDelete.setOnClickListener {
|
|
||||||
Memory.clearSearchHistory()
|
|
||||||
binding.rvInputHistory.visibility = View.GONE
|
|
||||||
binding.btnDelete.visibility = View.GONE
|
|
||||||
}
|
|
||||||
binding.tvInput.setOnEditorActionListener({ textView: TextView?, actionId: Int, keyEvent: KeyEvent? ->
|
|
||||||
val input =
|
|
||||||
if (binding.tvInput.getText() == null) "" else binding.tvInput.getText().toString()
|
|
||||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_SEND) {
|
|
||||||
if (!TextUtils.isEmpty(input)) {
|
|
||||||
onSearch(input)
|
|
||||||
}
|
|
||||||
true
|
|
||||||
}
|
|
||||||
false
|
|
||||||
})
|
|
||||||
searchResultAdapter?.setOnItemClickListener() { adapter, view, position ->
|
|
||||||
val data = adapter.getItem(position)
|
|
||||||
data?.short_play_id?.let { id ->
|
|
||||||
openDetail(id)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
val itemClickListener: View.OnClickListener = View.OnClickListener { v ->
|
|
||||||
if (v.getTag() is ExampleKeywordDataRes.KeywordData) {
|
|
||||||
val data = v.getTag() as ExampleKeywordDataRes.KeywordData
|
|
||||||
openDetail(data.short_play_id)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
binding.ivEmpty1.setOnClickListener(itemClickListener)
|
|
||||||
binding.ivEmpty2.setOnClickListener(itemClickListener)
|
|
||||||
binding.ivEmpty3.setOnClickListener(itemClickListener)
|
|
||||||
binding.ivEmpty4.setOnClickListener(itemClickListener)
|
|
||||||
binding.ivEmpty5.setOnClickListener(itemClickListener)
|
|
||||||
binding.btnMore.setOnClickListener { skip2Activity(HotActivity::class.java) }
|
|
||||||
mViewModel.hotsData.observe(this) {
|
|
||||||
val lists = it.data?.list.orEmpty().take(5) // 限制最多5个元素
|
|
||||||
lists.size.let { position ->
|
|
||||||
binding.ivEmpty1.visibility = if (position >= 1) View.VISIBLE else View.GONE
|
|
||||||
binding.ivEmpty2.visibility = if (position >= 2) View.VISIBLE else View.GONE
|
|
||||||
binding.ivEmpty3.visibility = if (position >= 3) View.VISIBLE else View.GONE
|
|
||||||
binding.ivEmpty4.visibility = if (position >= 4) View.VISIBLE else View.GONE
|
|
||||||
binding.ivEmpty5.visibility = if (position >= 5) View.VISIBLE else View.GONE
|
|
||||||
binding.ivEmpty1.setTag(it.data?.list[0])
|
|
||||||
binding.ivEmpty2.setTag(it.data?.list[1])
|
|
||||||
binding.ivEmpty3.setTag(it.data?.list[2])
|
|
||||||
binding.ivEmpty4.setTag(it.data?.list[3])
|
|
||||||
binding.ivEmpty5.setTag(it.data?.list[4])
|
|
||||||
Glide.with(this).load(it.data?.list[0]?.image_url).into(binding.ivEmpty1)
|
|
||||||
Glide.with(this).load(it.data?.list[1]?.image_url).into(binding.ivEmpty2)
|
|
||||||
Glide.with(this).load(it.data?.list[2]?.image_url).into(binding.ivEmpty3)
|
|
||||||
Glide.with(this).load(it.data?.list[3]?.image_url).into(binding.ivEmpty4)
|
|
||||||
Glide.with(this).load(it.data?.list[4]?.image_url).into(binding.ivEmpty5)
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
mViewModel.searchData.observe(this) {
|
|
||||||
searchResultAdapter?.items = it?.data?.list.orEmpty()
|
|
||||||
if (it?.data?.list.isNullOrEmpty()) {
|
|
||||||
toast(R.string.toast_no_result_of_keyword)
|
|
||||||
binding.emptyPan.visibility = View.VISIBLE
|
|
||||||
binding.resultPan.visibility = View.GONE
|
|
||||||
} else {
|
|
||||||
binding.emptyPan.visibility = View.GONE
|
|
||||||
binding.resultPan.visibility = View.VISIBLE
|
|
||||||
}
|
|
||||||
searchResultAdapter?.notifyDataSetChanged()
|
|
||||||
}
|
|
||||||
mViewModel.hots()
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun openDetail(id: Int) {
|
|
||||||
startActivity(
|
|
||||||
Intent(
|
|
||||||
this, PlayerDetailActivity::class.java
|
|
||||||
).apply {
|
|
||||||
putExtra(
|
|
||||||
Constants.CONSTANTS_short_play_id, id
|
|
||||||
)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun onSearch(input: String) {
|
|
||||||
Memory.saveSearchString(input)
|
|
||||||
mViewModel.searchDataByInput(input)
|
|
||||||
searchResultAdapter!!.setKeyword(input)
|
|
||||||
KeyboardUtils.hideSoftInput(this)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun center() {
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun getViewBinding(): ActivitySearchBinding {
|
|
||||||
return ActivitySearchBinding.inflate(getLayoutInflater())
|
|
||||||
}
|
|
||||||
}
|
|
@ -33,6 +33,7 @@ import com.jia.er.nebuluxe.app.data.UploadHistoryReq
|
|||||||
import com.jia.er.nebuluxe.app.data.UserInfoRes
|
import com.jia.er.nebuluxe.app.data.UserInfoRes
|
||||||
import com.jia.er.nebuluxe.app.data.UserRegisterRes
|
import com.jia.er.nebuluxe.app.data.UserRegisterRes
|
||||||
import com.jia.er.nebuluxe.app.data.VideoListDataRes
|
import com.jia.er.nebuluxe.app.data.VideoListDataRes
|
||||||
|
import com.jia.er.nebuluxe.app.net.MainRequest
|
||||||
|
|
||||||
class MainViewModel : ViewModel() {
|
class MainViewModel : ViewModel() {
|
||||||
private val userRegisterLiveData = MutableLiveData<BaseRes<UserRegisterRes>>()
|
private val userRegisterLiveData = MutableLiveData<BaseRes<UserRegisterRes>>()
|
||||||
@ -99,23 +100,15 @@ class MainViewModel : ViewModel() {
|
|||||||
|
|
||||||
private val searchLiveData = MutableLiveData<BaseRes<VideoListDataRes>>()
|
private val searchLiveData = MutableLiveData<BaseRes<VideoListDataRes>>()
|
||||||
val searchData: MutableLiveData<BaseRes<VideoListDataRes>> get() = searchLiveData
|
val searchData: MutableLiveData<BaseRes<VideoListDataRes>> get() = searchLiveData
|
||||||
fun searchDataByInput(search: String) {
|
fun getVideoList(search: String) {
|
||||||
MainRequest.getVideoList(search).observeForever { result ->
|
MainRequest.getVideoList(search).observeForever { result ->
|
||||||
searchLiveData.value = result.getOrNull()
|
searchLiveData.value = result.getOrNull()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// private val hotsLiveData = MutableLiveData<BaseRes<ExampleKeywordDataRes>>()
|
|
||||||
// val hotsData: MutableLiveData<BaseRes<ExampleKeywordDataRes>> get() = hotsLiveData
|
|
||||||
// fun hots() {
|
|
||||||
// MainRequest.hots().observeForever { result ->
|
|
||||||
// hotsLiveData.value = result.getOrNull()
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
private val videoListLiveData = MutableLiveData<BaseRes<VideoListDataRes>>()
|
private val videoListLiveData = MutableLiveData<BaseRes<VideoListDataRes>>()
|
||||||
val videoListData: MutableLiveData<BaseRes<VideoListDataRes>> get() = videoListLiveData
|
val videoListData: MutableLiveData<BaseRes<VideoListDataRes>> get() = videoListLiveData
|
||||||
fun searchDataByInput(current_page: Int, category_id: Int) {
|
fun getVideoList(current_page: Int, category_id: Int) {
|
||||||
MainRequest.getVideoList(current_page, category_id).observeForever { result ->
|
MainRequest.getVideoList(current_page, category_id).observeForever { result ->
|
||||||
videoListLiveData.value = result.getOrNull()
|
videoListLiveData.value = result.getOrNull()
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,20 @@
|
|||||||
package com.jia.er.nebuluxe.app.utils
|
package com.jia.er.nebuluxe.app.utils
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
|
import android.graphics.Color
|
||||||
|
import android.text.Spannable
|
||||||
|
import android.text.SpannableString
|
||||||
|
import android.text.SpannedString
|
||||||
|
import android.text.style.ForegroundColorSpan
|
||||||
|
import android.util.Log
|
||||||
|
import android.widget.TextView
|
||||||
import androidx.appcompat.widget.AppCompatImageView
|
import androidx.appcompat.widget.AppCompatImageView
|
||||||
import androidx.appcompat.widget.AppCompatTextView
|
import androidx.appcompat.widget.AppCompatTextView
|
||||||
import com.jia.er.nebuluxe.app.R
|
import com.jia.er.nebuluxe.app.R
|
||||||
import com.jia.er.nebuluxe.app.basics.CommonDialog
|
import com.jia.er.nebuluxe.app.basics.CommonDialog
|
||||||
import com.jia.er.nebuluxe.app.net.MainViewModel
|
import com.jia.er.nebuluxe.app.net.MainViewModel
|
||||||
import com.jia.er.nebuluxe.app.ui.UnFavoriteDialog
|
import com.jia.er.nebuluxe.app.ui.UnFavoriteDialog
|
||||||
|
import com.jia.er.nebuluxe.app.utils.singleClick
|
||||||
|
|
||||||
|
|
||||||
object DialogUtils {
|
object DialogUtils {
|
||||||
@ -35,40 +43,20 @@ object DialogUtils {
|
|||||||
fun onCancelClick()
|
fun onCancelClick()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun <T> showDoubleBtnDialog(
|
fun showDoubleBtnDialog(
|
||||||
context: Context,
|
context: Context,
|
||||||
t: T,
|
title: String,
|
||||||
c: T,
|
content: String,
|
||||||
confirmBtnStr: T,
|
confirmStr: String,
|
||||||
cancelBtnStr: T,
|
cancelStr: String,
|
||||||
iconRes: Int,
|
iconRes: Int,
|
||||||
listener: DialogOnClickListener
|
listener: DialogOnClickListener
|
||||||
) {
|
) {
|
||||||
val title = when (t) {
|
|
||||||
is String -> t
|
|
||||||
is Int -> context.getString(t)
|
|
||||||
else -> ""
|
|
||||||
}
|
|
||||||
val content = when (c) {
|
|
||||||
is String -> c
|
|
||||||
is Int -> context.getString(c)
|
|
||||||
else -> ""
|
|
||||||
}
|
|
||||||
val confirm = when (confirmBtnStr) {
|
|
||||||
is String -> confirmBtnStr
|
|
||||||
is Int -> context.getString(confirmBtnStr)
|
|
||||||
else -> ""
|
|
||||||
}
|
|
||||||
val cancel = when (cancelBtnStr) {
|
|
||||||
is String -> cancelBtnStr
|
|
||||||
is Int -> context.getString(cancelBtnStr)
|
|
||||||
else -> ""
|
|
||||||
}
|
|
||||||
singleClick {
|
singleClick {
|
||||||
val dialog = CommonDialog(
|
val dialog = CommonDialog(
|
||||||
CommonDialog.Builder(context).title(title).content(content).centerIcon(iconRes)
|
CommonDialog.Builder(context).title(title).content(content).centerIcon(iconRes)
|
||||||
.addString(R.id.dialog_confirm, confirm)
|
.addString(R.id.dialog_confirm, confirmStr)
|
||||||
.addString(R.id.dialog_cancel, cancel)
|
.addString(R.id.dialog_cancel, cancelStr)
|
||||||
.addOnClick({ commonDialog, vId ->
|
.addOnClick({ commonDialog, vId ->
|
||||||
commonDialog.dismiss()
|
commonDialog.dismiss()
|
||||||
if (vId == R.id.dialog_confirm) {
|
if (vId == R.id.dialog_confirm) {
|
||||||
|
@ -34,10 +34,6 @@ object Memory {
|
|||||||
return Gson().fromJson(string, UserInfoRes::class.java)
|
return Gson().fromJson(string, UserInfoRes::class.java)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun clearSearchHistory() {
|
|
||||||
getMMKV().putString(CONSTANTS_SEARCH_STRINGExample, "[]")
|
|
||||||
}
|
|
||||||
|
|
||||||
fun saveSearchString(search: String) {
|
fun saveSearchString(search: String) {
|
||||||
val strings = getSearch()
|
val strings = getSearch()
|
||||||
if (!strings.contains(search)) {
|
if (!strings.contains(search)) {
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
package com.jia.er.nebuluxe.app.utils;
|
|
||||||
|
|
||||||
public class StringUtil {
|
|
||||||
public static String getWatchNum(long num) {
|
|
||||||
if (num < 1000) {
|
|
||||||
return num + "";
|
|
||||||
}
|
|
||||||
return num / 1000 + "." + num % 1000 / 100 + "k";
|
|
||||||
}
|
|
||||||
}
|
|
@ -93,11 +93,10 @@ public class TextViewUtil {
|
|||||||
LOG.e("TextViewUtil", " tv = " + con + " \nlight = " + light);
|
LOG.e("TextViewUtil", " tv = " + con + " \nlight = " + light);
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
LOG.d("TextViewUtil.96", con + "->" + light);
|
|
||||||
SpannableString spannableString = new SpannableString(con);
|
SpannableString spannableString = new SpannableString(con);
|
||||||
ForegroundColorSpan colorSpan = new ForegroundColorSpan(MyApplication.context.getResources()
|
ForegroundColorSpan colorSpan = new ForegroundColorSpan(MyApplication.context.getResources()
|
||||||
.getColor(color));
|
.getColor(color));
|
||||||
int start = con.toLowerCase().indexOf(light.toLowerCase());
|
int start = con.indexOf(light);
|
||||||
int end = start + light.length();
|
int end = start + light.length();
|
||||||
spannableString.setSpan(colorSpan, start, end, Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
spannableString.setSpan(colorSpan, start, end, Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||||
return spannableString;
|
return spannableString;
|
||||||
@ -126,6 +125,7 @@ public class TextViewUtil {
|
|||||||
// public static CharSequence get123(String bigAndColor, String color, String normal) {
|
// public static CharSequence get123(String bigAndColor, String color, String normal) {
|
||||||
// return getTextColorSize(bigAndColor + color + normal, bigAndColor + color, bigAndColor, R.color.text_color_black, 1.6F);
|
// return getTextColorSize(bigAndColor + color + normal, bigAndColor + color, bigAndColor, R.color.text_color_black, 1.6F);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
public static CharSequence getTextColorSize(String con, String change, int color,
|
public static CharSequence getTextColorSize(String con, String change, int color,
|
||||||
float colorSizeRate) {
|
float colorSizeRate) {
|
||||||
return getTextColorSize(con, change, change, color, colorSizeRate);
|
return getTextColorSize(con, change, change, color, colorSizeRate);
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@drawable/iv_bg"
|
android:background="@drawable/iv_bg"
|
||||||
@ -11,7 +10,7 @@
|
|||||||
android:id="@+id/example_iv_back"
|
android:id="@+id/example_iv_back"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="@dimen/padding_16px"
|
android:layout_marginLeft="@dimen/padding_16px"
|
||||||
android:padding="@dimen/padding_8px"
|
android:padding="@dimen/padding_8px"
|
||||||
android:src="@drawable/iv_example_back"
|
android:src="@drawable/iv_example_back"
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
@ -56,11 +55,11 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@null"
|
android:background="@null"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
|
android:singleLine="true"
|
||||||
android:hint="@string/hint_search_input"
|
android:hint="@string/hint_search_input"
|
||||||
android:imeOptions="actionSearch"
|
android:imeOptions="actionSearch"
|
||||||
android:paddingLeft="@dimen/padding_50px"
|
android:paddingLeft="@dimen/padding_50px"
|
||||||
android:paddingRight="@dimen/padding_50px"
|
android:paddingRight="@dimen/padding_50px"
|
||||||
android:singleLine="true"
|
|
||||||
android:textColor="@color/text_color_white"
|
android:textColor="@color/text_color_white"
|
||||||
android:textColorHint="@color/text_color_hint_B7"
|
android:textColorHint="@color/text_color_hint_B7"
|
||||||
android:textSize="@dimen/text_size_12px" />
|
android:textSize="@dimen/text_size_12px" />
|
||||||
@ -81,7 +80,6 @@
|
|||||||
android:layout_height="@dimen/padding_40px"
|
android:layout_height="@dimen/padding_40px"
|
||||||
android:padding="@dimen/padding_11px"
|
android:padding="@dimen/padding_11px"
|
||||||
android:src="@drawable/ic_delete_gray"
|
android:src="@drawable/ic_delete_gray"
|
||||||
android:visibility="gone"
|
|
||||||
app:layout_constraintRight_toRightOf="parent"
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
@ -89,7 +87,6 @@
|
|||||||
android:id="@+id/rv_input_history"
|
android:id="@+id/rv_input_history"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="@dimen/padding_40px"
|
android:layout_height="@dimen/padding_40px"
|
||||||
android:visibility="gone"
|
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
app:layout_constraintRight_toLeftOf="@id/btn_delete"
|
app:layout_constraintRight_toLeftOf="@id/btn_delete"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
@ -99,8 +96,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/bg_conner_20px_black_light"
|
android:background="@drawable/bg_conner_20px_black_light"
|
||||||
android:padding="@dimen/padding_10px"
|
android:padding="@dimen/padding_10px"
|
||||||
app:layout_constraintTop_toBottomOf="@id/rv_input_history"
|
app:layout_constraintTop_toBottomOf="@id/rv_input_history">
|
||||||
tools:visibility="gone">
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
android:id="@+id/tv_empty_title"
|
android:id="@+id/tv_empty_title"
|
||||||
@ -125,9 +121,8 @@
|
|||||||
app:layout_constraintTop_toBottomOf="@id/tv_empty_title" />
|
app:layout_constraintTop_toBottomOf="@id/tv_empty_title" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageView
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
android:id="@+id/btn_more"
|
|
||||||
android:layout_width="@dimen/padding_40px"
|
android:layout_width="@dimen/padding_40px"
|
||||||
android:layout_height="@dimen/padding_42px"
|
android:layout_height="@dimen/padding_22px"
|
||||||
android:paddingLeft="@dimen/padding_12px"
|
android:paddingLeft="@dimen/padding_12px"
|
||||||
android:paddingRight="@dimen/padding_12px"
|
android:paddingRight="@dimen/padding_12px"
|
||||||
android:src="@drawable/ic_arrow_right"
|
android:src="@drawable/ic_arrow_right"
|
||||||
@ -136,69 +131,63 @@
|
|||||||
|
|
||||||
<com.google.android.material.imageview.ShapeableImageView
|
<com.google.android.material.imageview.ShapeableImageView
|
||||||
android:id="@+id/iv_empty_1"
|
android:id="@+id/iv_empty_1"
|
||||||
android:layout_width="0dp"
|
android:layout_width="@dimen/padding_150px"
|
||||||
android:layout_height="@dimen/padding_220px"
|
android:layout_height="@dimen/padding_220px"
|
||||||
android:layout_marginTop="@dimen/padding_20px"
|
android:layout_marginTop="@dimen/padding_20px"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:src="@drawable/ic_default_iv_ver"
|
android:src="@drawable/ic_default_iv_ver"
|
||||||
app:layout_constraintHorizontal_weight="2"
|
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
app:layout_constraintRight_toLeftOf="@id/iv_empty_2"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/tv_empty_con"
|
app:layout_constraintTop_toBottomOf="@id/tv_empty_con"
|
||||||
app:shapeAppearance="@style/CircleCornerStyle" />
|
app:shapeAppearance="@style/CircleCornerStyle" />
|
||||||
|
|
||||||
<com.google.android.material.imageview.ShapeableImageView
|
<com.google.android.material.imageview.ShapeableImageView
|
||||||
android:id="@+id/iv_empty_2"
|
android:id="@+id/iv_empty_2"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="@dimen/padding_108px"
|
||||||
android:layout_marginStart="@dimen/padding_6px"
|
android:layout_marginLeft="@dimen/padding_6px"
|
||||||
|
android:layout_marginTop="@dimen/padding_20px"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:src="@drawable/ic_default_iv_ver"
|
android:src="@drawable/ic_default_iv_ver"
|
||||||
app:layout_constraintBottom_toTopOf="@id/iv_empty_4"
|
|
||||||
app:layout_constraintHorizontal_weight="1"
|
|
||||||
app:layout_constraintLeft_toRightOf="@id/iv_empty_1"
|
app:layout_constraintLeft_toRightOf="@id/iv_empty_1"
|
||||||
app:layout_constraintRight_toLeftOf="@id/iv_empty_3"
|
app:layout_constraintRight_toLeftOf="@id/iv_empty_3"
|
||||||
app:layout_constraintTop_toTopOf="@id/iv_empty_1"
|
app:layout_constraintTop_toBottomOf="@id/tv_empty_con"
|
||||||
app:shapeAppearance="@style/CircleCornerStyle" />
|
app:shapeAppearance="@style/CircleCornerStyle" />
|
||||||
|
|
||||||
<com.google.android.material.imageview.ShapeableImageView
|
<com.google.android.material.imageview.ShapeableImageView
|
||||||
android:id="@+id/iv_empty_3"
|
android:id="@+id/iv_empty_3"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="@dimen/padding_108px"
|
||||||
android:layout_marginStart="@dimen/padding_6px"
|
android:layout_marginLeft="@dimen/padding_6px"
|
||||||
|
android:layout_marginTop="@dimen/padding_20px"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:src="@drawable/ic_default_iv_ver"
|
android:src="@drawable/ic_default_iv_ver"
|
||||||
app:layout_constraintBottom_toBottomOf="@id/iv_empty_2"
|
|
||||||
app:layout_constraintHorizontal_weight="1"
|
|
||||||
app:layout_constraintLeft_toRightOf="@id/iv_empty_2"
|
app:layout_constraintLeft_toRightOf="@id/iv_empty_2"
|
||||||
app:layout_constraintRight_toRightOf="parent"
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="@id/iv_empty_1"
|
app:layout_constraintTop_toBottomOf="@id/tv_empty_con"
|
||||||
app:shapeAppearance="@style/CircleCornerStyle" />
|
app:shapeAppearance="@style/CircleCornerStyle" />
|
||||||
|
|
||||||
<com.google.android.material.imageview.ShapeableImageView
|
<com.google.android.material.imageview.ShapeableImageView
|
||||||
android:id="@+id/iv_empty_4"
|
android:id="@+id/iv_empty_4"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="@dimen/padding_108px"
|
||||||
android:layout_marginStart="@dimen/padding_6px"
|
android:layout_marginLeft="@dimen/padding_6px"
|
||||||
android:layout_marginTop="@dimen/padding_4px"
|
android:layout_marginTop="@dimen/padding_4px"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:src="@drawable/ic_default_iv_ver"
|
android:src="@drawable/ic_default_iv_ver"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintLeft_toRightOf="@id/iv_empty_1"
|
app:layout_constraintLeft_toRightOf="@id/iv_empty_1"
|
||||||
app:layout_constraintRight_toLeftOf="@id/iv_empty_5"
|
app:layout_constraintRight_toRightOf="@id/iv_empty_2"
|
||||||
app:layout_constraintTop_toBottomOf="@id/iv_empty_2"
|
app:layout_constraintTop_toBottomOf="@id/iv_empty_3"
|
||||||
app:shapeAppearance="@style/CircleCornerStyle" />
|
app:shapeAppearance="@style/CircleCornerStyle" />
|
||||||
|
|
||||||
<com.google.android.material.imageview.ShapeableImageView
|
<com.google.android.material.imageview.ShapeableImageView
|
||||||
android:id="@+id/iv_empty_5"
|
android:id="@+id/iv_empty_5"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="@dimen/padding_108px"
|
||||||
android:layout_marginStart="@dimen/padding_6px"
|
android:layout_marginLeft="@dimen/padding_6px"
|
||||||
android:layout_marginTop="@dimen/padding_4px"
|
android:layout_marginTop="@dimen/padding_4px"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:src="@drawable/ic_default_iv_ver"
|
android:src="@drawable/ic_default_iv_ver"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintLeft_toRightOf="@id/iv_empty_2"
|
||||||
app:layout_constraintLeft_toRightOf="@id/iv_empty_4"
|
|
||||||
app:layout_constraintRight_toRightOf="parent"
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/iv_empty_3"
|
app:layout_constraintTop_toBottomOf="@id/iv_empty_3"
|
||||||
app:shapeAppearance="@style/CircleCornerStyle" />
|
app:shapeAppearance="@style/CircleCornerStyle" />
|
||||||
@ -209,13 +198,11 @@
|
|||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/result_pan"
|
android:id="@+id/result_pan"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="@dimen/padding_16px"
|
android:layout_margin="@dimen/padding_16px"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintTop_toBottomOf="@id/search_pan">
|
||||||
app:layout_constraintTop_toBottomOf="@id/search_pan"
|
|
||||||
tools:visibility="visible">
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
android:id="@+id/tv_result_tip"
|
android:id="@+id/tv_result_tip"
|
||||||
@ -232,8 +219,7 @@
|
|||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/rv_result"
|
android:id="@+id/rv_result"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="wrap_content"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/tv_result_tip" />
|
app:layout_constraintTop_toBottomOf="@id/tv_result_tip" />
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -40,28 +40,17 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<com.scwang.smart.refresh.layout.SmartRefreshLayout
|
|
||||||
android:id="@+id/sr_my_list"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/rv_favor"
|
android:id="@+id/rv_favor"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent" />
|
android:layout_height="match_parent"
|
||||||
|
tools:visibility="gone" />
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/rv_history"
|
android:id="@+id/rv_history"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@drawable/bg_conner_10px_black_light"
|
android:background="@drawable/bg_conner_10px_black_light"
|
||||||
android:visibility="gone" />
|
tools:visibility="visible" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
|
|
||||||
</LinearLayout>
|
|
@ -2,13 +2,12 @@
|
|||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:id="@+id/item_pan"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="@dimen/padding_6px"
|
android:layout_margin="@dimen/padding_6px"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<com.google.android.material.imageview.ShapeableImageView
|
<com.google.android.material.imageview.ShapeableImageView
|
||||||
android:id="@+id/iv"
|
android:id="@+id/example_iv_icon_ceo"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/padding_144px"
|
android:layout_height="@dimen/padding_144px"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
@ -19,28 +18,27 @@
|
|||||||
app:shapeAppearance="@style/CircleCornerStyle" />
|
app:shapeAppearance="@style/CircleCornerStyle" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatSeekBar
|
<androidx.appcompat.widget.AppCompatSeekBar
|
||||||
android:id="@+id/sk_play_progress"
|
android:id="@+id/progress_bar"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="@dimen/padding_4px"
|
android:layout_height="@dimen/padding_4px"
|
||||||
android:layout_marginTop="@dimen/padding_6px"
|
android:layout_marginTop="@dimen/padding_6px"
|
||||||
android:layout_marginBottom="@dimen/padding_20px"
|
android:layout_marginBottom="@dimen/padding_20px"
|
||||||
android:max="100"
|
|
||||||
android:paddingStart="0dp"
|
android:paddingStart="0dp"
|
||||||
android:paddingEnd="0dp"
|
android:paddingEnd="0dp"
|
||||||
|
android:progress="50"
|
||||||
android:progressDrawable="@drawable/seek_save_favorites"
|
android:progressDrawable="@drawable/seek_save_favorites"
|
||||||
android:thumb="@color/transparent"
|
android:thumb="@color/transparent"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
app:layout_constraintRight_toRightOf="parent"
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/iv" />
|
app:layout_constraintTop_toBottomOf="@id/example_iv_icon_ceo" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageView
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
android:id="@+id/iv_favorites_delete"
|
android:id="@+id/iv_favorites_delete"
|
||||||
android:layout_width="@dimen/padding_30px"
|
android:layout_width="@dimen/padding_20px"
|
||||||
android:layout_height="@dimen/padding_30px"
|
android:layout_height="@dimen/padding_20px"
|
||||||
android:padding="@dimen/padding_6px"
|
android:src="@drawable/baseline_delete_forever_24"
|
||||||
android:src="@drawable/ic_star_select"
|
app:layout_constraintRight_toRightOf="@id/example_iv_icon_ceo"
|
||||||
app:layout_constraintRight_toRightOf="@id/iv"
|
app:layout_constraintTop_toTopOf="@id/example_iv_icon_ceo" />
|
||||||
app:layout_constraintTop_toTopOf="@id/iv" />
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -2,7 +2,6 @@
|
|||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/item_pan"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="@dimen/padding_6px"
|
android:layout_margin="@dimen/padding_6px"
|
||||||
@ -19,7 +18,7 @@
|
|||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<com.google.android.material.imageview.ShapeableImageView
|
<com.google.android.material.imageview.ShapeableImageView
|
||||||
android:id="@+id/iv"
|
android:id="@+id/example_iv_icon_ceo"
|
||||||
android:layout_width="@dimen/padding_92px"
|
android:layout_width="@dimen/padding_92px"
|
||||||
android:layout_height="@dimen/padding_124px"
|
android:layout_height="@dimen/padding_124px"
|
||||||
android:layout_margin="@dimen/padding_10px"
|
android:layout_margin="@dimen/padding_10px"
|
||||||
@ -38,9 +37,9 @@
|
|||||||
android:textColor="@color/text_color_white"
|
android:textColor="@color/text_color_white"
|
||||||
android:textSize="@dimen/text_size_14px"
|
android:textSize="@dimen/text_size_14px"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
app:layout_constraintLeft_toRightOf="@id/iv"
|
app:layout_constraintLeft_toRightOf="@id/example_iv_icon_ceo"
|
||||||
app:layout_constraintRight_toRightOf="parent"
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="@id/iv"
|
app:layout_constraintTop_toTopOf="@id/example_iv_icon_ceo"
|
||||||
tools:text="her veiled protectoy" />
|
tools:text="her veiled protectoy" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
@ -54,7 +53,7 @@
|
|||||||
android:paddingEnd="@dimen/padding_26px"
|
android:paddingEnd="@dimen/padding_26px"
|
||||||
android:textColor="@color/text_color_white"
|
android:textColor="@color/text_color_white"
|
||||||
android:textSize="@dimen/text_size_12px"
|
android:textSize="@dimen/text_size_12px"
|
||||||
app:layout_constraintLeft_toRightOf="@id/iv"
|
app:layout_constraintLeft_toRightOf="@id/example_iv_icon_ceo"
|
||||||
app:layout_constraintRight_toRightOf="parent"
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/tv_name"
|
app:layout_constraintTop_toBottomOf="@id/tv_name"
|
||||||
tools:text="her veiled protectoy" />
|
tools:text="her veiled protectoy" />
|
||||||
@ -70,7 +69,7 @@
|
|||||||
android:textColor="@color/text_color_gray_DF"
|
android:textColor="@color/text_color_gray_DF"
|
||||||
android:textSize="@dimen/text_size_10px"
|
android:textSize="@dimen/text_size_10px"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintLeft_toRightOf="@id/iv" />
|
app:layout_constraintLeft_toRightOf="@id/example_iv_icon_ceo" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatSeekBar
|
<androidx.appcompat.widget.AppCompatSeekBar
|
||||||
android:id="@+id/progress_bar"
|
android:id="@+id/progress_bar"
|
||||||
|
@ -32,9 +32,4 @@
|
|||||||
<string name="search_empty_title">What Everyone’s Watching</string>
|
<string name="search_empty_title">What Everyone’s Watching</string>
|
||||||
<string name="search_empty_con">Join the trend</string>
|
<string name="search_empty_con">Join the trend</string>
|
||||||
<string name="tip_search_tip">Search Results</string>
|
<string name="tip_search_tip">Search Results</string>
|
||||||
<string name="dialog_title_remove_favorites">Remove from Favorites?</string>
|
|
||||||
<string name="dialog_content_remove_favorites">This drama will be removed from your favorites.</string>
|
|
||||||
<string name="dialog_confirm_btn_remove_favorites">Remove</string>
|
|
||||||
<string name="dialog_cancel_btn_remove_favorites">Cancel</string>
|
|
||||||
<string name="toast_no_result_of_keyword">未搜索到结果</string>
|
|
||||||
</resources>
|
</resources>
|
Loading…
x
Reference in New Issue
Block a user