This commit is contained in:
limqhz
2020-08-30 17:31:45 +08:00
parent 6290b0e417
commit 52708eeb48
5 changed files with 18 additions and 9 deletions

View File

@@ -22,6 +22,13 @@ android {
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
product {

View File

@@ -58,7 +58,7 @@ public class MainActivity extends SDBaseActivity {
@BindView(R.id.qr_code_pb_cover)
ContentLoadingProgressBar qrCodePbCover;
private String current_date;
private String current_date = TimeUtil.getCurrentDate();
private EggClickUtil eggClickUtil;
private SDErrorDialog errorDialog;
@@ -77,7 +77,7 @@ public class MainActivity extends SDBaseActivity {
// 应该是原来的保持屏幕常亮的代码
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
order_view.setWebViewClient(new WebViewClient());
current_date = TimeUtil.getCurrentDate();
// current_date = TimeUtil.getCurrentDate();
refreshWebView();
// 启动Service
Intent socketService = new Intent(this, ClientService.class);
@@ -163,12 +163,12 @@ public class MainActivity extends SDBaseActivity {
break;
case R.id.btn_last_day:
current_date = TimeUtil.getSpecifiedDayAfter(current_date,1);
current_date = TimeUtil.getSpecifiedDayAfter(current_date,-1);
refreshWebView();
break;
case R.id.btn_next_day:
current_date = TimeUtil.getSpecifiedDayAfter(current_date,-1);
current_date = TimeUtil.getSpecifiedDayAfter(current_date,1);
refreshWebView();
break;

View File

@@ -73,7 +73,10 @@ public class ClientHandler extends SimpleChannelInboundHandler<String> {
if (IdleStateEvent.class.isAssignableFrom(evt.getClass())) {
IdleStateEvent event = (IdleStateEvent) evt;
if (event.state() == IdleState.ALL_IDLE) {
ctx.writeAndFlush(getHbMessage());
Integer venueId = SDAppConfig.getInstance().getVenueId();
if (venueId != null && 0 != venueId){
ctx.writeAndFlush(getHbMessage());
}
}
}
}

View File

@@ -162,7 +162,7 @@ public class SDSettingActivity extends SDBaseActivity {
});
Integer venueId = SDAppConfig.getInstance().getVenueId();
String deviceType = SDAppConfig.getInstance().getDeviceType();
if (venueId!=null){
if (venueId != null && 0 != venueId){
int position = 0;
for (VenueItem venueItem : resultList){
if (venueId.equals(venueItem.getVenueId())){

View File

@@ -17,7 +17,7 @@ public class TimeUtil {
static final private SimpleDateFormat sFormat = new SimpleDateFormat("yyMMddHHmmssSSS");
static final private SimpleDateFormat sLogFormat = new SimpleDateFormat("MM-dd HH:mm:ss.SSS");
static final private SimpleDateFormat initOrderFormat = new SimpleDateFormat("YYYY-MM-dd");
static final private SimpleDateFormat initOrderFormat = new SimpleDateFormat("yyyy-MM-dd");
static public String getNowTimeStr() {
return sFormat.format(new Date());
@@ -46,8 +46,7 @@ public class TimeUtil {
}
Calendar c = Calendar.getInstance();
c.setTime(specifiedDate);
int day = c.get(Calendar.DATE);
c.set(Calendar.DATE, day + num);
c.add(Calendar.DATE, num);
String dayAfter = initOrderFormat.format(c.getTime());
return dayAfter;
}