Commit b39e100a authored by 陳煦元's avatar 陳煦元

V3.0.6

- [x]  開機第一張單會卡(優先度高),沒抓到GPS,先給假的有連到網在給真的(預設`23.28453`,`120.26546`)
- [x]  有兩張單單號一樣,但資料不同(優先度高) (使用清冊時可以更改資料 文字檔會變成更改後的樣子)(鎖清冊修改)
parent d440a51b
...@@ -348,7 +348,6 @@ public class Case { ...@@ -348,7 +348,6 @@ public class Case {
printer = null; printer = null;
//printer = new CarPrinter_PK105B();//汽車用PK105B型印表機版面 //printer = new CarPrinter_PK105B();//汽車用PK105B型印表機版面
} }
return printer; return printer;
} }
......
...@@ -168,8 +168,6 @@ public class T02StartActivity extends AppCompatActivity { ...@@ -168,8 +168,6 @@ public class T02StartActivity extends AppCompatActivity {
// 搜尋監聽藍芽裝置 // 搜尋監聽藍芽裝置
hasPermissions.setValue(false); hasPermissions.setValue(false);
initBlueTooth(); initBlueTooth();
} }
@Override @Override
protected void onResume() { protected void onResume() {
...@@ -517,7 +515,6 @@ public class T02StartActivity extends AppCompatActivity { ...@@ -517,7 +515,6 @@ public class T02StartActivity extends AppCompatActivity {
if (!dataBinding.btnPageDown.isEnabled()) if (!dataBinding.btnPageDown.isEnabled())
dataBinding.btnPageDown.setEnabled(true); dataBinding.btnPageDown.setEnabled(true);
} }
}); });
fusedGpsViewModel.getLocation().observe(this, location -> { fusedGpsViewModel.getLocation().observe(this, location -> {
...@@ -528,7 +525,7 @@ public class T02StartActivity extends AppCompatActivity { ...@@ -528,7 +525,7 @@ public class T02StartActivity extends AppCompatActivity {
fusedGpsViewModel.getLastUpdateTime().observe(this, date -> { fusedGpsViewModel.getLastUpdateTime().observe(this, date -> {
if (t02StartViewModel.getCurrentCase().getValue() != null && t02StartViewModel.getCurrentCase().getValue().caseStatus == CaseStatus.NEW) { if (t02StartViewModel.getCurrentCase().getValue() != null && t02StartViewModel.getCurrentCase().getValue().caseStatus == CaseStatus.NEW) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); @SuppressLint("SimpleDateFormat") SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
dataBinding.lastUpdateTimeText.setText(getString(R.string.last_location_time_textView, simpleDateFormat.format(date))); dataBinding.lastUpdateTimeText.setText(getString(R.string.last_location_time_textView, simpleDateFormat.format(date)));
} }
...@@ -560,9 +557,7 @@ public class T02StartActivity extends AppCompatActivity { ...@@ -560,9 +557,7 @@ public class T02StartActivity extends AppCompatActivity {
Toast.makeText(this, "即將有可以加時的案件", Toast.LENGTH_LONG).show(); Toast.makeText(this, "即將有可以加時的案件", Toast.LENGTH_LONG).show();
} }
}); });
} }
private void btnParkingSpaceOnClicked() { private void btnParkingSpaceOnClicked() {
Intent intent = new Intent(); Intent intent = new Intent();
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
...@@ -593,7 +588,6 @@ public class T02StartActivity extends AppCompatActivity { ...@@ -593,7 +588,6 @@ public class T02StartActivity extends AppCompatActivity {
builder.setNegativeButton("取消", (dialogInterface, i) -> { builder.setNegativeButton("取消", (dialogInterface, i) -> {
dialogInterface.dismiss(); dialogInterface.dismiss();
}); });
builder.create().show(); builder.create().show();
} }
...@@ -621,12 +615,10 @@ public class T02StartActivity extends AppCompatActivity { ...@@ -621,12 +615,10 @@ public class T02StartActivity extends AppCompatActivity {
if (currentCase == null) { if (currentCase == null) {
return; return;
} }
Intent takePhotoIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); Intent takePhotoIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
takePhotoIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); takePhotoIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
// 檢查是否已取得權限 // 檢查是否已取得權限
if (takePhotoIntent.resolveActivity(getPackageManager()) == null) return; if (takePhotoIntent.resolveActivity(getPackageManager()) == null) return;
String day = new SimpleDateFormat("yyyyMMdd").format(new Date()); String day = new SimpleDateFormat("yyyyMMdd").format(new Date());
String path = Environment.getExternalStorageDirectory() + getString(R.string.sysDataPhoto_path) + day; String path = Environment.getExternalStorageDirectory() + getString(R.string.sysDataPhoto_path) + day;
...@@ -919,8 +911,10 @@ public class T02StartActivity extends AppCompatActivity { ...@@ -919,8 +911,10 @@ public class T02StartActivity extends AppCompatActivity {
} }
private void btnInventoryOnClicked() {//清冊按鈕 private void btnInventoryOnClicked() {//清冊按鈕
opentakephoto(); closedatachange();
dataBinding.btnAddPhoto.setEnabled(false);//關閉添加照片
dataBinding.btnCancelbill.setEnabled(true); dataBinding.btnCancelbill.setEnabled(true);
dataBinding.btnPrint.setEnabled(true);//列印
Intent intent = new Intent(); Intent intent = new Intent();
intent.setClass(this, T03ListFilesActivity.class); intent.setClass(this, T03ListFilesActivity.class);
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
......
...@@ -29,6 +29,12 @@ import java.util.concurrent.ThreadPoolExecutor; ...@@ -29,6 +29,12 @@ import java.util.concurrent.ThreadPoolExecutor;
import ecom.android.newparkapp.R; import ecom.android.newparkapp.R;
public class FusedGpsViewModel extends AndroidViewModel { public class FusedGpsViewModel extends AndroidViewModel {
private static final Location DEFAULT_LOCATION;
static {
DEFAULT_LOCATION = new Location("");
DEFAULT_LOCATION.setLatitude(23.28453);
DEFAULT_LOCATION.setLongitude(120.26546);
}
private long UPDATE_INTERVAL_IN_MILLISECONDS = 100; private long UPDATE_INTERVAL_IN_MILLISECONDS = 100;
private long FASTEST_UPDATE_INTERVAL_IN_MILLISECONDS = 50; private long FASTEST_UPDATE_INTERVAL_IN_MILLISECONDS = 50;
...@@ -72,6 +78,10 @@ public class FusedGpsViewModel extends AndroidViewModel { ...@@ -72,6 +78,10 @@ public class FusedGpsViewModel extends AndroidViewModel {
if (lastLocation != null){ if (lastLocation != null){
location.postValue(lastLocation); location.postValue(lastLocation);
} }
else
{
location.postValue(DEFAULT_LOCATION);//1130711預設經緯度位置為嘉義市交通局
}
}); });
fusedLocationProviderClient.requestLocationUpdates(locationRequest, executorService, locationCallback); fusedLocationProviderClient.requestLocationUpdates(locationRequest, executorService, locationCallback);
......
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