I have the following page in my android app (I cannot take screenshot of the page so i simply draw it): I have edittexts and i use edittext's showError property.
Then, at some point of the program, the whole page animates and slides down. The problem is, when edittexts slide down, the error message does not slide, it holds its position and becomes like this:
Here is my layout file for the edittexts:
<RelativeLayout
android:layout_marginTop="10dp"
android:id="@+id/loginFieldsPanel"
android:layout_below="@+id/loginWarningPanel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:background="@drawable/login_edit_fields_bg">
<RelativeLayout
android:id="@+id/userNamePanel"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:id="@+id/userNameWithBg"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/login_eposta_image_bg"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/login_username_left_image"/>
</RelativeLayout>
<com.example.CustomEditText
android:paddingRight="5dp"
android:id="@+id/editUserName"
android:layout_toRightOf="@+id/userNameWithBg"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:layout_centerVertical="true"
android:textSize="16sp"
custom:customFontType="regular"
android:hint="@string/login_identity_hint"
android:background="@null"/>
</RelativeLayout>
<ImageView
android:id="@+id/login_fields_line"
android:layout_below="@+id/userNamePanel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@drawable/login_fileds_line"/>
<RelativeLayout
android:layout_below="@+id/login_fields_line"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:id="@+id/passwordWithBg"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/login_password_image_bg"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/login_password_left_image"/>
</RelativeLayou
<com.example.CustomEditText
android:layout_margin="5dp"
android:paddingRight="5dp"
android:layout_centerVertical="true"
android:layout_toRightOf="@+id/passwordWithBg"
android:id="@+id/editPassword"
android:background="@null"
android:inputType="textPassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="16sp"
custom:customFontType="regular"
android:hint="@string/login_password_hint"/>
</RelativeLayout>
</RelativeLayout>
And here is how i perform the animation:
ObjectAnimator.ofFloat(basePanel, "translationY", start, finish).setDuration(duration).start();
where basePanel is the root layout of my layout file.
So, can anyone help me to fix it?
Thanks
0 comments:
Post a Comment