Commit e4ae7b9b by 宁斌

Merge remote-tracking branch 'origin/master'

parents 76f945d5 fad94245
......@@ -219,9 +219,7 @@ public class ArmsUtils {
mToast.cancel();
mToast = null;
}
if (mToast == null) {
mToast = Toast.makeText(context, string, Toast.LENGTH_SHORT);
}
mToast.setText(string);
mToast.show();
}
......
......@@ -58,6 +58,7 @@
android:id="@+id/tv_printer_edit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/dp_10"
android:text="編輯"
android:textColor="@color/theme_color"
android:textSize="@dimen/dp_14"
......
......@@ -160,7 +160,8 @@ public class PrintUtils {
tableNum.setText(tableBean.getTableName());
people.setText(OpenTableManage.getDefault().getPeopleNumber() + "");
orderData.setText(tableBean.getCreateTime());
orderData.setText(TimeUtils.getCurrentTimeInString(TimeUtils.DEFAULT_DATE_FORMAT));
checkOutTime.setText(TimeUtils.getCurrentTimeInString(TimeUtils.DEFAULT_DATE_FORMAT));
......@@ -233,8 +234,8 @@ public class PrintUtils {
tableNum.setText(tableBean.getTableName());
people.setText(OpenTableManage.getDefault().getPeopleNumber() + "");
orderData.setText(tableBean.getCreateTime());
orderData.setText(TimeUtils.getFormatTime(tableBean.getCreateTime(), TimeUtils.DEFAULT_DATE_FORMAT));
checkOutTime.setText(TimeUtils.getCurrentTimeInString(TimeUtils.DEFAULT_DATE_FORMAT));
FoodAdapter foodAdapter = new FoodAdapter(foodList);
......
......@@ -4,9 +4,10 @@ package com.gingersoft.gsa.cloud.base.utils.constans;
* Created by Wyh on 2019/12/21.
*/
public class HttpsConstans {
// public static String ROOT_SERVER_ADDRESS_FORMAL = "http://gingersoft.tpddns.cn:58201/ricepon-cloud-gsa/api/";// 深圳服务器
public static String ROOT_SERVER_ADDRESS_FORMAL = "http://a.ricepon.com:58201/ricepon-cloud-gsa/api/";// 香港服务器
//默認為深圳
public static String ROOT_SERVER_ADDRESS_FORMAL = "http://gingersoft.tpddns.cn:58201/ricepon-cloud-gsa/api/";
public static final String ROOT_SERVER_ADDRESS_FORMAL_SZ = "http://gingersoft.tpddns.cn:58201/ricepon-cloud-gsa/api/";// 深圳服务器
public static final String ROOT_SERVER_ADDRESS_FORMAL_HK = "http://a.ricepon.com:58201/ricepon-cloud-gsa/api/";// 香港服务器
public static String ROOT_SERVER_ADDRESS_FORMAL2 = "http://gingersoft.tpddns.cn:53000/mock/49/ricepon-cloud-gsa/api/";//測試服務器
......
......@@ -6,6 +6,9 @@ import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.Locale;
import java.util.TimeZone;
import timber.log.Timber;
/**
* @ClassName: TimeUtils
......@@ -55,6 +58,9 @@ public class TimeUtils {
throw new AssertionError();
}
public static String getFormatTime(String time, SimpleDateFormat simpleDateFormat){
return simpleDateFormat.format(new Date(time));
}
public static String getYesterdayTime(SimpleDateFormat simpleDateFormat) {
Calendar calendar = Calendar.getInstance();
......@@ -189,7 +195,6 @@ public class TimeUtils {
* @return date
*/
public static Date StrToDate(String str) {
Date date = null;
try {
date = DEFAULT_DATE_FORMAT.parse(str);
......@@ -407,4 +412,19 @@ public class TimeUtils {
}
return after;
}
public static Date parseServerTime(String serverTime, String format) {
if (format == null || format.isEmpty()) {
format = "yyyy-MM-dd HH:mm:ss";
}
SimpleDateFormat sdf = new SimpleDateFormat(format, Locale.CHINESE);
sdf.setTimeZone(TimeZone.getTimeZone("GMT+8:00"));
Date date = null;
try {
date = sdf.parse(serverTime);
} catch (Exception e) {
Timber.e(e, "");
}
return date;
}
}
......@@ -123,7 +123,6 @@
style="@style/Print_text_style"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="日期:"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_order_number_text" />
......
......@@ -4,28 +4,35 @@ import android.app.Application;
import android.os.CountDownTimer;
import android.view.View;
import com.billy.cc.core.component.CC;
import com.gingersoft.gsa.cloud.base.application.GsaCloudApplication;
import com.gingersoft.gsa.cloud.base.common.bean.BaseResult;
import com.gingersoft.gsa.cloud.base.common.bean.OrderBean;
import com.gingersoft.gsa.cloud.base.common.bean.OrderDetail;
import com.gingersoft.gsa.cloud.base.common.bean.TableBean;
import com.gingersoft.gsa.cloud.base.common.bean.mealManage.MyOrderManage;
import com.gingersoft.gsa.cloud.base.common.bean.mealManage.OpenTableManage;
import com.gingersoft.gsa.cloud.base.utils.JsonUtils;
import com.gingersoft.gsa.cloud.database.bean.Food;
import com.gingersoft.gsa.cloud.table.mvp.model.bean.BaseRespose;
import com.gingersoft.gsa.cloud.database.bean.Function;
import com.gingersoft.gsa.cloud.table.R;
import com.gingersoft.gsa.cloud.table.app.GoldConstants;
import com.gingersoft.gsa.cloud.base.common.bean.TableBean;
import com.gingersoft.gsa.cloud.table.app.TableOperatTypeConstant;
import com.gingersoft.gsa.cloud.table.mvp.contract.TableContract;
import com.gingersoft.gsa.cloud.table.mvp.model.bean.BaseRespose;
import com.gingersoft.gsa.cloud.table.mvp.model.bean.TableDetail;
import com.gingersoft.gsa.cloud.table.mvp.ui.activity.TableActivity;
import com.gingersoft.gsa.cloud.table.mvp.ui.adapter.BottomFunctionAdapter;
import com.jess.arms.base.DefaultAdapter;
import com.jess.arms.integration.AppManager;
import com.jess.arms.di.scope.ActivityScope;
import com.jess.arms.mvp.BasePresenter;
import com.jess.arms.http.imageloader.ImageLoader;
import com.jess.arms.integration.AppManager;
import com.jess.arms.mvp.BasePresenter;
import com.jess.arms.utils.RxLifecycleUtils;
import com.qmuiteam.qmui.widget.dialog.QMUIDialog;
import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction;
import java.util.ArrayList;
import java.util.List;
import javax.inject.Inject;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.annotations.NonNull;
......@@ -36,17 +43,6 @@ import me.jessyan.rxerrorhandler.handler.ErrorHandleSubscriber;
import okhttp3.FormBody;
import okhttp3.RequestBody;
import javax.inject.Inject;
import com.gingersoft.gsa.cloud.table.mvp.contract.TableContract;
import com.jess.arms.utils.ArmsUtils;
import com.jess.arms.utils.RxLifecycleUtils;
import com.qmuiteam.qmui.widget.dialog.QMUIDialog;
import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction;
import java.util.ArrayList;
import java.util.List;
/**
* ================================================
......@@ -146,6 +142,18 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
mRootView.setCurrentOperatType(TableOperatTypeConstant.move_table_4);
return;
}
if (mBottomFunctionList.get(position).getResName().equals("上菜紙")) {
CC.obtainBuilder("Component.Print")
.setActionName("printActivity")
.addParam("type", 0)
.build()
.callAsync((cc, result) -> {
if (result.isSuccess()) {
//打印成功
}
});
return;
}
// if (mBottomFunctionList.get(position).getResName().equals("↑")) {
// mBottomFunctionList.add(new Function((long) 5, 1, 2025, "skyorder", "", ""));
// mBottomFunctionList.add(new Function((long) 6, 1, 2025, "上菜紙", "", ""));
......
......@@ -28,6 +28,7 @@ import com.gingersoft.gsa.cloud.base.common.bean.mealManage.OpenTableManage;
import com.gingersoft.gsa.cloud.base.utils.VibratorUtils;
import com.gingersoft.gsa.cloud.base.utils.constans.Constans;
import com.gingersoft.gsa.cloud.base.utils.other.SPUtils;
import com.gingersoft.gsa.cloud.base.utils.time.TimeUtils;
import com.gingersoft.gsa.cloud.base.utils.view.ViewUtils;
import com.gingersoft.gsa.cloud.base.widget.DialogUtils;
import com.gingersoft.gsa.cloud.database.bean.Food;
......@@ -284,6 +285,10 @@ public class MealStandActivity extends BaseActivity<MealStandPresenter> implemen
return;
mPresenter.toFindMeal(inputText);
});
TableBean.DataBean tableBean = OpenTableManage.getDefault().getTableBean();
String time = TimeUtils.DEFAULT_DATE_FORMAT.format(tableBean.getCreateTime());
int x = 0;
}
@Override
......@@ -973,7 +978,7 @@ public class MealStandActivity extends BaseActivity<MealStandPresenter> implemen
dialog.dismiss();
});
hepler.setViewClick(R.id.internet_print, v -> {
SPUtils.put(mContext, Constans.DEFAULT_PRINT_METHOD, Constans.LOCAL_PRINT);
SPUtils.put(mContext, Constans.DEFAULT_PRINT_METHOD, Constans.IP_PRINT);
dialog.dismiss();
});
}
......
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.gingersoft.gsa.cloud.user.login">
......@@ -15,25 +16,24 @@
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/user_login_name"
tools:replace="android:label"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
android:theme="@style/AppTheme"
tools:replace="android:label">
<activity android:name=".mvp.ui.activity.SwitchServerActivity"></activity>
<activity android:name=".mvp.ui.activity.LoginActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".mvp.ui.activity.LoginOutActivity"/>
<activity android:name=".mvp.ui.activity.LoginOutActivity" />
<meta-data
android:name="com.gingersoft.gsa.cloud.globalconfig.GlobalConfiguration"
android:value="ConfigModule" />
<meta-data
android:name="design_width_in_dp"
android:value="360" />
......@@ -43,4 +43,3 @@
</application>
</manifest>
\ No newline at end of file
package com.gingersoft.gsa.cloud.user.login.di.component;
import dagger.BindsInstance;
import dagger.Component;
import com.jess.arms.di.component.AppComponent;
import com.gingersoft.gsa.cloud.user.login.di.module.SwitchServerModule;
import com.gingersoft.gsa.cloud.user.login.mvp.contract.SwitchServerContract;
import com.jess.arms.di.scope.ActivityScope;
import com.gingersoft.gsa.cloud.user.login.mvp.ui.activity.SwitchServerActivity;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 02/29/2020 20:49
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
@ActivityScope
@Component(modules = SwitchServerModule.class, dependencies = AppComponent.class)
public interface SwitchServerComponent {
void inject(SwitchServerActivity activity);
@Component.Builder
interface Builder {
@BindsInstance
SwitchServerComponent.Builder view(SwitchServerContract.View view);
SwitchServerComponent.Builder appComponent(AppComponent appComponent);
SwitchServerComponent build();
}
}
\ No newline at end of file
package com.gingersoft.gsa.cloud.user.login.di.module;
import com.jess.arms.di.scope.ActivityScope;
import dagger.Binds;
import dagger.Module;
import dagger.Provides;
import com.gingersoft.gsa.cloud.user.login.mvp.contract.SwitchServerContract;
import com.gingersoft.gsa.cloud.user.login.mvp.model.SwitchServerModel;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 02/29/2020 20:49
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
@Module
public abstract class SwitchServerModule {
@Binds
abstract SwitchServerContract.Model bindSwitchServerModel(SwitchServerModel model);
}
\ No newline at end of file
package com.gingersoft.gsa.cloud.user.login.mvp.contract;
import com.gingersoft.gsa.cloud.ui.bean.mode.LoginBean;
import com.jess.arms.mvp.IView;
import com.jess.arms.mvp.IModel;
import com.jess.arms.mvp.IView;
import io.reactivex.Observable;
import okhttp3.RequestBody;
......@@ -26,6 +26,8 @@ public interface LoginContract {
void loginSuccess(LoginBean info);
void loginOut();
void startToSwitchServer();
}
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
......
package com.gingersoft.gsa.cloud.user.login.mvp.contract;
import com.jess.arms.mvp.IView;
import com.jess.arms.mvp.IModel;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 02/29/2020 20:49
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
public interface SwitchServerContract {
//对于经常使用的关于UI的方法可以定义到IView中,如显示隐藏进度条,和显示文字消息
interface View extends IView {
}
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
interface Model extends IModel {
}
}
package com.gingersoft.gsa.cloud.user.login.mvp.model;
import android.app.Application;
import com.google.gson.Gson;
import com.jess.arms.integration.IRepositoryManager;
import com.jess.arms.mvp.BaseModel;
import com.jess.arms.di.scope.ActivityScope;
import javax.inject.Inject;
import com.gingersoft.gsa.cloud.user.login.mvp.contract.SwitchServerContract;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 02/29/2020 20:49
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
@ActivityScope
public class SwitchServerModel extends BaseModel implements SwitchServerContract.Model {
@Inject
Gson mGson;
@Inject
Application mApplication;
@Inject
public SwitchServerModel(IRepositoryManager repositoryManager) {
super(repositoryManager);
}
@Override
public void onDestroy() {
super.onDestroy();
this.mGson = null;
this.mApplication = null;
}
}
\ No newline at end of file
package com.gingersoft.gsa.cloud.user.login.mvp.presenter;
import android.app.Application;
import android.util.Log;
import com.gingersoft.gsa.cloud.base.application.GsaCloudApplication;
import com.gingersoft.gsa.cloud.ui.bean.mode.LoginBean;
import com.jess.arms.integration.AppManager;
import com.gingersoft.gsa.cloud.user.login.mvp.contract.LoginContract;
import com.jess.arms.di.scope.ActivityScope;
import com.jess.arms.mvp.BasePresenter;
import com.jess.arms.http.imageloader.ImageLoader;
import com.jess.arms.integration.AppManager;
import com.jess.arms.mvp.BasePresenter;
import com.jess.arms.utils.RxLifecycleUtils;
import javax.inject.Inject;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.annotations.NonNull;
......@@ -18,11 +21,6 @@ import me.jessyan.rxerrorhandler.handler.ErrorHandleSubscriber;
import okhttp3.FormBody;
import okhttp3.RequestBody;
import javax.inject.Inject;
import com.gingersoft.gsa.cloud.user.login.mvp.contract.LoginContract;
import com.jess.arms.utils.RxLifecycleUtils;
/**
* ================================================
......@@ -63,6 +61,11 @@ public class LoginPresenter extends BasePresenter<LoginContract.Model, LoginCont
public void login(String account, String pwd) {
if(account.equals("88888888") && pwd.equals("cc81081168")){
mRootView.startToSwitchServer();
return;
}
RequestBody requestBody;
if (account.equals("")) {
......
package com.gingersoft.gsa.cloud.user.login.mvp.presenter;
import android.app.Application;
import com.gingersoft.gsa.cloud.user.login.mvp.contract.SwitchServerContract;
import com.jess.arms.di.scope.ActivityScope;
import com.jess.arms.http.imageloader.ImageLoader;
import com.jess.arms.integration.AppManager;
import com.jess.arms.mvp.BasePresenter;
import javax.inject.Inject;
import me.jessyan.rxerrorhandler.core.RxErrorHandler;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 02/29/2020 20:49
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
* 切換服務器頁面
*/
@ActivityScope
public class SwitchServerPresenter extends BasePresenter<SwitchServerContract.Model, SwitchServerContract.View> {
@Inject
RxErrorHandler mErrorHandler;
@Inject
Application mApplication;
@Inject
ImageLoader mImageLoader;
@Inject
AppManager mAppManager;
@Inject
public SwitchServerPresenter(SwitchServerContract.Model model, SwitchServerContract.View rootView) {
super(model, rootView);
}
@Override
public void onDestroy() {
super.onDestroy();
this.mErrorHandler = null;
this.mAppManager = null;
this.mImageLoader = null;
this.mApplication = null;
}
}
......@@ -221,7 +221,6 @@ public class LoginActivity extends BaseActivity<LoginPresenter> implements Login
@Override
public void showMessage(@NonNull String message) {
if (message != null)
ArmsUtils.makeText(this, message);
}
......@@ -380,6 +379,11 @@ public class LoginActivity extends BaseActivity<LoginPresenter> implements Login
}
@Override
public void startToSwitchServer() {
startActivity(new Intent(mContext, SwitchServerActivity.class));
}
@Override
@OnClick({R2.id.tv_gsa_user_login, R2.id.iv_clear_pwd, R2.id.iv_clear_account})
public void onClick(View v) {
switch (v.getId()) {
......
package com.gingersoft.gsa.cloud.user.login.mvp.ui.activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.Button;
import android.widget.RadioButton;
import android.widget.TextView;
import com.gingersoft.gsa.cloud.base.utils.constans.HttpsConstans;
import com.gingersoft.gsa.cloud.user.login.R;
import com.gingersoft.gsa.cloud.user.login.R2;
import com.gingersoft.gsa.cloud.user.login.di.component.DaggerSwitchServerComponent;
import com.gingersoft.gsa.cloud.user.login.mvp.contract.SwitchServerContract;
import com.gingersoft.gsa.cloud.user.login.mvp.presenter.SwitchServerPresenter;
import com.jess.arms.base.BaseActivity;
import com.jess.arms.di.component.AppComponent;
import com.jess.arms.utils.ArmsUtils;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import butterknife.BindView;
import me.jessyan.retrofiturlmanager.RetrofitUrlManager;
import static com.jess.arms.utils.Preconditions.checkNotNull;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 02/29/2020 20:49
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
public class SwitchServerActivity extends BaseActivity<SwitchServerPresenter> implements SwitchServerContract.View {
@BindView(R2.id.rb_server_sz)
RadioButton rbSZ;
@BindView(R2.id.rb_server_hk)
RadioButton rbHK;
@BindView(R2.id.btn_switch_server)
Button switchServer;
@BindView(R2.id.tv_now_server)
TextView tvNowServer;
@Override
public void setupActivityComponent(@NonNull AppComponent appComponent) {
DaggerSwitchServerComponent //如找不到该类,请编译一下项目
.builder()
.appComponent(appComponent)
.view(this)
.build()
.inject(this);
}
@Override
public int initView(@Nullable Bundle savedInstanceState) {
return R.layout.activity_switch_server; //如果你不需要框架帮你设置 setContentView(id) 需要自行设置,请返回 0
}
///RetrofitUrlManager.getInstance().putDomain("common", HttpsConstans.ROOT_SERVER_ADDRESS_FORMAL);
@Override
public void initData(@Nullable Bundle savedInstanceState) {
String nowServer = HttpsConstans.ROOT_SERVER_ADDRESS_FORMAL;
tvNowServer.setText("當前服務器:" + nowServer);
rbSZ.setText("深圳服務器:" + HttpsConstans.ROOT_SERVER_ADDRESS_FORMAL_SZ);
rbHK.setText("香港服務器:" + HttpsConstans.ROOT_SERVER_ADDRESS_FORMAL_HK);
if (nowServer.equals(HttpsConstans.ROOT_SERVER_ADDRESS_FORMAL_SZ)) {
rbSZ.setChecked(true);
} else {
rbHK.setChecked(true);
}
switchServer.setOnClickListener(v -> {
if (rbSZ.isChecked()) {
RetrofitUrlManager.getInstance().putDomain("common", HttpsConstans.ROOT_SERVER_ADDRESS_FORMAL_SZ);
} else {
RetrofitUrlManager.getInstance().putDomain("common", HttpsConstans.ROOT_SERVER_ADDRESS_FORMAL_HK);
}
finish();
});
}
@Override
public void initIntent() {
}
@Override
public void initTopBar() {
}
@Override
public void initLanguage() {
}
@Override
public void initLayoutParams() {
}
@Override
public void initLayoutVisible() {
}
@Override
public void showLoading(String message) {
}
@Override
public void hideLoading() {
}
@Override
public void showMessage(@NonNull String message) {
checkNotNull(message);
ArmsUtils.snackbarText(message);
}
@Override
public void launchActivity(@NonNull Intent intent) {
checkNotNull(intent);
ArmsUtils.startActivity(intent);
}
@Override
public void killMyself() {
finish();
}
}
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RadioGroup
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RadioButton
android:id="@+id/rb_server_sz"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/dp_10"
android:text="深圳環境"
android:textColor="@color/theme_333_color"
android:textSize="@dimen/sp_16" />
<RadioButton
android:id="@+id/rb_server_hk"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/dp_10"
android:text="香港環境"
android:textColor="@color/theme_333_color"
android:textSize="@dimen/sp_16" />
</RadioGroup>
<TextView
android:id="@+id/tv_now_server"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/dp_10"
android:text="當前服務器:"
android:textColor="@color/theme_333_color"
android:textSize="@dimen/sp_16" />
<Button
android:id="@+id/btn_switch_server"
android:layout_width="match_parent"
android:layout_height="@dimen/head_height"
android:layout_margin="@dimen/dp_20"
android:background="@color/theme_color"
android:text="切換環境"
android:textColor="@color/white"
android:textSize="@dimen/sp_16" />
</LinearLayout>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment