修改布局适配bug(部分)

This commit is contained in:
md 2021-07-29 15:49:37 +08:00
parent e0e53d69fd
commit 0a0231396f
17 changed files with 100 additions and 84 deletions

View File

@ -3,7 +3,7 @@ apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion '29.0.2'
// ndkVersion '23.0.7123448'
ndkVersion '23.0.7123448'
defaultConfig {
applicationId "com.navinfo.outdoor"

View File

@ -43,7 +43,7 @@ public class ChargingPileAdapter extends RecyclerView.Adapter<ChargingPileAdapte
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
ChargingPileEntity chargingPileEntity = chargingPileEntities.get(position);
holder.textView.setText(chargingPileEntity.getName());
holder.rlItem.setBackgroundColor(Color.parseColor("#03A9F4"));
holder.rlItem.setBackgroundColor(Color.parseColor("#BDBDBD"));
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {

View File

@ -123,13 +123,24 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
startActivityForResult(ivAttestation3, 300);
break;
case R.id.btn_attestation:
/**
* static boolean ChineseNameTest(String name) {
* if (!name.matches("[\u4e00-\u9fa5]{2,4}")) {
* System.out.println("只能输入2到4个汉字");
* return false;
* }else return true;
* }
*/
if (etAttestationName.getText().toString() == null || etAttestationName.getText().toString().equals("")) {
Toast.makeText(getContext(), "姓名不能为空,请输入姓名", Toast.LENGTH_SHORT).show();
return;
}
if (!chineseNameTest(etAttestationName.getText().toString())){
Toast.makeText(getActivity(), "请输入中文名字", Toast.LENGTH_SHORT).show();
return;
}
if (!checkNum(etNamePhone.getText().toString().trim())) {
Toast.makeText(getContext(), "身份证错误,请重新输入", Toast.LENGTH_SHORT).show();
Toast.makeText(getContext(), "身份证错误,请重新输入", Toast.LENGTH_SHORT).show();
return;
}
nameAuthentication();
@ -149,7 +160,12 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
else return true;
}
static boolean chineseNameTest(String name) {
if (!name.matches("[\u4e00-\u9fa5]{2,4}")) {
System.out.println("只能输入2到4个汉字");
return false;
}else return true;
}
private void nameAuthentication() {
showLoadingDialog();
takePhoneList = new ArrayList<>();
@ -180,21 +196,20 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
@Override
public void onSuccess(Response<NameAuthenticationBean> response) {
dismissLoadingDialog();
Log.d("TAG", "onSuccess: " + response.toString() + "sssssssssssss");
if (response.body().equals("0")) {
MessageDialog.show((AppCompatActivity) getActivity(), "提示", "不通过", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
if (response.body().equals("200")) {
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
MessageDialog.show((AppCompatActivity) getActivity(), "提示", "通过", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
@Override
public boolean onClick(BaseDialog baseDialog, View v) {
// Toast.makeText(getContext(), "点击了确定", Toast.LENGTH_SHORT).show();
//传值给持卡人
Constant.USER_ATTESTATION_NAME = attestationName;
return false;
}
});
} else {
MessageDialog.show((AppCompatActivity) getActivity(), "提示", "通过", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
MessageDialog.show((AppCompatActivity) getActivity(), "提示", "不通过", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
@Override
public boolean onClick(BaseDialog baseDialog, View v) {
Constant.USER_ATTESTATION_NAME = attestationName;

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/colorGray" />
</selector>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/colorGrays" />
</shape>

View File

@ -20,6 +20,7 @@
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_marginTop="6dp"
app:tabMode="fixed"
app:tabRippleColor="@android:color/transparent"
app:tabIndicatorHeight="0dp"
app:tabTextColor="#F08A8888"

View File

@ -59,8 +59,10 @@
app:layout_constraintLeft_toLeftOf="@id/login_name"
app:layout_constraintTop_toBottomOf="@id/login_name" />
<View
android:layout_width="300dp"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="40dp"
android:layout_marginRight="40dp"
android:background="@color/colorHui"
app:layout_constraintTop_toBottomOf="@id/et_login_name"
app:layout_constraintLeft_toLeftOf="@id/et_login_name"/>
@ -94,9 +96,11 @@
app:layout_constraintTop_toBottomOf="@id/login_paw" />
<View
android:layout_width="300dp"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/colorHui"
android:layout_marginLeft="40dp"
android:layout_marginRight="40dp"
app:layout_constraintTop_toBottomOf="@id/et_login_paw"
app:layout_constraintLeft_toLeftOf="@id/et_login_paw"/>
@ -144,10 +148,12 @@
<Button
android:id="@+id/btn_login"
style="@style/login_style"
android:layout_width="300dp"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginTop="30dp"
android:layout_marginBottom="261dp"
android:layout_marginRight="40dp"
android:layout_marginLeft="40dp"
android:gravity="center"
android:text="登录"
app:layout_constraintBottom_toBottomOf="parent"

View File

@ -5,7 +5,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto">
<ImageView
android:id="@+id/road_bg"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="100dp"
android:background="@drawable/top_bg"
app:layout_constraintBottom_toBottomOf="parent"

View File

@ -5,7 +5,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto">
<ImageView
android:id="@+id/road_bg"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="100dp"
android:background="@drawable/top_bg"
app:layout_constraintTop_toTopOf="parent"

View File

@ -153,8 +153,8 @@
<ImageView
android:id="@+id/iv_road_picture"
android:layout_width="100dp"
android:layout_height="50dp"
android:layout_width="200dp"
android:layout_height="100dp"
android:layout_marginTop="10dp"
app:layout_constraintLeft_toLeftOf="@id/ll_pictures"
app:layout_constraintTop_toBottomOf="@id/ll_pictures" />
@ -209,28 +209,34 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="100dp"
android:gravity="center_horizontal"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="20dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="20dp"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/ll_desc">
<Button
android:id="@+id/btn_road_save"
style="@style/user_data_style"
android:layout_width="150dp"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="保存本地" />
android:layout_margin="10dp"
android:layout_weight="1"
android:background="@drawable/selector_red_radius_bg"
android:text="保存本地"
android:textColor="@color/white" />
<Button
android:id="@+id/road_upload"
android:layout_width="150dp"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:background="@drawable/uploding_shape"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="@drawable/shape_transparent_pink_radius_bg"
android:text="上传" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -11,7 +11,7 @@
android:layout_height="100dp"
android:layout_alignParentLeft="true"
android:layout_margin="10dp"
android:background="#03A9F4"
android:background="@drawable/selector_hui_bg"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">

View File

@ -6,7 +6,7 @@
<ImageView
android:id="@+id/road_bg"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="100dp"
android:background="@drawable/top_bg"
app:layout_constraintEnd_toEndOf="parent"

View File

@ -143,8 +143,8 @@
<ImageView
android:id="@+id/iv_poi_video_picture"
android:layout_width="100dp"
android:layout_height="50dp"
android:layout_width="200dp"
android:layout_height="100dp"
android:layout_marginTop="10dp"
app:layout_constraintLeft_toLeftOf="@id/ll_pictures"
@ -240,31 +240,36 @@
/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="100dp"
android:gravity="center_horizontal"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="20dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="20dp"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/ll_desc">
<Button
android:id="@+id/btn_poi_video_save"
style="@style/user_data_style"
android:layout_width="150dp"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="保存本地" />
android:layout_margin="10dp"
android:layout_weight="1"
android:background="@drawable/selector_red_radius_bg"
android:text="保存本地"
android:textColor="@color/white" />
<Button
android:id="@+id/btn_poi_video_upload"
android:layout_width="150dp"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:background="@drawable/uploding_shape"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="@drawable/shape_transparent_pink_radius_bg"
android:text="上传" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -6,7 +6,7 @@
<ImageView
android:id="@+id/road_bg"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="100dp"
android:background="@drawable/top_bg"
app:layout_constraintLeft_toLeftOf="parent"

View File

@ -42,6 +42,7 @@
android:id="@+id/tab_record"
android:layout_width="match_parent"
android:layout_height="40dp"
app:tabMode="fixed"
app:tabTextColor="@color/colormap"
app:tabSelectedTextColor="@color/white"
app:tabRippleColor="@color/colormap"

View File

@ -5,7 +5,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto">
<ImageView
android:id="@+id/road_bg"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="100dp"
android:background="@drawable/top_bg"
app:layout_constraintTop_toTopOf="parent"

View File

@ -42,14 +42,6 @@
app:layout_constraintTop_toTopOf="parent">
</ImageView>
<!--<TextView-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:text="10"-->
<!--android:background="@drawable/small_bell_text"-->
<!--android:textColor="@color/white"-->
<!--app:layout_constraintTop_toTopOf="@+id/iv_message"-->
<!--app:layout_constraintLeft_toRightOf="@+id/iv_message"/>-->
<FrameLayout
android:id="@+id/frame_layout"
@ -64,28 +56,17 @@
<CheckBox
android:id="@+id/cb_map_type"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginRight="15dp"
android:background="@drawable/atlas_selector"
android:button="@null"
android:checked="false"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintBottom_toTopOf="@+id/iv_submit"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintTop_toTopOf="@+id/iv_zoom_add"
/>
<!-- <CheckBox-->
<!-- android:id="@+id/cb_foot_type"-->
<!-- android:layout_width="40dp"-->
<!-- android:layout_height="40dp"-->
<!-- android:layout_marginTop="15dp"-->
<!-- android:background="@drawable/foot_selector"-->
<!-- android:button="@null"-->
<!-- android:checked="false"-->
<!-- app:layout_constraintRight_toRightOf="@id/cb_map_type"-->
<!-- app:layout_constraintTop_toBottomOf="@id/cb_map_type"-->
<!-- />-->
<ImageView
android:id="@+id/iv_submit"
@ -109,19 +90,20 @@
<ImageView
android:id="@+id/iv_zoom_add"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginLeft="15dp"
android:layout_marginTop="15dp"
android:src="@mipmap/zoom_add"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/cb_map_type"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
/>
<ImageView
android:id="@+id/iv_zoom_del"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginTop="15dp"
android:src="@mipmap/zoom_del"
app:layout_constraintLeft_toLeftOf="@id/iv_zoom_add"
@ -130,8 +112,8 @@
<ImageView
android:id="@+id/iv_refrish"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginTop="15dp"
android:src="@mipmap/refresh"
app:layout_constraintLeft_toLeftOf="@id/iv_zoom_del"
@ -140,8 +122,8 @@
<ImageView
android:id="@+id/iv_location"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginTop="15dp"
android:src="@mipmap/mine_location"
app:layout_constraintLeft_toLeftOf="@id/iv_refrish"

View File

@ -65,7 +65,7 @@
<EditText
android:id="@+id/et_attestationName"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:hint="请输入姓名"
@ -93,7 +93,7 @@
<EditText
android:id="@+id/et_namePhone"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:hint="请输入身份证号"