|
|
@@ -12,6 +12,7 @@ import android.widget.TextView;
|
|
|
|
|
|
import com.kfzs.duanduan.utils.NumberFormatUtils;
|
|
|
import com.sheep.gamegroup.absBase.BaseUMActivity;
|
|
|
+import com.sheep.gamegroup.greendao.download.SheepAd;
|
|
|
import com.sheep.gamegroup.model.entity.BaseMessage;
|
|
|
import com.sheep.gamegroup.model.entity.Lp;
|
|
|
import com.sheep.gamegroup.model.entity.PunchAndSign;
|
|
|
@@ -406,25 +407,43 @@ public class SignActivity extends BaseUMActivity {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- private void tryShowSignResultAndTask(final String title, final double money) {
|
|
|
- CommonUtil.getInstance().robTask(new Action1<CommendTask>() {
|
|
|
+ private void showSignResult(String title, double money, SheepAd ad) {
|
|
|
+ ViewUtil.newInstance().showCheckinAdDialog(this, ad, R.layout.dialog_sign_result_and_task, new Action1<View>() {
|
|
|
@Override
|
|
|
- public void call(CommendTask robTask) {
|
|
|
- if (robTask != null) {
|
|
|
- DataUtil.putAsInt(DataKey.KEY_ORDER, robTask.getOrder());
|
|
|
- try {
|
|
|
- showSignResultAndTask(title, money, robTask);
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- G.showToast(e.getMessage());
|
|
|
- }
|
|
|
- } else {
|
|
|
- G.showToast(R.string.task_sold_out_focus_publish);
|
|
|
- }
|
|
|
+ public void call(View view) {
|
|
|
+ ViewUtil.setText((TextView) view.findViewById(R.id.sign_window_title), title);
|
|
|
+ ViewUtil.setText((TextView) view.findViewById(R.id.sign_money_number), String.format(Locale.CHINA, "+%s", NumberFormatUtils.retainMost2(money)));
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ private void tryShowSignResultAndTask(final String title, final double money) {
|
|
|
+// CommonUtil.getInstance().robTask(new Action1<CommendTask>() {
|
|
|
+// @Override
|
|
|
+// public void call(CommendTask robTask) {
|
|
|
+// if (robTask != null) {
|
|
|
+// DataUtil.putAsInt(DataKey.KEY_ORDER, robTask.getOrder());
|
|
|
+// try {
|
|
|
+// showSignResultAndTask(title, money, robTask);
|
|
|
+// } catch (Exception e) {
|
|
|
+// e.printStackTrace();
|
|
|
+// G.showToast(e.getMessage());
|
|
|
+// }
|
|
|
+// } else {
|
|
|
+// G.showToast(R.string.task_sold_out_focus_publish);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// });
|
|
|
+ CommonUtil.getInstance().refreshAds(SheepAd.FORM_CHECKIN, (ret, ads) -> {
|
|
|
+ if (!ret || ads.size() == 0) {
|
|
|
+ showSignResult(title, money, null);
|
|
|
+ } else {
|
|
|
+ showSignResult(title, money, ads.get(0));
|
|
|
+ }
|
|
|
+
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
@OnClick(R.id.active_info)
|
|
|
public void onActiveInfoClicked() {
|
|
|
startActivity(new Intent(SignActivity.this, ActiveRuleActivity.class));
|