|
@@ -170,7 +170,12 @@ public class ViewUtil {
|
|
|
* @param mTextView 显示日期的TextView
|
|
* @param mTextView 显示日期的TextView
|
|
|
*/
|
|
*/
|
|
|
public static void showDateDialog(final PersonalInfoAct context, final TextView mTextView, String time) {
|
|
public static void showDateDialog(final PersonalInfoAct context, final TextView mTextView, String time) {
|
|
|
- List<Integer> date = DateUtil.getDateForString(TextUtils.isEmpty(time)?"1990-01-01":time);//从1990-01-01开始显示}
|
|
|
|
|
|
|
+ List<Integer> date;
|
|
|
|
|
+ try {
|
|
|
|
|
+ date = DateUtil.getDateForString((TextUtils.isEmpty(time) && time.equals("0001-01-01T00:00:00Z")) ? "1990-01-01" : time);//从1990-01-01开始显示}
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ date = DateUtil.getDateForString("1990-01-01");
|
|
|
|
|
+ }
|
|
|
DatePickerDialog.Builder builder = new DatePickerDialog.Builder(context);
|
|
DatePickerDialog.Builder builder = new DatePickerDialog.Builder(context);
|
|
|
builder.setOnDateSelectedListener(new DatePickerDialog.OnDateSelectedListener() {
|
|
builder.setOnDateSelectedListener(new DatePickerDialog.OnDateSelectedListener() {
|
|
|
@Override
|
|
@Override
|
|
@@ -237,6 +242,7 @@ public class ViewUtil {
|
|
|
ImageView ivDoNow = view.findViewById(R.id.iv_do_now);
|
|
ImageView ivDoNow = view.findViewById(R.id.iv_do_now);
|
|
|
|
|
|
|
|
final ImageView ivIcon = view.findViewById(R.id.iv_duty);
|
|
final ImageView ivIcon = view.findViewById(R.id.iv_duty);
|
|
|
|
|
+ ImageView ivClose = view.findViewById(R.id.iv_close);
|
|
|
final TextView tvTitel = view.findViewById(R.id.tv_duty_title);
|
|
final TextView tvTitel = view.findViewById(R.id.tv_duty_title);
|
|
|
final TextView tvDutyMoney = view.findViewById(R.id.tv_robduty_money);
|
|
final TextView tvDutyMoney = view.findViewById(R.id.tv_robduty_money);
|
|
|
mRobTask = getTask(ivIcon, tvTitel, tvDutyMoney);
|
|
mRobTask = getTask(ivIcon, tvTitel, tvDutyMoney);
|
|
@@ -245,10 +251,11 @@ public class ViewUtil {
|
|
|
final PopupWindow popupWindow = new PopupWindow(mActivity);
|
|
final PopupWindow popupWindow = new PopupWindow(mActivity);
|
|
|
popupWindow.setContentView(view);
|
|
popupWindow.setContentView(view);
|
|
|
popupWindow.setAnimationStyle(R.style.Rising);
|
|
popupWindow.setAnimationStyle(R.style.Rising);
|
|
|
- popupWindow.setWidth(ActionBar.LayoutParams.WRAP_CONTENT);
|
|
|
|
|
- popupWindow.setHeight(ActionBar.LayoutParams.WRAP_CONTENT);
|
|
|
|
|
|
|
+ popupWindow.setWidth(ActionBar.LayoutParams.MATCH_PARENT);
|
|
|
|
|
+ popupWindow.setHeight(ActionBar.LayoutParams.MATCH_PARENT);
|
|
|
popupWindow.setTouchable(true);
|
|
popupWindow.setTouchable(true);
|
|
|
popupWindow.setFocusable(true);
|
|
popupWindow.setFocusable(true);
|
|
|
|
|
+ popupWindow.setOutsideTouchable(false);
|
|
|
popupWindow.setBackgroundDrawable(new BitmapDrawable());
|
|
popupWindow.setBackgroundDrawable(new BitmapDrawable());
|
|
|
backgroundAlpha(0.5f, mActivity);
|
|
backgroundAlpha(0.5f, mActivity);
|
|
|
popupWindow.showAtLocation(viewAnchor, Gravity.CENTER, 0, 0);
|
|
popupWindow.showAtLocation(viewAnchor, Gravity.CENTER, 0, 0);
|
|
@@ -278,13 +285,16 @@ public class ViewUtil {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
-
|
|
|
|
|
|
|
+ ivClose.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onClick(View view) {
|
|
|
|
|
+ popupWindow.dismiss();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* 兑换红包弹窗
|
|
* 兑换红包弹窗
|
|
|
*
|
|
*
|
|
@@ -293,21 +303,32 @@ public class ViewUtil {
|
|
|
public static void changeRedPackage(final Activity mActivity, View viewAnchor, final FgtPersonalCenter fgtPersonalCenter) {
|
|
public static void changeRedPackage(final Activity mActivity, View viewAnchor, final FgtPersonalCenter fgtPersonalCenter) {
|
|
|
View view = LayoutInflater.from(mActivity).inflate(R.layout.pop_get_redpackage, null);
|
|
View view = LayoutInflater.from(mActivity).inflate(R.layout.pop_get_redpackage, null);
|
|
|
final EditText edInvitationCode = view.findViewById(R.id.ed_invitation_code);
|
|
final EditText edInvitationCode = view.findViewById(R.id.ed_invitation_code);
|
|
|
|
|
+ TextView tvTitle = view.findViewById(R.id.tv_title);
|
|
|
final TextView tvGetRedPackage = view.findViewById(R.id.tv_get_redpackage);
|
|
final TextView tvGetRedPackage = view.findViewById(R.id.tv_get_redpackage);
|
|
|
|
|
+ ImageView ivClose = view.findViewById(R.id.iv_close);
|
|
|
final PopupWindow popupWindow = new PopupWindow(mActivity);
|
|
final PopupWindow popupWindow = new PopupWindow(mActivity);
|
|
|
popupWindow.setContentView(view);
|
|
popupWindow.setContentView(view);
|
|
|
- popupWindow.setWidth(measureWidth(mActivity) * 4 / 5);
|
|
|
|
|
- popupWindow.setHeight(ActionBar.LayoutParams.WRAP_CONTENT);
|
|
|
|
|
|
|
+ popupWindow.setWidth(ActionBar.LayoutParams.MATCH_PARENT);
|
|
|
|
|
+ popupWindow.setHeight(ActionBar.LayoutParams.MATCH_PARENT);
|
|
|
popupWindow.setTouchable(true);
|
|
popupWindow.setTouchable(true);
|
|
|
popupWindow.setFocusable(true);
|
|
popupWindow.setFocusable(true);
|
|
|
|
|
+ popupWindow.setOutsideTouchable(false);
|
|
|
popupWindow.setBackgroundDrawable(new BitmapDrawable());
|
|
popupWindow.setBackgroundDrawable(new BitmapDrawable());
|
|
|
backgroundAlpha(0.7f, mActivity);
|
|
backgroundAlpha(0.7f, mActivity);
|
|
|
popupWindow.showAtLocation(viewAnchor, Gravity.CENTER, 0, 0);
|
|
popupWindow.showAtLocation(viewAnchor, Gravity.CENTER, 0, 0);
|
|
|
popupWindow.setOnDismissListener(new PopDismissListener(mActivity));
|
|
popupWindow.setOnDismissListener(new PopDismissListener(mActivity));
|
|
|
|
|
+ tvTitle.setText("兑换");
|
|
|
tvGetRedPackage.setOnClickListener(new View.OnClickListener() {
|
|
tvGetRedPackage.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
public void onClick(View v) {
|
|
|
fgtPersonalCenter.getRedPackage(edInvitationCode.getText().toString(), popupWindow);
|
|
fgtPersonalCenter.getRedPackage(edInvitationCode.getText().toString(), popupWindow);
|
|
|
|
|
+ popupWindow.dismiss();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ ivClose.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onClick(View view) {
|
|
|
|
|
+ popupWindow.dismiss();
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
@@ -397,7 +418,7 @@ public class ViewUtil {
|
|
|
/**
|
|
/**
|
|
|
* popwindow消失监听类,消失恢复window透明度
|
|
* popwindow消失监听类,消失恢复window透明度
|
|
|
*/
|
|
*/
|
|
|
- public static class PopDismissListener implements PopupWindow.OnDismissListener {
|
|
|
|
|
|
|
+ public static class PopDismissListener implements PopupWindow.OnDismissListener {
|
|
|
Activity mActivity;
|
|
Activity mActivity;
|
|
|
|
|
|
|
|
public PopDismissListener(Activity activity) {
|
|
public PopDismissListener(Activity activity) {
|