Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValidatorEditText用于BaseDialog中时,错误提示位置显示不对、错误提示被BaseDialog遮挡 #186

Open
luckywur opened this issue Jul 8, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@luckywur
Copy link

luckywur commented Jul 8, 2024

问题描述(必填)

ValidatorEditText用于BaseDialog中时,错误提示位置显示不对、错误提示被BaseDialog遮挡,app中的MaterialDialog.Builder自定义对话框同样存在这个问题

使用的XUI版本(必填)

1.2.1

如何重现(必填)

使用BaseDialog,自定义组件(组件中使用ValidatorEditText),ValidatorEditText错误提示位置不正确,同时被BaseDialog遮挡

期望的效果

提示位置正确并能正常显示

截图

image

设备信息

  • 设备名: 模拟器,分辨率1280*800,dpi 240
  • Android版本: 7.1
  • 设备型号 模拟器
  • 系统版本:模拟器
@luckywur luckywur added the bug Something isn't working label Jul 8, 2024
@luckywur
Copy link
Author

luckywur commented Jul 8, 2024

dialog定义

float width = getContext().getResources().getDimension(R.dimen.dp_300);
float height = getContext().getResources().getDimension(R.dimen.dp_200);

baseDialog = new BaseDialog(getContext(), R.layout.table_area_edit_dialog)
        .setIsSyncSystemUiVisibility(true)
        .setDialogSize(Float.valueOf(width).intValue(), Float.valueOf(height).intValue());

布局定义

<?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="wrap_content"
    android:background="@drawable/dialog_normal_background"
    android:orientation="vertical">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/dialog_title_background"
        android:gravity="center_vertical"
        android:paddingStart="@dimen/dp_14"
        android:paddingEnd="@dimen/dp_5">

        <TextView
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="区域信息"
            android:textColor="#fff"
            android:textSize="@dimen/sp_12" />

        <ImageButton
            android:id="@+id/areaEditDialogClose"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:layout_marginTop="@dimen/dp_5"
            android:layout_marginBottom="@dimen/dp_5"
            android:src="@mipmap/close" />
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="@dimen/dp_20"
        android:layout_marginBottom="@dimen/dp_5"
        android:paddingLeft="@dimen/dp_20"
        android:paddingRight="@dimen/dp_20">

        <TextView
            android:layout_width="@dimen/dp_60"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:text="上级区域"
            android:textColor="@color/line_title"
            android:textSize="@dimen/sp_11" />

        <TextView
            android:id="@+id/parentCode"
            style="@style/EditText.Normal"
            android:layout_width="match_parent"
            android:background="@drawable/param_set_frame_edit_background"
            android:singleLine="true"
            android:textColor="#fff"
            android:textSize="@dimen/sp_11" />
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="@dimen/dp_5"
        android:layout_marginBottom="@dimen/dp_5"
        android:paddingLeft="@dimen/dp_20"
        android:paddingRight="@dimen/dp_20">

        <TextView
            android:layout_width="@dimen/dp_60"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:text="区域名称"
            android:textColor="@color/line_title"
            android:textSize="@dimen/sp_11" />

        <com.xuexiang.xui.widget.edittext.ValidatorEditText
            android:id="@+id/areaName"
            style="@style/EditText.Normal"
            android:layout_width="match_parent"
            android:background="@drawable/param_set_frame_edit_background"
            android:focusableInTouchMode="true"
            android:inputType="numberDecimal"
            android:singleLine="true"
            android:textColor="#fff"
            android:textSize="@dimen/sp_11"
            app:vet_errorMessage="@string/text_regexp_msg"
            app:vet_regexp="@string/text_regexp"
            app:vet_tipPosition="top" />
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="@dimen/dp_5"
        android:layout_marginBottom="@dimen/dp_10"
        android:paddingLeft="@dimen/dp_20"
        android:paddingRight="@dimen/dp_20">

        <TextView
            android:layout_width="@dimen/dp_60"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:text="区域编码"
            android:textColor="@color/line_title"
            android:textSize="@dimen/sp_11" />

        <com.xuexiang.xui.widget.edittext.ValidatorEditText
            android:id="@+id/areaCode"
            style="@style/EditText.Normal"
            android:layout_width="match_parent"
            android:background="@drawable/param_set_frame_edit_background"
            android:focusableInTouchMode="true"
            android:inputType="numberDecimal"
            android:singleLine="true"
            android:textColor="#fff"
            android:textSize="@dimen/sp_11"
            app:vet_errorMessage="@string/text_regexp_msg"
            app:vet_regexp="@string/text_regexp"
            app:vet_tipPosition="top" />
    </LinearLayout>

    <com.google.android.flexbox.FlexboxLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="@dimen/dp_2_5"
        android:layout_marginBottom="@dimen/dp_2_5"
        app:justifyContent="space_around">

        <com.xuexiang.xui.widget.alpha.XUIAlphaLinearLayout
            android:id="@+id/cancelButton"
            android:layout_width="@dimen/dp_70"
            android:layout_height="@dimen/dp_25"
            android:background="@mipmap/rectangle9"
            android:gravity="center|center_vertical">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="取消"
                android:textAlignment="center"
                android:textColor="#fff"
                android:textSize="@dimen/sp_11" />
        </com.xuexiang.xui.widget.alpha.XUIAlphaLinearLayout>

        <com.xuexiang.xui.widget.alpha.XUIAlphaLinearLayout
            android:id="@+id/saveButton"
            android:layout_width="@dimen/dp_70"
            android:layout_height="@dimen/dp_25"
            android:background="@mipmap/rectangle_blue"
            android:gravity="center|center_vertical">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="确定"
                android:textAlignment="center"
                android:textColor="#fff"
                android:textSize="@dimen/sp_11" />
        </com.xuexiang.xui.widget.alpha.XUIAlphaLinearLayout>
    </com.google.android.flexbox.FlexboxLayout>
</LinearLayout>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants