光环助手V3.3-开服表优化需求汇总(20180625)(除了新增开服清空时间 其余完成)
This commit is contained in:
@ -67,7 +67,7 @@ public class BindingAdapters {
|
||||
KaifuDetailItemRowBinding binding = KaifuDetailItemRowBinding.bind(inflate);
|
||||
binding.setIsCloseBottom(i == list.size());
|
||||
binding.setIsReadyPatch(isReadyPatch);
|
||||
binding.getRoot().setClickable(isReadyPatch);
|
||||
binding.getRoot().setEnabled(isReadyPatch);
|
||||
if (i == 0) {
|
||||
binding.setIsTitle(true);
|
||||
} else {
|
||||
@ -99,14 +99,14 @@ public class BindingAdapters {
|
||||
if (hasFocus) {
|
||||
binding.kaifuAddName.setHint("");
|
||||
} else {
|
||||
binding.kaifuAddName.setHint("点击选择");
|
||||
binding.kaifuAddName.setHint("点击填写");
|
||||
}
|
||||
});
|
||||
binding.kaifuAddRemark.setOnFocusChangeListener((v, hasFocus) -> {
|
||||
if (hasFocus) {
|
||||
binding.kaifuAddRemark.setHint("");
|
||||
} else {
|
||||
binding.kaifuAddRemark.setHint("点击选择");
|
||||
binding.kaifuAddRemark.setHint("点击填写");
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -115,7 +115,7 @@ public class BindingAdapters {
|
||||
@BindingAdapter({"addKaiFuTime", "addKaiFuPosition"})
|
||||
public static void addKaiFuTime(EditText view, Long time, Integer position) {
|
||||
if (time == 0) {
|
||||
view.setText("点击选择");
|
||||
view.setHint("点击选择");
|
||||
} else {
|
||||
String pattern;
|
||||
if (position == 0) {
|
||||
@ -138,8 +138,10 @@ public class BindingAdapters {
|
||||
view.setHintTextColor(ContextCompat.getColor(view.getContext(), R.color.red));
|
||||
} else if (position == 0) {
|
||||
view.setTextColor(ContextCompat.getColor(view.getContext(), R.color.hint));
|
||||
view.setHintTextColor(ContextCompat.getColor(view.getContext(), R.color.hint));
|
||||
} else {
|
||||
view.setTextColor(ContextCompat.getColor(view.getContext(), R.color.title));
|
||||
view.setHintTextColor(ContextCompat.getColor(view.getContext(), R.color.hint));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -59,7 +59,7 @@ public class GameDetailKaiFuAdapter extends BaseRecyclerAdapter<ViewHolder> {
|
||||
private int curWeek;
|
||||
private int curDay;
|
||||
|
||||
private boolean isNextMonth;
|
||||
private boolean isNextMonth = true; // 初始化会调用setKaiFuTitle 也就是 isNextMonth默认是false
|
||||
private boolean isExistCurServer; //s 当月是否存在开服
|
||||
|
||||
private String suggestTime;
|
||||
@ -88,7 +88,6 @@ public class GameDetailKaiFuAdapter extends BaseRecyclerAdapter<ViewHolder> {
|
||||
|
||||
sp = PreferenceManager.getDefaultSharedPreferences(mContext);
|
||||
|
||||
isNextMonth = false;
|
||||
isExistCurServer = false;
|
||||
|
||||
mCurDayData = new ArrayList<>();
|
||||
@ -96,7 +95,6 @@ public class GameDetailKaiFuAdapter extends BaseRecyclerAdapter<ViewHolder> {
|
||||
checkExistCurSerer();
|
||||
|
||||
initView();
|
||||
initDate();
|
||||
}
|
||||
|
||||
private void checkExistCurSerer() {
|
||||
@ -150,36 +148,14 @@ public class GameDetailKaiFuAdapter extends BaseRecyclerAdapter<ViewHolder> {
|
||||
mBinding.kaifuNextMonth.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (!isNextMonth) {
|
||||
mBinding.kaifuNextMonth.setBackgroundResource(R.drawable.calendar_bar_select);
|
||||
mBinding.kaifuNextMonth.setTextColor(Color.WHITE);
|
||||
mBinding.kaifuCurMonth.setBackgroundDrawable(new ColorDrawable(0));
|
||||
mBinding.kaifuCurMonth.setTextColor(Color.BLACK);
|
||||
isNextMonth = true;
|
||||
initDate();
|
||||
|
||||
if (mBinding.kaifuDetail.getVisibility() == View.VISIBLE) {
|
||||
mBinding.kaifuDetail.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
setKaiFuTitle();
|
||||
}
|
||||
});
|
||||
|
||||
mBinding.kaifuCurMonth.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (isNextMonth) {
|
||||
mBinding.kaifuNextMonth.setTextColor(Color.BLACK);
|
||||
mBinding.kaifuNextMonth.setBackgroundDrawable(new ColorDrawable(0));
|
||||
mBinding.kaifuCurMonth.setTextColor(Color.WHITE);
|
||||
mBinding.kaifuCurMonth.setBackgroundResource(R.drawable.calendar_bar_select);
|
||||
isNextMonth = false;
|
||||
initDate();
|
||||
|
||||
if (mBinding.kaifuDetail.getVisibility() == View.VISIBLE) {
|
||||
mBinding.kaifuDetail.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
setKaiFuTitle();
|
||||
}
|
||||
});
|
||||
|
||||
@ -216,6 +192,27 @@ public class GameDetailKaiFuAdapter extends BaseRecyclerAdapter<ViewHolder> {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
setKaiFuTitle();
|
||||
}
|
||||
|
||||
void setKaiFuTitle() {
|
||||
if (isNextMonth) {
|
||||
mBinding.kaifuNextMonth.setTextColor(Color.BLACK);
|
||||
mBinding.kaifuNextMonth.setBackgroundDrawable(new ColorDrawable(0));
|
||||
mBinding.kaifuCurMonth.setTextColor(Color.WHITE);
|
||||
mBinding.kaifuCurMonth.setBackgroundResource(R.drawable.calendar_bar_select);
|
||||
} else {
|
||||
mBinding.kaifuNextMonth.setBackgroundResource(R.drawable.calendar_bar_select);
|
||||
mBinding.kaifuNextMonth.setTextColor(Color.WHITE);
|
||||
mBinding.kaifuCurMonth.setBackgroundDrawable(new ColorDrawable(0));
|
||||
mBinding.kaifuCurMonth.setTextColor(Color.BLACK);
|
||||
}
|
||||
isNextMonth = !isNextMonth;
|
||||
if (mBinding.kaifuDetail.getVisibility() == View.VISIBLE) {
|
||||
mBinding.kaifuDetail.setVisibility(View.GONE);
|
||||
}
|
||||
initDate();
|
||||
}
|
||||
|
||||
void showKaiFuDetail(boolean openKaiFuDetail) {
|
||||
|
||||
@ -1,13 +1,12 @@
|
||||
package com.gh.gamecenter.kaifu;
|
||||
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v4.app.FragmentTransaction;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.text.TextUtils;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.gh.common.util.EntranceUtils;
|
||||
@ -51,7 +50,7 @@ public class KaiFuWrapperFragment extends NormalFragment {
|
||||
@BindView(R.id.kaifu_skip_cur_time)
|
||||
View mSkipCurTime;
|
||||
@BindView(R.id.kaifu_skip_next_time)
|
||||
TextView mSkipNextTime;
|
||||
ImageView mSkipNextTime;
|
||||
|
||||
private KaiFuFragment mKaiFuFragment;
|
||||
private KaiFuFragment mGameKaiFuFragment;
|
||||
@ -94,10 +93,12 @@ public class KaiFuWrapperFragment extends NormalFragment {
|
||||
mKaiFuFragment = new KaiFuFragment();
|
||||
Bundle args = new Bundle();
|
||||
SimpleDateFormat format = new SimpleDateFormat("HH", Locale.CHINA);
|
||||
args.putInt(KEY_INDEX_PAGE, Integer.valueOf(format.format(new Date(System.currentTimeMillis()))) > 18 ? 1 : -1);
|
||||
args.putInt(KEY_INDEX_PAGE, Integer.valueOf(format.format(new Date(System.currentTimeMillis()))) >= 18 ? 1 : -1);
|
||||
mKaiFuFragment.setArguments(args);
|
||||
fragmentTransaction.add(R.id.layout_fragment_content, mKaiFuFragment);
|
||||
fragmentTransaction.commit();
|
||||
|
||||
mSkipNextTime.setTag(SHOW_NEXT_TIME);
|
||||
}
|
||||
|
||||
private void resetFragment() {
|
||||
@ -150,15 +151,19 @@ public class KaiFuWrapperFragment extends NormalFragment {
|
||||
}
|
||||
|
||||
private void changeHintStyle(String status) {
|
||||
Drawable drawable;
|
||||
// Drawable drawable;
|
||||
if (status.equals(SHOW_LIST_TOP)) {
|
||||
drawable = ContextCompat.getDrawable(getContext(), R.drawable.kaifu_hint_icon_up);
|
||||
mSkipNextTime.setImageResource(R.drawable.kaifu_hint_icon_up);
|
||||
// drawable = ContextCompat.getDrawable(getContext(), R.drawable.kaifu_hint_icon_up);
|
||||
} else {
|
||||
drawable = ContextCompat.getDrawable(getContext(), R.drawable.kaifu_hint_icon_down);
|
||||
mSkipNextTime.setImageResource(R.drawable.kaifu_hint_icon_down);
|
||||
// drawable = ContextCompat.getDrawable(getContext(), R.drawable.kaifu_hint_icon_down);
|
||||
}
|
||||
drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight());
|
||||
mSkipNextTime.setCompoundDrawables(null, null, drawable, null);
|
||||
mSkipNextTime.setText(status);
|
||||
// drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight());
|
||||
// mSkipNextTime.setCompoundDrawables(null, null, drawable, null);
|
||||
// mSkipNextTime.setText(status);
|
||||
|
||||
mSkipNextTime.setTag(status);
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
@ -172,7 +177,7 @@ public class KaiFuWrapperFragment extends NormalFragment {
|
||||
@OnClick({R.id.kaifu_skip_next_time, R.id.kaifu_skip_cur_time})
|
||||
public void onViewClick(View view) {
|
||||
if (view.getId() == R.id.kaifu_skip_next_time) {
|
||||
EventBus.getDefault().post(new EBTypeChange(mSkipNextTime.getText().toString().equals(SHOW_LIST_TOP)
|
||||
EventBus.getDefault().post(new EBTypeChange(mSkipNextTime.getTag().toString().equals(SHOW_LIST_TOP)
|
||||
? SKIP_LIST_TOP : SKIP_NEXT_TIME, mGameKaiFuFragment != null
|
||||
&& mGameKaiFuFragment.isVisible() ? CUR_GAME_KAIFU : CUR_ALL_KAIFU));
|
||||
} else {
|
||||
|
||||
@ -103,7 +103,7 @@ class AddKaiFuActivity : BaseActivity() {
|
||||
.setBgColor(Color.WHITE)
|
||||
.setDate(selectedDate)
|
||||
.setRangDate(startDate, endDate)
|
||||
.setLabel("", "月", "日", "时", "分", "")
|
||||
.setLabel("年", "月", "日", "时", "分", "")
|
||||
.isCenterLabel(false)
|
||||
.isDialog(true)
|
||||
.setContentTextSize(15)
|
||||
|
||||
@ -29,7 +29,8 @@ class AddKaiFuViewModel(application: Application) : AndroidViewModel(application
|
||||
fun initData(entity: KaiFuCalendarEntity, allKaifuList: ArrayList<KaiFuCalendarEntity>, gameId: String) {
|
||||
mAllKaifuList = allKaifuList
|
||||
mGameId = gameId
|
||||
entity.setNote(entity.getNote() + "+") // 第一条 添加+(号)
|
||||
entity.setNote(entity.getNote() + " +") // 第一条 添加+(号)
|
||||
if (entity.remark.isNullOrEmpty()) entity.remark = "-"
|
||||
calendarList.add(entity)
|
||||
for (i in 0 until 5) {
|
||||
calendarList.add(KaiFuCalendarEntity())
|
||||
|
||||
@ -43,12 +43,21 @@ class PatchKaifuActivity : BaseActivity() {
|
||||
|
||||
mBinding = ActivityKaifuPatchBinding.bind(mContentView)
|
||||
mBinding?.entity = mViewModel?.serverEntity
|
||||
mBinding?.patchBtn?.isChecked = true
|
||||
mBinding?.patchBtn?.setOnCheckedChangeListener({ _, b: Boolean ->
|
||||
if (b) mBinding?.deleteBtn?.isChecked = false
|
||||
})
|
||||
mBinding?.deleteBtn?.setOnCheckedChangeListener({ _, b: Boolean ->
|
||||
if (b) mBinding?.patchBtn?.isChecked = false
|
||||
})
|
||||
|
||||
mBinding?.patchRemark?.setOnFocusChangeListener({ v, hasFocus ->
|
||||
if (hasFocus) {
|
||||
mBinding?.patchRemark?.hint = ""
|
||||
} else {
|
||||
mBinding?.patchRemark?.hint = "点击填写"
|
||||
}
|
||||
})
|
||||
mBinding?.patchPost?.setOnClickListener({
|
||||
if (!mBinding?.deleteBtn?.isChecked!! == !mBinding?.patchBtn?.isChecked!!) {
|
||||
toast("请选择修改类型")
|
||||
|
||||
@ -155,7 +155,7 @@ public class UserManager {
|
||||
e.printStackTrace();
|
||||
}
|
||||
mApiService
|
||||
.refreshToken("tokens:refresh", body)
|
||||
.refreshToken(BuildConfig.API_HOST + "tokens:refresh", body)
|
||||
.subscribe(new Response<LoginTokenEntity>() {
|
||||
@Override
|
||||
public void onResponse(LoginTokenEntity response) {
|
||||
|
||||
Reference in New Issue
Block a user