|
|
@@ -23,6 +23,7 @@ import com.sheep.gamegroup.absBase.BaseActivity;
|
|
|
import com.sheep.gamegroup.model.entity.Advertising;
|
|
|
import com.sheep.gamegroup.model.entity.Agreement;
|
|
|
import com.sheep.gamegroup.model.entity.BaseMessage;
|
|
|
+import com.sheep.gamegroup.model.entity.CheckUserLabel;
|
|
|
import com.sheep.gamegroup.model.entity.CreditCard;
|
|
|
import com.sheep.gamegroup.model.entity.DialogEntity;
|
|
|
import com.sheep.gamegroup.model.entity.NewbieTask;
|
|
|
@@ -30,6 +31,7 @@ import com.sheep.gamegroup.model.entity.NewbieTaskRecord;
|
|
|
import com.sheep.gamegroup.model.entity.TaskAcceptedEty;
|
|
|
import com.sheep.gamegroup.model.entity.TaskEty;
|
|
|
import com.sheep.gamegroup.model.entity.UserEntity;
|
|
|
+import com.sheep.gamegroup.model.entity.UserLabelList;
|
|
|
import com.sheep.gamegroup.model.entity.VersionInfo;
|
|
|
import com.sheep.gamegroup.model.entity.WebviewEntity;
|
|
|
import com.sheep.gamegroup.model.util.SheepSubscriber;
|
|
|
@@ -45,6 +47,7 @@ import com.sheep.gamegroup.view.activity.ActMyMoney;
|
|
|
import com.sheep.gamegroup.view.activity.ActNewbieTaskList;
|
|
|
import com.sheep.gamegroup.view.activity.ActNotice;
|
|
|
import com.sheep.gamegroup.view.activity.ActUnderstandSheep;
|
|
|
+import com.sheep.gamegroup.view.activity.ActUserLabelList;
|
|
|
import com.sheep.gamegroup.view.activity.ActWeb;
|
|
|
import com.sheep.gamegroup.view.activity.AskGetMoneyAct;
|
|
|
import com.sheep.gamegroup.view.activity.BindDataAct;
|
|
|
@@ -186,18 +189,37 @@ public class Jump2View {
|
|
|
* @param context
|
|
|
* @param o
|
|
|
*/
|
|
|
- public void goHomePageView(Context context, Object o){
|
|
|
- Intent intent = new Intent(context, ActMain.class);
|
|
|
+ public void goHomePageView(final Context context, Object o){
|
|
|
+ final Intent intent = new Intent(context, ActMain.class);
|
|
|
if(o instanceof Integer){
|
|
|
intent.putExtra(ActMain.INTENT_GAME_ID, (Integer) o);
|
|
|
+ context.startActivity(intent);
|
|
|
} else if(o instanceof String){
|
|
|
//从登录界面过来//新注册用户才添加到数据库,并设置可以显示
|
|
|
NewbieTaskRecord newbie_task_record = new NewbieTaskRecord();
|
|
|
newbie_task_record.setUser_id((String)o);
|
|
|
newbie_task_record.setDontShowNewbieTaskDialog(false);
|
|
|
MyDbManager.getInstance().saveOrUpdate(newbie_task_record);
|
|
|
+ //是否展示协议
|
|
|
+ tryShowAgreement((Activity) context, new Action1<String>() {
|
|
|
+ @Override
|
|
|
+ public void call(String msg) {
|
|
|
+ if(msg == null || TextUtils.equals(msg, "404")) {
|
|
|
+ checkLabel((Activity) context, new Action1<BaseMessage>() {
|
|
|
+ @Override
|
|
|
+ public void call(BaseMessage baseMessage) {
|
|
|
+ context.startActivity(intent);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }else {
|
|
|
+ G.showToast(msg);
|
|
|
+ SheepApp.getInstance().quit();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ context.startActivity(intent);
|
|
|
}
|
|
|
- context.startActivity(intent);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -1024,7 +1046,15 @@ public class Jump2View {
|
|
|
Jump2View.getInstance().goLoginView(SheepApp.mContext, "");
|
|
|
}
|
|
|
|
|
|
- public void gotoGuide(Activity activity) {
|
|
|
+ public void gotoGuide(final Activity activity) {
|
|
|
+ if(BuildConfig.DEBUG){
|
|
|
+ checkLabel(activity, new Action1<BaseMessage>() {
|
|
|
+ @Override
|
|
|
+ public void call(BaseMessage baseMessage) {
|
|
|
+ gotoMain(activity);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else
|
|
|
if(SysAppUtil.isNewSmallSheep(true)){
|
|
|
Intent intent = new Intent(activity, ActGuide.class);
|
|
|
activity.startActivity(intent);
|
|
|
@@ -1087,4 +1117,37 @@ public class Jump2View {
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
+ public void gotoUserLabelList(Activity activity, BaseMessage baseMessage) {
|
|
|
+ Intent intent = new Intent(activity, ActUserLabelList.class);
|
|
|
+ activity.startActivity(intent);
|
|
|
+ }
|
|
|
+
|
|
|
+ public void checkLabel(final Activity activity, final Action1<BaseMessage> action1) {
|
|
|
+ SheepApp.getInstance().getNetComponent().getApiService().checkLabel()
|
|
|
+ .subscribeOn(Schedulers.io())
|
|
|
+ .observeOn(AndroidSchedulers.mainThread())
|
|
|
+ .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
|
|
|
+ @Override
|
|
|
+ public void onNext(BaseMessage baseMessage) {
|
|
|
+ LogUtil.println("baseMessage onNext "+ JSON.toJSONString(baseMessage));
|
|
|
+ CheckUserLabel checkLabel = baseMessage.getData(CheckUserLabel.class);
|
|
|
+ if(
|
|
|
+ BuildConfig.DEBUG ||
|
|
|
+ checkLabel != null && checkLabel.isNeed_set_label()){//需要设置用户标签
|
|
|
+ Jump2View.getInstance().gotoUserLabelList(activity, baseMessage);
|
|
|
+ } else if(action1 != null) {
|
|
|
+ action1.call(baseMessage);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onError(BaseMessage baseMessage) {
|
|
|
+ LogUtil.println("baseMessage onError "+JSON.toJSONString(baseMessage));
|
|
|
+ if(action1 != null) {
|
|
|
+ action1.call(baseMessage);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|