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

Text is cut off #18

Open
nikak259 opened this issue Dec 23, 2016 · 4 comments
Open

Text is cut off #18

nikak259 opened this issue Dec 23, 2016 · 4 comments

Comments

@nikak259
Copy link

When I'm trying to show a tooltip under the edittext, text is cut off. Maybe you know what could cause this problem?
20161223_143830 1

@ViHtarb
Copy link
Owner

ViHtarb commented Dec 29, 2016

Hi. As soon as I get free time, I'll check what could be the problem

@ViHtarb
Copy link
Owner

ViHtarb commented Dec 29, 2016

@nikak259 can you show your code of Tooltip usage? Because i can`t to reproduce this bug

@nikak259
Copy link
Author

Hi, here is the layout:

<android.support.constraint.ConstraintLayout 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:descendantFocusability="beforeDescendants">

`<FrameLayout
    android:id="@+id/email_fl"
    android:layout_width="0dp"
    android:layout_height="wrap_content"
    app:layout_constraintBottom_toTopOf="@+id/phone_code_fl"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintRight_toRightOf="parent"
    app:layout_constraintTop_toTopOf="parent">

    <android.support.design.widget.TextInputLayout
        android:id="@+id/email_ti"
        style="@style/InputText"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="@dimen/register_et_margin_bottom"
        app:errorTextAppearance="@style/ErrorAppearance">

        <android.support.design.widget.TextInputEditText
            android:id="@+id/email_et"
            style="@style/EdittextLight"
            android:layout_width="match_parent"
            android:layout_height="@dimen/et_layout_height"
            android:background="@drawable/edittext_light_bkg"
            android:hint="@string/signup_email_hint"
            android:textColor="@color/colorText"
            android:imeOptions="flagNoExtractUi"
            android:inputType="textEmailAddress"
            android:nextFocusForward="@+id/phoneNumberET"
            android:paddingRight="@dimen/et_icon_padding"
            android:textSize="@dimen/text_size_normal" />
    </android.support.design.widget.TextInputLayout>

    <ImageView
        android:id="@+id/email_help_iv"
        android:layout_width="@dimen/signup_icon_size"
        android:layout_height="@dimen/signup_icon_size"
        android:layout_gravity="right"
        android:paddingLeft="@dimen/signup_icon_padding"
        android:paddingRight="@dimen/signup_icon_padding"
        android:paddingTop="@dimen/signup_icon_padding"
        android:src="@drawable/help" />
</FrameLayout>

<FrameLayout
    android:id="@+id/phone_code_fl"
    android:layout_width="@dimen/signup_phone_code_width"
    android:layout_height="wrap_content"
    android:layout_marginEnd="@dimen/signup_icon_padding"
    android:layout_marginRight="@dimen/signup_icon_padding"
    app:layout_constraintBottom_toTopOf="@+id/firstNameTI"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintRight_toLeftOf="@+id/phoneNumber_fl"
    app:layout_constraintTop_toBottomOf="@+id/email_fl">

    <android.support.design.widget.TextInputLayout
        android:id="@+id/phone_code_ti"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="@dimen/register_et_margin_bottom"
        app:errorTextAppearance="@style/ErrorAppearance"
        app:theme="@style/InputText">

        <android.support.design.widget.TextInputEditText
            android:id="@+id/phone_code_et"
            style="@style/EdittextLight"
            android:layout_width="match_parent"
            android:layout_height="@dimen/et_layout_height"
            android:background="@drawable/edittext_light_bkg"
            android:focusable="false"
            android:hint="@string/signup_code_number_hint"
            android:textColor="@color/colorText"
            android:imeOptions="flagNoExtractUi"
            android:inputType="phone"
            android:textSize="@dimen/text_size_normal" />

    </android.support.design.widget.TextInputLayout>

    <ImageView
        android:layout_width="@dimen/signup_icon_size"
        android:layout_height="@dimen/signup_icon_size"
        android:layout_gravity="right"
        android:paddingLeft="@dimen/signup_icon_padding"
        android:paddingRight="@dimen/signup_icon_padding"
        android:paddingTop="@dimen/signup_icon_padding"
        android:src="@drawable/down_arrow"
        android:tint="@color/colorAccent" />
</FrameLayout>

