Commit cf0481a6 by Wyh

3-18 打印超時時間設置,報表優化

parent 7410f941
......@@ -21,6 +21,10 @@ import android.os.Bundle;
import android.util.AttributeSet;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import com.jess.arms.base.delegate.IActivity;
import com.jess.arms.integration.cache.Cache;
import com.jess.arms.integration.cache.CacheType;
......@@ -32,10 +36,6 @@ import com.trello.rxlifecycle2.android.ActivityEvent;
import javax.inject.Inject;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.FragmentManager;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import io.reactivex.subjects.BehaviorSubject;
......
......@@ -101,11 +101,13 @@ public class BusinessReportFragment extends BaseFragment<BusinessReportPresenter
@Override
public void initData(@Nullable Bundle savedInstanceState) {
//獲取一段時間內的營業信息,默認獲取七天的數據
mPresenter.getRestaurantAmount(GsaCloudApplication.getRestaurantId(mContext) + "", TimeUtils.getOldDate(-6), TimeUtils.getOldDate(1));
mPresenter.getRestaurantBusinessInfo(GsaCloudApplication.getRestaurantId(mContext) + "", TimeUtils.getOldDate(-6), TimeUtils.getOldDate(1));
String startTime = TimeUtils.getOldDate(-6);
mPresenter.getRestaurantAmount(GsaCloudApplication.getRestaurantId(mContext) + "", startTime, TimeUtils.getOldDate(1));
mPresenter.getRestaurantBusinessInfo(GsaCloudApplication.getRestaurantId(mContext) + "", startTime, TimeUtils.getOldDate(1));
mRestaurantName.setText(GsaCloudApplication.getRestaurantName(mContext));
mTvStartTime.setText(TimeUtils.getOldDate(-6));
mTvStartTime.setText(startTime);
mTvEndTime.setText(TimeUtils.getOldDate(0));
}
......
......@@ -100,9 +100,10 @@ public class PaymentMethodReportFragment extends BaseFragment<PaymentMethodRepor
@Override
public void initData(@Nullable Bundle savedInstanceState) {
mPresenter.getPaymentInfo(GsaCloudApplication.getRestaurantId(mContext) + "", TimeUtils.getOldDate(-6));
String startTime = TimeUtils.getOldDate(-6);
mPresenter.getPaymentInfo(GsaCloudApplication.getRestaurantId(mContext) + "", startTime);
mTvStartTime.setText(TimeUtils.getOldDate(-6));
mTvStartTime.setText(startTime);
mTvEndTime.setText(TimeUtils.getOldDate(0));
}
......
......@@ -103,8 +103,9 @@ public class SalesFragment extends BaseFragment<SalesPresenter> implements Sales
@Override
public void initData(@Nullable Bundle savedInstanceState) {
mPresenter.getSalesReportInfo(GsaCloudApplication.getRestaurantId(mContext) + "", TimeUtils.getYear(-1));
mTvStartTime.setText(TimeUtils.getYear(-1));
String startTime = TimeUtils.getOldDate(-6);
mPresenter.getSalesReportInfo(GsaCloudApplication.getRestaurantId(mContext) + "", startTime);
mTvStartTime.setText(startTime);
mTvEndTime.setText(TimeUtils.getOldDate(0));
}
......@@ -183,6 +184,8 @@ public class SalesFragment extends BaseFragment<SalesPresenter> implements Sales
@Override
public void loadInfo(List<SalesFoodsBean.DataBean.SalesRankingBean> salesRanking) {
totalAmount = 0;
totalNum = 0;
for (SalesFoodsBean.DataBean.SalesRankingBean salesRankingBean : salesRanking) {
totalAmount = MoneyUtil.sum(totalAmount, salesRankingBean.getAmount());
totalNum = totalNum + salesRankingBean.getNumber();
......@@ -236,11 +239,11 @@ public class SalesFragment extends BaseFragment<SalesPresenter> implements Sales
salesChart.setHoleColor(Color.WHITE);
salesChart.setTransparentCircleColor(Color.WHITE);
salesChart.setTransparentCircleAlpha(110);
salesChart.setTransparentCircleAlpha(200);
//中心圓的大小,相當於百分比
salesChart.setHoleRadius(24f);
//中心圓外部的半透明部分,百分比
salesChart.setTransparentCircleRadius(0f);
salesChart.setTransparentCircleRadius(10f);
//是否繪製文字
salesChart.setDrawCenterText(true);
......@@ -289,13 +292,16 @@ public class SalesFragment extends BaseFragment<SalesPresenter> implements Sales
for (int i = 0; i < info.size(); i++) {
if (info.get(i) != null) {
//金額佔比
entries.add(new PieEntry(MoneyUtil.divide(info.get(i).getAmount(), totalAmount, 2, ROUND_HALF_UP), info.get(i).getProductName()));
float money = MoneyUtil.divide(info.get(i).getAmount(), totalAmount, 2, ROUND_HALF_UP);
if (money > 0.05) {
entries.add(new PieEntry(money, info.get(i).getProductName()));
}
}
}
}
PieDataSet dataSet = new PieDataSet(entries, "Election Results");
dataSet.setSliceSpace(3f);//設置餅狀圖空隙
dataSet.setSelectionShift(10f);//放大時突出多少
dataSet.setSelectionShift(5f);//放大時突出多少
// add a lot of colors
ArrayList<Integer> colors = new ArrayList<>();
......
......@@ -26,7 +26,7 @@
android:layout_marginTop="@dimen/dp_15"
android:text="个人中心"
android:textColor="@color/white"
android:textSize="@dimen/sp_17" />
android:textSize="@dimen/dp_17" />
<ImageView
android:layout_width="@dimen/dp_76"
......@@ -41,7 +41,7 @@
android:layout_marginTop="@dimen/dp_6"
android:text="NAME"
android:textColor="@color/white"
android:textSize="@dimen/sp_20" />
android:textSize="@dimen/dp_20" />
<TextView
android:id="@+id/tv_store_name"
......@@ -50,7 +50,7 @@
android:layout_marginTop="@dimen/dp_10"
android:text="店鋪名稱"
android:textColor="@color/white"
android:textSize="@dimen/sp_20" />
android:textSize="@dimen/dp_20" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_side_menu"
......@@ -80,7 +80,7 @@
android:layout_marginLeft="@dimen/dp_6"
android:text="登出"
android:textColor="@color/white"
android:textSize="@dimen/sp_17" />
android:textSize="@dimen/dp_17" />
</LinearLayout>
</LinearLayout>
......@@ -118,7 +118,7 @@
android:gravity="center"
android:text="店鋪名稱"
android:textColor="@color/white"
android:textSize="@dimen/sp_18"
android:textSize="@dimen/dp_18"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
......@@ -182,7 +182,7 @@
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_15"
android:textColor="#181818"
android:textSize="@dimen/sp_14" />
android:textSize="@dimen/dp_14" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_management"
......@@ -205,7 +205,7 @@
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginTop="@dimen/dp_20"
android:textColor="#181818"
android:textSize="@dimen/sp_14" />
android:textSize="@dimen/dp_14" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_staff_management"
......@@ -243,7 +243,7 @@
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_22"
android:textColor="#181818"
android:textSize="@dimen/sp_17" />
android:textSize="@dimen/dp_17" />
<View
android:layout_width="match_parent"
......
......@@ -33,7 +33,7 @@
android:paddingBottom="@dimen/dp_5"
android:text="上次清機時間:2020-3-1 21:59:18"
android:textColor="@color/red"
android:textSize="@dimen/sp_16" />
android:textSize="@dimen/dp_16" />
<LinearLayout
android:layout_width="match_parent"
......@@ -46,7 +46,7 @@
android:layout_height="wrap_content"
android:text="店鋪名稱:gingersoft"
android:textColor="@color/black"
android:textSize="@dimen/sp_16" />
android:textSize="@dimen/dp_18" />
<TextView
android:id="@+id/tv_business_area_title"
......@@ -54,7 +54,7 @@
android:layout_height="wrap_content"
android:text="店鋪名稱:gingersoft"
android:textColor="@color/black"
android:textSize="@dimen/sp_16" />
android:textSize="@dimen/dp_18" />
<TextView
android:id="@+id/tv_start_time"
......@@ -63,7 +63,7 @@
android:layout_marginTop="@dimen/dp_5"
android:text=""
android:textColor="@color/black"
android:textSize="@dimen/sp_14" />
android:textSize="@dimen/settlement_report_text_size" />
<TextView
android:id="@+id/tv_end_time"
......@@ -72,7 +72,7 @@
android:layout_marginTop="@dimen/dp_5"
android:text=""
android:textColor="@color/black"
android:textSize="@dimen/sp_14" />
android:textSize="@dimen/settlement_report_text_size" />
</LinearLayout>
<View
......@@ -107,5 +107,5 @@
android:gravity="center"
android:text="去清機"
android:textColor="@color/theme_white_color"
android:textSize="@dimen/sp_15" />
android:textSize="@dimen/dp_15" />
</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout>
\ No newline at end of file
......@@ -44,14 +44,14 @@
android:layout_weight="1"
android:text="支付方式分析"
android:textColor="#181818"
android:textSize="@dimen/sp_17" />
android:textSize="@dimen/dp_17" />
<TextView
android:id="@+id/tv_start_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#181818"
android:textSize="@dimen/sp_10" />
android:textSize="@dimen/dp_10" />
<TextView
android:layout_width="wrap_content"
......@@ -59,7 +59,7 @@
android:layout_marginLeft="@dimen/dp_7"
android:text="到"
android:textColor="#999"
android:textSize="@dimen/sp_10" />
android:textSize="@dimen/dp_10" />
<TextView
android:id="@+id/tv_end_time"
......@@ -67,7 +67,7 @@
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_7"
android:textColor="#181818"
android:textSize="@dimen/sp_10" />
android:textSize="@dimen/dp_10" />
</LinearLayout>
<androidx.constraintlayout.widget.ConstraintLayout
......@@ -103,7 +103,7 @@
android:layout_height="wrap_content"
android:text="支付方式1"
android:textColor="@color/color_3c"
android:textSize="@dimen/sp_13"
android:textSize="@dimen/dp_13"
android:visibility="gone"
app:layout_constraintLeft_toLeftOf="@id/tv_chart_line"
app:layout_constraintRight_toRightOf="@id/tv_chart_line"
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/cl_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
......@@ -15,7 +14,7 @@
android:text="item1"
android:maxLines="1"
android:textColor="@color/black"
android:textSize="@dimen/sp_14" />
android:textSize="@dimen/settlement_report_text_size" />
<TextView
android:id="@+id/tv_item2"
......@@ -26,7 +25,7 @@
android:maxLines="1"
android:text="item2"
android:textColor="@color/black"
android:textSize="@dimen/sp_14" />
android:textSize="@dimen/settlement_report_text_size" />
<TextView
android:id="@+id/tv_item3"
......@@ -37,7 +36,7 @@
android:maxLines="1"
android:text="item3"
android:textColor="@color/black"
android:textSize="@dimen/sp_14" />
android:textSize="@dimen/settlement_report_text_size" />
<TextView
android:id="@+id/tv_item4"
......@@ -48,17 +47,17 @@
android:text="item4"
android:maxLines="1"
android:textColor="@color/black"
android:textSize="@dimen/sp_14" />
android:textSize="@dimen/settlement_report_text_size" />
<TextView
android:id="@+id/tv_item5"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:maxLines="1"
android:gravity="right"
android:text="item5"
android:ellipsize="marquee"
android:textColor="@color/black"
android:textSize="@dimen/sp_14" />
android:textSize="@dimen/settlement_report_text_size" />
</LinearLayout>
\ No newline at end of file
......@@ -44,9 +44,9 @@ dependencies {
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
annotationProcessor rootProject.ext.dependencies["dagger2-compiler"]
implementation 'am.util:printer:2.1.0'//打印
// implementation 'am.util:printer:2.1.0'//打印
implementation rootProject.ext.dependencies["BaseRecyclerViewAdapter"]
implementation rootProject.ext.dependencies["yzjRecyclerView"]
implementation rootProject.ext.dependencies["yzjRecyclerView"]//可長按拖動 側滑刪除的recyclerview
// implementation rootProject.ext.dependencies["fastjson"]
debugImplementation rootProject.ext.dependencies["canary-debug"]
releaseImplementation rootProject.ext.dependencies["canary-release"]
......
......@@ -27,9 +27,7 @@ import com.gingersoft.gsa.cloud.base.utils.view.LayoutToBitmapUtils;
import com.joe.print.R;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -57,18 +55,29 @@ public class PrintUtils {
PrintUtils.paperWidth = paperWidth;
if (type == -1) {
//測試紙
bitmaps.add(PrintUtils.getTestPrintBitmap(mContext));
bitmaps.add(getTestPrintBitmap(mContext));
} else if (type == 0) {
//上菜紙
bitmaps.add(PrintUtils.getPrintBitmap(mContext, MyOrderManage.getInstance().getNewFoodList()));
bitmaps.add(getPrintBitmap(mContext, MyOrderManage.getInstance().getNewFoodList()));
} else if (type == 1) {
//印單
bitmaps.add(PrintUtils.getPrintBitmap(mContext));
//印單,可能會有還未送單的食品,同時也要將未送單的食品以廚房單的格式打印出來
bitmaps.add(getPrintBitmap(mContext));
bitmaps.addAll(getKitchenBitmap(mContext));
} else if (type == 2) {
//結賬單
bitmaps.add(PrintUtils.getPrintBillBitmap(mContext));
bitmaps.add(getPrintBillBitmap(mContext));
} else if (type == 3) {
//廚房單,需要切紙
bitmaps.addAll(getKitchenBitmap(mContext));
} else if (type == 4) {
//清機報表
bitmaps.add(getReportBitmap(mContext));
}
return bitmaps;
}
private static List<Bitmap> getKitchenBitmap(Context mContext) {
List<Bitmap> bitmaps = new ArrayList<>();
List<OrderDetail> orderDetails = MyOrderManage.getInstance().getNewFoodList();
if (orderDetails != null) {
// 將沒有打印位置的歸類到一起
......@@ -129,10 +138,6 @@ public class PrintUtils {
}
}
}
} else if (type == 4) {
//清機報表
bitmaps.add(getReportBitmap(mContext));
}
return bitmaps;
}
......@@ -241,7 +246,7 @@ public class PrintUtils {
tableNum.setText(tableBean.getTableName());
people.setText(OpenTableManage.getDefault().getPeopleNumber() + "");
orderData.setText(TimeUtils.getFormatTime(tableBean.getCreateTime(), TimeUtils.DEFAULT_DATE_FORMAT));
orderData.setText(tableBean.getCreateTime());
checkOutTime.setText(TimeUtils.getCurrentTimeInString(TimeUtils.DEFAULT_DATE_FORMAT));
FoodAdapter foodAdapter = new FoodAdapter(foodList);
......@@ -317,13 +322,11 @@ public class PrintUtils {
//人數
tvPeople.setText(OpenTableManage.getDefault().getPeopleNumber() + "");
//開台時間
Date time = new Date(OpenTableManage.getDefault().getTableBean().getCreateTime());
SimpleDateFormat sdf = new SimpleDateFormat("MM-dd HH:mm");
tvOpeningTime.setText(sdf.format(time));
// SimpleDateFormat sdf = new SimpleDateFormat("MM-dd HH:mm");
tvOpeningTime.setText(OpenTableManage.getDefault().getTableBean().getCreateTime());
}
//落單時間
tvOrderTime.setText(TimeUtils.getCurrentTimeInString(TimeUtils.DEFAULT_DATE_MDHM));
//操作人員
tvOperator.setText(GsaCloudApplication.userName);
......
......@@ -5,19 +5,17 @@ import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.Rect;
import android.util.Log;
import com.gingersoft.gsa.cloud.base.utils.toast.ToastUtils;
import com.gingersoft.gsa.cloud.print.PrintDataMaker;
import com.gingersoft.gsa.cloud.print.PrinterWriter;
import com.gingersoft.gsa.cloud.print.PrinterWriter58mm;
import com.gingersoft.gsa.cloud.print.PrinterWriter80mm;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import am.util.printer.PrintDataMaker;
import am.util.printer.PrinterWriter;
import am.util.printer.PrinterWriter58mm;
import am.util.printer.PrinterWriter80mm;
/**
* Created by Wyh on 2020/1/9.
* 送單打印
......@@ -61,6 +59,7 @@ public class SendPrint implements PrintDataMaker {
printer.printLineFeed();
printer.printLineFeed();
printer.feedPaperCutPartial();
data.add(printer.getDataAndReset());
}
// String bitmapPath = FileUtils.getExternalFilesDir(context, "Temp") + "tmp_qr.jpg";
// if (QRCodeUtil.createQRImage(qr, 380, 380, null, bitmapPath)) {
......
......@@ -2,6 +2,10 @@ package com.joe.print.mvp.print;
import android.content.Context;
import com.gingersoft.gsa.cloud.print.PrintDataMaker;
import com.gingersoft.gsa.cloud.print.PrinterWriter;
import com.gingersoft.gsa.cloud.print.PrinterWriter58mm;
import com.gingersoft.gsa.cloud.print.PrinterWriter80mm;
import com.joe.print.R;
import java.text.SimpleDateFormat;
......@@ -10,11 +14,6 @@ import java.util.Date;
import java.util.List;
import java.util.Locale;
import am.util.printer.PrintDataMaker;
import am.util.printer.PrinterWriter;
import am.util.printer.PrinterWriter58mm;
import am.util.printer.PrinterWriter80mm;
/**
* 测试数据生成
*/
......
......@@ -22,15 +22,14 @@ import androidx.annotation.Nullable;
import com.billy.cc.core.component.CC;
import com.billy.cc.core.component.CCResult;
import com.gingersoft.gsa.cloud.print.PrintExecutor;
import com.gingersoft.gsa.cloud.print.PrintSocketHolder;
import com.gingersoft.gsa.cloud.print.PrinterWriter58mm;
import com.gingersoft.gsa.cloud.print.PrinterWriter80mm;
import com.joe.print.R;
import com.joe.print.mvp.print.SendPrint;
import com.joe.print.mvp.print.TestPrintDataMaker;
import am.util.printer.PrintExecutor;
import am.util.printer.PrintSocketHolder;
import am.util.printer.PrinterWriter58mm;
import am.util.printer.PrinterWriter80mm;
import static com.billy.cc.core.component.CCUtil.EXTRA_KEY_CALL_ID;
/**
......
......@@ -8,7 +8,6 @@ import android.os.Build;
import android.os.Bundle;
import android.os.IBinder;
import android.os.RemoteException;
import android.util.Log;
import android.view.MotionEvent;
import android.view.WindowManager;
......@@ -28,6 +27,7 @@ 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.toast.ToastUtils;
import com.gingersoft.gsa.cloud.base.widget.DialogUtils;
import com.gingersoft.gsa.cloud.constans.PrintConstans;
import com.gingersoft.gsa.cloud.database.bean.PrinterDeviceBean;
import com.hyweb.n5.lib.constant.PrinterConstant;
import com.hyweb.n5.lib.exception.NoInitPrinterException;
......@@ -40,7 +40,6 @@ import com.joe.print.R;
import com.joe.print.di.component.DaggerPrintComponent;
import com.joe.print.mvp.contract.PrintContract;
import com.joe.print.mvp.presenter.PrintPresenter;
import com.joe.print.mvp.print.PrintConstans;
import com.joe.print.mvp.print.PrintStatus;
import com.joe.print.mvp.print.PrintUtils;
import com.joe.print.mvp.ui.adapter.DialogPrinterListAdapter;
......@@ -150,13 +149,11 @@ public class PrintActivity extends BaseActivity<PrintPresenter> implements Print
paperWidth = 500;
try {
//初始化N5打印
// int state = PrinterUtil.getStatus();
boolean state = PrintStatus.initN5PrintStatus(mContext);
if (!state) {
//不能打印
printFile();
}
Log.e("error", "打印機狀態:" + state);
} catch (NullPointerException e) {
e.printStackTrace();
//如果是空指針,那麼需要初始化
......@@ -164,7 +161,6 @@ public class PrintActivity extends BaseActivity<PrintPresenter> implements Print
PrinterUtil.initPrinter(this);
} catch (NoInitPrinterException | RemoteException ex) {
ex.printStackTrace();
Log.e("error", "打印初始化失敗:" + ex.getMessage());
}
}
}
......@@ -269,12 +265,10 @@ public class PrintActivity extends BaseActivity<PrintPresenter> implements Print
startN5Print();
} catch (NullPointerException e) {
ToastUtils.show(mContext, "打印失敗,請重試");
Log.e("error", "打印失敗請重試:" + e.getMessage());
finish();
}
} catch (RemoteException e) {
e.printStackTrace();
Log.e("error", "打印失敗請重試RemoteException:" + e.getMessage());
printFile();
}
} else {
......@@ -289,7 +283,6 @@ public class PrintActivity extends BaseActivity<PrintPresenter> implements Print
PrinterUtil.startPrint(true, new IOnPrintCallback.Stub() {
@Override
public void onPrintResult(int i) {
Log.e("error", "打印回調:" + i);
if (i == 0) {
//打印成功
printSuccess();
......@@ -307,7 +300,6 @@ public class PrintActivity extends BaseActivity<PrintPresenter> implements Print
} catch (RemoteException e) {
e.printStackTrace();
//打印失敗
Log.e("error", "打印失敗請重試22222222222RemoteException:" + e.getMessage());
printFile();
}
}
......
......@@ -26,7 +26,7 @@ import com.joe.print.R2;
import com.joe.print.di.component.DaggerPrinterAddComponent;
import com.joe.print.mvp.contract.PrinterAddContract;
import com.joe.print.mvp.presenter.PrinterAddPresenter;
import com.joe.print.mvp.print.PrintConstans;
import com.gingersoft.gsa.cloud.constans.PrintConstans;
import com.qmuiteam.qmui.widget.QMUITopBar;
import butterknife.BindView;
......
......@@ -11,7 +11,7 @@ import com.gingersoft.gsa.cloud.base.utils.other.SPUtils;
import com.gingersoft.gsa.cloud.base.utils.toast.ToastUtils;
import com.gingersoft.gsa.cloud.database.bean.PrinterDeviceBean;
import com.joe.print.R;
import com.joe.print.mvp.print.PrintConstans;
import com.gingersoft.gsa.cloud.constans.PrintConstans;
import java.util.List;
......
......@@ -29,7 +29,7 @@ import com.joe.print.di.component.DaggerIpPrintListActivityComponent;
import com.joe.print.di.module.IpPrintListActivityModule;
import com.joe.print.mvp.contract.IpPrintListActivityContract;
import com.joe.print.mvp.presenter.IpPrintListActivityPresenter;
import com.joe.print.mvp.print.PrintConstans;
import com.gingersoft.gsa.cloud.constans.PrintConstans;
import com.joe.print.mvp.ui.activity.PrinterAddActivity;
import com.joe.print.mvp.ui.adapter.PrinterListAdapter;
import com.yanzhenjie.recyclerview.SwipeMenuCreator;
......
<?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:gravity="center"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="本地打印機列表"
android:textColor="@color/theme_333_color" />
</LinearLayout>
\ No newline at end of file
......@@ -14,7 +14,7 @@
android:padding="@dimen/dp_10"
android:text="本機打印"
android:textColor="@color/theme_333_color"
android:textSize="@dimen/sp_20" />
android:textSize="@dimen/dp_20" />
<include layout="@layout/include_horizontal_color_ccc_dividing_line" />
......@@ -25,7 +25,7 @@
android:padding="@dimen/dp_10"
android:text="網絡打印"
android:textColor="@color/theme_333_color"
android:textSize="@dimen/sp_20" />
android:textSize="@dimen/dp_20" />
</LinearLayout>
\ No newline at end of file
......@@ -12,7 +12,7 @@
android:layout_height="wrap_content"
android:text="打印測試"
android:textColor="@color/theme_333_color"
android:textSize="@dimen/sp_25" />
android:textSize="@dimen/dp_25" />
</LinearLayout>
\ No newline at end of file
......@@ -24,7 +24,7 @@
android:layout_weight="0.3"
android:text="打印機IP"
android:textColor="@color/normal_color"
android:textSize="@dimen/sp_14"
android:textSize="@dimen/dp_14"
android:textStyle="bold" />
<LinearLayout
......@@ -46,7 +46,7 @@
android:text="192"
android:textColor="@color/normal_color"
android:textCursorDrawable="@null"
android:textSize="15sp">
android:textSize="@dimen/dp_15">
<requestFocus />
</EditText>
......@@ -58,7 +58,7 @@
android:singleLine="true"
android:text="."
android:textColor="#000"
android:textSize="20sp"
android:textSize="@dimen/dp_20"
android:textStyle="bold" />
<EditText
......@@ -74,7 +74,7 @@
android:text="168"
android:textColor="@color/normal_color"
android:textCursorDrawable="@null"
android:textSize="15sp" />
android:textSize="@dimen/dp_15" />
<TextView
android:id="@+id/dot_2"
......@@ -83,7 +83,7 @@
android:singleLine="true"
android:text="."
android:textColor="#000"
android:textSize="20sp"
android:textSize="@dimen/dp_20"
android:textStyle="bold" />
<EditText
......@@ -99,7 +99,7 @@
android:text="125"
android:textColor="@color/normal_color"
android:textCursorDrawable="@null"
android:textSize="15sp" />
android:textSize="@dimen/dp_15" />
<TextView
android:id="@+id/dot_3"
......@@ -108,7 +108,7 @@
android:singleLine="true"
android:text="."
android:textColor="#000"
android:textSize="20sp"
android:textSize="@dimen/dp_20"
android:textStyle="bold" />
<EditText
......@@ -124,7 +124,7 @@
android:text="075"
android:textColor="@color/normal_color"
android:textCursorDrawable="@null"
android:textSize="15sp" />
android:textSize="@dimen/dp_15" />
</LinearLayout>
</LinearLayout>
......@@ -142,7 +142,7 @@
android:layout_weight="0.3"
android:text="端口號"
android:textColor="@color/normal_color"
android:textSize="@dimen/sp_14"
android:textSize="@dimen/dp_14"
android:textStyle="bold" />
<EditText
......@@ -174,7 +174,7 @@
android:layout_weight="0.3"
android:text="紙張規格"
android:textColor="@color/normal_color"
android:textSize="@dimen/sp_14"
android:textSize="@dimen/dp_14"
android:textStyle="bold" />
<RadioGroup
......@@ -191,7 +191,7 @@
android:layout_height="wrap_content"
android:text="58mm"
android:textColor="@color/normal_color"
android:textSize="@dimen/sp_14" />
android:textSize="@dimen/dp_14" />
<RadioButton
android:id="@+id/print_paper_size_88"
......@@ -200,7 +200,7 @@
android:layout_marginLeft="@dimen/dp_10"
android:text="88mm"
android:textColor="@color/normal_color"
android:textSize="@dimen/sp_14" />
android:textSize="@dimen/dp_14" />
</RadioGroup>
</LinearLayout>
......@@ -219,6 +219,6 @@
android:paddingBottom="@dimen/dp_10"
android:text="打印測試"
android:textColor="@color/white"
android:textSize="@dimen/sp_16" />
android:textSize="@dimen/dp_16" />
</LinearLayout>
\ No newline at end of file
......@@ -82,8 +82,9 @@ dependencies {
implementation 'com.gcssloop.recyclerview:pagerlayoutmanager:2.3.8'
//陰影背景
api 'com.github.lihangleo2:ShadowLayout:2.1.6'
api 'com.contrarywind:Android-PickerView:3.2.4'
//時間選擇控件
api 'com.contrarywind:Android-PickerView:3.2.4'
implementation 'org.aspectj:aspectjrt:1.8.9'
//商米打印庫
api 'com.sunmi:printerlibrary:1.0.7'
......
package com.gingersoft.gsa.cloud.base.application;
import android.app.Activity;
import android.app.Application;
import android.content.Context;
import android.os.Build;
import android.os.RemoteException;
import android.util.Log;
import com.billy.cc.core.component.CC;
import com.elvishew.xlog.LogConfiguration;
......@@ -148,7 +146,6 @@ public class GsaCloudApplication extends BaseApplication {
PrinterUtil.initPrinter(this);
} catch (NoInitPrinterException | RemoteException e) {
e.printStackTrace();
Log.e("error", "GsaCloudApplication打印初始化失敗:" + e.getMessage());
}
}
//需要單獨配置域名URL的,在接口上添加@Headers({"Domain-Name: settlement_report_server"}),不添加則是使用默認域名
......
......@@ -91,7 +91,6 @@ public class LayoutToBitmapUtils {
if (photoBitmap != null) {
if (photoBitmap.compress(Bitmap.CompressFormat.PNG, 100, fileOutputStream)) {
fileOutputStream.flush();
Log.e("aaa", "图片路径:" + photoFile.getPath());
return photoFile.getPath();
}
}
......
package com.joe.print.mvp.print;
package com.gingersoft.gsa.cloud.constans;
public class PrintConstans {
//默認打印機數據
public static final String DEFAULT_PRINT_IP = "default_print_ip";
public static final String DEFAULT_PRINT_PORT = "default_print_port";
public static final String DEFAULT_PRINT_PAPER = "default_print_paper";
public static final int SO_TIMEOUT = 10000;//讀取/輸入io流數據超時的時間
public static final int PRINT_TIMEOUT = 5000;//打印機連接超時時間
}
......@@ -3,7 +3,6 @@ package com.gingersoft.gsa.cloud.globalconfig.applyOptions;
import com.gingersoft.gsa.cloud.base.application.GsaCloudApplication;
import com.gingersoft.gsa.cloud.base.utils.constans.AppConstans;
import com.gingersoft.gsa.cloud.base.utils.encryption.Aes;
import com.gingersoft.gsa.cloud.base.utils.log.LogUtil;
import com.gingersoft.gsa.cloud.base.utils.other.AppUtils;
import com.jess.arms.http.GlobalHttpHandler;
......@@ -61,17 +60,17 @@ public class MyGlobalHttpHandler implements GlobalHttpHandler {
private void e(String msg) {
if (msg == null) {
return;
}
// if (msg == null) {
// return;
// }
//因为String的length是字符数量不是字节数量所以为了防止中文字符过多,
// 把4*1024的MAX字节打印长度改为2001字符数
int max_str_length = 2001 - TAG.length();
// int max_str_length = 2001 - TAG.length();
//大于4000时
while (msg.length() > max_str_length) {
LogUtil.e(TAG, msg);
msg = msg.substring(max_str_length);
}
// while (msg.length() > max_str_length) {
// LogUtil.e(TAG, msg);
// msg = msg.substring(max_str_length);
// }
//剩余部分
// LogUtil.e(TAG, msg);
}
......
......@@ -480,4 +480,6 @@
<dimen name="sp_40">40sp</dimen>
<dimen name="sp_42">42sp</dimen>
<dimen name="sp_48">48sp</dimen>
<!-- 清機報表字體大小 -->
<dimen name="settlement_report_text_size">@dimen/dp_16</dimen>
</resources>
\ No newline at end of file
......@@ -4,13 +4,14 @@ import android.app.Activity;
import android.app.Application;
import android.widget.TextView;
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.time.TimeUtils;
import com.gingersoft.gsa.cloud.table.R;
import com.gingersoft.gsa.cloud.table.mvp.contract.BaseOrderContract;
import com.gingersoft.gsa.cloud.table.mvp.model.bean.BillOrderMoney;
......@@ -27,8 +28,6 @@ import com.jess.arms.utils.RxLifecycleUtils;
import com.qmuiteam.qmui.widget.dialog.QMUIDialog;
import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
......@@ -97,6 +96,13 @@ public class BaseOrderPresenter<M extends BaseOrderContract.Model, V extends Bas
private final String noFoodDeliveryTip = "賬單沒有食品,是否開台?";
void saveCreateTime(long createTime){
if(OpenTableManage.getDefault().getTableBean() == null){
OpenTableManage.getDefault().setTableBean(new TableBean.DataBean());
}
OpenTableManage.getDefault().getTableBean().setCreateTime(TimeUtils.getTime(createTime, TimeUtils.DEFAULT_DATE_FORMAT));
}
@Inject
public BaseOrderPresenter(BaseOrderContract.Model model, BaseOrderContract.View rootView) {
super(model, rootView);
......@@ -250,12 +256,13 @@ public class BaseOrderPresenter<M extends BaseOrderContract.Model, V extends Bas
/**
* 送單
*
* @param isPrint 是否印單
*/
public void sendOrder(boolean isPrint) {
if (MyOrderManage.getInstance().getOrderId() == -1) {
if (getFoodCount() == 0) {
showTip2Dialog(IActivity, noFoodDeliveryTip,isPrint);
showTip2Dialog(IActivity, noFoodDeliveryTip, isPrint);
} else {
if (mMealStandPresenter != null) {
mMealStandPresenter.createOrder();
......@@ -353,6 +360,8 @@ public class BaseOrderPresenter<M extends BaseOrderContract.Model, V extends Bas
if (foodList != null) {
//套餐明細ID
long mapIndex = 0;
//打印用到,清理掉之前保存的食品
MyOrderManage.getInstance().getNewFoodList().clear();
List<OrderBean.OrderDetailsBean> orderItems = null;
for (int i = 0; i < foodList.size(); i++) {
OrderDetail food = foodList.get(i);
......@@ -372,6 +381,8 @@ public class BaseOrderPresenter<M extends BaseOrderContract.Model, V extends Bas
if (food.isNew()) {
//這裡只添加新食品
orderItems.add(request);
//保存新食品,打印用到
MyOrderManage.getInstance().getNewFoodList().add(food);
}
int nextIndex = i + 1;
if (foodList.size() > nextIndex) {
......@@ -531,7 +542,7 @@ public class BaseOrderPresenter<M extends BaseOrderContract.Model, V extends Bas
dialogBuilder.create(R.style.MyDialogTheme2).show();
}
protected void showTip2Dialog(Activity context, String msg,boolean isPrint) {
protected void showTip2Dialog(Activity context, String msg, boolean isPrint) {
QMUIDialog.MessageDialogBuilder dialogBuilder = new QMUIDialog.MessageDialogBuilder(context);
dialogBuilder.setTitle("溫馨提示");
dialogBuilder.setMessage(msg);
......
......@@ -39,7 +39,6 @@ import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction;
import org.simple.eventbus.EventBus;
import org.simple.eventbus.Subscriber;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
......@@ -346,6 +345,8 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
@Override
public void onNext(@NonNull BaseResult info) {
if (info != null && info.isSuccess()) {
saveCreateTime(info.getSysTime());
//創建訂單成功,保存訂單創建時間到開台信息中
if (info.getData() != null) {
setOrderId((Double) info.getData());
}
......@@ -402,13 +403,13 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
}
/**
* 打印上菜紙
* 打印
* @param initTable 是否是開台
*/
private void printSendOrder(boolean initTable) {
CC.obtainBuilder("Component.Print")
.setActionName("printActivity")
.addParam("type", 3)
.addParam("type", 3)//廚房單
.build()
.callAsyncCallbackOnMainThread((cc, result) -> {
// if (result.isSuccess()) {
......
......@@ -2,7 +2,6 @@ package com.gingersoft.gsa.cloud.table.mvp.presenter;
import android.app.Application;
import android.graphics.Color;
import android.util.Log;
import android.view.View;
import com.billy.cc.core.component.CC;
......@@ -125,6 +124,8 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
//有未送單食品先送單
sendOrder(true);
} else {
// 沒有未送單食品,將之前的食品列表清空
MyOrderManage.getInstance().getNewFoodList().clear();
printOrder(OpenTableManage.getDefault().getTableBean().getId(), false);
}
break;
......@@ -159,6 +160,7 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
@Override
public void onNext(@NonNull BaseResult info) {
if (info != null && info.isSuccess()) {
saveCreateTime(info.getSysTime());
if (info.getData() != null) {
setOrderId((Double) info.getData());
}
......@@ -235,11 +237,6 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
.addParam("type", 3)
.build()
.callAsyncCallbackOnMainThread((cc, result) -> {
Log.e("error", "是否成功打印:" + result.isSuccess());
// if (result.isSuccess()) {
// //打印成功
//
// }
mRootView.sendSuccess();
});
......@@ -274,14 +271,28 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
@Override
public void onNext(@NonNull BaseRespose info) {
if (info != null && info.isSuccess()) {
//打印
printOrder();
} else {
mRootView.showMessage("印單失敗!");
if (isSend) {
//印單失敗但提交新食品成功,更新一遍訂單數據
loadOrder(MyOrderManage.getInstance().getOrderId());
}
}
}
});
}
private void printOrder() {
CC.obtainBuilder("Component.Print")
.addParam("type", 1)//印單
.setActionName("printActivity")
.build()
.callAsyncCallbackOnMainThread((cc, result) -> {
Log.e("error", "是否成功打印:" + result.isSuccess());
if (result.isSuccess()) {
//打印成功
//打印成功,接著打印廚房單
mRootView.showMessage("打印成功!");
} else {
mRootView.showMessage("打印失敗!");
......@@ -289,18 +300,7 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
//不管打印是否成功,都需要退出當前頁面
mRootView.printSuccess();
});
//打印
} else {
mRootView.showMessage("印單失敗!");
if (isSend) {
//印單失敗但提交新食品成功,更新一遍訂單數據
loadOrder(MyOrderManage.getInstance().getOrderId());
}
}
}
});
}
public void loadOrder(int orderId) {
mModel.loadOrder(orderId)
......
......@@ -7,16 +7,14 @@ import android.view.View;
import com.chad.library.adapter.base.BaseQuickAdapter;
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.PayMethod;
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.base.utils.MoneyUtil;
import com.gingersoft.gsa.cloud.base.utils.gson.GsonUtils;
import com.gingersoft.gsa.cloud.table.app.payment.PayConstant;
import com.gingersoft.gsa.cloud.table.mvp.contract.OrderPayContract;
import com.gingersoft.gsa.cloud.base.common.bean.PayMethod;
import com.gingersoft.gsa.cloud.table.mvp.model.bean.request.AddOrderRequest;
import com.gingersoft.gsa.cloud.table.mvp.model.bean.request.CreateOrderRequest;
import com.gingersoft.gsa.cloud.table.mvp.ui.activity.OrderPayActivity;
......@@ -230,6 +228,7 @@ public class OrderPayPresenter extends BaseOrderPresenter<OrderPayContract.Model
@Override
public void onNext(@NonNull BaseResult info) {
if (info != null && info.isSuccess()) {
saveCreateTime(info.getSysTime());
if (info.getData() != null) {
setOrderId((Double) info.getData());
}
......
......@@ -2,7 +2,6 @@ package com.gingersoft.gsa.cloud.table.mvp.presenter;
import android.app.Application;
import android.os.CountDownTimer;
import android.util.Log;
import android.view.View;
import com.billy.cc.core.component.CC;
......@@ -12,6 +11,7 @@ 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.time.TimeUtils;
import com.gingersoft.gsa.cloud.database.bean.Function;
import com.gingersoft.gsa.cloud.table.R;
import com.gingersoft.gsa.cloud.table.app.GoldConstants;
......@@ -150,7 +150,6 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
.addParam("type", 0)
.build()
.callAsync((cc, result) -> {
Log.e("error", "是否成功打印:" + result.isSuccess());
if (result.isSuccess()) {
//打印成功
}
......@@ -242,15 +241,15 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
@Override
public void onNext(@NonNull BaseRespose respose) {
if (respose.isSuccess()) {
//設置當前開台數據
//設置當前開台數據1584427984728 1584428017196 1584428086282
TableBean.DataBean openTableBean = getTableById(tableId);
OpenTableManage.getDefault().setTableBean(openTableBean);
OpenTableManage.getDefault().setPeopleNumber(0);
OrderBean orderBean = respose.getData();
if (orderBean != null && respose.getData().getOrderDetails() != null) {
if (respose.getData().getCreateTime() != null && openTableBean != null) {
openTableBean.setCreateTime(TimeUtils.getFormatTime(respose.getData().getCreateTime(), TimeUtils.DEFAULT_DATE_FORMAT));
}
OpenTableManage.getDefault().setPeopleNumber(orderBean.getPerson());
List<OrderBean.OrderDetailsBean> orderDetailsBeans = respose.getData().getOrderDetails();
......@@ -264,7 +263,7 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
MyOrderManage.getInstance().setOrderBean(null);
MyOrderManage.getInstance().setOrderFoodList(new ArrayList<>());
}
OpenTableManage.getDefault().setTableBean(openTableBean);
mRootView.startMealStandActivity();
} else {
mRootView.showMessage(respose.getErrMsg());
......
......@@ -2,49 +2,28 @@ package com.gingersoft.gsa.cloud.table.mvp.ui.activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.TypedValue;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.billy.cc.core.component.CC;
import com.gingersoft.gsa.cloud.base.qmui.arch.QMUIFragment;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.Fragment;
import androidx.viewpager.widget.ViewPager;
import com.gingersoft.gsa.cloud.base.qmui.arch.QMUIFragmentPagerAdapter;
import com.gingersoft.gsa.cloud.table.R;
import com.gingersoft.gsa.cloud.table.R2;
import com.gingersoft.gsa.cloud.table.mvp.ui.adapter.BaseFragmentAdapter;
import com.gingersoft.gsa.cloud.table.di.component.DaggerOrderCenterComponent;
import com.gingersoft.gsa.cloud.table.mvp.contract.OrderCenterContract;
import com.gingersoft.gsa.cloud.table.mvp.presenter.OrderCenterPresenter;
import com.gingersoft.gsa.cloud.table.mvp.ui.fragment.AllOrderFragment;
import com.gingersoft.gsa.cloud.table.mvp.ui.fragment.AllTableFragment;
import com.gingersoft.gsa.cloud.table.mvp.ui.fragment.InputTableFragment;
import com.gingersoft.gsa.cloud.table.mvp.ui.fragment.StateTableFragment;
import com.gingersoft.gsa.cloud.ui.view.PagerSlidingTabStrip;
import com.gingersoft.gsa.cloud.ui.widget.dialog.LoadingDialog;
import com.jess.arms.base.BaseActivity;
import com.jess.arms.di.component.AppComponent;
import com.jess.arms.utils.ArmsUtils;
import com.gingersoft.gsa.cloud.table.di.component.DaggerOrderCenterComponent;
import com.gingersoft.gsa.cloud.table.mvp.contract.OrderCenterContract;
import com.gingersoft.gsa.cloud.table.mvp.presenter.OrderCenterPresenter;
import com.gingersoft.gsa.cloud.table.R;
import com.qmuiteam.qmui.alpha.QMUIAlphaImageButton;
import com.qmuiteam.qmui.widget.QMUITopBar;
import com.qmuiteam.qmui.widget.QMUIViewPager;
import com.qmuiteam.qmui.widget.tab.QMUITabBuilder;
import com.qmuiteam.qmui.widget.tab.QMUITabSegment;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.viewpager.widget.PagerAdapter;
import androidx.viewpager.widget.ViewPager;
import butterknife.BindView;
import static com.jess.arms.utils.Preconditions.checkNotNull;
......
......@@ -6,7 +6,6 @@ import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
......@@ -513,11 +512,6 @@ public class OrderPayActivity extends BaseActivity<OrderPayPresenter> implements
.addParam("type", 2)
.build()
.callAsyncCallbackOnMainThread((cc, result) -> {
Log.e("error", "是否成功打印:" + result.isSuccess());
// if (result.isSuccess()) {
// //打印成功
//
// }
setResult(Activity.RESULT_OK, null);
killMyself();
});
......
......@@ -18,7 +18,7 @@
android:layout_alignParentTop="true"
android:text="Button"
android:textColor="@color/theme_white_color"
android:textSize="38sp" />
android:textSize="@dimen/dp_38" />
<Button
android:id="@+id/btn_showMain"
......@@ -31,7 +31,7 @@
android:layout_marginLeft="0dp"
android:layout_marginTop="0dp"
android:text="Button"
android:textSize="16sp"
android:textSize="@dimen/dp_16"
android:visibility="gone" />
</RelativeLayout>
......
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/theme_white_color"
android:clipChildren="true"
android:fillViewport="true"
android:orientation="vertical">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/login_title"
android:layout_width="wrap_content"
......@@ -197,6 +202,6 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
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