parent
1e816330ca
commit
a77cba5456
31 changed files with 3217 additions and 12 deletions
@ -0,0 +1,97 @@ |
||||
package com.project.survey.adapter; |
||||
|
||||
import android.annotation.SuppressLint; |
||||
import android.content.Context; |
||||
import android.graphics.drawable.GradientDrawable; |
||||
import android.view.LayoutInflater; |
||||
import android.view.View; |
||||
import android.view.ViewGroup; |
||||
import android.widget.ImageView; |
||||
import android.widget.TextView; |
||||
|
||||
import androidx.annotation.NonNull; |
||||
import androidx.recyclerview.widget.RecyclerView; |
||||
|
||||
import com.project.survey.R; |
||||
import com.project.survey.model.TextStyleBean; |
||||
import com.project.survey.util.DisplayUtils; |
||||
|
||||
import java.util.List; |
||||
|
||||
public class CustomRecycleTtemStyleDialogAdapter extends RecyclerView.Adapter<CustomRecycleTtemStyleDialogAdapter.ViewHolder> { |
||||
|
||||
private Context context; |
||||
private List<TextStyleBean> list; |
||||
private int mposition; |
||||
private OnItemClickListener onClickListener; |
||||
|
||||
public CustomRecycleTtemStyleDialogAdapter(Context context, List<TextStyleBean> list, int selectedIndex) { |
||||
this.context = context; |
||||
this.list = list; |
||||
mposition = selectedIndex; |
||||
} |
||||
|
||||
@NonNull |
||||
@Override |
||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { |
||||
ViewHolder holder = new ViewHolder(LayoutInflater.from( |
||||
context).inflate(R.layout.layout_checkbox_item, parent, |
||||
false)); |
||||
return holder; |
||||
} |
||||
|
||||
@Override |
||||
public void onBindViewHolder(@NonNull ViewHolder holder, @SuppressLint("RecyclerView") int position) { |
||||
|
||||
ViewGroup.LayoutParams layoutParams = holder.radio_type.getLayoutParams(); |
||||
layoutParams.width = 100; |
||||
layoutParams.height = 50; |
||||
holder.radio_type.setLayoutParams(layoutParams); |
||||
|
||||
holder.radio_type.setText(list.get(position).getText()); |
||||
|
||||
if (list.get(position).getTextSize() > 0) { |
||||
holder.radio_type.setTextSize(list.get(position).getTextSize()); |
||||
} |
||||
if (list.get(position).getTextColor() > 0) { |
||||
holder.radio_type.setTextColor(list.get(position).getTextColor()); |
||||
} |
||||
|
||||
GradientDrawable gradientDrawable = new GradientDrawable(); |
||||
gradientDrawable.setCornerRadii(new float[]{DisplayUtils.dip2px(3), DisplayUtils.dip2px(3), DisplayUtils.dip2px(3), DisplayUtils.dip2px(3), |
||||
DisplayUtils.dip2px(3), DisplayUtils.dip2px(3), DisplayUtils.dip2px(3), DisplayUtils.dip2px(3)}); |
||||
gradientDrawable.setColor(list.get(position).getBackground()); |
||||
holder.radio_type.setBackgroundDrawable(gradientDrawable); |
||||
|
||||
if (position == mposition) { |
||||
holder.iv_select_choose.setImageResource(R.mipmap.icon_checkbox_select); |
||||
} else { |
||||
holder.iv_select_choose.setImageResource(R.mipmap.icon_checkbox_unselect); |
||||
} |
||||
holder.itemView.setOnClickListener(v -> onClickListener.OnItemClick(position)); |
||||
} |
||||
|
||||
@Override |
||||
public int getItemCount() { |
||||
return list == null ? 0 : list.size(); |
||||
} |
||||
|
||||
public class ViewHolder extends RecyclerView.ViewHolder { |
||||
ImageView iv_select_choose; |
||||
TextView radio_type; |
||||
|
||||
public ViewHolder(@NonNull View itemView) { |
||||
super(itemView); |
||||
iv_select_choose = itemView.findViewById(R.id.iv_select_choose); |
||||
radio_type = itemView.findViewById(R.id.radio_type); |
||||
} |
||||
} |
||||
|
||||
public interface OnItemClickListener { |
||||
void OnItemClick(int position); |
||||
} |
||||
|
||||
public void setOnClickListener(OnItemClickListener onClickListener) { |
||||
this.onClickListener = onClickListener; |
||||
} |
||||
} |
@ -0,0 +1,128 @@ |
||||
package com.project.survey.dialog; |
||||
|
||||
import static androidx.recyclerview.widget.LinearLayoutManager.VERTICAL; |
||||
|
||||
import android.app.Dialog; |
||||
import android.content.Context; |
||||
import android.text.TextUtils; |
||||
import android.view.LayoutInflater; |
||||
import android.view.View; |
||||
import android.widget.LinearLayout; |
||||
import android.widget.TextView; |
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager; |
||||
import androidx.recyclerview.widget.RecyclerView; |
||||
|
||||
import com.project.survey.R; |
||||
import com.project.survey.adapter.CustomRecycleTtemStyleDialogAdapter; |
||||
import com.project.survey.model.TextStyleBean; |
||||
|
||||
import java.util.List; |
||||
|
||||
public class CustomRecycleStyleDialog extends Dialog { |
||||
|
||||
public CustomRecycleStyleDialog(Context context) { |
||||
super(context); |
||||
} |
||||
|
||||
public CustomRecycleStyleDialog(Context context, int theme) { |
||||
super(context, theme); |
||||
} |
||||
|
||||
public static class Builder { |
||||
private Context context; // 上下文对象
|
||||
private String title; // 对话框标题
|
||||
private List<TextStyleBean> list; |
||||
private String preferenceKey; |
||||
private int selectedIndex; |
||||
private static OnItemClickListener onItemClickListener; |
||||
|
||||
public Builder(Context context) { |
||||
this.context = context; |
||||
} |
||||
|
||||
/** |
||||
* Set the Dialog title from resource |
||||
* |
||||
* @param title |
||||
* @return |
||||
*/ |
||||
public Builder setTitle(int title) { |
||||
this.title = (String) context.getText(title); |
||||
return this; |
||||
} |
||||
|
||||
/** |
||||
* Set the Dialog title from String |
||||
* |
||||
* @param title |
||||
* @return |
||||
*/ |
||||
public Builder setTitle(String title) { |
||||
this.title = title; |
||||
return this; |
||||
} |
||||
|
||||
public Builder setItemClickListener(OnItemClickListener onItemClickListener){ |
||||
this.onItemClickListener = onItemClickListener; |
||||
return this; |
||||
} |
||||
|
||||
public Builder setListData(List<TextStyleBean> list, String preferenceKey){ |
||||
this.list = list; |
||||
this.preferenceKey = preferenceKey; |
||||
this.selectedIndex = 0; |
||||
return this; |
||||
} |
||||
|
||||
public Builder setListData(List<TextStyleBean> list, String preferenceKey, int selectedIndex){ |
||||
this.list = list; |
||||
this.preferenceKey = preferenceKey; |
||||
this.selectedIndex = selectedIndex; |
||||
return this; |
||||
} |
||||
|
||||
public CustomRecycleStyleDialog create() { |
||||
LayoutInflater inflater = (LayoutInflater) context |
||||
.getSystemService(Context.LAYOUT_INFLATER_SERVICE); |
||||
// instantiate the dialog with the custom Theme
|
||||
final CustomRecycleStyleDialog dialog = new CustomRecycleStyleDialog(context, |
||||
R.style.gif_dialog); |
||||
View layout = inflater.inflate(R.layout.layout_recycle_style_dialog, null); |
||||
dialog.addContentView(layout, new LinearLayout.LayoutParams( |
||||
LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)); |
||||
|
||||
RecyclerView recyclerView = layout.findViewById(R.id.recyclerView); |
||||
if (list != null && list.size() > 0){ |
||||
CustomRecycleTtemStyleDialogAdapter adapter = new CustomRecycleTtemStyleDialogAdapter(context,list,selectedIndex); |
||||
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(context); |
||||
linearLayoutManager.setOrientation(VERTICAL); |
||||
recyclerView.setLayoutManager(linearLayoutManager); |
||||
recyclerView.setAdapter(adapter); |
||||
adapter.setOnClickListener(position -> { |
||||
onItemClickListener.OnItemClick(preferenceKey,position,list.get(position)); |
||||
dialog.dismiss(); |
||||
}); |
||||
} |
||||
|
||||
TextView tv_title = layout.findViewById(R.id.tv_title); |
||||
if (title != null || !TextUtils.isEmpty(title)){ |
||||
tv_title.setText(title); |
||||
// tv_title.getPaint().setFakeBoldText(true);
|
||||
tv_title.setVisibility(View.VISIBLE); |
||||
}else { |
||||
tv_title.setVisibility(View.GONE); |
||||
} |
||||
|
||||
TextView tv_cancel = layout.findViewById(R.id.tv_cancel); |
||||
tv_cancel.setOnClickListener(v -> dialog.dismiss()); |
||||
|
||||
dialog.setContentView(layout); |
||||
return dialog; |
||||
} |
||||
} |
||||
|
||||
public interface OnItemClickListener{ |
||||
void OnItemClick(String preferenceKey, int position, TextStyleBean textStyleBean); |
||||
} |
||||
} |
@ -0,0 +1,62 @@ |
||||
package com.project.survey.model; |
||||
|
||||
import androidx.annotation.ColorInt; |
||||
|
||||
public class TextStyleBean { |
||||
private String text; |
||||
private float textSize; |
||||
@ColorInt |
||||
private int textColor; |
||||
|
||||
@ColorInt |
||||
private int background; |
||||
|
||||
public TextStyleBean(@ColorInt int background) { |
||||
this.background = background; |
||||
} |
||||
|
||||
// public TextStyleBean(String text, float textSize, @ColorInt int textColor, @ColorInt int background) {
|
||||
// this.text = text;
|
||||
// this.textSize = textSize;
|
||||
// this.textColor = textColor;
|
||||
// this.background = background;
|
||||
// }
|
||||
|
||||
public TextStyleBean(String text) { |
||||
this.text = text; |
||||
} |
||||
|
||||
public String getText() { |
||||
return text; |
||||
} |
||||
|
||||
public void setText(String text) { |
||||
this.text = text; |
||||
} |
||||
|
||||
public float getTextSize() { |
||||
return textSize; |
||||
} |
||||
|
||||
public void setTextSize(float textSize) { |
||||
this.textSize = textSize; |
||||
} |
||||
|
||||
@ColorInt |
||||
public int getTextColor() { |
||||
return textColor; |
||||
} |
||||
|
||||
// public void setTextColor(@ColorInt int textColor) {
|
||||
// this.textColor = textColor;
|
||||
// }
|
||||
|
||||
@ColorInt |
||||
public int getBackground() { |
||||
return background; |
||||
} |
||||
|
||||
// public void setBackground(@ColorInt int background) {
|
||||
// this.background = background;
|
||||
// }
|
||||
} |
@ -0,0 +1,414 @@ |
||||
package com.project.survey.ui.lofting.pointlofting; |
||||
|
||||
import android.content.Context; |
||||
import android.content.Intent; |
||||
import android.graphics.Color; |
||||
import android.graphics.drawable.GradientDrawable; |
||||
import android.view.View; |
||||
|
||||
import androidx.annotation.ColorInt; |
||||
|
||||
import com.bingce.device.Device; |
||||
import com.bingce.device.enums.DeviceTypeEnum; |
||||
import com.bingce.surveyor.util.ConstUtils; |
||||
import com.bingce.surveyor.util.PreferencesCadUtil; |
||||
import com.bingce.surveyor.util.PreferencesUtil; |
||||
import com.bingce.surveyor.util.dialog.CustomRecycleDialog; |
||||
import com.bingce.utils.FileUtil; |
||||
import com.bingce.utils.IntentUtil; |
||||
import com.bingce.utils.Util; |
||||
import com.project.survey.R; |
||||
import com.project.survey.databinding.ActivityPointStakingSettingBinding; |
||||
import com.project.survey.dialog.CustomRecycleStyleDialog; |
||||
import com.project.survey.model.TextStyleBean; |
||||
import com.project.survey.ui.base.BaseSurveyNewActivity; |
||||
|
||||
import java.io.File; |
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
import blankj.utilcode.util.ToastUtils; |
||||
|
||||
public class PointStakingSettingActivity extends BaseSurveyNewActivity { |
||||
|
||||
private ActivityPointStakingSettingBinding binding; |
||||
private int limitHrmsIndex = -1; |
||||
private int limitVrmsIndex = -1; |
||||
private int limitPdopIndex = -1; |
||||
private int limitAgeIndex = -1; |
||||
private int limitTipsRangeIndex = -1; |
||||
private int limitStakingIndex = -1; |
||||
private int limitSmoothPointNumberIndex = -1; |
||||
|
||||
@Override |
||||
public View getContentView() { |
||||
binding = ActivityPointStakingSettingBinding.inflate(getLayoutInflater()); |
||||
return binding.getRoot(); |
||||
} |
||||
|
||||
@Override |
||||
protected void initView() { |
||||
if (IntentUtil.boolExtra(getIntent(), KEY_IS_CAD_SETTING) && !Device.getInstance().isDeviceConnected()) { |
||||
setTitle(getString(R.string.cad_setting)); |
||||
binding.rlStatusLimit.setVisibility(View.GONE); |
||||
binding.llHvpd.setVisibility(View.GONE); |
||||
binding.llRangeLimit.setVisibility(View.GONE); |
||||
binding.llCadSetting.setVisibility(View.VISIBLE); |
||||
} else { |
||||
if (Device.getInstance().deviceType == DeviceTypeEnum.DEVICE_TYPE_TS) { |
||||
setTitle(getString(R.string.ts_staking_setting)); |
||||
binding.rlStatusLimit.setVisibility(View.GONE); |
||||
binding.llHvpd.setVisibility(View.GONE); |
||||
binding.rlSmoothPointNumberLimit.setVisibility(View.GONE); |
||||
} else { |
||||
setTitle(getString(R.string.rtk_staking_setting)); |
||||
binding.rlStatusLimit.setVisibility(View.VISIBLE); |
||||
binding.llHvpd.setVisibility(View.VISIBLE); |
||||
binding.rlSmoothPointNumberLimit.setVisibility(View.VISIBLE); |
||||
} |
||||
binding.llRangeLimit.setVisibility(View.VISIBLE); |
||||
if (IntentUtil.boolExtra(getIntent(), KEY_IS_CAD_SETTING)) { |
||||
binding.llCadSetting.setVisibility(View.VISIBLE); |
||||
} else { |
||||
binding.llCadSetting.setVisibility(View.GONE); |
||||
} |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
protected void initData() { |
||||
limitStatus(); |
||||
limitHrms(); |
||||
limitVrms(); |
||||
limitPdop(); |
||||
limitAge(); |
||||
limitTipsRange(); |
||||
limitStaking(); |
||||
cadUcsWcsStatus(); |
||||
cadUnitLength(); |
||||
cadBackground(); |
||||
cadCleanCache(); |
||||
limitSmoothPointNumber(); |
||||
} |
||||
|
||||
/** |
||||
* 状态解 |
||||
*/ |
||||
private void limitStatus() { |
||||
List<String> limitStatusList = new ArrayList<>(); |
||||
limitStatusList.add(getString(R.string.rtk_state_fixed)); |
||||
limitStatusList.add(getString(R.string.rtk_state_diff_3D)); |
||||
limitStatusList.add(getString(R.string.rtk_state_float)); |
||||
limitStatusList.add(getString(R.string.rtk_state_single)); |
||||
binding.tvStatusLimit.setText(limitStatusList.get(PreferencesUtil.getPointStakingStatusLimitIndex())); |
||||
binding.rlStatusLimit.setOnClickListener(view -> CustomRecycleDialog.showDialog(PointStakingSettingActivity.this, R.string.solution_status_limit, limitStatusList, PreferencesUtil.getPointStakingStatusLimitIndex(), false, (index, itemString) -> { |
||||
binding.tvStatusLimit.setText(limitStatusList.get(index)); |
||||
PreferencesUtil.putPreference(ConstUtils.preferConst.pointStakingStatusLimit, index); |
||||
})); |
||||
} |
||||
|
||||
/** |
||||
* Hrms |
||||
*/ |
||||
private void limitHrms() { |
||||
List<String> limitHrmsList = new ArrayList<>(); |
||||
limitHrmsList.add("0.05"); |
||||
limitHrmsList.add("0.10"); |
||||
limitHrmsList.add("0.20"); |
||||
limitHrmsList.add("0.30"); |
||||
for (int i = 0; i < limitHrmsList.size(); i++) { |
||||
if (Double.parseDouble(PreferencesUtil.getPointStakingHrmsLimit()) == Double.parseDouble(limitHrmsList.get(i))) { |
||||
limitHrmsIndex = i; |
||||
} |
||||
} |
||||
|
||||
binding.tvHrmsLimit.setText(PreferencesUtil.getPointStakingHrmsLimit() + getString(R.string.meter)); |
||||
binding.rlHrmsLimit.setOnClickListener(view -> CustomRecycleDialog.showDialog(PointStakingSettingActivity.this, R.string.hrms_limit, limitHrmsList, limitHrmsIndex, CustomRecycleDialog.Builder.INPUT_TYPE_DECIMAL, true, PreferencesUtil.getPointStakingHrmsLimit(), new CustomRecycleDialog.IClickCallback() { |
||||
@Override |
||||
public void onItemSelected(int index, String itemString) { |
||||
limitHrmsIndex = index; |
||||
if (index != -1) { |
||||
binding.tvHrmsLimit.setText(limitHrmsList.get(index) + getString(R.string.meter)); |
||||
} else { |
||||
binding.tvHrmsLimit.setText(itemString + getString(R.string.meter)); |
||||
} |
||||
PreferencesUtil.putPreference(ConstUtils.preferConst.pointStakingHrmsLimit, itemString); |
||||
} |
||||
})); |
||||
} |
||||
|
||||
/** |
||||
* Vrms |
||||
*/ |
||||
private void limitVrms() { |
||||
List<String> limitVrmsList = new ArrayList<>(); |
||||
limitVrmsList.add("0.05"); |
||||
limitVrmsList.add("0.10"); |
||||
limitVrmsList.add("0.20"); |
||||
limitVrmsList.add("0.30"); |
||||
for (int i = 0; i < limitVrmsList.size(); i++) { |
||||
if (Double.parseDouble(PreferencesUtil.getPointStakingVrmsLimit()) == Double.parseDouble(limitVrmsList.get(i))) { |
||||
limitVrmsIndex = i; |
||||
} |
||||
} |
||||
|
||||
binding.tvVrmsLimit.setText(PreferencesUtil.getPointStakingVrmsLimit() + getString(R.string.meter)); |
||||
binding.rlVrmsLimit.setOnClickListener(view -> CustomRecycleDialog.showDialog(PointStakingSettingActivity.this, R.string.vrms_limit, limitVrmsList, limitVrmsIndex, CustomRecycleDialog.Builder.INPUT_TYPE_DECIMAL, true, PreferencesUtil.getPointStakingVrmsLimit(), new CustomRecycleDialog.IClickCallback() { |
||||
@Override |
||||
public void onItemSelected(int index, String itemString) { |
||||
limitVrmsIndex = index; |
||||
if (index != -1) { |
||||
binding.tvVrmsLimit.setText(limitVrmsList.get(index) + getString(R.string.meter)); |
||||
} else { |
||||
binding.tvVrmsLimit.setText(itemString + getString(R.string.meter)); |
||||
} |
||||
PreferencesUtil.putPreference(ConstUtils.preferConst.pointStakingVrmsLimit, itemString); |
||||
} |
||||
})); |
||||
} |
||||
|
||||
/** |
||||
* Pdop |
||||
*/ |
||||
private void limitPdop() { |
||||
List<String> limitPdopList = new ArrayList<>(); |
||||
limitPdopList.add("5.00"); |
||||
limitPdopList.add("20.00"); |
||||
limitPdopList.add("50.00"); |
||||
limitPdopList.add("100.00"); |
||||
for (int i = 0; i < limitPdopList.size(); i++) { |
||||
if (Double.parseDouble(PreferencesUtil.getPointStakingPdopLimit()) == Double.parseDouble(limitPdopList.get(i))) { |
||||
limitPdopIndex = i; |
||||
} |
||||
} |
||||
|
||||
binding.tvPdopLimit.setText(PreferencesUtil.getPointStakingPdopLimit()); |
||||
binding.rlPdopLimit.setOnClickListener(view -> CustomRecycleDialog.showDialog(PointStakingSettingActivity.this, R.string.pdop_limit, limitPdopList, limitPdopIndex, CustomRecycleDialog.Builder.INPUT_TYPE_DECIMAL, true, PreferencesUtil.getPointStakingPdopLimit(), new CustomRecycleDialog.IClickCallback() { |
||||
@Override |
||||
public void onItemSelected(int index, String itemString) { |
||||
limitPdopIndex = index; |
||||
if (index != -1) { |
||||
binding.tvPdopLimit.setText(limitPdopList.get(index)); |
||||
} else { |
||||
binding.tvPdopLimit.setText(itemString); |
||||
} |
||||
PreferencesUtil.putPreference(ConstUtils.preferConst.pointStakingPdopLimit, itemString); |
||||
} |
||||
})); |
||||
} |
||||
|
||||
private void limitAge() { |
||||
List<String> limitAgeList = new ArrayList<>(); |
||||
limitAgeList.add("5"); |
||||
limitAgeList.add("10"); |
||||
limitAgeList.add("15"); |
||||
limitAgeList.add("25"); |
||||
for (int i = 0; i < limitAgeList.size(); i++) { |
||||
if (Double.parseDouble(PreferencesUtil.getPointStakingAgeLimit()) == Double.parseDouble(limitAgeList.get(i))) { |
||||
limitAgeIndex = i; |
||||
} |
||||
} |
||||
|
||||
binding.tvAgeLimit.setText(PreferencesUtil.getPointStakingAgeLimit() + getString(R.string.sec)); |
||||
binding.rlAgeLimit.setOnClickListener(view -> CustomRecycleDialog.showDialog(PointStakingSettingActivity.this, R.string.diff_age_limit, limitAgeList, limitAgeIndex, CustomRecycleDialog.Builder.INPUT_TYPE_INTEGER, true, PreferencesUtil.getPointStakingAgeLimit(), new CustomRecycleDialog.IClickCallback() { |
||||
@Override |
||||
public void onItemSelected(int index, String itemString) { |
||||
limitAgeIndex = index; |
||||
if (index != -1) { |
||||
binding.tvAgeLimit.setText(limitAgeList.get(index) + getString(R.string.sec)); |
||||
} else { |
||||
binding.tvAgeLimit.setText(itemString + getString(R.string.sec)); |
||||
} |
||||
PreferencesUtil.putPreference(ConstUtils.preferConst.pointStakingAgeLimit, itemString); |
||||
} |
||||
})); |
||||
} |
||||
|
||||
public void limitTipsRange() { |
||||
List<String> limitTipsRangeList = new ArrayList<>(); |
||||
limitTipsRangeList.add("0.20"); |
||||
limitTipsRangeList.add("0.50"); |
||||
limitTipsRangeList.add("1.00"); |
||||
limitTipsRangeList.add("2.00"); |
||||
for (int i = 0; i < limitTipsRangeList.size(); i++) { |
||||
if (Double.parseDouble(PreferencesUtil.getPointStakingTipsRangeLimit()) == Double.parseDouble(limitTipsRangeList.get(i))) { |
||||
limitTipsRangeIndex = i; |
||||
} |
||||
} |
||||
|
||||
binding.tvTipsRangeLimit.setText(PreferencesUtil.getPointStakingTipsRangeLimit() + getString(R.string.meter)); |
||||
binding.rlTipsRangeLimit.setOnClickListener(view -> CustomRecycleDialog.showDialog(PointStakingSettingActivity.this, R.string.tips_range, limitTipsRangeList, limitTipsRangeIndex, CustomRecycleDialog.Builder.INPUT_TYPE_DECIMAL, true, PreferencesUtil.getPointStakingTipsRangeLimit(), new CustomRecycleDialog.IClickCallback() { |
||||
@Override |
||||
public void onItemSelected(int index, String itemString) { |
||||
limitTipsRangeIndex = index; |
||||
if (index != -1) { |
||||
binding.tvTipsRangeLimit.setText(limitTipsRangeList.get(index) + getString(R.string.meter)); |
||||
} else { |
||||
binding.tvTipsRangeLimit.setText(itemString + getString(R.string.meter)); |
||||
} |
||||
PreferencesUtil.putPreference(ConstUtils.preferConst.pointStakingTipsRangeLimit, itemString); |
||||
} |
||||
})); |
||||
} |
||||
|
||||
private void limitSmoothPointNumber() { |
||||
List<String> limitSmoothPointNumberList = new ArrayList<>(); |
||||
limitSmoothPointNumberList.add("1"); |
||||
limitSmoothPointNumberList.add("2"); |
||||
limitSmoothPointNumberList.add("5"); |
||||
limitSmoothPointNumberList.add("10"); |
||||
for (int i = 0; i < limitSmoothPointNumberList.size(); i++) { |
||||
if (PreferencesUtil.getPreferenceInt(ConstUtils.preferConst.rtkStakingSmoothPointsNumber, 1) == Integer.parseInt(limitSmoothPointNumberList.get(i))) { |
||||
limitSmoothPointNumberIndex = i; |
||||
} |
||||
} |
||||
binding.tvSmoothPointNumberLimit.setText(String.valueOf(PreferencesUtil.getPreferenceInt(ConstUtils.preferConst.rtkStakingSmoothPointsNumber, 1))); |
||||
binding.rlSmoothPointNumberLimit.setOnClickListener(view -> CustomRecycleDialog.showDialog(PointStakingSettingActivity.this, R.string.smooth_points_number, limitSmoothPointNumberList, limitSmoothPointNumberIndex, CustomRecycleDialog.Builder.INPUT_TYPE_INTEGER, true, Util.formatDouble2StringDotAuto(PreferencesUtil.getPreferenceInt(ConstUtils.preferConst.rtkStakingSmoothPointsNumber, 1)), new CustomRecycleDialog.IClickCallback() { |
||||
@Override |
||||
public void onItemSelected(int index, String itemString) { |
||||
limitSmoothPointNumberIndex = index; |
||||
if (index != -1) { |
||||
binding.tvSmoothPointNumberLimit.setText(limitSmoothPointNumberList.get(index)); |
||||
PreferencesUtil.putPreference(ConstUtils.preferConst.rtkStakingSmoothPointsNumber, Integer.parseInt(limitSmoothPointNumberList.get(index))); |
||||
} else { |
||||
binding.tvSmoothPointNumberLimit.setText(itemString); |
||||
PreferencesUtil.putPreference(ConstUtils.preferConst.rtkStakingSmoothPointsNumber, Integer.parseInt(itemString)); |
||||
} |
||||
} |
||||
})); |
||||
} |
||||
|
||||
private void limitStaking() { |
||||
List<String> limitStakingList = new ArrayList<>(); |
||||
limitStakingList.add("0.01"); |
||||
limitStakingList.add("0.02"); |
||||
limitStakingList.add("0.05"); |
||||
limitStakingList.add("0.10"); |
||||
for (int i = 0; i < limitStakingList.size(); i++) { |
||||
if (Double.parseDouble(PreferencesUtil.getPointStakingLimit()) == Double.parseDouble(limitStakingList.get(i))) { |
||||
limitStakingIndex = i; |
||||
} |
||||
} |
||||
|
||||
binding.tvStakingLimit.setText(PreferencesUtil.getPointStakingLimit() + getString(R.string.meter)); |
||||
binding.rlStakingLimit.setOnClickListener(view -> CustomRecycleDialog.showDialog(PointStakingSettingActivity.this, R.string.stakout_difference, limitStakingList, limitStakingIndex, CustomRecycleDialog.Builder.INPUT_TYPE_DECIMAL, true, PreferencesUtil.getPointStakingLimit(), new CustomRecycleDialog.IClickCallback() { |
||||
@Override |
||||
public void onItemSelected(int index, String itemString) { |
||||
limitStakingIndex = index; |
||||
if (index != -1) { |
||||
binding.tvStakingLimit.setText(limitStakingList.get(index) + getString(R.string.meter)); |
||||
} else { |
||||
binding.tvStakingLimit.setText(itemString + getString(R.string.meter)); |
||||
} |
||||
PreferencesUtil.putPreference(ConstUtils.preferConst.pointStakingLimit, itemString); |
||||
} |
||||
})); |
||||
} |
||||
|
||||
private void cadUcsWcsStatus() { |
||||
List<String> ucsWcsStatusList = new ArrayList<>(); |
||||
ucsWcsStatusList.add(getString(R.string.user_coordinate_system)); |
||||
ucsWcsStatusList.add(getString(R.string.world_coordinate_system)); |
||||
binding.tvWcsUcsStatus.setText(ucsWcsStatusList.get(PreferencesCadUtil.getCadUserSetUcsWcsStatus())); |
||||
binding.rlSelectCoordinateSystem.setOnClickListener(view -> CustomRecycleDialog.showDialog(PointStakingSettingActivity.this, R.string.coordinate_system, ucsWcsStatusList, PreferencesCadUtil.getCadUserSetUcsWcsStatus(), false, (index, itemString) -> { |
||||
binding.tvWcsUcsStatus.setText(ucsWcsStatusList.get(index)); |
||||
PreferencesCadUtil.putPreference(ConstUtils.preferConst.cadUseSetUcsWcsStatus, index); |
||||
})); |
||||
} |
||||
|
||||
private void cadUnitLength() { |
||||
List<String> unitLengthList = new ArrayList<>(); |
||||
unitLengthList.add(getString(R.string.unit_cad_m)); |
||||
unitLengthList.add(getString(R.string.unit_cad_cm)); |
||||
unitLengthList.add(getString(R.string.unit_cad_mm)); |
||||
binding.tvUnitLength.setText(unitLengthList.get(PreferencesCadUtil.getCadDrawingUnitLength())); |
||||
binding.rlSelectUnitLength.setOnClickListener(view -> CustomRecycleDialog.showDialog(PointStakingSettingActivity.this, R.string.unit_length, unitLengthList, PreferencesCadUtil.getCadDrawingUnitLength(), false, (index, itemString) -> { |
||||
binding.tvUnitLength.setText(unitLengthList.get(index)); |
||||
PreferencesCadUtil.putPreference(ConstUtils.preferConst.cadDrawingUnitLength, index); |
||||
})); |
||||
} |
||||
|
||||
private int cadBackgroundColorIndex = 0; |
||||
private GradientDrawable mGroupDrawable; |
||||
|
||||
/** |
||||
* cad背景 |
||||
*/ |
||||
private void cadBackground() { |
||||
mGroupDrawable = (GradientDrawable) binding.tvSelectColor.getBackground(); |
||||
setGroupDrawable(PreferencesCadUtil.getCadBackgroundColorValue()); |
||||
List<TextStyleBean> list = new ArrayList<>(); |
||||
list.add(new TextStyleBean(Color.BLACK)); |
||||
list.add(new TextStyleBean(Color.WHITE)); |
||||
if (PreferencesCadUtil.getCadBackgroundColorValue() == Color.BLACK) { |
||||
cadBackgroundColorIndex = 0; |
||||
} else { |
||||
cadBackgroundColorIndex = 1; |
||||
} |
||||
binding.rlCadBackground.setOnClickListener(v -> { |
||||
new CustomRecycleStyleDialog.Builder(this).setTitle(R.string.background_color).setListData(list, "", cadBackgroundColorIndex) |
||||
.setItemClickListener((preferenceKey, position, textStyleBean) -> { |
||||
cadBackgroundColorIndex = position; |
||||
setGroupDrawable(textStyleBean.getBackground()); |
||||
PreferencesCadUtil.putPreference(ConstUtils.preferConst.cadBackgroundColor, textStyleBean.getBackground()); |
||||
}).create().show(); |
||||
}); |
||||
} |
||||
|
||||
private void setGroupDrawable(@ColorInt int color) { |
||||
if (color == Color.WHITE) { |
||||
//判断为白色是,添加一个边框便于颜色识别(白色和弹框背景色重合了)
|
||||
mGroupDrawable.setStroke(2, getColor(R.color.color_8a8a8a)); |
||||
mGroupDrawable.setColor(color); |
||||
} else { |
||||
mGroupDrawable.setStroke(1, color); |
||||
mGroupDrawable.setColor(color); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* cad文件缓存 |
||||
*/ |
||||
private void cadCleanCache() { |
||||
File file = new File(FileUtil.getSDPath() + "/SurveyorCAD"); |
||||
binding.tvCleanCache.setText(formatSize(file.length())); |
||||
binding.rlCleanCache.setOnClickListener(v -> { |
||||
if (file.exists()) { |
||||
boolean result = FileUtil.deleteDir(file); |
||||
if (result) { |
||||
ToastUtils.showShort(R.string.clean_over_then_restart_activity); |
||||
binding.tvCleanCache.setText("0.0KB"); |
||||
} |
||||
} else { |
||||
ToastUtils.showShort(R.string.clean_over_then_restart_activity); |
||||
binding.tvCleanCache.setText("0.0KB"); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
public static String formatSize(long size) { |
||||
String suffix = "KB"; |
||||
double fSize = size / 1024; |
||||
if (fSize > 1024) { |
||||
suffix = "MB"; |
||||
fSize /= 1024; |
||||
} |
||||
if (fSize > 1024) { |
||||
suffix = "GB"; |
||||
fSize /= 1024; |
||||
} |
||||
return fSize + suffix; |
||||
} |
||||
|
||||
private static String KEY_IS_CAD_SETTING = "isCADSetting"; |
||||
|
||||
public static void start(Context context) { |
||||
start(context, false); |
||||
} |
||||
|
||||
public static void start(Context context, boolean isCADSetting) { |
||||
Intent intent = new Intent(context, PointStakingSettingActivity.class); |
||||
intent.putExtra(KEY_IS_CAD_SETTING, isCADSetting); |
||||
context.startActivity(intent); |
||||
} |
||||
} |
@ -0,0 +1,364 @@ |
||||
package com.project.survey.ui.lofting.pointlofting.record; |
||||
|
||||
|
||||
import android.annotation.SuppressLint; |
||||
import android.app.ProgressDialog; |
||||
import android.content.Context; |
||||
import android.content.Intent; |
||||
import android.content.SharedPreferences; |
||||
import android.content.pm.ActivityInfo; |
||||
import android.graphics.Color; |
||||
import android.os.Bundle; |
||||
import android.view.Menu; |
||||
import android.view.MenuItem; |
||||
import android.view.View; |
||||
import android.view.WindowManager; |
||||
import android.widget.AdapterView; |
||||
import android.widget.ArrayAdapter; |
||||
import android.widget.TextView; |
||||
|
||||
import androidx.annotation.Nullable; |
||||
import androidx.preference.PreferenceManager; |
||||
|
||||
import com.bingce.AppChannel; |
||||
import com.bingce.data.base.user.UserConfig; |
||||
import com.bingce.data.sync.utils.LoadCurrentJobIdKt; |
||||
import com.bingce.data.sync.utils.LoadCurrentProjectIdKt; |
||||
import com.bingce.data.sync.utils.LoadCurrentRoadIdKt; |
||||
import com.bingce.data.sync.utils.LoadCurrentWaterPipeIdKt; |
||||
import com.bingce.data.sync.utils.LoadUserConfigKt; |
||||
import com.bingce.utils.StringUtil; |
||||
import com.bingce.utils.ThreadPoolUtil; |
||||
import com.hjq.permissions.Permission; |
||||
import com.hjq.permissions.XXPermissions; |
||||
import com.hjq.shape.view.ShapeTextView; |
||||
import com.project.survey.databinding.ActivityRecordsBinding; |
||||
import com.project.survey.ui.lofting.pointlofting.record.util.RecordsActivityExportUtils; |
||||
import com.project.survey.ui.lofting.pointlofting.record.util.RecordsActivityFilterUtils; |
||||
|
||||
import org.polaric.colorful.ColorfulActivity; |
||||
|
||||
import java.io.File; |
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
|
||||
import blankj.utilcode.util.ToastUtils; |
||||
import blankj.utilcode.util.Utils; |
||||
|
||||
|
||||
public class RecordsActivity extends ColorfulActivity { |
||||
private static final String TAG = "RecordsActivity"; |
||||
private final static String KEY_TYPE = "type"; |
||||
|
||||
private boolean isSortByTimeAcs = false;//是否把结果按照时间升序排列
|
||||
private TextView tv_top_date_filter; |
||||
private ShapeTextView tv_filter_other; |
||||
private ShapeTextView tv_filter_time; |
||||
private ShapeTextView tv_filter_dcs_type; |
||||
private ActivityRecordsBinding binding; |
||||
|
||||
private int currentTypeFromSpinner; |
||||
private final RecordsActivityFilterUtils filterUtils = new RecordsActivityFilterUtils(() -> this, |
||||
() -> currentTypeFromSpinner, () -> tv_filter_time, () -> tv_filter_dcs_type); |
||||
private final RecordsActivityExportUtils exportUtils = new RecordsActivityExportUtils(() -> this, () -> currentTypeFromSpinner); |
||||
private final RecordsActivityClearUtils clearUtils = new RecordsActivityClearUtils(() -> this, () -> currentTypeFromSpinner); |
||||
|
||||
private final Map<Integer, IRecordsUtils> recordsUtilsMap = RecordsUtilsFactory.buildUtils(this); |
||||
|
||||
private final RecordsActivityHeaders headers = new RecordsActivityHeaders(() -> this); |
||||
private final RecordsViewModelKt.HolderInActivity holderInActivity = |
||||
new RecordsViewModelKt.HolderInActivity(this); |
||||
|
||||
public static void start(Context context, int type) { |
||||
Intent intent = new Intent(context, RecordsActivity.class); |
||||
intent.putExtra(KEY_TYPE, type); |
||||
context.startActivity(intent); |
||||
} |
||||
|
||||
public static void start(Context context) { |
||||
Intent intent = new Intent(context, RecordsActivity.class); |
||||
context.startActivity(intent); |
||||
} |
||||
|
||||
@SuppressLint("SourceLockedOrientationActivity") |
||||
@Override |
||||
protected void onCreate(Bundle savedInstanceState) { |
||||
if (((App) getApplication()).isLandscape()) { |
||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE); |
||||
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, |
||||
WindowManager.LayoutParams.FLAG_FULLSCREEN); |
||||
} else { |
||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); |
||||
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); |
||||
} |
||||
super.onCreate(savedInstanceState); |
||||
binding = ActivityRecordsBinding.inflate(getLayoutInflater()); |
||||
setContentView(binding.getRoot()); |
||||
setSupportActionBar(binding.toolbarWithOneSpinner); |
||||
if (getSupportActionBar() != null) |
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true); |
||||
tv_top_date_filter = findViewById(R.id.activity_records_top_date_filter); |
||||
tv_filter_time = findViewById(R.id.tv_filter_time); |
||||
tv_filter_dcs_type = findViewById(R.id.tv_filter_dcs_type); |
||||
tv_filter_other = findViewById(R.id.tv_filter_other); |
||||
tv_top_date_filter.setText(R.string.record_default_display_one_week); |
||||
|
||||
if (((App) Utils.getApp()).isThemeDark) { |
||||
tv_filter_time.getShapeDrawableBuilder().setSolidColor(Color.GRAY).intoBackground(); |
||||
tv_filter_dcs_type.getShapeDrawableBuilder().setSolidColor(Color.GRAY).intoBackground(); |
||||
tv_filter_other.getShapeDrawableBuilder().setSolidColor(Color.GRAY).intoBackground(); |
||||
} else { |
||||
tv_filter_time.getShapeDrawableBuilder().setSolidColor(Color.WHITE).intoBackground(); |
||||
tv_filter_dcs_type.getShapeDrawableBuilder().setSolidColor(Color.WHITE).intoBackground(); |
||||
tv_filter_other.getShapeDrawableBuilder().setSolidColor(Color.WHITE).intoBackground(); |
||||
} |
||||
initSpinnerType(); |
||||
headers.initHeaders(); |
||||
binding.ivOrder.setOnClickListener(view -> { |
||||
isSortByTimeAcs = !isSortByTimeAcs; |
||||
binding.ivOrder.setImageResource(isSortByTimeAcs ? R.drawable.icon_sort_ascending : R.drawable.icon_sort_descending); |
||||
updateRecyclerView(); |
||||
}); |
||||
binding.tvFilterTime.setOnClickListener(v -> filterUtils.showTimeFilterDialog(this::updateRecyclerView)); |
||||
if (currentTypeFromSpinner != RecordTypeConstants.TYPE_TUNNEL_BACK_BREAK && currentTypeFromSpinner != RecordTypeConstants.TYPE_WATER_PIPE_BACK_BREAK) { |
||||
filterUtils.resetTcsType(); |
||||
} |
||||
binding.tvFilterDcsType.setOnClickListener(v -> filterUtils.showTcsTypeDialog(this::updateRecyclerView)); |
||||
|
||||
|
||||
tv_filter_dcs_type.setVisibility((currentTypeFromSpinner != RecordTypeConstants.TYPE_TUNNEL_BACK_BREAK && currentTypeFromSpinner != RecordTypeConstants.TYPE_WATER_PIPE_BACK_BREAK) ? View.GONE : View.VISIBLE); |
||||
tv_filter_other.setOnClickListener(v -> { |
||||
filterUtils.showFilterDialog(this::updateRecyclerView); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 切换里程坐标等记录类型 |
||||
*/ |
||||
private void initSpinnerType() { |
||||
binding.spinner1.setOnItemSelectedListener(spinnerListener); |
||||
|
||||
List<String> spinnerTitlesList = new ArrayList<>(); |
||||
for (Map.Entry<Integer, IRecordsUtils> entry : recordsUtilsMap.entrySet()) { |
||||
if (entry == null) { |
||||
continue; |
||||
} |
||||
IRecordsUtils recordsUtils = entry.getValue(); |
||||
if (recordsUtils == null) { |
||||
continue; |
||||
} |
||||
int type = entry.getKey(); |
||||
String name = recordsUtils.name(); |
||||
switch (type) { |
||||
case RecordTypeConstants.TYPE_CUSTOM_ZHONG_JIAO_ONE: |
||||
if (AppChannel.customChannel == AppChannel.CUSTOM_ZJYGJ) { |
||||
spinnerTitlesList.add(name); |
||||
} |
||||
break; |
||||
case RecordTypeConstants.TYPE_CUSTOM_TIAN_JING_ONE: |
||||
if (AppChannel.customChannel == AppChannel.CUSTOM_CR18SZ) { |
||||
spinnerTitlesList.add(name); |
||||
} |
||||
break; |
||||
case RecordTypeConstants.TYPE_CUSTOM_MDM: |
||||
if (AppChannel.customChannel == AppChannel.CUSTOM_MONITOR) { |
||||
spinnerTitlesList.add(name); |
||||
} |
||||
break; |
||||
// case RecordTypeConstants.TYPE_ROTARY_BRIDGE_6COM:
|
||||
// if (AppChannel.customChannel == AppChannel.CUSTOM_6_COM) {
|
||||
// spinnerTitlesList.add(name);
|
||||
// }
|
||||
// break;
|
||||
default: |
||||
spinnerTitlesList.add(name); |
||||
break; |
||||
} |
||||
} |
||||
|
||||
ArrayAdapter<String> mSpinnerAdapter = new ArrayAdapter<>(this, |
||||
R.layout.spinner_dropdown_item_my_with_background, android.R.id.text1, |
||||
spinnerTitlesList); |
||||
binding.spinner1.setAdapter(mSpinnerAdapter); |
||||
|
||||
//设置默认记录类型
|
||||
int type = ((App) getApplication()).lastRecordBrowseType; |
||||
Intent intent = getIntent(); |
||||
if (intent != null && intent.hasExtra(KEY_TYPE)) { |
||||
type = intent.getIntExtra(KEY_TYPE, 0); |
||||
} |
||||
int lastType = Math.max(type, 0); |
||||
|
||||
IRecordsUtils utils = recordsUtilsMap.get(lastType); |
||||
int index = 0; |
||||
if (utils != null) { |
||||
String name = utils.name(); |
||||
boolean found = false; |
||||
for (index = 0; index < spinnerTitlesList.size(); index++) { |
||||
if (spinnerTitlesList.get(index).equals(name)) { |
||||
found = true; |
||||
break; |
||||
} |
||||
} |
||||
if (!found) { |
||||
index = 0; |
||||
} |
||||
} |
||||
binding.spinner1.setSelection(index); |
||||
} |
||||
|
||||
//里程计算坐标等类型切换监听器
|
||||
AdapterView.OnItemSelectedListener spinnerListener = new AdapterView.OnItemSelectedListener() { |
||||
@Override |
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { |
||||
String typeString = binding.spinner1.getSelectedItem().toString(); |
||||
Set<Map.Entry<Integer, IRecordsUtils>> entries = recordsUtilsMap.entrySet(); |
||||
for (Map.Entry<Integer, IRecordsUtils> entry : entries) { |
||||
if (entry.getValue().name().equals(typeString)) { |
||||
currentTypeFromSpinner = entry.getKey(); |
||||
if (currentTypeFromSpinner != RecordTypeConstants.TYPE_TUNNEL_BACK_BREAK && currentTypeFromSpinner != RecordTypeConstants.TYPE_WATER_PIPE_BACK_BREAK) { |
||||
filterUtils.resetTcsType(); |
||||
tv_filter_dcs_type.setVisibility(View.GONE); |
||||
} else { |
||||
tv_filter_dcs_type.setVisibility(View.VISIBLE); |
||||
} |
||||
break; |
||||
} |
||||
} |
||||
|
||||
updateRecyclerView(); |
||||
((App) getApplication()).lastRecordBrowseType = currentTypeFromSpinner; |
||||
SharedPreferences prefs = |
||||
PreferenceManager.getDefaultSharedPreferences(RecordsActivity.this); |
||||
SharedPreferences.Editor editor = prefs.edit(); |
||||
editor.putInt("lastRecordBrowseType", ((App) getApplication()).lastRecordBrowseType); |
||||
editor.apply(); |
||||
} |
||||
|
||||
@Override |
||||
public void onNothingSelected(AdapterView<?> parent) { |
||||
} |
||||
}; |
||||
|
||||
@Override |
||||
public boolean onCreateOptionsMenu(Menu menu) { |
||||
getMenuInflater().inflate(R.menu.menu_activity_records, menu); |
||||
return super.onCreateOptionsMenu(menu); |
||||
} |
||||
|
||||
@Override |
||||
public boolean onOptionsItemSelected(MenuItem item) { |
||||
switch (item.getItemId()) { |
||||
case android.R.id.home: |
||||
finish(); |
||||
break; |
||||
case R.id.menu_record_sort: |
||||
isSortByTimeAcs = !isSortByTimeAcs; |
||||
updateRecyclerView(); |
||||
break; |
||||
case R.id.menu_record_export: |
||||
exportUtils.requestStoragePermission(this, exportSuccess()); |
||||
break; |
||||
case R.id.menu_record_filter: |
||||
binding.spinner1.getSelectedItem().toString(); |
||||
filterUtils.showFilterDialog(this::updateRecyclerView); |
||||
break; |
||||
case R.id.menu_record_clear: |
||||
clearUtils.showClearDialog(() -> { |
||||
ProgressDialog mProgressDialog = new ProgressDialog(this); |
||||
mProgressDialog.setMessage(getString(R.string.deleting)); |
||||
mProgressDialog.show(); |
||||
ThreadPoolUtil.execute(() -> { |
||||
IRecordsUtils recordsUtils = recordsUtilsMap.get(currentTypeFromSpinner); |
||||
if (recordsUtils != null) { |
||||
recordsUtils.clearInWorkerThread(filterUtils.filterParameter(), () -> { |
||||
runOnUiThread(mProgressDialog::dismiss); |
||||
}); |
||||
} |
||||
ToastUtils.showShort(R.string.clean_over); |
||||
}); |
||||
}); |
||||
break; |
||||
} |
||||
return super.onOptionsItemSelected(item); |
||||
} |
||||
|
||||
private void updateRecyclerView() { |
||||
ThreadPoolUtil.execute(() -> { |
||||
UserConfig userConfig = LoadUserConfigKt.loadUserConfig(); |
||||
String projectId = LoadCurrentProjectIdKt.loadCurrentProjectId(true, userConfig); |
||||
if (StringUtil.isEmpty(projectId)) { |
||||
return; |
||||
} |
||||
String jobId = LoadCurrentJobIdKt.loadCurrentJobId(projectId, true, userConfig); |
||||
if (StringUtil.isEmpty(jobId)) { |
||||
return; |
||||
} |
||||
if (currentTypeFromSpinner == RecordTypeConstants.TYPE_WATER_PIPE_BACK_BREAK){ |
||||
String waterPipeId = LoadCurrentWaterPipeIdKt.loadCurrentWaterPipeId(projectId, true, userConfig); |
||||
if (StringUtil.isEmpty(waterPipeId)){ |
||||
return; |
||||
} |
||||
runOnUiThread(() -> { |
||||
IRecordsUtils recordsUtils = recordsUtilsMap.get(currentTypeFromSpinner); |
||||
if (recordsUtils != null) { |
||||
recordsUtils.update(binding.recyclerviewRecords, isSortByTimeAcs, |
||||
userConfig, |
||||
projectId, jobId, waterPipeId, |
||||
filterUtils.filterParameter()); |
||||
|
||||
} |
||||
}); |
||||
}else { |
||||
String roadId = LoadCurrentRoadIdKt.loadCurrentRoadId(projectId, true, userConfig); |
||||
if (StringUtil.isEmpty(roadId)) { |
||||
return; |
||||
} |
||||
runOnUiThread(() -> { |
||||
IRecordsUtils recordsUtils = recordsUtilsMap.get(currentTypeFromSpinner); |
||||
if (recordsUtils != null) { |
||||
recordsUtils.update(binding.recyclerviewRecords, isSortByTimeAcs, |
||||
userConfig, |
||||
projectId, jobId, roadId, |
||||
filterUtils.filterParameter()); |
||||
|
||||
if (RecordTypeConstants.TYPE_MEASURING_TAPE == currentTypeFromSpinner) { |
||||
//如果选中的是进尺,尝试加载数据
|
||||
holderInActivity.getViewModel().loadMeasuringTapeRecord(userConfig, roadId); |
||||
} |
||||
} |
||||
}); |
||||
} |
||||
|
||||
|
||||
}); |
||||
} |
||||
|
||||
@Override |
||||
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { |
||||
super.onActivityResult(requestCode, resultCode, data); |
||||
if (requestCode == XXPermissions.REQUEST_CODE) { |
||||
if (XXPermissions.isGranted(this, Permission.MANAGE_EXTERNAL_STORAGE)) { |
||||
exportUtils.requestStoragePermission(this, exportSuccess()); |
||||
} else { |
||||
ToastUtils.showLong(getString(R.string.no_storage_permission_hint)); |
||||
} |
||||
} |
||||
} |
||||
|
||||
private RecordsActivityExportUtils.IExportCallback exportSuccess() { |
||||
return (name, isExportRtkStatus, isExportHr, exportSuccess) -> { |
||||
IRecordsUtils recordsUtils = recordsUtilsMap.get(currentTypeFromSpinner); |
||||
if (recordsUtils != null) { |
||||
recordsUtils.exportRecord2ExcelAsync(name, isSortByTimeAcs, filterUtils.filterParameter(), headers, isExportRtkStatus, isExportHr, |
||||
exportSuccess); |
||||
} |
||||
}; |
||||
} |
||||
|
||||
public interface IExportSuccess { |
||||
void showExportSuccessDialog(File file); |
||||
} |
||||
} |
@ -0,0 +1,4 @@ |
||||
package com.project.survey.ui.lofting.pointlofting.record.util; |
||||
|
||||
class RecordDetailActivityDbFindUtils { |
||||
} |
@ -0,0 +1,54 @@ |
||||
package com.project.survey.ui.lofting.pointlofting.record.util; |
||||
|
||||
import android.content.Context; |
||||
import android.view.View; |
||||
import android.widget.EditText; |
||||
|
||||
import com.afollestad.materialdialogs.MaterialDialog; |
||||
|
||||
import com.bingce.utils.StringUtil; |
||||
import com.project.survey.R; |
||||
import com.project.survey.util.CommonUtils; |
||||
|
||||
|
||||
class RecordDetailActivityRemarksUtils { |
||||
static void changeRemarks(Context context, String remarks, IOnRemarksChanged remarksChanged) { |
||||
MaterialDialog dialog = new MaterialDialog.Builder(context) |
||||
.title(R.string.remarks) |
||||
.customView(R.layout.dialog_edit_remarks, false) |
||||
.onPositive((dialog1, which) -> { |
||||
View contentView = dialog1.getCustomView(); |
||||
if (contentView == null) { |
||||
return; |
||||
} |
||||
EditText met_remarks = contentView.findViewById(R.id.et_dialog_edit_remarks); |
||||
if (met_remarks == null) { |
||||
return; |
||||
} |
||||
String remarks1 = met_remarks.getText().toString(); |
||||
if (remarksChanged != null && !StringUtil.isEmpty(remarks1)) { |
||||
remarksChanged.onChanged(remarks1); |
||||
} |
||||
CommonUtils.hideSoftInput(); |
||||
}) |
||||
.positiveText(context.getString(R.string.save)) |
||||
.negativeText(context.getString(R.string.cancel)) |
||||
.show(); |
||||
|
||||
View contentView = dialog.getCustomView(); |
||||
if (contentView != null) { |
||||
EditText editText = contentView.findViewById(R.id.et_dialog_edit_remarks); |
||||
if (editText != null) { |
||||
if (StringUtil.isEmpty(remarks)) { |
||||
editText.setHint(R.string.empty); |
||||
} else { |
||||
editText.setText(remarks); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
interface IOnRemarksChanged { |
||||
void onChanged(String remarks); |
||||
} |
||||
} |
@ -0,0 +1,25 @@ |
||||
package com.project.survey.ui.lofting.pointlofting.record.util; |
||||
|
||||
import androidx.annotation.Nullable; |
||||
|
||||
import com.bingce.data.DeviceInfoData; |
||||
|
||||
import java.util.Date; |
||||
import java.util.LinkedHashMap; |
||||
|
||||
public class RecordDetailData { |
||||
public final String recordId; |
||||
public final LinkedHashMap<String, String> keyValueMap; |
||||
@Nullable |
||||
public final DeviceInfoData deviceInfoData; |
||||
public final Date date; |
||||
public final String remarks; |
||||
|
||||
public RecordDetailData(String recordId, LinkedHashMap<String, String> keyValueMap, @Nullable DeviceInfoData deviceInfoData, Date date, String remarks) { |
||||
this.recordId = recordId; |
||||
this.keyValueMap = keyValueMap; |
||||
this.deviceInfoData = deviceInfoData; |
||||
this.date = date; |
||||
this.remarks = remarks; |
||||
} |
||||
} |
@ -0,0 +1,36 @@ |
||||
package com.project.survey.ui.lofting.pointlofting.record.util; |
||||
|
||||
import android.graphics.Color; |
||||
|
||||
import androidx.annotation.NonNull; |
||||
import androidx.recyclerview.widget.RecyclerView; |
||||
|
||||
|
||||
import com.project.survey.App; |
||||
import com.project.survey.databinding.RecyclerviewItemRecordsBinding; |
||||
|
||||
import blankj.utilcode.util.Utils; |
||||
|
||||
public class RecordItemVH extends RecyclerView.ViewHolder { |
||||
public final RecyclerviewItemRecordsBinding itemBinding; |
||||
|
||||
public RecordItemVH(@NonNull RecyclerviewItemRecordsBinding binding) { |
||||
super(binding.getRoot()); |
||||
this.itemBinding = binding; |
||||
} |
||||
|
||||
public void doBinder(RecyclerViewItemData instance) { |
||||
itemBinding.recyclerviewItemSwipeRecordTitle1.setText(instance.title1); |
||||
itemBinding.recyclerviewItemSwipeRecordTitle2.setText(instance.title2); |
||||
itemBinding.recyclerviewItemSwipeRecordBody1.setText(instance.body1); |
||||
itemBinding.recyclerviewItemSwipeRecordBody2.setText(instance.body2); |
||||
itemBinding.recyclerviewItemSwipeRecordBody3.setText(instance.body3); |
||||
itemBinding.recyclerviewItemSwipeRecordBody4.setText(instance.body4); |
||||
itemBinding.recyclerviewItemSwipeRecordBody5.setText(instance.body5); |
||||
if (((App) Utils.getApp()).isThemeDark) { |
||||
itemBinding.sll.getShapeDrawableBuilder().setSolidColor(Color.GRAY).intoBackground(); |
||||
}else { |
||||
itemBinding.sll.getShapeDrawableBuilder().setSolidColor(Color.WHITE).intoBackground(); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,25 @@ |
||||
package com.project.survey.ui.lofting.pointlofting.record.util; |
||||
|
||||
public interface RecordTypeConstants { |
||||
int TYPE_K2XYZ = 0; |
||||
int TYPE_XYZ2K = TYPE_K2XYZ + 1; |
||||
int TYPE_TUNNEL_BACK_BREAK = TYPE_XYZ2K + 1; |
||||
int TYPE_LEVEL = TYPE_TUNNEL_BACK_BREAK + 1; |
||||
int TYPE_COMMON_SIDE = TYPE_LEVEL + 1; |
||||
int TYPE_FREEDOM_SIDE = TYPE_COMMON_SIDE + 1; |
||||
int TYPE_POINT_STAKE = TYPE_FREEDOM_SIDE + 1; |
||||
int TYPE_SUBWAY_SEGMENT = TYPE_POINT_STAKE + 1; |
||||
int TYPE_BRIDGE_STAKING = TYPE_SUBWAY_SEGMENT + 1;//桥梁放样的
|
||||
int TYPE_ROTARY_BRIDGE_6COM = TYPE_BRIDGE_STAKING + 1;//6com转体桥
|
||||
int TYPE_MEASURING_TAPE = TYPE_ROTARY_BRIDGE_6COM + 1;//进尺
|
||||
int TYPE_BRIDGE_STAKING2 = TYPE_MEASURING_TAPE + 1;//桥梁放样2
|
||||
int TYPE_ROTARY_BRIDGE_BC = TYPE_BRIDGE_STAKING2 + 1;//bc转体桥
|
||||
|
||||
int TYPE_WATER_PIPE_BACK_BREAK = TYPE_ROTARY_BRIDGE_BC + 1; |
||||
|
||||
|
||||
//自定义 定制类型
|
||||
int TYPE_CUSTOM_ZHONG_JIAO_ONE = 100;//中交一公司
|
||||
int TYPE_CUSTOM_TIAN_JING_ONE = TYPE_CUSTOM_ZHONG_JIAO_ONE + 1;//天津项目
|
||||
int TYPE_CUSTOM_MDM = TYPE_CUSTOM_TIAN_JING_ONE + 1;//测量数据管理
|
||||
} |
@ -0,0 +1,80 @@ |
||||
package com.project.survey.ui.lofting.pointlofting.record.util; |
||||
|
||||
import android.content.Context; |
||||
import android.os.CountDownTimer; |
||||
|
||||
import com.afollestad.materialdialogs.DialogAction; |
||||
import com.afollestad.materialdialogs.MaterialDialog; |
||||
import com.afollestad.materialdialogs.internal.MDButton; |
||||
import com.bingce.utils.ContextProviderUtils; |
||||
import com.bingce.utils.IProvider; |
||||
|
||||
import blankj.utilcode.util.ToastUtils; |
||||
import cn.liuyanbing.surveyor.R; |
||||
|
||||
public class RecordsActivityClearUtils extends ContextProviderUtils { |
||||
private MDButton mPositiveAction; |
||||
|
||||
private final IProvider<Integer> currentTypeFromSpinner; |
||||
|
||||
public RecordsActivityClearUtils(IProvider<Context> contextIProvider, IProvider<Integer> currentTypeFromSpinner) { |
||||
super(contextIProvider); |
||||
this.currentTypeFromSpinner = currentTypeFromSpinner; |
||||
} |
||||
|
||||
void showClearDialog(Runnable clearCallback) { |
||||
if (isCloceFunction()) { |
||||
ToastUtils.showShort("暂不支持"); |
||||
return; |
||||
} |
||||
MaterialDialog dialog = new MaterialDialog.Builder(context()) |
||||
.title(R.string.warning) |
||||
.content(R.string.confirm_delete_filter_records) |
||||
.positiveText(getString(R.string.clear)) |
||||
.negativeText(getString(R.string.cancel)) |
||||
.onPositive((dialog1, which) -> { |
||||
// ProgressDialog mProgressDialog = new ProgressDialog(context());
|
||||
// mProgressDialog.setMessage(getString(R.string.deleting));
|
||||
// mProgressDialog.show();
|
||||
// ThreadPoolUtil.execute(() -> {
|
||||
// IRecordsUtils recordsUtils = recordsUtilsMap.get(currentTypeFromSpinner);
|
||||
// if (recordsUtils != null) {
|
||||
// recordsUtils.clearInWorkerThread(this, mProgressDialog, filterParameter());
|
||||
// }
|
||||
// ToastUtils.showShort(R.string.clean_over);
|
||||
// });
|
||||
if (clearCallback != null) { |
||||
clearCallback.run(); |
||||
} |
||||
}) |
||||
.build(); |
||||
|
||||
mPositiveAction = dialog.getActionButton(DialogAction.POSITIVE); |
||||
mPositiveAction.setEnabled(false); |
||||
final CountDownTimer countDownTimer = new CountDownTimer(5000, 1000) { |
||||
@Override |
||||
public void onTick(long millisUntilFinished) { |
||||
mPositiveAction.setText(getString(R.string.clear) + "(" + millisUntilFinished / 1000 + "s)"); |
||||
} |
||||
|
||||
@Override |
||||
public void onFinish() { |
||||
mPositiveAction.setEnabled(true); |
||||
mPositiveAction.setText(R.string.clear); |
||||
} |
||||
}.start(); |
||||
dialog.setOnDismissListener(dialog12 -> countDownTimer.cancel()); |
||||
|
||||
dialog.show(); |
||||
} |
||||
|
||||
/** |
||||
* 是否关闭的功能 |
||||
* |
||||
* @return |
||||
*/ |
||||
private boolean isCloceFunction() { |
||||
return currentTypeFromSpinner.value() == RecordTypeConstants.TYPE_CUSTOM_TIAN_JING_ONE |
||||
|| currentTypeFromSpinner.value() == RecordTypeConstants.TYPE_CUSTOM_ZHONG_JIAO_ONE; |
||||
} |
||||
} |
@ -0,0 +1,183 @@ |
||||
package com.project.survey.ui.lofting.pointlofting.record.util; |
||||
|
||||
import android.app.Activity; |
||||
import android.content.Context; |
||||
import android.graphics.Color; |
||||
import android.text.Editable; |
||||
import android.text.TextWatcher; |
||||
import android.view.View; |
||||
import android.widget.CheckBox; |
||||
|
||||
import androidx.annotation.NonNull; |
||||
|
||||
import com.afollestad.materialdialogs.DialogAction; |
||||
import com.afollestad.materialdialogs.MaterialDialog; |
||||
import com.afollestad.materialdialogs.internal.MDButton; |
||||
import com.bingce.file.FileOperator; |
||||
|
||||
import com.bingce.utils.ContextProviderUtils; |
||||
import com.bingce.utils.FileUtil; |
||||
import com.bingce.utils.IProvider; |
||||
import com.hjq.permissions.OnPermissionCallback; |
||||
import com.hjq.permissions.Permission; |
||||
import com.hjq.permissions.XXPermissions; |
||||
import com.project.survey.R; |
||||
import com.rengwuxian.materialedittext.MaterialEditText; |
||||
|
||||
import java.io.File; |
||||
import java.util.List; |
||||
|
||||
import blankj.utilcode.util.ToastUtils; |
||||
import blankj.utilcode.util.Utils; |
||||
|
||||
|
||||
public class RecordsActivityExportUtils extends ContextProviderUtils { |
||||
private MDButton mPositiveAction; |
||||
private MaterialEditText met_export_name; |
||||
private CheckBox checkBoxRtkStatus, checkBoxHr; |
||||
private boolean isExportRtkStatus = true, isExportHr = true; |
||||
|
||||
private final IProvider<Integer> currentTypeFromSpinner; |
||||
|
||||
public RecordsActivityExportUtils(IProvider<Context> contextIProvider, IProvider<Integer> currentTypeFromSpinner) { |
||||
super(contextIProvider); |
||||
this.currentTypeFromSpinner = currentTypeFromSpinner; |
||||
} |
||||
|
||||
void showExportDialog(IExportCallback exportCallback) { |
||||
MaterialDialog dialog = new MaterialDialog.Builder(context()) |
||||
.title(R.string.export_excel) |
||||
.customView(R.layout.dialog_export_record_config, true) |
||||
.positiveText(R.string.export_records) |
||||
.negativeText(R.string.cancel) |
||||
.onPositive(new MaterialDialog.SingleButtonCallback() { |
||||
@Override |
||||
public void onClick(@NonNull MaterialDialog dialog, |
||||
@NonNull DialogAction which) { |
||||
String name; |
||||
if ("".equals(met_export_name.getText().toString().trim())) { |
||||
ToastUtils.showShort(R.string.file_name_can_not_empty); |
||||
return; |
||||
} else { |
||||
name = met_export_name.getText().toString().trim(); |
||||
} |
||||
|
||||
if (isIgnoreDeviceExport()) { |
||||
isExportRtkStatus = true; |
||||
isExportHr = true; |
||||
} else { |
||||
isExportRtkStatus = checkBoxRtkStatus.isChecked(); |
||||
isExportHr = checkBoxHr.isChecked(); |
||||
} |
||||
|
||||
// IRecordsUtils recordsUtils = recordsUtilsMap.get(currentTypeFromSpinner);
|
||||
// if (recordsUtils != null) {
|
||||
// recordsUtils.exportRecord2ExcelAsync(RecordsActivity.this, name, filterParameter(), headers, isExportRtkStatus, isExportHr,
|
||||
// file -> showExportSuccessDialog(file));
|
||||
// }
|
||||
if (exportCallback != null) { |
||||
exportCallback.onExport(name, isExportRtkStatus, isExportHr, file -> showExportSuccessDialog(file)); |
||||
} |
||||
} |
||||
}).build(); |
||||
|
||||
met_export_name = |
||||
dialog.getCustomView().findViewById(R.id.dialog_export_record_config_name); |
||||
checkBoxRtkStatus = |
||||
dialog.getCustomView().findViewById(R.id.dialog_export_record_config_check_rtk_status); |
||||
checkBoxHr = dialog.getCustomView().findViewById(R.id.dialog_export_record_config_check_hr); |
||||
mPositiveAction = dialog.getActionButton(DialogAction.POSITIVE); |
||||
|
||||
if (isIgnoreDeviceExport()) { |
||||
checkBoxRtkStatus.setVisibility(View.GONE); |
||||
checkBoxHr.setVisibility(View.GONE); |
||||
} else { |
||||
checkBoxRtkStatus.setVisibility(View.VISIBLE); |
||||
checkBoxHr.setVisibility(View.VISIBLE); |
||||
checkBoxRtkStatus.setChecked(isExportRtkStatus); |
||||
checkBoxHr.setChecked(isExportHr); |
||||
} |
||||
|
||||
initMaterialEditTextColor(); |
||||
|
||||
met_export_name.addTextChangedListener(new TextWatcher() { |
||||
@Override |
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) { |
||||
|
||||
} |
||||
|
||||
@Override |
||||
public void onTextChanged(CharSequence s, int start, int before, int count) { |
||||
|
||||
} |
||||
|
||||
@Override |
||||
public void afterTextChanged(Editable s) { |
||||
if (!"".equals(met_export_name.getText().toString().trim())) { |
||||
mPositiveAction.setEnabled(true); |
||||
} else { |
||||
mPositiveAction.setEnabled(false); |
||||
} |
||||
} |
||||
}); |
||||
dialog.show(); |
||||
mPositiveAction.setEnabled(false); |
||||
} |
||||
|
||||
void showExportSuccessDialog(final File file) { |
||||
new MaterialDialog.Builder(context()).title(R.string.export_successful) |
||||
.content(R.string.exported_file_save_at_surveyor_exported_files) |
||||
.positiveText(R.string.send_to) |
||||
.negativeText(R.string.open) |
||||
.neutralText(R.string.close) |
||||
.onPositive((dialog, which) -> FileOperator.shareFile(context(), file, BuildConfig.APPLICATION_ID)) |
||||
.onNegative((dialog, which) -> FileUtil.openFile(context(), file)).show(); |
||||
} |
||||
|
||||
private void initMaterialEditTextColor() { |
||||
if (((App) Utils.getApp()).isThemeDark) { |
||||
met_export_name.setMetTextColor(Color.WHITE); |
||||
met_export_name.setPrimaryColor(Color.LTGRAY); |
||||
met_export_name.setFocusFraction(1.0f); |
||||
met_export_name.setMetHintTextColor(Color.GRAY); |
||||
met_export_name.setUnderlineColor(Color.GRAY); |
||||
} |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 是否忽略导出(包含RTK状态,包含杆高/镜高) |
||||
* |
||||
* @return true 忽略 |
||||
*/ |
||||
private boolean isIgnoreDeviceExport() { |
||||
return currentTypeFromSpinner.value() == RecordTypeConstants.TYPE_LEVEL |
||||
|| currentTypeFromSpinner.value() == RecordTypeConstants.TYPE_SUBWAY_SEGMENT; |
||||
} |
||||
|
||||
public void requestStoragePermission(Activity activity, IExportCallback exportCallback) { |
||||
XXPermissions.with(activity) |
||||
.permission(Permission.MANAGE_EXTERNAL_STORAGE) |
||||
.request(new OnPermissionCallback() { |
||||
@Override |
||||
public void onGranted(List<String> permissions, boolean all) { |
||||
showExportDialog(exportCallback); |
||||
} |
||||
|
||||
@Override |
||||
public void onDenied(List<String> permissions, boolean never) { |
||||
if (never) { |
||||
ToastUtils.showShort(getString(R.string.manually_grant_read_and_write_permissions_to_files)); |
||||
// 如果是被永久拒绝就跳转到应用权限系统设置页面
|
||||
XXPermissions.startPermissionActivity(activity, permissions); |
||||
} else { |
||||
requestStoragePermission(activity, exportCallback); |
||||
} |
||||
} |
||||
}); |
||||
} |
||||
|
||||
public interface IExportCallback { |
||||
void onExport(String name, boolean isExportRtkStatus, boolean isExportHr,RecordsActivity.IExportSuccess exportSuccess); |
||||
} |
||||
} |
@ -0,0 +1,23 @@ |
||||
package com.project.survey.ui.lofting.pointlofting.record.util; |
||||
|
||||
import java.util.Date; |
||||
|
||||
public class RecordsActivityFilterParameter { |
||||
public final String road; |
||||
public final String k; |
||||
public final String remarks; |
||||
public final Date start; |
||||
public final Date end; |
||||
public String tcsType; |
||||
public RecordsActivityFilterParameter(String road, String k, String remarks, Date start, Date end) { |
||||
this.road = road; |
||||
this.k = k; |
||||
this.remarks = remarks; |
||||
this.start = start; |
||||
this.end = end; |
||||
} |
||||
public RecordsActivityFilterParameter(String road, String k, String remarks, Date start, Date end,String tcsType) { |
||||
this(road,k,remarks,start,end); |
||||
this.tcsType = tcsType; |
||||
} |
||||
} |
@ -0,0 +1,429 @@ |
||||
package com.project.survey.ui.lofting.pointlofting.record.util; |
||||
|
||||
import android.content.Context; |
||||
import android.graphics.Color; |
||||
import android.view.Gravity; |
||||
import android.view.View; |
||||
import android.view.ViewGroup; |
||||
import android.widget.RadioGroup; |
||||
import android.widget.TextView; |
||||
|
||||
import androidx.appcompat.app.AlertDialog; |
||||
|
||||
import com.bingce.utils.ContextProviderUtils; |
||||
import com.bingce.utils.DateUtils; |
||||
import com.bingce.utils.IProvider; |
||||
import com.kongzue.dialogx.dialogs.BottomDialog; |
||||
import com.kongzue.dialogx.dialogs.BottomMenu; |
||||
import com.kongzue.dialogx.interfaces.OnBindView; |
||||
import com.kongzue.dialogx.interfaces.OnMenuItemClickListener; |
||||
import com.project.survey.R; |
||||
import com.rengwuxian.materialedittext.MaterialEditText; |
||||
|
||||
import java.util.Calendar; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
|
||||
import blankj.utilcode.util.ToastUtils; |
||||
import blankj.utilcode.util.Utils; |
||||
import cn.aigestudio.datepicker.views.DatePicker; |
||||
|
||||
public class RecordsActivityFilterUtils extends ContextProviderUtils { |
||||
private int lastFilterPosition = 1; |
||||
private int lastFilterTcsType = 0; |
||||
private Date startDate = DateUtils.reverse2Date(DateUtils.get7DaysStartTime()); |
||||
private Date endDate = DateUtils.reverse2Date(DateUtils.getTodayEndTime()); |
||||
private MaterialEditText met_roadname_keyword, met_kilometer_keyword, met_remarks_keyword; |
||||
private RadioGroup group; |
||||
private RadioGroup tcsGroup; |
||||
private String roadname_keyword = "", kilometer_keyword = "", remarks_keyword = ""; |
||||
private String tcsType; |
||||
|
||||
private final IProvider<Integer> currentTypeFromSpinner; |
||||
private TextView tv_dialog_date_filter, tv_tcstype_filter; |
||||
private final IProvider<TextView> tv_top_date_filter; |
||||
private final IProvider<TextView> tv_top_dcs_filter; |
||||
|
||||
public void resetTcsType() { |
||||
tcsType = null; |
||||
lastFilterTcsType = 0; |
||||
tv_top_dcs_filter.value().setVisibility(View.GONE); |
||||
} |
||||
|
||||
public RecordsActivityFilterUtils(IProvider<Context> contextIProvider, IProvider<Integer> currentTypeFromSpinner, IProvider<TextView> tv_top_date_filter, IProvider<TextView> tv_top_dcs_filter) { |
||||
super(contextIProvider); |
||||
this.currentTypeFromSpinner = currentTypeFromSpinner; |
||||
this.tv_top_date_filter = tv_top_date_filter; |
||||
this.tv_top_dcs_filter = tv_top_dcs_filter; |
||||
} |
||||
|
||||
|
||||
private void checkFilterGroup(int checkId, boolean ready2Cal) { |
||||
switch (checkId) { |
||||
case R.id.dialog_records_filter_radio1: |
||||
startDate = DateUtils.reverse2Date(DateUtils.getTodayStartTime()); |
||||
endDate = DateUtils.reverse2Date(DateUtils.getTodayEndTime()); |
||||
// tv_dialog_date_filter.setText(DateUtils.toDate(startDate) + "~" + DateUtils.toDate(endDate));
|
||||
// tv_top_date_filter.value().setText(DateUtils.toDate(startDate) + "~" + DateUtils.toDate(endDate));
|
||||
lastFilterPosition = 0; |
||||
break; |
||||
case R.id.dialog_records_filter_radio2: |
||||
startDate = DateUtils.reverse2Date(DateUtils.get7DaysStartTime()); |
||||
endDate = DateUtils.reverse2Date(DateUtils.getTodayEndTime()); |
||||
// tv_dialog_date_filter.setText(DateUtils.toDate(startDate) + "~" + DateUtils.toDate(endDate));
|
||||
// tv_top_date_filter.value().setText(DateUtils.toDate(startDate) + "~" + DateUtils.toDate(endDate));
|
||||
lastFilterPosition = 1; |
||||
break; |
||||
case R.id.dialog_records_filter_radio3: |
||||
startDate = null; |
||||
endDate = null; |
||||
// tv_dialog_date_filter.setText(R.string.all);
|
||||
// tv_top_date_filter.value().setText(R.string.all);
|
||||
lastFilterPosition = 2; |
||||
break; |
||||
case R.id.dialog_records_filter_radio4: |
||||
if (!ready2Cal) { |
||||
showTimePickerDialog(); |
||||
} |
||||
break; |
||||
} |
||||
} |
||||
|
||||
private void checkFilterGroup2(int checkId, boolean ready2Cal) { |
||||
switch (checkId) { |
||||
case 0: |
||||
startDate = DateUtils.reverse2Date(DateUtils.getTodayStartTime()); |
||||
endDate = DateUtils.reverse2Date(DateUtils.getTodayEndTime()); |
||||
// tv_dialog_date_filter.setText(DateUtils.toDate(startDate) + "~" + DateUtils.toDate(endDate));
|
||||
// tv_top_date_filter.value().setText(DateUtils.toDate(startDate) + "~" + DateUtils.toDate(endDate));
|
||||
lastFilterPosition = 0; |
||||
break; |
||||
case 1: |
||||
startDate = DateUtils.reverse2Date(DateUtils.get7DaysStartTime()); |
||||
endDate = DateUtils.reverse2Date(DateUtils.getTodayEndTime()); |
||||
// tv_dialog_date_filter.setText(DateUtils.toDate(startDate) + "~" + DateUtils.toDate(endDate));
|
||||
// tv_top_date_filter.value().setText(DateUtils.toDate(startDate) + "~" + DateUtils.toDate(endDate));
|
||||
lastFilterPosition = 1; |
||||
break; |
||||
case 2: |
||||
startDate = null; |
||||
endDate = null; |
||||
// tv_dialog_date_filter.setText(R.string.all);
|
||||
// tv_top_date_filter.value().setText(R.string.all);
|
||||
lastFilterPosition = 2; |
||||
break; |
||||
case 3: |
||||
if (!ready2Cal) { |
||||
showTimePickerDialog(); |
||||
} |
||||
break; |
||||
} |
||||
} |
||||
|
||||
private void checkFilterGroup(int checkId) { |
||||
checkFilterGroup(checkId, false); |
||||
} |
||||
|
||||
private String[] timeMenuArr; |
||||
private String[] tcsMenuArr; |
||||
|
||||
public void showTimeFilterDialog(Runnable updateCallback) { |
||||
if (timeMenuArr == null || timeMenuArr.length == 0) { |
||||
timeMenuArr = new String[]{context().getString(R.string.today), context().getString(R.string.within_seven_days), context().getString(R.string.all), context().getString(R.string.custom_time)}; |
||||
} |
||||
BottomMenu.build().setMenuList(timeMenuArr) |
||||
.setShowSelectedBackgroundTips(true) |
||||
.setTitle(R.string.time_filter) |
||||
.setOnMenuItemClickListener((dialog, text, index) -> { |
||||
tv_top_date_filter.value().setText(timeMenuArr[index]); |
||||
checkFilterGroup2(index, false); |
||||
if (updateCallback != null) updateCallback.run(); |
||||
return false; |
||||
}).setCancelButton(R.string.cancel).setSelection(lastFilterPosition).show(); |
||||
} |
||||
|
||||
public void showTcsTypeDialog(Runnable updateCallback) { |
||||
if (tcsMenuArr == null || tcsMenuArr.length == 0) { |
||||
tcsMenuArr = new String[]{context().getString(R.string.all), context().getString(R.string.kaiwa), context().getString(R.string.chuzhi), context().getString(R.string.erchen)}; |
||||
} |
||||
BottomMenu.build().setMenuList(tcsMenuArr) |
||||
.setShowSelectedBackgroundTips(true) |
||||
.setTitle(R.string.type_filter) |
||||
.setOnMenuItemClickListener(new OnMenuItemClickListener<BottomMenu>() { |
||||
@Override |
||||
public boolean onClick(BottomMenu dialog, CharSequence text, int index) { |
||||
lastFilterTcsType = index; |
||||
tcsType = index == 0 ? null : tcsMenuArr[index]; |
||||
tv_top_dcs_filter.value().setText(tcsMenuArr[index]); |
||||
if (updateCallback != null) updateCallback.run(); |
||||
return false; |
||||
} |
||||
}).setCancelButton(R.string.cancel).setSelection(lastFilterTcsType).show(); |
||||
} |
||||
|
||||
public void showFilterDialog(Runnable updateCallback) { |
||||
BottomDialog.build(new OnBindView<BottomDialog>(R.layout.dialog_records_filter) { |
||||
@Override |
||||
public void onBind(BottomDialog dialog, View v) { |
||||
met_roadname_keyword = v.findViewById(R.id.met_dialog_records_filter_roadname_keyword); |
||||
met_kilometer_keyword = v.findViewById(R.id.met_dialog_records_filter_kilometer_keyword); |
||||
met_remarks_keyword = v.findViewById(R.id.met_dialog_records_filter_remarks_keyword); |
||||
if (isWaterPipKeyword()) { |
||||
met_roadname_keyword.setHint(R.string.water_pipe_name_keyword); |
||||
} |
||||
met_roadname_keyword.setText(roadname_keyword); |
||||
met_kilometer_keyword.setText(kilometer_keyword); |
||||
met_remarks_keyword.setText(remarks_keyword); |
||||
if (isHideMetRoadKeyword()) { |
||||
if (met_roadname_keyword != null) { |
||||
met_roadname_keyword.setVisibility(View.GONE); |
||||
} |
||||
} |
||||
if (isHideMetKilometerKeyword()) { |
||||
if (met_kilometer_keyword != null) { |
||||
met_kilometer_keyword.setVisibility(View.GONE); |
||||
} |
||||
} |
||||
if (isHideMetRemarksKeyword()) { |
||||
if (met_remarks_keyword != null) { |
||||
met_remarks_keyword.setVisibility(View.GONE); |
||||
} |
||||
} |
||||
initMaterialEditTextColor2(); |
||||
} |
||||
}).setTitle(R.string.other_filter).setOkButton(R.string.confirm, (dialog, v) -> { |
||||
roadname_keyword = met_roadname_keyword.getText().toString(); |
||||
kilometer_keyword = met_kilometer_keyword.getText().toString(); |
||||
remarks_keyword = met_remarks_keyword.getText().toString(); |
||||
if (updateCallback != null) { |
||||
updateCallback.run(); |
||||
} |
||||
return false; |
||||
}).setCancelButton(R.string.cancel).show(); |
||||
// MaterialDialog dialog = new MaterialDialog.Builder(context())
|
||||
// .title(R.string.filter)
|
||||
// .customView(R.layout.dialog_records_filter, true)
|
||||
// .onPositive((dialog1, which) -> {
|
||||
// roadname_keyword = met_roadname_keyword.getText().toString();
|
||||
// kilometer_keyword = met_kilometer_keyword.getText().toString();
|
||||
// remarks_keyword = met_remarks_keyword.getText().toString();
|
||||
// if (type == RecordTypeConstants.TYPE_TUNNEL_BACK_BREAK){
|
||||
// RadioButton crb = tcsGroup.findViewById(tcsGroup.getCheckedRadioButtonId());
|
||||
// String crbTxt = crb.getText().toString();
|
||||
// lastFilterTcsType = tcsGroup.indexOfChild(crb);
|
||||
// if (context().getString(R.string.all).equals(crbTxt)){
|
||||
// tcsType = null;
|
||||
// }else {
|
||||
// tcsType = crbTxt;
|
||||
// }
|
||||
// }else {
|
||||
// tcsType = null;
|
||||
// }
|
||||
// //读取设置信息
|
||||
// int checkId = group.getCheckedRadioButtonId();
|
||||
// checkFilterGroup(checkId, true);
|
||||
//// updateRecyclerView();
|
||||
// if (updateCallback != null) {
|
||||
// updateCallback.run();
|
||||
// }
|
||||
// })
|
||||
// .positiveText(context().getString(R.string.confirm))
|
||||
// .negativeText(context().getString(R.string.cancel)).build();
|
||||
//
|
||||
// tv_dialog_date_filter =
|
||||
// dialog.getCustomView().findViewById(R.id.tv_dialog_records_filter_period_of_time);
|
||||
// tv_tcstype_filter = dialog.getCustomView().findViewById(R.id.tv_dialog_records_filter_period_of_tcstype);
|
||||
// tcsGroup = dialog.getCustomView().findViewById(R.id.radiogroup_dialog_records_filter_tcstype);
|
||||
// group = dialog.getCustomView().findViewById(R.id.radiogroup_dialog_records_filter_time);
|
||||
// met_roadname_keyword =
|
||||
// dialog.getCustomView().findViewById(R.id.met_dialog_records_filter_roadname_keyword);
|
||||
// if (type == RecordTypeConstants.TYPE_TUNNEL_BACK_BREAK){
|
||||
// tv_tcstype_filter.setVisibility(View.VISIBLE);
|
||||
// tcsGroup.setVisibility(View.VISIBLE);
|
||||
// }
|
||||
// if (isHideMetRoadKeyword()) {
|
||||
// if (met_roadname_keyword != null) {
|
||||
// met_roadname_keyword.setVisibility(View.GONE);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// met_kilometer_keyword =
|
||||
// dialog.getCustomView().findViewById(R.id.met_dialog_records_filter_kilometer_keyword);
|
||||
//
|
||||
// if (isHideMetKilometerKeyword()) {
|
||||
// if (met_kilometer_keyword != null) {
|
||||
// met_kilometer_keyword.setVisibility(View.GONE);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// met_remarks_keyword =
|
||||
// dialog.getCustomView().findViewById(R.id.met_dialog_records_filter_remarks_keyword);
|
||||
//
|
||||
// if (isHideMetRemarksKeyword()) {
|
||||
// if (met_remarks_keyword != null) {
|
||||
// met_remarks_keyword.setVisibility(View.GONE);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// initMaterialEditTextColor2();
|
||||
//
|
||||
// met_roadname_keyword.setText(roadname_keyword);
|
||||
// met_kilometer_keyword.setText(kilometer_keyword);
|
||||
// met_remarks_keyword.setText(remarks_keyword);
|
||||
//
|
||||
// switch (lastFilterPosition) {
|
||||
// case 0:
|
||||
// ((RadioButton) dialog.getCustomView().findViewById(R.id.dialog_records_filter_radio1)).setChecked(true);
|
||||
// break;
|
||||
// case 1:
|
||||
// ((RadioButton) dialog.getCustomView().findViewById(R.id.dialog_records_filter_radio2)).setChecked(true);
|
||||
// break;
|
||||
// case 2:
|
||||
// ((RadioButton) dialog.getCustomView().findViewById(R.id.dialog_records_filter_radio3)).setChecked(true);
|
||||
// break;
|
||||
// case 3:
|
||||
// ((RadioButton) dialog.getCustomView().findViewById(R.id.dialog_records_filter_radio4)).setChecked(true);
|
||||
// break;
|
||||
// }
|
||||
// ((RadioButton)tcsGroup.getChildAt(lastFilterTcsType)).setChecked(true);
|
||||
//
|
||||
// group.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
|
||||
// @Override
|
||||
// public void onCheckedChanged(RadioGroup radioGroup, int checkId) {
|
||||
// checkFilterGroup(checkId);
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// dialog.show();
|
||||
} |
||||
|
||||
private void showTimePickerDialog() { |
||||
final AlertDialog dialog = new AlertDialog.Builder(context()).create(); |
||||
dialog.show(); |
||||
|
||||
DatePicker datePicker = new DatePicker(context()); |
||||
|
||||
Calendar calendar = Calendar.getInstance(); |
||||
datePicker.setDate(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH) + 1); |
||||
datePicker.setOnDateSelectedListener(new DatePicker.OnDateSelectedListener() { |
||||
@Override |
||||
public void onDateSelected(List<String> date) { |
||||
if (date.size() == 0) { |
||||
ToastUtils.showShort(R.string.not_choose_date); |
||||
return; |
||||
} |
||||
Date min = new Date(); |
||||
Date max = new Date(0); |
||||
if (date.size() == 1) { |
||||
startDate = |
||||
DateUtils.reverse2Date(DateUtils.toDate(DateUtils.reverse2Date(date.get(0))) + " 00:00:00"); |
||||
endDate = |
||||
DateUtils.reverse2Date(DateUtils.toDate(DateUtils.reverse2Date(date.get(0))) + " 23:59:59"); |
||||
// tv_dialog_date_filter.setText(DateUtils.toDate(startDate) + "~" + DateUtils.toDate(endDate));
|
||||
// tv_top_date_filter.value().setText(DateUtils.toDate(startDate) + "~" + DateUtils.toDate(endDate));
|
||||
lastFilterPosition = 1; |
||||
} else if (date.size() > 1) { |
||||
for (int i = 0; i < date.size(); i++) { |
||||
if (DateUtils.reverse2Date(date.get(i)).after(max)) |
||||
max = DateUtils.reverse2Date(date.get(i)); |
||||
if (DateUtils.reverse2Date(date.get(i)).before(min)) |
||||
min = DateUtils.reverse2Date(date.get(i)); |
||||
} |
||||
if (max.after(min)) { |
||||
startDate = DateUtils.reverse2Date(DateUtils.toDate(min) + " 00:00:00"); |
||||
endDate = DateUtils.reverse2Date(DateUtils.toDate(max) + " 23:59:59"); |
||||
// tv_dialog_date_filter.setText(DateUtils.toDate(startDate) + "~" + DateUtils.toDate(endDate));
|
||||
// tv_top_date_filter.value().setText(DateUtils.toDate(startDate) + "~" + DateUtils.toDate(endDate));
|
||||
lastFilterPosition = 1; |
||||
} |
||||
} |
||||
dialog.dismiss(); |
||||
} |
||||
}); |
||||
|
||||
ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(ViewGroup.LayoutParams |
||||
.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); |
||||
dialog.getWindow().setContentView(datePicker, params); |
||||
dialog.getWindow().setGravity(Gravity.CENTER); |
||||
} |
||||
|
||||
private void initMaterialEditTextColor2() { |
||||
if (((App) Utils.getApp()).isThemeDark) { |
||||
met_roadname_keyword.setMetTextColor(Color.WHITE); |
||||
met_kilometer_keyword.setMetTextColor(Color.WHITE); |
||||
met_remarks_keyword.setMetTextColor(Color.WHITE); |
||||
|
||||
met_roadname_keyword.setPrimaryColor(Color.LTGRAY); |
||||
met_kilometer_keyword.setPrimaryColor(Color.LTGRAY); |
||||
met_remarks_keyword.setPrimaryColor(Color.LTGRAY); |
||||
|
||||
met_roadname_keyword.setFocusFraction(1.0f); |
||||
met_kilometer_keyword.setFocusFraction(1.0f); |
||||
met_remarks_keyword.setFocusFraction(1.0f); |
||||
|
||||
met_roadname_keyword.setHelperTextColor(Color.GRAY); |
||||
met_kilometer_keyword.setHelperTextColor(Color.GRAY); |
||||
met_remarks_keyword.setHelperTextColor(Color.GRAY); |
||||
|
||||
met_roadname_keyword.setMetHintTextColor(Color.GRAY); |
||||
met_kilometer_keyword.setMetHintTextColor(Color.GRAY); |
||||
met_remarks_keyword.setMetHintTextColor(Color.GRAY); |
||||
|
||||
met_roadname_keyword.setUnderlineColor(Color.GRAY); |
||||
met_kilometer_keyword.setUnderlineColor(Color.GRAY); |
||||
met_remarks_keyword.setUnderlineColor(Color.GRAY); |
||||
} |
||||
} |
||||
|
||||
public String road() { |
||||
return roadname_keyword; |
||||
} |
||||
|
||||
public String k() { |
||||
return kilometer_keyword; |
||||
} |
||||
|
||||
public String remarks() { |
||||
return remarks_keyword; |
||||
} |
||||
|
||||
public Date start() { |
||||
return startDate; |
||||
} |
||||
|
||||
public Date end() { |
||||
return endDate; |
||||
} |
||||
|
||||
public RecordsActivityFilterParameter filterParameter() { |
||||
return new RecordsActivityFilterParameter(road(), k(), remarks(), start(), end(), tcsType); |
||||
} |
||||
|
||||
/** |
||||
* 是否隐藏里程过滤 |
||||
* |
||||
* @return true 隐藏 |
||||
*/ |
||||
private boolean isHideMetKilometerKeyword() { |
||||
return currentTypeFromSpinner.value() == RecordTypeConstants.TYPE_FREEDOM_SIDE |
||||
|| currentTypeFromSpinner.value() == RecordTypeConstants.TYPE_POINT_STAKE; |
||||
} |
||||
|
||||
/** |
||||
* 是否隐藏road过滤 |
||||
*/ |
||||
private boolean isHideMetRoadKeyword() { |
||||
return currentTypeFromSpinner.value() == RecordTypeConstants.TYPE_MEASURING_TAPE; |
||||
} |
||||
|
||||
/** |
||||
* 是否隐藏remarks过滤 |
||||
*/ |
||||
private boolean isHideMetRemarksKeyword() { |
||||
return currentTypeFromSpinner.value() == RecordTypeConstants.TYPE_MEASURING_TAPE; |
||||
} |
||||
|
||||
private boolean isWaterPipKeyword() { |
||||
return currentTypeFromSpinner.value() == RecordTypeConstants.TYPE_WATER_PIPE_BACK_BREAK; |
||||
} |
||||
} |
@ -0,0 +1,83 @@ |
||||
package com.project.survey.ui.lofting.pointlofting.record.util; |
||||
|
||||
import android.content.Context; |
||||
|
||||
import com.bingce.utils.ContextProviderUtils; |
||||
import com.bingce.utils.IProvider; |
||||
import com.project.survey.R; |
||||
|
||||
public class RecordsActivityHeaders extends ContextProviderUtils { |
||||
public String[] mHeaders01, mHeaders02, mHeaders03, mHeaders11, mHeaders12, mHeaders13, |
||||
mHeaders21, mHeaders22, mHeaders23, mHeaders24, |
||||
mHeaders3, mHeaders41, mHeaders42, mHeaders43, mHeaders51, mHeaders52, mHeaders53, |
||||
mHeaders61, mHeaders62, mHeaders63, mHeaders7; |
||||
|
||||
public String[] mHeadersBridgeStaking; |
||||
public String[] mHeadersRotaryBridge; |
||||
public String[] mHeadersBridge2Staking; |
||||
|
||||
public RecordsActivityHeaders(IProvider<Context> contextIProvider) { |
||||
super(contextIProvider); |
||||
} |
||||
|
||||
void initHeaders() { |
||||
initSideCommonHeaders(); |
||||
initSideFreedomHeaders(); |
||||
initKnowPointSettingOutHeaders(); |
||||
} |
||||
|
||||
private void initSideCommonHeaders() { |
||||
mHeaders41 = new String[]{getString(R.string.road_name), getString(R.string.fill_cut), |
||||
getString(R.string.side_name), getString(R.string.move_left_right), |
||||
getString(R.string.move_up_down), getString(R.string.back_break) |
||||
, getString(R.string.move_left_right_to_feature_point), |
||||
getString(R.string.move_up_down_to_feature_point), |
||||
getString(R.string.measured_x_k), getString(R.string.measured_y_d), |
||||
getString(R.string.measured_z), getString(R.string.k) |
||||
, getString(R.string.d), getString(R.string.design_h), |
||||
getString(R.string.longitudinal_slope), getString(R.string.roadbed_edge_h), |
||||
getString(R.string.roadbed_edge_d), getString(R.string.orientation) |
||||
, getString(R.string.remarks), getString(R.string.record_time)}; |
||||
mHeaders42 = new String[]{getString(R.string.position_type), |
||||
getString(R.string.station_type), getString(R.string.satellite) |
||||
, "hrms", "vrms", getString(R.string.diff_age), getString(R.string.battery)}; |
||||
mHeaders43 = new String[]{getString(R.string.hr)}; |
||||
} |
||||
|
||||
private void initSideFreedomHeaders() { |
||||
mHeaders51 = new String[]{getString(R.string.road_name), getString(R.string.begin_x), |
||||
getString(R.string.begin_y), getString(R.string.begin_z), |
||||
getString(R.string.end_x), getString(R.string.end_y), getString(R.string.end_z) |
||||
, getString(R.string.fill_cut), getString(R.string.side_name), |
||||
getString(R.string.move_left_right), getString(R.string.move_up_down), |
||||
getString(R.string.back_break) |
||||
, getString(R.string.move_left_right_to_feature_point), |
||||
getString(R.string.move_up_down_to_feature_point), getString(R.string.measured_x) |
||||
, getString(R.string.measured_y), getString(R.string.measured_z), |
||||
getString(R.string.k) |
||||
, getString(R.string.d), getString(R.string.design_h), |
||||
getString(R.string.longitudinal_slope), getString(R.string.roadbed_edge_h), |
||||
getString(R.string.roadbed_edge_d), getString(R.string.orientation) |
||||
, getString(R.string.remarks), getString(R.string.record_time)}; |
||||
mHeaders52 = new String[]{getString(R.string.position_type), |
||||
getString(R.string.station_type), getString(R.string.satellite) |
||||
, "hrms", "vrms", getString(R.string.diff_age), getString(R.string.battery)}; |
||||
mHeaders53 = new String[]{getString(R.string.hr)}; |
||||
} |
||||
|
||||
private void initKnowPointSettingOutHeaders() { |
||||
mHeaders61 = new String[]{getString(R.string.road_name), getString(R.string.point_name) |
||||
, getString(R.string.design_x), getString(R.string.design_y), getString(R.string.design_z) |
||||
, getString(R.string.measured_x), getString(R.string.measured_y), getString(R.string.measured_z) |
||||
, getString(R.string.distance), getString(R.string.move_up_down) |
||||
, getString(R.string.move_k), getString(R.string.move_d) |
||||
, getString(R.string.move_west_east), getString(R.string.move_north_south) |
||||
, getString(R.string.move_fore_back), getString(R.string.move_left_right) |
||||
, getString(R.string.remarks), getString(R.string.record_time)}; |
||||
mHeaders62 = new String[]{getString(R.string.position_type), |
||||
getString(R.string.station_type), getString(R.string.satellite) |
||||
, "hrms", "vrms", getString(R.string.diff_age), getString(R.string.battery)}; |
||||
mHeaders63 = new String[]{getString(R.string.hr)}; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,4 @@ |
||||
package com.project.survey.ui.lofting.pointlofting.record.util; |
||||
|
||||
class RecordsActivityRecyclerViewUtils { |
||||
} |
@ -0,0 +1,23 @@ |
||||
package com.project.survey.ui.lofting.pointlofting.record.util; |
||||
|
||||
public class RecyclerViewItemData { |
||||
final String id; |
||||
final String title1; |
||||
final String title2; |
||||
final String body1; |
||||
final String body2; |
||||
final String body3; |
||||
final String body4; |
||||
final String body5; |
||||
|
||||
public RecyclerViewItemData(String id, String title1, String title2, String body1, String body2, String body3, String body4, String body5) { |
||||
this.id = id; |
||||
this.title1 = title1; |
||||
this.title2 = title2; |
||||
this.body1 = body1; |
||||
this.body2 = body2; |
||||
this.body3 = body3; |
||||
this.body4 = body4; |
||||
this.body5 = body5; |
||||
} |
||||
} |
@ -0,0 +1,12 @@ |
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" |
||||
android:width="800dp" |
||||
android:height="800dp" |
||||
android:viewportWidth="512" |
||||
android:viewportHeight="512"> |
||||
<path |
||||
android:pathData="M64,320L170.67,320L170.67,362.67L64,362.67L64,320ZM64,256L213.33,256L213.33,213.33L64,213.33L64,256ZM64,149.33L256,149.33L256,106.67L64,106.67L64,149.33ZM432.92,295.99L384,344.9L384,106.67L341.33,106.67L341.33,344.9L292.42,295.99L262.25,326.15L362.67,426.67L463.08,326.15L432.92,295.99Z" |
||||
android:strokeWidth="1" |
||||
android:fillColor="#3333AA" |
||||
android:fillType="evenOdd" |
||||
android:strokeColor="#00000000"/> |
||||
</vector> |
@ -0,0 +1,572 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="match_parent"> |
||||
<LinearLayout |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:orientation="vertical"> |
||||
|
||||
<RelativeLayout |
||||
android:id="@+id/rl_status_limit" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="50dp" |
||||
android:layout_marginLeft="15dp" |
||||
android:layout_marginTop="15dp" |
||||
android:layout_marginRight="15dp" |
||||
android:background="@drawable/rectangle_radius_all_7_white_full"> |
||||
|
||||
<TextView |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_centerVertical="true" |
||||
android:layout_marginLeft="15dp" |
||||
android:text="@string/solution_status_limit" |
||||
android:textColor="@color/black" |
||||
android:textSize="15sp" |
||||
android:textStyle="bold" /> |
||||
|
||||
<LinearLayout |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="match_parent" |
||||
android:layout_alignParentRight="true" |
||||
android:layout_marginRight="15dp" |
||||
android:gravity="center_vertical"> |
||||
|
||||
<TextView |
||||
android:id="@+id/tv_status_limit" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginRight="5dp" |
||||
android:text="固定解" |
||||
android:textColor="@color/color_8a8a8a" |
||||
android:textSize="13.5sp" /> |
||||
|
||||
<ImageView |
||||
android:layout_width="13sp" |
||||
android:layout_height="wrap_content" |
||||
android:src="@drawable/icon_black_line_more" /> |
||||
|
||||
</LinearLayout> |
||||
|
||||
</RelativeLayout> |
||||
|
||||
<LinearLayout |
||||
android:id="@+id/ll_hvpd" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginLeft="15dp" |
||||
android:layout_marginTop="10dp" |
||||
android:layout_marginRight="15dp" |
||||
android:background="@drawable/rectangle_radius_all_7_white_full" |
||||
android:orientation="vertical"> |
||||
|
||||
<RelativeLayout |
||||
android:id="@+id/rl_hrms_limit" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="50dp"> |
||||
|
||||
<TextView |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_centerVertical="true" |
||||
android:layout_marginLeft="15dp" |
||||
android:text="@string/hrms_limit" |
||||
android:textColor="@color/black" |
||||
android:textSize="15sp" |
||||
android:textStyle="bold" /> |
||||
|
||||
<LinearLayout |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="match_parent" |
||||
android:layout_alignParentRight="true" |
||||
android:layout_marginRight="15dp" |
||||
android:gravity="center_vertical"> |
||||
|
||||
<TextView |
||||
android:id="@+id/tv_hrms_limit" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginRight="5dp" |
||||
android:text="0m" |
||||
android:textColor="@color/color_8a8a8a" |
||||
android:textSize="13.5sp" /> |
||||
|
||||
<ImageView |
||||
android:layout_width="13sp" |
||||
android:layout_height="wrap_content" |
||||
android:src="@drawable/icon_black_line_more" /> |
||||
|
||||
</LinearLayout> |
||||
|
||||
</RelativeLayout> |
||||
|
||||
<include layout="@layout/layout_dividing_line_theme_gray" /> |
||||
|
||||
<RelativeLayout |
||||
android:id="@+id/rl_vrms_limit" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="50dp"> |
||||
|
||||
<TextView |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_centerVertical="true" |
||||
android:layout_marginLeft="15dp" |
||||
android:text="@string/vrms_limit" |
||||
android:textColor="@color/black" |
||||
android:textSize="15sp" |
||||
android:textStyle="bold" /> |
||||
|
||||
<LinearLayout |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="match_parent" |
||||
android:layout_alignParentRight="true" |
||||
android:layout_marginRight="15dp" |
||||
android:gravity="center_vertical"> |
||||
|
||||
<TextView |
||||
android:id="@+id/tv_vrms_limit" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginRight="5dp" |
||||
android:text="0m" |
||||
android:textColor="@color/color_8a8a8a" |
||||
android:textSize="13.5sp" /> |
||||
|
||||
<ImageView |
||||
android:layout_width="13sp" |
||||
android:layout_height="wrap_content" |
||||
android:src="@drawable/icon_black_line_more" /> |
||||
|
||||
</LinearLayout> |
||||
|
||||
</RelativeLayout> |
||||
|
||||
<include layout="@layout/layout_dividing_line_theme_gray" /> |
||||
|
||||
<RelativeLayout |
||||
android:id="@+id/rl_pdop_limit" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="50dp"> |
||||
|
||||
<TextView |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_centerVertical="true" |
||||
android:layout_marginLeft="15dp" |
||||
android:text="@string/pdop_limit" |
||||
android:textColor="@color/black" |
||||
android:textSize="15sp" |
||||
android:textStyle="bold" /> |
||||
|
||||
<LinearLayout |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="match_parent" |
||||
android:layout_alignParentRight="true" |
||||
android:layout_marginRight="15dp" |
||||
android:gravity="center_vertical"> |
||||
|
||||
<TextView |
||||
android:id="@+id/tv_pdop_limit" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginRight="5dp" |
||||
android:text="0m" |
||||
android:textColor="@color/color_8a8a8a" |
||||
android:textSize="13.5sp" /> |
||||
|
||||
<ImageView |
||||
android:layout_width="13sp" |
||||
android:layout_height="wrap_content" |
||||
android:src="@drawable/icon_black_line_more" /> |
||||
|
||||
</LinearLayout> |
||||
|
||||
</RelativeLayout> |
||||
|
||||
<include layout="@layout/layout_dividing_line_theme_gray" /> |
||||
|
||||
<RelativeLayout |
||||
android:id="@+id/rl_age_limit" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="50dp"> |
||||
|
||||
<TextView |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_centerVertical="true" |
||||
android:layout_marginLeft="15dp" |
||||
android:text="@string/diff_age_limit" |
||||
android:textColor="@color/black" |
||||
android:textSize="15sp" |
||||
android:textStyle="bold" /> |
||||
|
||||
<LinearLayout |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="match_parent" |
||||
android:layout_alignParentRight="true" |
||||
android:layout_marginRight="15dp" |
||||
android:gravity="center_vertical"> |
||||
|
||||
<TextView |
||||
android:id="@+id/tv_age_limit" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginRight="5dp" |
||||
android:text="0m" |
||||
android:textColor="@color/color_8a8a8a" |
||||
android:textSize="13.5sp" /> |
||||
|
||||
<ImageView |
||||
android:layout_width="13sp" |
||||
android:layout_height="wrap_content" |
||||
android:src="@drawable/icon_black_line_more" /> |
||||
|
||||
</LinearLayout> |
||||
|
||||
</RelativeLayout> |
||||
|
||||
</LinearLayout> |
||||
|
||||
<LinearLayout |
||||
android:id="@+id/ll_range_limit" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginLeft="15dp" |
||||
android:layout_marginTop="10dp" |
||||
android:layout_marginRight="15dp" |
||||
android:background="@drawable/rectangle_radius_all_7_white_full" |
||||
android:orientation="vertical"> |
||||
|
||||
<RelativeLayout |
||||
android:id="@+id/rl_tips_range_limit" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="50dp"> |
||||
|
||||
<TextView |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_centerVertical="true" |
||||
android:layout_marginLeft="15dp" |
||||
android:text="@string/tips_range" |
||||
android:textColor="@color/black" |
||||
android:textSize="15sp" |
||||
android:textStyle="bold" /> |
||||
|
||||
<LinearLayout |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="match_parent" |
||||
android:layout_alignParentRight="true" |
||||
android:layout_marginRight="15dp" |
||||
android:gravity="center_vertical"> |
||||
|
||||
<TextView |
||||
android:id="@+id/tv_tips_range_limit" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginRight="5dp" |
||||
android:text="0m" |
||||
android:textColor="@color/color_8a8a8a" |
||||
android:textSize="13.5sp" /> |
||||
|
||||
<ImageView |
||||
android:layout_width="13sp" |
||||
android:layout_height="wrap_content" |
||||
android:src="@drawable/icon_black_line_more" /> |
||||
|
||||
</LinearLayout> |
||||
|
||||
</RelativeLayout> |
||||
|
||||
<include layout="@layout/layout_dividing_line_theme_gray" /> |
||||
|
||||
<RelativeLayout |
||||
android:id="@+id/rl_staking_limit" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="50dp"> |
||||
|
||||
<TextView |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_centerVertical="true" |
||||
android:layout_marginLeft="15dp" |
||||
android:text="@string/stakout_difference" |
||||
android:textColor="@color/black" |
||||
android:textSize="15sp" |
||||
android:textStyle="bold" /> |
||||
|
||||
<LinearLayout |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="match_parent" |
||||
android:layout_alignParentRight="true" |
||||
android:layout_marginRight="15dp" |
||||
android:gravity="center_vertical"> |
||||
|
||||
<TextView |
||||
android:id="@+id/tv_staking_limit" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginRight="5dp" |
||||
android:text="0m" |
||||
android:textColor="@color/color_8a8a8a" |
||||
android:textSize="13.5sp" /> |
||||
|
||||
<ImageView |
||||
android:layout_width="13sp" |
||||
android:layout_height="wrap_content" |
||||
android:src="@drawable/icon_black_line_more" /> |
||||
|
||||
</LinearLayout> |
||||
|
||||
</RelativeLayout> |
||||
|
||||
<include layout="@layout/layout_dividing_line_theme_gray" /> |
||||
|
||||
<RelativeLayout |
||||
android:id="@+id/rl_smooth_point_number_limit" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="50dp"> |
||||
|
||||
<TextView |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_centerVertical="true" |
||||
android:layout_marginLeft="15dp" |
||||
android:text="@string/smooth_points_number" |
||||
android:textColor="@color/black" |
||||
android:textSize="15sp" |
||||
android:textStyle="bold" /> |
||||
|
||||
<LinearLayout |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="match_parent" |
||||
android:layout_alignParentRight="true" |
||||
android:layout_marginRight="15dp" |
||||
android:gravity="center_vertical"> |
||||
|
||||
<TextView |
||||
android:id="@+id/tv_smooth_point_number_limit" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginRight="5dp" |
||||
android:text="0m" |
||||
android:textColor="@color/color_8a8a8a" |
||||
android:textSize="13.5sp" /> |
||||
|
||||
<ImageView |
||||
android:layout_width="13sp" |
||||
android:layout_height="wrap_content" |
||||
android:src="@drawable/icon_black_line_more" /> |
||||
|
||||
</LinearLayout> |
||||
|
||||
</RelativeLayout> |
||||
|
||||
</LinearLayout> |
||||
|
||||
<LinearLayout |
||||
android:id="@+id/ll_cad_setting" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="match_parent" |
||||
android:layout_marginLeft="15dp" |
||||
android:layout_marginRight="15dp" |
||||
android:orientation="vertical"> |
||||
|
||||
<TextView |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_centerVertical="true" |
||||
android:layout_marginLeft="15dp" |
||||
android:layout_marginTop="13dp" |
||||
android:text="@string/cad_setting" |
||||
android:textColor="@color/color_8a8a8a" |
||||
android:textSize="15sp" |
||||
android:textStyle="bold" /> |
||||
|
||||
<LinearLayout |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginTop="13dp" |
||||
android:background="@drawable/rectangle_radius_all_7_white_full" |
||||
android:orientation="vertical"> |
||||
|
||||
<RelativeLayout |
||||
android:id="@+id/rl_select_coordinate_system" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="50dp"> |
||||
|
||||
<TextView |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_centerVertical="true" |
||||
android:layout_marginLeft="15dp" |
||||
android:text="@string/cad_coordinate_system" |
||||
android:textColor="@color/black" |
||||
android:textSize="15sp" |
||||
android:textStyle="bold" /> |
||||
|
||||
<LinearLayout |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="match_parent" |
||||
android:layout_alignParentRight="true" |
||||
android:layout_marginRight="15dp" |
||||
android:gravity="center_vertical"> |
||||
|
||||
<TextView |
||||
android:id="@+id/tv_wcs_ucs_status" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginRight="5dp" |
||||
android:text="@string/user_coordinate_system" |
||||
android:textColor="@color/color_8a8a8a" |
||||
android:textSize="13.5sp" /> |
||||
|
||||
<ImageView |
||||
android:layout_width="13sp" |
||||
android:layout_height="wrap_content" |
||||
android:src="@drawable/icon_black_line_more" /> |
||||
|
||||
</LinearLayout> |
||||
|
||||
</RelativeLayout> |
||||
|
||||
<include layout="@layout/layout_dividing_line_theme_gray" /> |
||||
|
||||
<RelativeLayout |
||||
android:id="@+id/rl_select_unit_length" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="50dp"> |
||||
|
||||
<TextView |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_centerVertical="true" |
||||
android:layout_marginLeft="15dp" |
||||
android:text="@string/unit_length" |
||||
android:textColor="@color/black" |
||||
android:textSize="15sp" |
||||
android:textStyle="bold" /> |
||||
|
||||
<LinearLayout |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="match_parent" |
||||
android:layout_alignParentRight="true" |
||||
android:layout_marginRight="15dp" |
||||
android:gravity="center_vertical"> |
||||
|
||||
<TextView |
||||
android:id="@+id/tv_unit_length" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginRight="5dp" |
||||
android:text="@string/unit_cad_m" |
||||
android:textColor="@color/color_8a8a8a" |
||||
android:textSize="13.5sp" /> |
||||
|
||||
<ImageView |
||||
android:layout_width="13sp" |
||||
android:layout_height="wrap_content" |
||||
android:src="@drawable/icon_black_line_more" /> |
||||
|
||||
</LinearLayout> |
||||
|
||||
</RelativeLayout> |
||||
|
||||
</LinearLayout> |
||||
|
||||
<LinearLayout |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginTop="10dp" |
||||
android:background="@drawable/rectangle_radius_all_7_white_full" |
||||
android:orientation="vertical"> |
||||
|
||||
<RelativeLayout |
||||
android:id="@+id/rl_cad_background" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="50dp"> |
||||
|
||||
<TextView |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_centerVertical="true" |
||||
android:layout_marginLeft="15dp" |
||||
android:text="@string/background_color" |
||||
android:textColor="@color/black" |
||||
android:textSize="15sp" |
||||
android:textStyle="bold" /> |
||||
|
||||
<LinearLayout |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="match_parent" |
||||
android:layout_alignParentRight="true" |
||||
android:layout_marginRight="15dp" |
||||
android:gravity="center_vertical"> |
||||
|
||||
<TextView |
||||
android:id="@+id/tv_select_color" |
||||
android:layout_width="45dp" |
||||
android:layout_height="22dp" |
||||
android:layout_centerVertical="true" |
||||
android:layout_marginRight="5dp" |
||||
android:background="@drawable/rectangle_radius_3_theme_green_full" /> |
||||
|
||||
<ImageView |
||||
android:layout_width="13sp" |
||||
android:layout_height="wrap_content" |
||||
android:src="@drawable/icon_black_line_more" /> |
||||
|
||||
</LinearLayout> |
||||
|
||||
</RelativeLayout> |
||||
|
||||
<include layout="@layout/layout_dividing_line_theme_gray" /> |
||||
|
||||
<RelativeLayout |
||||
android:id="@+id/rl_clean_cache" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="50dp"> |
||||
|
||||
<TextView |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_centerVertical="true" |
||||
android:layout_marginLeft="15dp" |
||||
android:text="@string/clean_cache" |
||||
android:textColor="@color/black" |
||||
android:textSize="15sp" |
||||
android:textStyle="bold" /> |
||||
|
||||
<LinearLayout |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="match_parent" |
||||
android:layout_alignParentRight="true" |
||||
android:layout_marginRight="15dp" |
||||
android:gravity="center_vertical"> |
||||
|
||||
<TextView |
||||
android:id="@+id/tv_clean_cache" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginRight="5dp" |
||||
android:text="0MB" |
||||
android:textColor="@color/color_8a8a8a" |
||||
android:textSize="13.5sp" /> |
||||
|
||||
<ImageView |
||||
android:layout_width="13sp" |
||||
android:layout_height="wrap_content" |
||||
android:src="@drawable/icon_black_line_more" /> |
||||
|
||||
</LinearLayout> |
||||
|
||||
</RelativeLayout> |
||||
|
||||
</LinearLayout> |
||||
|
||||
</LinearLayout> |
||||
|
||||
|
||||
</LinearLayout> |
||||
</ScrollView> |
@ -0,0 +1,121 @@ |
||||
<?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:layout_width="match_parent" |
||||
android:layout_height="match_parent" |
||||
android:orientation="vertical"> |
||||
|
||||
<androidx.appcompat.widget.Toolbar |
||||
android:id="@+id/toolbar_with_one_spinner" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="?android:attr/actionBarSize" |
||||
android:background="?colorPrimary" |
||||
android:minHeight="?android:attr/actionBarSize" |
||||
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" |
||||
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" |
||||
app:title=""> |
||||
|
||||
<LinearLayout |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:orientation="horizontal"> |
||||
|
||||
<TextView |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:text="记录" |
||||
android:textColor="@color/white" |
||||
android:textSize="16sp" /> |
||||
|
||||
<androidx.appcompat.widget.AppCompatSpinner |
||||
android:id="@+id/spinner1" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="match_parent" /> |
||||
</LinearLayout> |
||||
|
||||
|
||||
</androidx.appcompat.widget.Toolbar> |
||||
|
||||
<LinearLayout |
||||
android:layout_width="match_parent" |
||||
android:layout_height="32dp" |
||||
android:layout_marginVertical="5dp" |
||||
android:orientation="horizontal"> |
||||
|
||||
<com.hjq.shape.view.ShapeTextView |
||||
android:id="@+id/tv_filter_time" |
||||
android:layout_width="0dp" |
||||
android:layout_height="match_parent" |
||||
android:layout_marginHorizontal="12dp" |
||||
android:layout_weight="1" |
||||
android:gravity="center" |
||||
android:orientation="horizontal" |
||||
android:text="@string/time_filter" |
||||
android:textAppearance="@style/MyTextAppearanceHeadline" |
||||
android:textSize="14sp" |
||||
app:shape_radius="16dp" |
||||
app:shape_solidColor="@color/white" |
||||
app:shape_solidPressedColor="@color/item_bg" /> |
||||
|
||||
<com.hjq.shape.view.ShapeTextView |
||||
android:id="@+id/tv_filter_dcs_type" |
||||
android:layout_width="0dp" |
||||
android:layout_height="match_parent" |
||||
android:layout_marginHorizontal="12dp" |
||||
android:layout_weight="1" |
||||
android:gravity="center" |
||||
android:orientation="horizontal" |
||||
android:text="@string/type_filter" |
||||
android:textAppearance="@style/MyTextAppearanceHeadline" |
||||
android:textSize="14sp" |
||||
app:shape_radius="16dp" |
||||
app:shape_solidColor="@color/white" |
||||
app:shape_solidPressedColor="@color/item_bg" /> |
||||
|
||||
<com.hjq.shape.view.ShapeTextView |
||||
android:id="@+id/tv_filter_other" |
||||
android:layout_width="0dp" |
||||
android:layout_height="match_parent" |
||||
android:layout_marginHorizontal="12dp" |
||||
android:layout_weight="1" |
||||
android:gravity="center" |
||||
android:orientation="horizontal" |
||||
android:text="@string/other_filter" |
||||
android:textAppearance="@style/MyTextAppearanceHeadline" |
||||
android:textSize="14sp" |
||||
app:shape_radius="16dp" |
||||
app:shape_solidColor="@color/white" |
||||
app:shape_solidPressedColor="@color/item_bg" /> |
||||
</LinearLayout> |
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:orientation="horizontal" |
||||
android:visibility="gone"> |
||||
|
||||
<TextView |
||||
android:id="@+id/activity_records_top_date_filter" |
||||
android:layout_width="0dp" |
||||
android:layout_height="wrap_content" |
||||
android:layout_gravity="center_vertical" |
||||
android:layout_weight="1" |
||||
android:paddingStart="16dp" |
||||
android:paddingEnd="16dp" /> |
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView |
||||
android:id="@+id/iv_order" |
||||
android:layout_width="30dp" |
||||
android:layout_height="30dp" |
||||
android:padding="3dp" |
||||
android:src="@drawable/icon_sort_descending" /> |
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat> |
||||
|
||||
<androidx.recyclerview.widget.RecyclerView |
||||
android:id="@+id/recyclerview_records" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="0dp" |
||||
android:layout_weight="1" /> |
||||
|
||||
</LinearLayout> |
@ -0,0 +1,20 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="match_parent" |
||||
android:orientation="vertical" |
||||
android:paddingStart="16dp" |
||||
android:paddingEnd="16dp"> |
||||
|
||||
<EditText |
||||
android:id="@+id/et_dialog_edit_remarks" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:gravity="top|left" |
||||
android:inputType="textMultiLine" |
||||
android:maxLines="3" |
||||
android:minLines="3" |
||||
android:scrollbars="vertical" |
||||
android:textSize="@dimen/myTextSize" /> |
||||
|
||||
</LinearLayout> |
@ -0,0 +1,40 @@ |
||||
<?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:layout_width="match_parent" |
||||
android:layout_height="match_parent" |
||||
android:gravity="center_horizontal" |
||||
android:orientation="vertical" |
||||
android:padding="10dip"> |
||||
|
||||
<com.rengwuxian.materialedittext.MaterialEditText |
||||
android:id="@+id/dialog_export_record_config_name" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:hint="@string/file_name" |
||||
android:textSize="@dimen/myTextSize" |
||||
app:met_floatingLabel="normal" |
||||
app:met_floatingLabelText="@string/file_name" /> |
||||
|
||||
<LinearLayout |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginTop="16dp"> |
||||
|
||||
<CheckBox |
||||
android:id="@+id/dialog_export_record_config_check_rtk_status" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:layout_weight="1" |
||||
android:checked="true" |
||||
android:text="@string/contain_rtk_status" /> |
||||
|
||||
<CheckBox |
||||
android:id="@+id/dialog_export_record_config_check_hr" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:layout_weight="1" |
||||
android:checked="true" |
||||
android:text="@string/contain_hr" /> |
||||
</LinearLayout> |
||||
</LinearLayout> |
@ -0,0 +1,128 @@ |
||||
<?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:layout_width="match_parent" |
||||
android:layout_height="match_parent" |
||||
android:orientation="vertical" |
||||
android:paddingStart="16dp" |
||||
android:paddingEnd="16dp"> |
||||
|
||||
<TextView |
||||
android:id="@+id/tv_dialog_records_filter_period_of_time" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:visibility="gone" |
||||
android:text="@string/period_of_time" /> |
||||
|
||||
<RadioGroup |
||||
android:visibility="gone" |
||||
android:id="@+id/radiogroup_dialog_records_filter_time" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginBottom="4dp" |
||||
android:layout_marginTop="4dp" |
||||
android:orientation="horizontal"> |
||||
|
||||
<RadioButton |
||||
android:id="@+id/dialog_records_filter_radio1" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:text="@string/today" /> |
||||
|
||||
<RadioButton |
||||
android:id="@+id/dialog_records_filter_radio2" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:text="@string/within_seven_days" /> |
||||
|
||||
<RadioButton |
||||
android:id="@+id/dialog_records_filter_radio3" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:text="@string/all" /> |
||||
|
||||
<RadioButton |
||||
android:id="@+id/dialog_records_filter_radio4" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:text="@string/custom_time" /> |
||||
</RadioGroup> |
||||
|
||||
<TextView |
||||
android:id="@+id/tv_dialog_records_filter_period_of_tcstype" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:visibility="gone" |
||||
android:text="@string/section_type" /> |
||||
<RadioGroup |
||||
android:visibility="gone" |
||||
android:id="@+id/radiogroup_dialog_records_filter_tcstype" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginBottom="4dp" |
||||
android:layout_marginTop="4dp" |
||||
android:orientation="horizontal"> |
||||
|
||||
<RadioButton |
||||
android:id="@+id/dialog_records_filter_radio5" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:checked="true" |
||||
android:text="@string/all" /> |
||||
|
||||
<RadioButton |
||||
android:id="@+id/dialog_records_filter_radio6" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:text="@string/kaiwa" /> |
||||
|
||||
<RadioButton |
||||
android:id="@+id/dialog_records_filter_radio7" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:text="@string/chuzhi" /> |
||||
|
||||
<RadioButton |
||||
android:id="@+id/dialog_records_filter_radio8" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:text="@string/erchen" /> |
||||
</RadioGroup> |
||||
|
||||
<com.rengwuxian.materialedittext.MaterialEditText |
||||
android:id="@+id/met_dialog_records_filter_roadname_keyword" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:hint="@string/road_name_keyword" |
||||
android:textSize="@dimen/myTextSize" |
||||
app:met_clearButton="true" |
||||
app:met_floatingLabel="normal" |
||||
app:met_floatingLabelText="@string/road_name_keyword" |
||||
app:met_helperText="@string/road_name_keyword_explain" |
||||
app:met_helperTextAlwaysShown="false" /> |
||||
|
||||
<com.rengwuxian.materialedittext.MaterialEditText |
||||
android:id="@+id/met_dialog_records_filter_kilometer_keyword" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:hint="@string/kilometer_keyword" |
||||
android:textSize="@dimen/myTextSize" |
||||
app:met_clearButton="true" |
||||
app:met_floatingLabel="normal" |
||||
app:met_floatingLabelText="@string/kilometer_keyword" |
||||
app:met_helperText="@string/kilometer_keyword_explain" |
||||
app:met_helperTextAlwaysShown="false" /> |
||||
|
||||
<com.rengwuxian.materialedittext.MaterialEditText |
||||
android:id="@+id/met_dialog_records_filter_remarks_keyword" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:hint="@string/remarks_keyword" |
||||
android:textSize="@dimen/myTextSize" |
||||
app:met_clearButton="true" |
||||
app:met_floatingLabel="normal" |
||||
app:met_floatingLabelText="@string/remarks_keyword" |
||||
app:met_helperText="@string/remarks_keyword_explain" |
||||
app:met_helperTextAlwaysShown="false" /> |
||||
|
||||
</LinearLayout> |
@ -0,0 +1,38 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="41dp" |
||||
android:orientation="vertical"> |
||||
|
||||
<RelativeLayout |
||||
android:layout_width="match_parent" |
||||
android:layout_height="40dp" |
||||
android:background="@color/color_EBEBEB"> |
||||
|
||||
<TextView |
||||
android:id="@+id/radio_type" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:text="中文" |
||||
android:textSize="13sp" |
||||
android:layout_centerVertical="true" |
||||
android:layout_marginLeft="15dp" |
||||
android:textColor="@color/black" /> |
||||
|
||||
<ImageView |
||||
android:id="@+id/iv_select_choose" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="22dp" |
||||
android:src="@mipmap/icon_checkbox_select" |
||||
android:layout_alignParentRight="true" |
||||
android:layout_centerVertical="true" /> |
||||
|
||||
</RelativeLayout> |
||||
|
||||
<View |
||||
android:id="@+id/h_line" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="@dimen/divider_height" |
||||
android:background="@color/color_EBEBEB" /> |
||||
|
||||
</LinearLayout> |
@ -0,0 +1,66 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||
android:orientation="vertical" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="match_parent" |
||||
android:gravity="center"> |
||||
|
||||
<LinearLayout |
||||
android:id="@+id/layout" |
||||
android:layout_width="280dp" |
||||
android:layout_height="wrap_content" |
||||
android:orientation="vertical" |
||||
android:background="@drawable/rectangle_radius_all_7_white_full"> |
||||
|
||||
<TextView |
||||
android:id="@+id/tv_title" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="50dp" |
||||
android:textSize="14sp" |
||||
android:text="title" |
||||
android:gravity="center" |
||||
android:textStyle="bold" |
||||
android:textColor="@color/black" /> |
||||
|
||||
<androidx.recyclerview.widget.RecyclerView |
||||
android:id="@+id/recyclerView" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:paddingTop="7dp" |
||||
android:paddingBottom="7dp" |
||||
android:background="@color/color_EBEBEB"/> |
||||
|
||||
<LinearLayout |
||||
android:id="@+id/ll_button" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="50dp" |
||||
android:orientation="horizontal" > |
||||
|
||||
<TextView |
||||
android:id="@+id/tv_cancel" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="match_parent" |
||||
android:layout_weight="1" |
||||
android:text="@string/cancel" |
||||
android:textColor="@color/red" |
||||
android:gravity="center" |
||||
android:textStyle="bold" |
||||
android:textSize="@dimen/NormalTextSize" /> |
||||
|
||||
<TextView |
||||
android:id="@+id/tv_determine" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="match_parent" |
||||
android:layout_weight="1" |
||||
android:text="@string/confirm" |
||||
android:gravity="center" |
||||
android:textStyle="bold" |
||||
android:textSize="@dimen/NormalTextSize" |
||||
android:visibility="gone" |
||||
android:textColor="@color/color_575757"/> |
||||
|
||||
</LinearLayout> |
||||
|
||||
</LinearLayout> |
||||
|
||||
</LinearLayout> |
@ -0,0 +1,115 @@ |
||||
<?xml version="1.0" encoding="utf-8" ?> |
||||
<com.hjq.shape.layout.ShapeFrameLayout |
||||
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" |
||||
app:shape_radius="16dp" |
||||
android:gravity="center_vertical" |
||||
android:orientation="vertical" |
||||
android:paddingHorizontal="12dp" |
||||
android:paddingBottom="12dp"> |
||||
<com.hjq.shape.layout.ShapeLinearLayout |
||||
android:id="@+id/sll" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="@dimen/item_height_record" |
||||
xmlns:app="http://schemas.android.com/apk/res-auto" |
||||
app:shape_radius="16dp" |
||||
app:shape_solidColor="@color/white" |
||||
android:gravity="center_vertical" |
||||
android:orientation="vertical" |
||||
android:paddingStart="16dp" |
||||
android:paddingEnd="16dp"> |
||||
|
||||
<LinearLayout |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:orientation="horizontal"> |
||||
|
||||
<TextView |
||||
android:id="@+id/recyclerview_item_swipe_record_title1" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:ellipsize="end" |
||||
android:paddingEnd="16dp" |
||||
android:singleLine="true" |
||||
android:textAppearance="@style/MyTextAppearanceHeadline" |
||||
tools:text="title1" /> |
||||
|
||||
<TextView |
||||
android:id="@+id/recyclerview_item_swipe_record_title2" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:ellipsize="end" |
||||
android:singleLine="true" |
||||
android:textAppearance="@style/MyTextAppearanceSubhead" |
||||
tools:text="title2" /> |
||||
</LinearLayout> |
||||
|
||||
|
||||
<LinearLayout |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:orientation="horizontal"> |
||||
|
||||
<TextView |
||||
android:id="@+id/recyclerview_item_swipe_record_body1" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:ellipsize="end" |
||||
android:paddingEnd="16dp" |
||||
android:singleLine="true" |
||||
android:textAppearance="@style/MyTextAppearanceBody1" |
||||
tools:text="body1" /> |
||||
|
||||
<TextView |
||||
android:id="@+id/recyclerview_item_swipe_record_body2" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:ellipsize="end" |
||||
android:paddingEnd="16dp" |
||||
android:singleLine="true" |
||||
android:textAppearance="@style/MyTextAppearanceBody1" |
||||
tools:text="body2" /> |
||||
|
||||
<TextView |
||||
android:id="@+id/recyclerview_item_swipe_record_body3" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:ellipsize="end" |
||||
android:singleLine="true" |
||||
android:textAppearance="@style/MyTextAppearanceBody1" |
||||
tools:text="body3" /> |
||||
</LinearLayout> |
||||
|
||||
<RelativeLayout |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:orientation="horizontal"> |
||||
|
||||
<TextView |
||||
android:id="@+id/recyclerview_item_swipe_record_body4" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_alignParentLeft="true" |
||||
android:layout_toLeftOf="@+id/recyclerview_item_swipe_record_body5" |
||||
android:singleLine="true" |
||||
android:ellipsize="end" |
||||
android:textAppearance="@style/MyTextAppearanceBody1" |
||||
tools:text="body4" /> |
||||
|
||||
<TextView |
||||
android:id="@+id/recyclerview_item_swipe_record_body5" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_alignParentRight="true" |
||||
android:ellipsize="end" |
||||
android:singleLine="true" |
||||
android:textAppearance="@style/MyTextAppearanceBody1" |
||||
tools:text="body5" /> |
||||
</RelativeLayout> |
||||
|
||||
|
||||
</com.hjq.shape.layout.ShapeLinearLayout> |
||||
</com.hjq.shape.layout.ShapeFrameLayout> |
Loading…
Reference in new issue