<FrameLayout
    android:id="@+id/phoneNumber_fl"
    android:layout_width="0dp"
    android:layout_height="wrap_content"
    app:layout_constraintBottom_toTopOf="@+id/firstNameTI"
    app:layout_constraintLeft_toRightOf="@+id/phone_code_fl"
    app:layout_constraintRight_toRightOf="parent"
    app:layout_constraintTop_toBottomOf="@+id/email_fl">

    <android.support.design.widget.TextInputLayout
        android:id="@+id/phoneNumber_ti"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="@dimen/register_et_margin_bottom"
        android:layout_marginLeft="@dimen/signup_icon_padding"
        android:layout_marginStart="@dimen/signup_icon_padding"
        android:theme="@style/InputText"
        app:errorTextAppearance="@style/ErrorAppearance">

        <android.support.design.widget.TextInputEditText
            android:id="@+id/phoneNumberET"
            style="@style/EdittextLight"
            android:layout_width="match_parent"
            android:layout_height="@dimen/et_layout_height"
            android:background="@drawable/edittext_light_bkg"
            android:digits="0123456789"
            android:hint="@string/signup_phone_number_hint"
            android:imeOptions="flagNoExtractUi"
            android:inputType="numberDecimal"
            android:nextFocusForward="@+id/firstNameET"
            android:textColor="@color/colorText"
            android:textSize="@dimen/text_size_normal" />

    </android.support.design.widget.TextInputLayout>

    <ImageView
        android:id="@+id/phone_help_iv"
        android:layout_width="@dimen/signup_icon_size"
        android:layout_height="@dimen/signup_icon_size"
        android:layout_gravity="right"
        android:paddingLeft="@dimen/signup_icon_padding"
        android:paddingRight="@dimen/signup_icon_padding"
        android:paddingTop="@dimen/signup_icon_padding"
        android:src="@drawable/help" />
</FrameLayout>

<android.support.design.widget.TextInputLayout
    android:id="@+id/firstNameTI"
    android:layout_width="0dp"
    android:layout_height="wrap_content"
    android:layout_marginBottom="@dimen/register_et_margin_bottom"
    android:layout_marginEnd="@dimen/signup_icon_padding"
    android:layout_marginRight="@dimen/signup_icon_padding"
    android:theme="@style/InputText"
    app:errorTextAppearance="@style/ErrorAppearance"
    app:layout_constraintBottom_toTopOf="@+id/uniqueNameTI"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintRight_toLeftOf="@+id/lastNameTI"
    app:layout_constraintTop_toBottomOf="@+id/phone_code_fl">

    <android.support.design.widget.TextInputEditText
        android:id="@+id/firstNameET"
        style="@style/EdittextLight"
        android:layout_width="match_parent"
        android:layout_height="@dimen/et_layout_height"
        android:background="@drawable/edittext_light_bkg"
        android:hint="@string/signup_first_name_hint"
        android:imeOptions="flagNoExtractUi"
        android:textColor="@color/colorText"
        android:inputType="text"
        android:maxLength="15"
        android:nextFocusForward="@+id/lastNameET"
        android:textSize="@dimen/text_size_normal" />
</android.support.design.widget.TextInputLayout>

<android.support.design.widget.TextInputLayout
    android:id="@+id/lastNameTI"
    android:layout_width="0dp"
    android:layout_height="wrap_content"
    android:layout_marginBottom="@dimen/register_et_margin_bottom"
    android:layout_marginLeft="@dimen/signup_icon_padding"
    android:layout_marginStart="@dimen/signup_icon_padding"
    android:textColor="@color/colorText"
    android:theme="@style/InputText"
    app:errorTextAppearance="@style/ErrorAppearance"
    app:layout_constraintBottom_toTopOf="@+id/uniqueNameTI"
    app:layout_constraintLeft_toRightOf="@+id/firstNameTI"
    app:layout_constraintRight_toRightOf="parent"
    app:layout_constraintTop_toBottomOf="@+id/phoneNumber_fl">

    <android.support.design.widget.TextInputEditText
        android:id="@+id/lastNameET"
        style="@style/EdittextLight"
        android:layout_width="match_parent"
        android:layout_height="@dimen/et_layout_height"
        android:background="@drawable/edittext_light_bkg"
        android:hint="@string/signup_surname_hint"
        android:imeOptions="flagNoExtractUi"
        android:inputType="text"
        android:maxLength="15"
        android:nextFocusForward="@+id/uniqueNameET"
        android:textSize="@dimen/text_size_normal" />
</android.support.design.widget.TextInputLayout>


