|
@@ -239,6 +239,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
};
|
|
};
|
|
|
private TextView doIt;
|
|
private TextView doIt;
|
|
|
private TextView willStart;
|
|
private TextView willStart;
|
|
|
|
|
+ private TextView promote_goods_tv;
|
|
|
private View doItLine;
|
|
private View doItLine;
|
|
|
private LinearLayout lines;
|
|
private LinearLayout lines;
|
|
|
|
|
|
|
@@ -479,29 +480,31 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
// titleCardLayout = (LinearLayout) LayoutInflater.from(context).inflate(R.layout.view_float_title_card, null);
|
|
// titleCardLayout = (LinearLayout) LayoutInflater.from(context).inflate(R.layout.view_float_title_card, null);
|
|
|
doIt = titleCardLayout.findViewById(R.id.do_it_text);
|
|
doIt = titleCardLayout.findViewById(R.id.do_it_text);
|
|
|
willStart = titleCardLayout.findViewById(R.id.will_start_text);
|
|
willStart = titleCardLayout.findViewById(R.id.will_start_text);
|
|
|
|
|
+ promote_goods_tv = titleCardLayout.findViewById(R.id.promote_goods_tv);
|
|
|
doItLine = titleCardLayout.findViewById(R.id.do_it_every_day_line);
|
|
doItLine = titleCardLayout.findViewById(R.id.do_it_every_day_line);
|
|
|
|
|
+ int lineWidth = (int) doIt.getPaint().measureText(doIt.getText().toString());
|
|
|
lines = titleCardLayout.findViewById(R.id.but_will_start);
|
|
lines = titleCardLayout.findViewById(R.id.but_will_start);
|
|
|
- int lineX = (G.WIDTH / 6) - (getViewWidth(doItLine) / 2);
|
|
|
|
|
|
|
+ LayoutParamsUtil.resetLayoutParams(lines, new Lp().setWidth(lineWidth));
|
|
|
|
|
+ int lineX = (G.WIDTH / 3 - lineWidth) / 2;
|
|
|
|
|
+ LayoutParamsUtil.resetLayoutParams(doItLine, new Lp().setWidth(G.WIDTH - lineX * 2));
|
|
|
lines.setX(lineX);
|
|
lines.setX(lineX);
|
|
|
- ViewGroup.LayoutParams layoutParams = lines.getLayoutParams();
|
|
|
|
|
- layoutParams.width = G.WIDTH - (lineX * 2);
|
|
|
|
|
- doIt.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
- @Override
|
|
|
|
|
- public void onClick(View v) {
|
|
|
|
|
- if (mViewPager != null) {
|
|
|
|
|
- mViewPager.setCurrentItem(0);
|
|
|
|
|
- }
|
|
|
|
|
- toDayClick();
|
|
|
|
|
|
|
+ doIt.setOnClickListener(v -> {
|
|
|
|
|
+ if (mViewPager != null) {
|
|
|
|
|
+ mViewPager.setCurrentItem(0);
|
|
|
}
|
|
}
|
|
|
|
|
+ toDayClick();
|
|
|
});
|
|
});
|
|
|
- willStart.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
- @Override
|
|
|
|
|
- public void onClick(View v) {
|
|
|
|
|
- if (mViewPager != null) {
|
|
|
|
|
- mViewPager.setCurrentItem(1);
|
|
|
|
|
- }
|
|
|
|
|
- willStartClick();
|
|
|
|
|
|
|
+ willStart.setOnClickListener(v -> {
|
|
|
|
|
+ if (mViewPager != null) {
|
|
|
|
|
+ mViewPager.setCurrentItem(1);
|
|
|
|
|
+ }
|
|
|
|
|
+ willStartClick();
|
|
|
|
|
+ });
|
|
|
|
|
+ promote_goods_tv.setOnClickListener(v -> {
|
|
|
|
|
+ if (mViewPager != null) {
|
|
|
|
|
+ mViewPager.setCurrentItem(2);
|
|
|
}
|
|
}
|
|
|
|
|
+ clickPromoteGoods();
|
|
|
});
|
|
});
|
|
|
// ((ViewGroup) activity.getWindow().getDecorView()).addView(titleCardLayout);
|
|
// ((ViewGroup) activity.getWindow().getDecorView()).addView(titleCardLayout);
|
|
|
ViewUtil.setVisibility(titleCardLayout, false);
|
|
ViewUtil.setVisibility(titleCardLayout, false);
|
|
@@ -513,6 +516,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
private void toDayClick() {
|
|
private void toDayClick() {
|
|
|
doIt.setTextColor(getResources().getColor(R.color.blue_34a6e7));
|
|
doIt.setTextColor(getResources().getColor(R.color.blue_34a6e7));
|
|
|
willStart.setTextColor(getResources().getColor(R.color.black_444444));
|
|
willStart.setTextColor(getResources().getColor(R.color.black_444444));
|
|
|
|
|
+ promote_goods_tv.setTextColor(getResources().getColor(R.color.black_444444));
|
|
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
|
|
TransitionManager.beginDelayedTransition(titleCardLayout, new ChangeBounds());
|
|
TransitionManager.beginDelayedTransition(titleCardLayout, new ChangeBounds());
|
|
|
}
|
|
}
|
|
@@ -525,6 +529,19 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
private void willStartClick() {
|
|
private void willStartClick() {
|
|
|
doIt.setTextColor(getResources().getColor(R.color.black_444444));
|
|
doIt.setTextColor(getResources().getColor(R.color.black_444444));
|
|
|
willStart.setTextColor(getResources().getColor(R.color.blue_34a6e7));
|
|
willStart.setTextColor(getResources().getColor(R.color.blue_34a6e7));
|
|
|
|
|
+ promote_goods_tv.setTextColor(getResources().getColor(R.color.black_444444));
|
|
|
|
|
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
|
|
|
|
+ TransitionManager.beginDelayedTransition(titleCardLayout, new ChangeBounds());
|
|
|
|
|
+ }
|
|
|
|
|
+ lines.setGravity(Gravity.CENTER);
|
|
|
|
|
+ }
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 点击限时抢购
|
|
|
|
|
+ */
|
|
|
|
|
+ private void clickPromoteGoods() {
|
|
|
|
|
+ doIt.setTextColor(getResources().getColor(R.color.black_444444));
|
|
|
|
|
+ willStart.setTextColor(getResources().getColor(R.color.black_444444));
|
|
|
|
|
+ promote_goods_tv.setTextColor(getResources().getColor(R.color.blue_34a6e7));
|
|
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
|
|
TransitionManager.beginDelayedTransition(titleCardLayout, new ChangeBounds());
|
|
TransitionManager.beginDelayedTransition(titleCardLayout, new ChangeBounds());
|
|
|
}
|
|
}
|