视频上传交互优化(第二期)20200827ui反馈 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/969
This commit is contained in:
@ -29,12 +29,6 @@ import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.facebook.drawee.generic.GenericDraweeHierarchy;
|
||||
import com.gh.common.AppExecutor;
|
||||
import com.gh.common.constant.Config;
|
||||
@ -68,6 +62,12 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
public class DialogUtils {
|
||||
|
||||
public static Dialog showWaitDialog(Context context, String msg) {
|
||||
@ -1559,6 +1559,35 @@ public class DialogUtils {
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
public static void showUploadVideoChangeLabelDialog(Context context, @NonNull ConfirmListener confirmListener) {
|
||||
context = checkDialogContext(context);
|
||||
|
||||
final Dialog dialog = new Dialog(context, R.style.GhAlertDialog);
|
||||
|
||||
View contentView = LayoutInflater.from(context).inflate(R.layout.dialog_upload_video_change_label, null);
|
||||
|
||||
View cancelBtn = contentView.findViewById(R.id.cancel);
|
||||
View confirmBtn = contentView.findViewById(R.id.confirm);
|
||||
|
||||
cancelBtn.setOnClickListener(v -> {
|
||||
dialog.dismiss();
|
||||
});
|
||||
|
||||
confirmBtn.setOnClickListener(v -> {
|
||||
confirmListener.onConfirm();
|
||||
dialog.dismiss();
|
||||
});
|
||||
|
||||
Window window = dialog.getWindow();
|
||||
if (window != null) {
|
||||
window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
}
|
||||
|
||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
dialog.setContentView(contentView);
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param context may be is application context
|
||||
* @return activity context
|
||||
|
||||
@ -116,6 +116,7 @@ object ErrorHelper {
|
||||
403078 -> Utils.toast(context, "已点赞")
|
||||
403072 -> Utils.toast(context, R.string.comment_failed_userblocked)
|
||||
403082 -> Utils.toast(context, "作者已关闭评论")
|
||||
403022 -> Utils.toast(context, "不能回复自己")
|
||||
|
||||
403020 -> if (showHighPriorityHint) {
|
||||
DialogUtils.showAlertDialog(context,
|
||||
|
||||
@ -2,7 +2,6 @@ package com.gh.gamecenter.message;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
@ -269,7 +268,7 @@ public class MessageItemViewHolder extends BaseRecyclerViewHolder<MessageEntity>
|
||||
case "game_comment_vote":
|
||||
mBinding.messageCommand.setText("赞了你的评论");
|
||||
mBinding.messageContent.setVisibility(View.GONE);
|
||||
mBinding.messageOriginalTitle.setText(TextUtils.isEmpty(messageEntity.getGame().getName()) ? "" : messageEntity.getGame().getName());
|
||||
mBinding.messageOriginalTitle.setText(messageEntity.getGame().getName());
|
||||
targetUrl = messageEntity.getGame().getDefaultIcon();
|
||||
ImageUtils.displayIcon(mBinding.messageAskIcon, targetUrl);
|
||||
mBinding.messageAskIcon.setVisibility(View.VISIBLE);
|
||||
@ -294,7 +293,7 @@ public class MessageItemViewHolder extends BaseRecyclerViewHolder<MessageEntity>
|
||||
case "game_comment_reply_vote":
|
||||
mBinding.messageCommand.setText("赞了你的回复");
|
||||
mBinding.messageContent.setVisibility(View.GONE);
|
||||
mBinding.messageOriginalTitle.setText(TextUtils.isEmpty(messageEntity.getGame().getName()) ? "" : messageEntity.getGame().getName());
|
||||
mBinding.messageOriginalTitle.setText(messageEntity.getGame().getName());
|
||||
targetUrl = messageEntity.getGame().getDefaultIcon();
|
||||
ImageUtils.displayIcon(mBinding.messageAskIcon, targetUrl);
|
||||
mBinding.messageAskIcon.setVisibility(View.VISIBLE);
|
||||
|
||||
@ -31,8 +31,12 @@ class VideoLabelActivity : NormalActivity() {
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun getIntent(context: Context): Intent {
|
||||
return getTargetIntent(context, VideoLabelActivity::class.java, VideoLabelFragment::class.java)
|
||||
const val TAG_ACTIVITY_ID = "tagActivityId"
|
||||
|
||||
fun getIntent(context: Context, tagActivityId: String = ""): Intent {
|
||||
val bundle = Bundle()
|
||||
bundle.putString(TAG_ACTIVITY_ID, tagActivityId)
|
||||
return getTargetIntent(context, VideoLabelActivity::class.java, VideoLabelFragment::class.java, bundle)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2,6 +2,7 @@ package com.gh.gamecenter.video.label
|
||||
|
||||
import android.content.Context
|
||||
import android.view.ViewGroup
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.gh.base.BaseRecyclerViewHolder
|
||||
import com.gh.gamecenter.R
|
||||
@ -9,7 +10,7 @@ import com.gh.gamecenter.databinding.VideoLabelItemBinding
|
||||
import com.gh.gamecenter.entity.ActivityLabelEntity
|
||||
import com.lightgame.adapter.BaseRecyclerAdapter
|
||||
|
||||
class VideoLabelAdapter(context: Context, private val onItemClickListener: (entity: ActivityLabelEntity) -> Unit) : BaseRecyclerAdapter<RecyclerView.ViewHolder>(context) {
|
||||
class VideoLabelAdapter(context: Context, private val selectTagActivityId: String, private val onItemClickListener: (entity: ActivityLabelEntity) -> Unit) : BaseRecyclerAdapter<RecyclerView.ViewHolder>(context) {
|
||||
|
||||
val entityList = ArrayList<ActivityLabelEntity>()
|
||||
|
||||
@ -31,10 +32,15 @@ class VideoLabelAdapter(context: Context, private val onItemClickListener: (enti
|
||||
holder.itemView.setOnClickListener {
|
||||
onItemClickListener.invoke(activityLabelEntity)
|
||||
}
|
||||
if (selectTagActivityId == activityLabelEntity.id) {
|
||||
holder.itemView.setBackgroundColor(ContextCompat.getColor(mContext, R.color.bg_EFF7FF))
|
||||
} else {
|
||||
holder.itemView.setBackgroundColor(ContextCompat.getColor(mContext, R.color.white))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class VideoLabelViewHolder(val binding: VideoLabelItemBinding) : BaseRecyclerViewHolder<Any>(binding.root)
|
||||
|
||||
override fun getItemCount(): Int = entityList.size
|
||||
|
||||
class VideoLabelViewHolder(val binding: VideoLabelItemBinding) : BaseRecyclerViewHolder<Any>(binding.root)
|
||||
}
|
||||
@ -36,9 +36,10 @@ class VideoLabelFragment : NormalFragment() {
|
||||
mRefresh.isEnabled = false
|
||||
|
||||
mViewModel = viewModelProvider()
|
||||
val selectTagActivityId = arguments?.getString(VideoLabelActivity.TAG_ACTIVITY_ID)?:""
|
||||
mListRv.apply {
|
||||
layoutManager = LinearLayoutManager(requireContext())
|
||||
mAdapter = VideoLabelAdapter(requireContext()) {
|
||||
mAdapter = VideoLabelAdapter(requireContext(),selectTagActivityId) {
|
||||
val intent = Intent()
|
||||
intent.putExtra(ActivityLabelEntity::class.java.simpleName, it)
|
||||
requireActivity().setResult(Activity.RESULT_OK, intent)
|
||||
|
||||
@ -168,7 +168,8 @@ class UploadVideoActivity : ToolBarActivity() {
|
||||
return@setOnClickListener
|
||||
}
|
||||
|
||||
startActivityForResult(VideoLabelActivity.getIntent(this), REQUEST_CODE_CHOOSE_LABEL)
|
||||
startActivityForResult(VideoLabelActivity.getIntent(this, mActivityLabelEntity?.id
|
||||
?: ""), REQUEST_CODE_CHOOSE_LABEL)
|
||||
}
|
||||
mBinding.deleteActivity.setOnClickListener {
|
||||
mActivityLabelEntity = null
|
||||
@ -185,12 +186,12 @@ class UploadVideoActivity : ToolBarActivity() {
|
||||
}
|
||||
mBinding.reprintTv.setOnClickListener {
|
||||
if (mActivityLabelEntity != null) {
|
||||
DialogUtils.showAlertDialog(this, "提示", "转载无法参与活动,确定切换为转载吗?", "确定", "暂不", {
|
||||
DialogUtils.showUploadVideoChangeLabelDialog(this) {
|
||||
switchVideoSource(false)
|
||||
mActivityLabelEntity = null
|
||||
mBinding.activityContainer.visibility = View.GONE
|
||||
mBinding.activityTv.text = ""
|
||||
}, {})
|
||||
}
|
||||
} else {
|
||||
switchVideoSource(false)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user