修改游戏详情开服表样式
This commit is contained in:
@ -5,6 +5,7 @@ import android.databinding.BindingAdapter;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
import android.widget.LinearLayout;
|
||||
@ -31,11 +32,14 @@ import com.gh.gamecenter.databinding.KaifuDetailItemRowBinding;
|
||||
import com.gh.gamecenter.entity.ApkEntity;
|
||||
import com.gh.gamecenter.entity.GameEntity;
|
||||
import com.gh.gamecenter.entity.KaiFuCalendarEntity;
|
||||
import com.gh.gamecenter.eventbus.EBReuse;
|
||||
import com.gh.gamecenter.manager.PackageManager;
|
||||
import com.lightgame.download.DownloadEntity;
|
||||
import com.lightgame.download.FileUtils;
|
||||
import com.lightgame.utils.Utils;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
@ -68,7 +72,15 @@ public class BindingAdapters {
|
||||
binding.setEntity(serverEntity);
|
||||
binding.getRoot().setOnClickListener(v -> {
|
||||
listener.onClick(v, isReadyPatch != null && isReadyPatch ? serverEntity : null);
|
||||
// mContext.startActivity(PatchKaifuActivity.Companion.getIntent(view.getContext(), serverEntity, mGameEntity.getId()));
|
||||
});
|
||||
// 滑动冲突处理
|
||||
binding.getRoot().setOnTouchListener((v, event) -> {
|
||||
if (event.getAction() == MotionEvent.ACTION_DOWN) {
|
||||
EventBus.getDefault().post(new EBReuse("CalenderDown"));
|
||||
} else if (event.getAction() == MotionEvent.ACTION_UP || event.getAction() == MotionEvent.ACTION_CANCEL) {
|
||||
EventBus.getDefault().post(new EBReuse("CalenderCancel"));
|
||||
}
|
||||
return false;
|
||||
});
|
||||
}
|
||||
view.addView(inflate);
|
||||
|
||||
@ -215,19 +215,6 @@ public class GameDetailKaiFuAdapter extends BaseRecyclerAdapter<ViewHolder> {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// 滑动冲突处理
|
||||
mBinding.kaifuDetailSv.setOnTouchListener(new View.OnTouchListener() {
|
||||
@Override
|
||||
public boolean onTouch(View v, MotionEvent event) {
|
||||
if (event.getAction() == MotionEvent.ACTION_DOWN) {
|
||||
EventBus.getDefault().post(new EBReuse("CalenderDown"));
|
||||
} else if (event.getAction() == MotionEvent.ACTION_UP) {
|
||||
EventBus.getDefault().post(new EBReuse("CalenderCancel"));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void showKaiFuDetail(boolean openKaiFuDetail) {
|
||||
@ -405,29 +392,17 @@ public class GameDetailKaiFuAdapter extends BaseRecyclerAdapter<ViewHolder> {
|
||||
int padd = DisplayUtils.dip2px(mContext, 2);
|
||||
viewHolder.calendarKaifu.setPadding(padd, DisplayUtils.dip2px(mContext, 1), padd, padd);
|
||||
|
||||
|
||||
// todo 颜色配置
|
||||
if (day < curDay && !isNextMonth) {
|
||||
String remark = null;
|
||||
for (KaiFuCalendarEntity calendarEntity : calendarServer) {
|
||||
if (!TextUtils.isEmpty(calendarEntity.getRemark())) {
|
||||
remark = calendarEntity.getRemark();
|
||||
break;
|
||||
}
|
||||
String remark = null;
|
||||
for (KaiFuCalendarEntity calendarEntity : calendarServer) {
|
||||
if (!TextUtils.isEmpty(calendarEntity.getRemark())) {
|
||||
remark = calendarEntity.getRemark();
|
||||
break;
|
||||
}
|
||||
viewHolder.calendarKaifu.setBackgroundResource(R.drawable.textview_b3b3b3_bg);
|
||||
viewHolder.calendarKaifu.setText(TextUtils.isEmpty(remark) ? "新服×" + calendarServer.size() : remark);
|
||||
} else {
|
||||
String remark = null;
|
||||
for (KaiFuCalendarEntity calendarEntity : calendarServer) {
|
||||
if (!TextUtils.isEmpty(calendarEntity.getRemark())) {
|
||||
remark = calendarEntity.getRemark();
|
||||
break;
|
||||
}
|
||||
}
|
||||
viewHolder.calendarKaifu.setBackgroundResource(R.drawable.textview_b3b3b3_bg);
|
||||
viewHolder.calendarKaifu.setText(TextUtils.isEmpty(remark) ? "新服×" + calendarServer.size() : remark);
|
||||
}
|
||||
viewHolder.calendarKaifu.setBackgroundResource(R.drawable.textview_b3b3b3_bg);
|
||||
viewHolder.calendarKaifu.setBackgroundResource(TextUtils.isEmpty(remark)
|
||||
? R.drawable.textview_yellow_bg : R.drawable.textview_orange_bg);
|
||||
viewHolder.calendarKaifu.setText(TextUtils.isEmpty(remark) ? "新服×" + calendarServer.size() : remark);
|
||||
|
||||
holder.itemView.setEnabled(true);
|
||||
holder.itemView.setOnClickListener(new View.OnClickListener() {
|
||||
|
||||
9
app/src/main/res/drawable/textview_orange_bg.xml
Normal file
9
app/src/main/res/drawable/textview_orange_bg.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android = "http://schemas.android.com/apk/res/android"
|
||||
android:shape = "rectangle" >
|
||||
|
||||
<solid android:color = "@color/tag_orange" />
|
||||
|
||||
<corners android:radius = "2dp" />
|
||||
|
||||
</shape >
|
||||
9
app/src/main/res/drawable/textview_yellow_bg.xml
Normal file
9
app/src/main/res/drawable/textview_yellow_bg.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android = "http://schemas.android.com/apk/res/android"
|
||||
android:shape = "rectangle" >
|
||||
|
||||
<solid android:color = "@color/tag_yellow" />
|
||||
|
||||
<corners android:radius = "2dp" />
|
||||
|
||||
</shape >
|
||||
Reference in New Issue
Block a user