<android.support.design.widget.TextInputLayout
    android:id="@+id/uniqueNameTI"
    android:layout_width="0dp"
    android:layout_height="wrap_content"
    android:layout_marginBottom="@dimen/register_et_margin_bottom"
    android:textColor="@color/colorText"
    android:theme="@style/InputText"
    app:errorTextAppearance="@style/ErrorAppearance"
    app:layout_constraintBottom_toTopOf="@+id/passwordTI"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintRight_toRightOf="parent"
    app:layout_constraintTop_toBottomOf="@+id/firstNameTI">

    <android.support.design.widget.TextInputEditText
        android:id="@+id/uniqueNameET"
        style="@style/EdittextLight"
        android:layout_width="match_parent"
        android:layout_height="@dimen/et_layout_height"
        android:background="@drawable/edittext_light_bkg"
        android:hint="@string/signup_unique_name_hint"
        android:imeOptions="flagNoExtractUi"
        android:inputType="textNoSuggestions|textVisiblePassword"
        android:maxLength="16"
        android:nextFocusForward="@+id/passwordET"
        android:textSize="@dimen/text_size_normal" />
</android.support.design.widget.TextInputLayout>


<android.support.design.widget.TextInputLayout
    android:id="@+id/passwordTI"
    android:layout_width="0dp"
    android:layout_height="wrap_content"
    android:layout_marginBottom="@dimen/register_et_margin_bottom"
    android:textColor="@color/colorText"
    android:theme="@style/InputText"
    app:errorTextAppearance="@style/ErrorAppearance"
    app:layout_constraintBottom_toTopOf="@+id/confirmPasswordTI"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintRight_toRightOf="parent"
    app:layout_constraintTop_toBottomOf="@+id/uniqueNameTI">

    <android.support.design.widget.TextInputEditText
        android:id="@+id/passwordET"
        style="@style/EdittextLight"
        android:layout_width="match_parent"
        android:layout_height="@dimen/et_layout_height"
        android:background="@drawable/edittext_light_bkg"
        android:hint="@string/signup_password_hint"
        android:imeOptions="flagNoExtractUi"
        android:inputType="textPassword"
        android:nextFocusForward="@+id/confirmPasswordET"
        android:textSize="@dimen/text_size_normal" />
</android.support.design.widget.TextInputLayout>

<android.support.design.widget.TextInputLayout
    android:id="@+id/confirmPasswordTI"
    android:layout_width="0dp"
    android:layout_height="wrap_content"
    android:layout_marginBottom="@dimen/register_et_margin_bottom"
    android:textColor="@color/colorText"
    android:theme="@style/InputText"
    app:errorTextAppearance="@style/ErrorAppearance"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintRight_toRightOf="parent"
    app:layout_constraintTop_toBottomOf="@+id/passwordTI">

    <android.support.design.widget.TextInputEditText
        android:id="@+id/confirmPasswordET"
        style="@style/EdittextLight"
        android:layout_width="match_parent"
        android:layout_height="@dimen/et_layout_height"
        android:background="@drawable/edittext_light_bkg"
        android:hint="@string/signup_confirm_password_hint"
        android:imeOptions="flagNoExtractUi"
        android:inputType="textPassword"
        android:textSize="@dimen/text_size_normal" />
</android.support.design.widget.TextInputLayout>`

</android.support.constraint.ConstraintLayout>

and I've got static method, which I use to create tooltip:

public static Tooltip createToolTipDialogBox(EditText editText, int stringId, int gravity, Context context) {

    return new Tooltip.Builder(editText)
            .setGravity(gravity)
            .setCancelable(true)
            .setText(stringId)
            .setBackgroundColor(context.getResources().getColor(R.color.colorPrimaryDark))
            .setCornerRadius(R.dimen._4sdp)
            .setTextColor(context.getResources().getColor(R.color.colorText))
            .setPadding(R.dimen._8sdp)
            .setMargin(R.dimen._14sdp)
            .setArrowHeight(0f)
            .build();
}

then i create tooltip using this method:
mEmailTooltip = TooltipHelper.createToolTipDialogBox(mEmailTI.getEditText(), R.string.signup_email_help, Gravity.BOTTOM, getContext());
and show/dismiss it when i need

@ViHtarb ViHtarb closed this as completed Dec 29, 2016
@ViHtarb
Copy link
Owner

ViHtarb commented Dec 29, 2016

@nikak259 i can`t reproduce this bug with your layout and Tooltip creating code. Try to use \n in your tooltip text

@ViHtarb ViHtarb reopened this Dec 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants