Commit e2b59b69 authored by YONG-LIN SU's avatar YONG-LIN SU

新增巡場管理頁面

parent 90dd3290
......@@ -12,6 +12,6 @@
</deviceKey>
</Target>
</runningDeviceTargetSelectedWithDropDown>
<timeTargetWasSelectedWithDropDown value="2022-08-19T08:00:42.164342600Z" />
<timeTargetWasSelectedWithDropDown value="2022-08-22T03:51:15.557672Z" />
</component>
</project>
\ No newline at end of file
......@@ -34,6 +34,8 @@
<entry key="..\:/Users/pp931/Desktop/RD/Projects/NewParkApp/app/src/main/res/layout/activity_t03_list_files.xml" value="0.34375" />
<entry key="..\:/Users/pp931/Desktop/RD/Projects/NewParkApp/app/src/main/res/layout/activity_t03_searching_parking_space.xml" value="0.34375" />
<entry key="..\:/Users/pp931/Desktop/RD/Projects/NewParkApp/app/src/main/res/layout/activity_t03_total.xml" value="0.34375" />
<entry key="..\:/Users/pp931/Desktop/RD/Projects/NewParkApp/app/src/main/res/layout/activity_t04_renew_list.xml" value="0.34375" />
<entry key="..\:/Users/pp931/Desktop/RD/Projects/NewParkApp/app/src/main/res/layout/activity_test_renew_list.xml" value="0.34375" />
<entry key="..\:/Users/pp931/Desktop/RD/Projects/NewParkApp/app/src/main/res/layout/alert_dialog_progress_bar.xml" value="0.29957264957264956" />
<entry key="..\:/Users/pp931/Desktop/RD/Projects/NewParkApp/app/src/main/res/layout/alert_dialog_t02_device_list.xml" value="0.34375" />
<entry key="..\:/Users/pp931/Desktop/RD/Projects/NewParkApp/app/src/main/res/layout/alert_dialog_t03_cumulative_time.xml" value="0.34375" />
......@@ -42,13 +44,16 @@
<entry key="..\:/Users/pp931/Desktop/RD/Projects/NewParkApp/app/src/main/res/layout/card_view_list_files_item.xml" value="0.34375" />
<entry key="..\:/Users/pp931/Desktop/RD/Projects/NewParkApp/app/src/main/res/layout/content_t02_select_road.xml" value="0.1875" />
<entry key="..\:/Users/pp931/Desktop/RD/Projects/NewParkApp/app/src/main/res/layout/list_view_device_name_item.xml" value="0.34375" />
<entry key="..\:/Users/pp931/Desktop/RD/Projects/NewParkApp/app/src/main/res/layout/recycle_item.xml" value="0.34375" />
<entry key="..\:/Users/pp931/Desktop/RD/Projects/NewParkApp/app/src/main/res/layout/recycler_view_bulletin_board_item.xml" value="0.34375" />
<entry key="..\:/Users/pp931/Desktop/RD/Projects/NewParkApp/app/src/main/res/layout/recycler_view_db_table_item.xml" value="0.33" />
<entry key="..\:/Users/pp931/Desktop/RD/Projects/NewParkApp/app/src/main/res/layout/recycler_view_item.xml" value="0.34375" />
<entry key="..\:/Users/pp931/Desktop/RD/Projects/NewParkApp/app/src/main/res/layout/recycler_view_list_files_item.xml" value="0.34375" />
<entry key="..\:/Users/pp931/Desktop/RD/Projects/NewParkApp/app/src/main/res/layout/recycler_view_renew_item.xml" value="0.34375" />
<entry key="..\:/Users/pp931/Desktop/RD/Projects/NewParkApp/app/src/main/res/layout/recycler_view_road_item.xml" value="0.34375" />
<entry key="..\:/Users/pp931/Desktop/RD/Projects/NewParkApp/app/src/main/res/layout/recycler_view_space_item.xml" value="0.24954710144927536" />
<entry key="..\:/Users/pp931/Desktop/RD/Projects/NewParkApp/app/src/main/res/layout/recycler_view_vehicle_type_item.xml" value="0.34375" />
<entry key="..\:/Users/pp931/Desktop/RD/Projects/NewParkApp/app/src/main/res/menu/bottom_nav_menu.xml" value="0.36614583333333334" />
<entry key="..\:/Users/pp931/Desktop/RD/Projects/NewParkApp/app/src/main/res/mipmap-anydpi-v26/ic_icon_launcher.xml" value="0.2985" />
<entry key="..\:/Users/pp931/Desktop/RD/Projects/NewParkApp/app/src/main/res/mipmap-anydpi-v26/ic_icon_launcher_round.xml" value="0.2985" />
<entry key="..\:/Users/pp931/Desktop/RD/Projects/NewParkApp/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml" value="0.2985" />
......
......@@ -73,6 +73,7 @@ dependencies {
implementation 'com.squareup.retrofit2:retrofit:2.8.1'
implementation 'com.squareup.retrofit2:converter-gson:2.8.1'
implementation 'com.squareup.okhttp3:logging-interceptor:3.9.0'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
......
......@@ -100,6 +100,15 @@
android:label="案件搜尋"
android:theme="@style/Theme.AppCompat.Light"
/>
<activity
android:name=".view.T04RenewListActivity"
android:exported="false"
android:label="GPS巡場模式"
android:theme="@style/Theme.AppCompat.Light"
/>
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="ecom.android.newparkapp.fileprovider"
......
......@@ -12,6 +12,7 @@ import androidx.databinding.BindingAdapter;
import java.text.SimpleDateFormat;
import java.util.Date;
import ecom.android.newparkapp.R;
import ecom.android.newparkapp.entity.Case;
import ecom.android.newparkapp.entity.CaseStatus;
import ecom.android.newparkapp.viewModel.BlueToothViewModel;
......
package ecom.android.newparkapp.adapter;
import android.content.Context;
import android.content.Intent;
import android.content.res.ColorStateList;
import android.graphics.Color;
import android.location.Location;
import android.net.Uri;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.LiveData;
import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.RecyclerView;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import ecom.android.newparkapp.databinding.RecycleViewRenewListItemBinding;
import ecom.android.newparkapp.entity.Case;
public class ReNewListAdapter extends RecyclerView.Adapter<ReNewListAdapter.ReNewListViewHolder> {
private RecyclerView.RecycledViewPool recycledViewPool = new RecyclerView.RecycledViewPool();
private Map<String, List<Case>> caseMap;
private List<String> keys = new ArrayList<>();
private LiveData<Location> currentLocation;
public ReNewListAdapter(Map<String, List<Case>> caseMap, LiveData<Location> location){
this.caseMap = caseMap;
this.keys = new ArrayList<>(caseMap.keySet());
this.currentLocation = location;
}
@NonNull
@Override
public ReNewListViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
RecycleViewRenewListItemBinding recycleViewRenewListItemBinding = RecycleViewRenewListItemBinding.inflate(LayoutInflater.from(parent.getContext()),parent,false);
return new ReNewListViewHolder(recycleViewRenewListItemBinding, currentLocation);
}
@Override
public void onBindViewHolder(@NonNull ReNewListViewHolder holder, int position) {
String key = keys.get(position);
if (caseMap.containsKey(key)){
holder.setBinding(key,caseMap.get(key), recycledViewPool);
}
}
@Override
public int getItemCount() {
return keys.size();
}
static class ReNewListViewHolder extends RecyclerView.ViewHolder {
private RecycleViewRenewListItemBinding dataBinding;
private Context context;
private boolean isExpanded = false;
private LiveData<Location> currentLocation;
private List<Case> caseList = new ArrayList<>();
ReNewListViewHolder(RecycleViewRenewListItemBinding dataBinding, LiveData<Location> currentLocation){
super(dataBinding.getRoot());
this.dataBinding = dataBinding;
this.context = dataBinding.getRoot().getContext();
this.currentLocation = currentLocation;
currentLocation.observe((LifecycleOwner) context, location -> {
if (caseList.size() == 0){
return;
}
// 車格距離排序
caseList.sort((t1, t2) -> Float.compare(t1.space.getDistance(location),t2.space.getDistance(location)));
// 更新距離
dataBinding.spaceDistanceTxt.setText(String.format("距離此處 %f m",caseList.get(0).space.getDistance(location)));
});
}
void setBinding(String road, List<Case> cases,RecyclerView.RecycledViewPool recycledViewPool){
this.caseList = cases;
ReNewNestedAdapter reNewNestedAdapter = new ReNewNestedAdapter();
reNewNestedAdapter.submitList(caseList);
dataBinding.renewListRecyclerView.setAdapter(reNewNestedAdapter);
dataBinding.renewListRecyclerView.setRecycledViewPool(recycledViewPool);
dataBinding.renewListRecyclerView.addItemDecoration(new DividerItemDecoration(context, DividerItemDecoration.VERTICAL));
dataBinding.renewListRecyclerView.setVisibility(isExpanded ? View.VISIBLE : View.GONE);
int totalSpacesNum = caseList.size();
int renewSpacesNum= getReNewSpaceNum(caseList);
String carNumString = String.format("%d/%d",renewSpacesNum,totalSpacesNum);
dataBinding.carNumTxt.setText(carNumString);
float percentageReNewCount = renewSpacesNum/totalSpacesNum;
int progressTintColor = Color.GREEN;
if (percentageReNewCount>=0.7)
progressTintColor = Color.RED;
else if (percentageReNewCount>=0.3)
progressTintColor = Color.YELLOW;
dataBinding.renewCountPgb.setProgressTintList(ColorStateList.valueOf(progressTintColor));
dataBinding.renewCountPgb.setProgress((int)(percentageReNewCount * 100));
dataBinding.parkInfoTxt.setText(road);
dataBinding.getRoot().setOnClickListener(view -> {
isExpanded = !isExpanded;
dataBinding.renewListRecyclerView.setVisibility(isExpanded ? View.VISIBLE : View.GONE);
});
// 排序當前任務座標,透過開啟google map導航
dataBinding.btnOpenNavigation.setOnClickListener(view -> {
// Create a Uri from an intent string. Use the result to create an Intent.
String gmmIntentUriString = "google.navigation:q=";
// 最遠的為目的
gmmIntentUriString+= caseList.get(caseList.size() - 1).space.getLocationString();
for (int i = 0; i < caseList.size() - 1; i++){
if (i == 0){
gmmIntentUriString+="&waypoints=";
}else {
gmmIntentUriString+="|";
}
gmmIntentUriString+= caseList.get(i).space.getLocationString();
}
//gmmIntentUriString+="23.4799691,120.448693";
//gmmIntentUriString+="&waypoints=24.1430503,120.7234986";
//gmmIntentUriString+="|24.141538, 120.683667";
gmmIntentUriString+="&avoid=thf"; // t for tolls, h for highways, f for ferries
gmmIntentUriString+="&mode=l"; // d for driving (default), b for bicycling, l for two-wheeler, w for walking
Uri gmmIntentUri = Uri.parse(gmmIntentUriString);
// Create an Intent from gmmIntentUri. Set the action to ACTION_VIEW
Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);
// Make the Intent explicit by setting the Google Maps package
mapIntent.setPackage("com.google.android.apps.maps");
// Attempt to start an activity that can handle the Intent
context.startActivity(mapIntent);
});
}
private int getReNewSpaceNum(List<Case> caseList){
int num = 0;
for (Case c:caseList) {
int mins = c.getNextAddMinsAway();
if (mins < 10){
num++;
}
}
return num;
}
}
}
package ecom.android.newparkapp.adapter;
import android.graphics.Color;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.DiffUtil;
import androidx.recyclerview.widget.ListAdapter;
import androidx.recyclerview.widget.RecyclerView;
import ecom.android.newparkapp.R;
import ecom.android.newparkapp.databinding.RecyclerViewRenewItemBinding;
import ecom.android.newparkapp.entity.Case;
public class ReNewNestedAdapter extends ListAdapter<Case, ReNewNestedAdapter.ReNewNestedViewHolder> {
public ReNewNestedAdapter(){
super(caseItemCallback);
}
@NonNull
@Override
public ReNewNestedViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
RecyclerViewRenewItemBinding recyclerViewRenewItemBinding = RecyclerViewRenewItemBinding.inflate(LayoutInflater.from(parent.getContext()),parent,false);
return new ReNewNestedViewHolder(recyclerViewRenewItemBinding);
}
@Override
public void onBindViewHolder(@NonNull ReNewNestedViewHolder holder, int position) {
holder.setBinding(getItem(position));
}
public static final DiffUtil.ItemCallback<Case> caseItemCallback = new DiffUtil.ItemCallback<Case>() {
@Override
public boolean areItemsTheSame(@NonNull Case oldItem, @NonNull Case newItem) {
return oldItem.billingNumber2.equals(newItem.billingNumber2);
}
@Override
public boolean areContentsTheSame(@NonNull Case oldItem, @NonNull Case newItem) {
return false;
}
};
static class ReNewNestedViewHolder extends RecyclerView.ViewHolder {
private RecyclerViewRenewItemBinding dataBinding;
ReNewNestedViewHolder(RecyclerViewRenewItemBinding dataBinding){
super(dataBinding.getRoot());
this.dataBinding = dataBinding;
}
void setBinding(Case thisCase){
int nextAddMinsAway = thisCase.getNextAddMinsAway();
int parkPeriodColor = Color.BLACK;
if (nextAddMinsAway < 10)
parkPeriodColor = Color.RED;
dataBinding.Plate.setText(thisCase.plateNumber);
dataBinding.Space.setText(thisCase.space.id);
dataBinding.parkPeriod.setText(String.format("%d分鐘",nextAddMinsAway));
dataBinding.parkPeriod.setTextColor(parkPeriodColor);
dataBinding.renewItemIcon.setBackgroundResource(R.drawable.icon);
}
}
}
......@@ -16,6 +16,7 @@ import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
import ecom.android.newparkapp.Common;
import ecom.android.newparkapp.printer.CarPrinter_TPB250;
......@@ -300,4 +301,26 @@ public class Case {
return printer;
}
/**
* @return 距離下一個 加時時間剩餘多少分鐘
*/
public int getNextAddMinsAway(){
int addMins = 0;
Calendar nowCalendar = Calendar.getInstance();
nowCalendar.set(Calendar.SECOND, 0);
Calendar nextCalendar = Calendar.getInstance();
nextCalendar.setTime(this.caseTime);
nextCalendar.set(Calendar.SECOND, 0);
nextCalendar.add(Calendar.MINUTE, (int)(this.periodHour * 60));
long diff = nextCalendar.getTime().getTime() - nowCalendar.getTime().getTime();
long minutes = TimeUnit.MILLISECONDS.toMinutes(diff);
addMins = (int) minutes;
return addMins;
}
}
package ecom.android.newparkapp.entity;
import java.util.List;
public class RenewInfoData {
public final int road_distance;
private String road; // 路段名稱
private int total_spaces_num; // 該路段車格總數
private List<RenewSpaceData> Renew_Space_Datas; // 有開單過的車格列表
public RenewInfoData (String _road,int _total_space_num,List<RenewSpaceData> _Renew_Space_Datas,int road_distance){
this.road=_road;
this.total_spaces_num=_total_space_num;
this.Renew_Space_Datas=_Renew_Space_Datas;
this.road_distance = road_distance;
}
public String getRoad() {
return road;
}
public int get_total_spaces_num() {
return total_spaces_num;
}
public int getRenewSpacesNum(){
int renewNum=0;
for (RenewSpaceData renew_data: Renew_Space_Datas
) {
if (renew_data.park_period < 10)
renewNum++;
}
return renewNum;
}
public List<RenewSpaceData> getRenew_Space_Datas(){
return Renew_Space_Datas;
}
public static class RenewSpaceData{
private String space; // 車格編號
private String plate; // 車牌號碼
private int park_period; // 距離下次加時,還剩多少分鐘,負數為已經超時了
public RenewSpaceData(String _spaces,String _plate,int _park_period){
this.space=_spaces;
this.plate=_plate;
this.park_period=_park_period;
}
public String getRenewSpace() {
return space;
}
public String getRenewPlate() {
return plate;
}
public int getRenewPeriod() {
return park_period;
}
}
}
package ecom.android.newparkapp.entity;
import android.location.Location;
import android.os.Parcel;
import android.os.Parcelable;
......@@ -104,5 +105,19 @@ public class Space implements Parcelable {
public int getAddMinutes() {
return (int)(60 * this.spaceRate.perHours);
}
public float getDistance(Location myLocation){
if (myLocation == null){
return -1;
}
float[] results = new float[1];
Location.distanceBetween(myLocation.getLatitude(),myLocation.getLongitude(),latitude, longitude, results);
return results[0];
}
public String getLocationString(){
return this.latitude+","+this.longitude;
}
}
......@@ -82,6 +82,7 @@ public class T02StartActivity extends AppCompatActivity {
private ActivityResultLauncher requestMultiplePermissions;
private ActivityResultLauncher requestBluetooth;
private ActivityResultLauncher searchingParkingSpaceActivityResultLauncher;
private ActivityResultLauncher gpsSearchModeActivityResultLauncher;
private User currentUser;
private Shift shift;
......@@ -155,6 +156,7 @@ public class T02StartActivity extends AppCompatActivity {
dataBinding.btnInventory.setOnClickListener(v -> btnInventoryOnClicked());
dataBinding.btnMonthlyReport.setOnClickListener(v -> btnMonthlyReportOnClicked());
dataBinding.btnPrint.setOnClickListener(v -> btnPrintOnClicked());
dataBinding.btnGpsSearchMode.setOnClickListener(v -> btnGpsSearchModeOnClicked());
// 搜尋是否有相關車格資料
dataBinding.btnParkingSpace.setOnClickListener(v -> btnParkingSpaceOnClicked());
......@@ -291,6 +293,12 @@ public class T02StartActivity extends AppCompatActivity {
autoNext(t01SettingViewModel.getAutoNext(), Stage.SPACE);
}
});
gpsSearchModeActivityResultLauncher = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), result -> {
if (result.getResultCode() == RESULT_OK){
}
});
}
private void observeBinding() {
......@@ -807,6 +815,18 @@ public class T02StartActivity extends AppCompatActivity {
}
}
private void btnGpsSearchModeOnClicked(){
Intent intent = new Intent();
intent.setClass(this, T04RenewListActivity.class);
Bundle bundle = new Bundle();
bundle.putInt("UserId", currentUser.id);
bundle.putParcelable("Shift", shift);
intent.putExtras(bundle);
gpsSearchModeActivityResultLauncher.launch(intent);
}
enum Stage{
TAKE_PHOTO,
SPACE,
......
package ecom.android.newparkapp.view;
import android.os.Bundle;
import android.view.MenuItem;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;
import androidx.lifecycle.ViewModelProvider;
import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.LinearLayoutManager;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.stream.Collectors;
import ecom.android.newparkapp.R;
import ecom.android.newparkapp.adapter.ReNewListAdapter;
import ecom.android.newparkapp.databinding.ActivityT04RenewListBinding;
import ecom.android.newparkapp.entity.Case;
import ecom.android.newparkapp.entity.RenewInfoData;
import ecom.android.newparkapp.entity.Shift;
import ecom.android.newparkapp.repository.InfoRepository;
import ecom.android.newparkapp.viewModel.FusedGpsViewModel;
public class T04RenewListActivity extends AppCompatActivity {
private ArrayList<RenewInfoData> arrayList = new ArrayList<RenewInfoData>();
private ActivityT04RenewListBinding dataBinding;
private InfoRepository infoRepository;
private int userId;
private Shift shift;
private List<Case> cases;
private ReNewListAdapter reNewListAdapter;
private Map<String, List<Case>> pureCasesGroupByRoad = new HashMap<>();
private FusedGpsViewModel fusedGpsViewModel;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
dataBinding = DataBindingUtil.setContentView(this, R.layout.activity_t04_renew_list);
fusedGpsViewModel = new ViewModelProvider(this).get(FusedGpsViewModel.class);
// 顯示上一頁按鈕
ActionBar actionBar = getSupportActionBar();
if (actionBar != null){
actionBar.setDisplayHomeAsUpEnabled(true);
}
// 取得資料
Bundle bundle = getIntent().getExtras();
userId = bundle.getInt("UserId");
shift = bundle.getParcelable("Shift");
infoRepository = new InfoRepository(this.getApplication());
updateData();
//設置RecycleView
dataBinding.recyclelist.setLayoutManager(new LinearLayoutManager(this));
dataBinding.recyclelist.addItemDecoration(new DividerItemDecoration(this, DividerItemDecoration.VERTICAL));
reNewListAdapter = new ReNewListAdapter(pureCasesGroupByRoad, fusedGpsViewModel.getLocation());
dataBinding.recyclelist.setAdapter(reNewListAdapter);
//下拉刷新
dataBinding.refreshLayout.setColorSchemeColors(getResources().getColor(R.color.blue));
dataBinding.refreshLayout.setOnRefreshListener(()->{
pureCasesGroupByRoad.clear();
updateData();
reNewListAdapter.notifyDataSetChanged();
dataBinding.refreshLayout.setRefreshing(false);
});
}//onCreate
/**
* 複寫上一頁按鈕事件
*/
@Override
public boolean onOptionsItemSelected(MenuItem item){
switch (item.getItemId()) {
case android.R.id.home:
finish();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
private void updateData(){
cases = infoRepository.caseDao.getAllByShiftAndUser(shift, userId);
Map<String, List<Case>> casesGroupByRoad = cases.stream().collect(Collectors.groupingBy(c->c.space.road.getCombineInfo()));
for (Map.Entry<String, List<Case>> entry: casesGroupByRoad.entrySet()){
String road = entry.getKey();
List<Case> roadCases = entry.getValue();
List<String> existSpaceId = new ArrayList<>();
// 依照開單時間排序
Collections.sort(roadCases, (t1, t2) -> t1.caseTime.compareTo(t2.caseTime));
Collections.reverse(roadCases);
List<Case> pureRoadCases = new ArrayList<>();
for (int i = 0; i < roadCases.size(); i++){
Case selectedCase = roadCases.get(i);
// 已過期 重複單號過濾
if (existSpaceId.contains(selectedCase.space.id)){
continue;
}
pureRoadCases.add(selectedCase);
existSpaceId.add(selectedCase.space.id);
}
if (pureRoadCases.size() != 0){
pureCasesGroupByRoad.put(road, pureRoadCases);
}
}
}
}
\ No newline at end of file
......@@ -67,7 +67,16 @@ public class FusedGpsViewModel extends AndroidViewModel {
// for ActivityCompat#requestPermissions for more details.
return ;
}
// 手動讀取
fusedLocationProviderClient.getLastLocation().addOnSuccessListener(executorService, lastLocation -> {
if (lastLocation != null){
location.postValue(lastLocation);
}
});
fusedLocationProviderClient.requestLocationUpdates(locationRequest, executorService, locationCallback);
}
public LiveData<Location> getLocation(){
......
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:autoMirrored="true"
android:tint="#FFFFFF"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M3,18h6v-2L3,16v2zM3,6v2h18L21,6L3,6zM3,13h12v-2L3,11v2z" />
</vector>
......@@ -40,10 +40,9 @@
android:textSize="26sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.825"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.273" />
app:layout_constraintVertical_bias="0.223" />
<Button
android:id="@+id/btn_start_afternoon"
......@@ -59,10 +58,10 @@
android:textSize="26sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.4"
app:layout_constraintHorizontal_bias="0.6"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.463" />
app:layout_constraintVertical_bias="0.415" />
<Button
android:id="@+id/btn_go_setting"
......@@ -86,10 +85,10 @@
android:textSize="30sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.4"
app:layout_constraintHorizontal_bias="0.6"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.623" />
app:layout_constraintVertical_bias="0.634" />
<Button
android:id="@+id/btn_exit_app"
......
......@@ -552,6 +552,20 @@ tools:layout_editor_absoluteY="25dp">
android:textSize="28sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<Button
android:id="@+id/btn_gps_search_mode"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="巡場模式"
android:textSize="28sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/linearLayout13"
android:layout_width="match_parent"
......@@ -575,25 +589,25 @@ tools:layout_editor_absoluteY="25dp">
android:id="@+id/pay_state_text"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textSize="21sp"
android:layout_weight="1"
android:text="@{`自動扣款: ` + (t02StartViewModel.currentCase.autoPay ? `是`:`否`)}" />
android:text="@{`自動扣款: ` + (t02StartViewModel.currentCase.autoPay ? `是`:`否`)}"
android:textSize="21sp" />
<TextView
android:id="@+id/latitude_text"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textSize="21sp"
android:layout_weight="1"
android:text="@{`經緯度:` + t02StartViewModel.currentCase.location.latitude + `,` + t02StartViewModel.currentCase.location.longitude}" />
android:text="@{`經緯度:` + t02StartViewModel.currentCase.location.latitude + `,` + t02StartViewModel.currentCase.location.longitude}"
android:textSize="21sp" />
<TextView
android:id="@+id/last_update_time_text"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textSize="21sp"
android:layout_weight="1"
android:text="@string/last_location_time_textView" />
android:text="@string/last_location_time_textView"
android:textSize="21sp" />
</LinearLayout>
<!-- Printer
<Button
......
<?xml version="1.0" encoding="utf-8"?>
<layout>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".view.T04RenewListActivity">
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/nav_view"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@color/gray_deep"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:menu="@menu/bottom_nav_menu" />
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/refreshLayout"
>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclelist"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout>
<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="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_margin="10dp"
android:background="#ECEBEB"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="#80000000">
<ProgressBar
android:id="@+id/renew_count_pgb"
style="@android:style/Widget.ProgressBar.Horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<TextView
android:id="@+id/park_info_txt"
android:layout_width="375dp"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentEnd="true"
android:layout_marginStart="17dp"
android:layout_marginEnd="1dp"
android:layout_weight="1"
android:gravity="left|center_vertical"
android:text="TextView"
android:textAllCaps="false"
android:textColor="@color/black"
android:textSize="34sp"
android:textStyle="bold" />
<TextView
android:id="@+id/car_num_txt"
android:layout_width="153dp"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentEnd="true"
android:layout_marginStart="234dp"
android:layout_marginEnd="4dp"
android:layout_weight="1"
android:gravity="fill_horizontal|center_vertical"
android:text="(0/0)"
android:textAllCaps="false"
android:textColor="@color/black"
android:textSize="34sp" />
</RelativeLayout>
<Space
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="#DA9696"
android:orientation="horizontal">
<TextView
android:id="@+id/space_distance_txt"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginStart="5dp"
android:layout_marginEnd="1dp"
android:layout_weight="1"
android:gravity="left|center_vertical"
android:text="TextView"
android:textAllCaps="false"
android:textColor="@color/black"
android:textSize="20sp"
android:textStyle="bold" />
<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
app:srcCompat="@android:drawable/ic_dialog_map" />
<Button
android:id="@+id/btn_open_navigation"
android:layout_width="129dp"
android:layout_height="47dp"
android:layout_weight="0"
android:text="導航前往"
android:textSize="14sp"
android:textStyle="bold" />
</LinearLayout>
<Space
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/renew_list_recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/recycler_view_renew_item" />
</LinearLayout>
</layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/renew_item_icon"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:src="@tools:sample/avatars" />
<TextView
android:id="@+id/Space"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="@tools:sample/full_names"
android:textSize="20sp"
android:textColor="@android:color/holo_blue_dark"
app:layout_constraintTop_toTopOf="@+id/renew_item_icon"
app:layout_constraintStart_toEndOf="@+id/renew_item_icon"
android:layout_marginStart="8dp"
android:layout_marginBottom="8dp"
app:layout_constraintBottom_toTopOf="@+id/Plate" />
<TextView
android:id="@+id/Plate"
android:layout_width="285dp"
android:layout_height="20dp"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:textSize="18sp"
android:textColor="@android:color/black"
app:layout_constraintBottom_toBottomOf="@+id/renew_item_icon"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.050"
app:layout_constraintStart_toEndOf="@+id/renew_item_icon"
tools:text="@tools:sample/lorem[4:10]" />
<TextView
android:id="@+id/park_period"
android:layout_width="wrap_content"
android:layout_height="44dp"
android:layout_marginEnd="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/renew_item_icon"
android:gravity="left|center_vertical"
android:textSize="18sp"
android:textColor="@color/black"
tools:text="@tools:sample/date/hhmm" />
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/renewList_all"
android:icon="@drawable/ic_baseline_sort_24"
android:title="全站續單清單" />
<item
android:id="@+id/renewList_near"
android:icon="@android:drawable/ic_menu_mylocation"
android:title="鄰近續單清單" />
</menu>
\ 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