|
@@ -2,12 +2,14 @@ package com.kfzs.duanduan.fragment;
|
|
|
|
|
|
|
|
import android.app.Activity;
|
|
import android.app.Activity;
|
|
|
import android.content.Context;
|
|
import android.content.Context;
|
|
|
|
|
+import android.content.DialogInterface;
|
|
|
import android.graphics.drawable.Drawable;
|
|
import android.graphics.drawable.Drawable;
|
|
|
import android.os.Bundle;
|
|
import android.os.Bundle;
|
|
|
import android.os.Handler;
|
|
import android.os.Handler;
|
|
|
import android.os.Message;
|
|
import android.os.Message;
|
|
|
import android.support.v4.view.ViewPager;
|
|
import android.support.v4.view.ViewPager;
|
|
|
import android.support.v4.widget.SwipeRefreshLayout;
|
|
import android.support.v4.widget.SwipeRefreshLayout;
|
|
|
|
|
+import android.support.v7.app.AlertDialog;
|
|
|
import android.support.v7.widget.LinearLayoutManager;
|
|
import android.support.v7.widget.LinearLayoutManager;
|
|
|
import android.support.v7.widget.RecyclerView;
|
|
import android.support.v7.widget.RecyclerView;
|
|
|
import android.text.TextUtils;
|
|
import android.text.TextUtils;
|
|
@@ -63,6 +65,7 @@ import com.sheep.gamegroup.presenter.TryMakeMoneyContract;
|
|
|
import com.sheep.gamegroup.presenter.TryMakeMoneyPresenter;
|
|
import com.sheep.gamegroup.presenter.TryMakeMoneyPresenter;
|
|
|
import com.sheep.gamegroup.util.AppUtil;
|
|
import com.sheep.gamegroup.util.AppUtil;
|
|
|
import com.sheep.gamegroup.util.CommonUtil;
|
|
import com.sheep.gamegroup.util.CommonUtil;
|
|
|
|
|
+import com.sheep.gamegroup.util.ConnectAddress;
|
|
|
import com.sheep.gamegroup.util.ImageGlarryDrawable;
|
|
import com.sheep.gamegroup.util.ImageGlarryDrawable;
|
|
|
import com.sheep.gamegroup.util.Jump2View;
|
|
import com.sheep.gamegroup.util.Jump2View;
|
|
|
import com.sheep.gamegroup.util.MyDbManager;
|
|
import com.sheep.gamegroup.util.MyDbManager;
|
|
@@ -82,6 +85,7 @@ import com.umeng.analytics.MobclickAgent;
|
|
|
import org.greenrobot.eventbus.EventBus;
|
|
import org.greenrobot.eventbus.EventBus;
|
|
|
import org.greenrobot.eventbus.Subscribe;
|
|
import org.greenrobot.eventbus.Subscribe;
|
|
|
import org.greenrobot.eventbus.ThreadMode;
|
|
import org.greenrobot.eventbus.ThreadMode;
|
|
|
|
|
+import org.w3c.dom.Text;
|
|
|
import org.xutils.ex.DbException;
|
|
import org.xutils.ex.DbException;
|
|
|
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
@@ -152,6 +156,9 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
@BindView(R.id.recyclerview)
|
|
@BindView(R.id.recyclerview)
|
|
|
RecyclerView recyclerview;
|
|
RecyclerView recyclerview;
|
|
|
|
|
|
|
|
|
|
+ @BindView(R.id.test_change)
|
|
|
|
|
+ TextView test_change;
|
|
|
|
|
+
|
|
|
@Inject
|
|
@Inject
|
|
|
SmallSheepPresenter pagePresenter;
|
|
SmallSheepPresenter pagePresenter;
|
|
|
@Inject
|
|
@Inject
|
|
@@ -190,6 +197,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
setContentView(R.layout.homepage_act_layout);
|
|
setContentView(R.layout.homepage_act_layout);
|
|
|
initView();
|
|
initView();
|
|
|
initListener();
|
|
initListener();
|
|
|
|
|
+ testChange();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void initView() {
|
|
public void initView() {
|
|
@@ -901,4 +909,36 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+ private void testChange(){
|
|
|
|
|
+ if(!"sheep".equals(BuildConfig.FLAVOR)){
|
|
|
|
|
+ test_change.setVisibility(View.VISIBLE);
|
|
|
|
|
+ test_change.setText(SheepApp.getInstance().getConnectAddress().getName());
|
|
|
|
|
+ test_change.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onClick(View view) {
|
|
|
|
|
+
|
|
|
|
|
+ final String[] items = {"张伟", "测试服", "正式服"};
|
|
|
|
|
+ AlertDialog dialog = new AlertDialog.Builder(activity).setTitle("请选择要切换的服务器")
|
|
|
|
|
+ .setItems(items, new DialogInterface.OnClickListener() {
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onClick(DialogInterface dialog, int which) {
|
|
|
|
|
+ switch (items[which]){
|
|
|
|
|
+ case "张伟":
|
|
|
|
|
+ SheepApp.getInstance().setConnectAddress(ConnectAddress.sheepzhangwei);
|
|
|
|
|
+ break;
|
|
|
|
|
+ case "测试服":
|
|
|
|
|
+ SheepApp.getInstance().setConnectAddress(ConnectAddress.sheeptest);
|
|
|
|
|
+ break;
|
|
|
|
|
+ case "正式服":
|
|
|
|
|
+ SheepApp.getInstance().setConnectAddress(ConnectAddress.sheep);
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }).create();
|
|
|
|
|
+ dialog.show();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|