I have a Fragment
that leads to another one and on the second one, there are some EditText
's for the user to fill.
When I first click on any EditText
, the whole fragment becomes transparent for about a second and I'm able to see the previous fragment.
Then when I click on the others EditText
's, it doesn't happen anymore.
This is what happens when I click for the first time on an EditText
And after a second, it becomes normal
What could it be?
EDIT
My Second Fragment Layout is:
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:clickable="true"
android:fillViewport="true">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginBottom="0dp"
tools:context="com.kayan.letsapp.Fragments.AddInviteeFragment"
android:background="@color/white"
android:clickable="true" >
<include android:id="@+id/header"
layout="@layout/event_header" />
<com.kayan.letsapp.CustomComponents.GifView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:id="@+id/loading_view"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/header"
android:layout_marginTop="@dimen/activity_vertical_margin"
android:layout_marginLeft="@dimen/activity_vertical_margin"
android:layout_marginRight="@dimen/activity_vertical_margin"
android:id="@+id/main"
android:background="@color/white"
android:visibility="gone">
<com.kayan.letsapp.CustomComponents.CustomTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/invitee_form_title"
android:id="@+id/invitee_form_title"
android:textSize="@dimen/text_size_medium"
android:textColor="@color/grayLight"
android:layout_marginTop="@dimen/margin_small"
app:customFont="boldCondensed" />
<com.kayan.letsapp.CustomComponents.CustomTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/invitee_form_subtitle"
android:layout_below="@+id/invitee_form_title"
android:textSize="@dimen/text_size_small"
android:textColor="@color/grayLighter"
android:layout_marginTop="@dimen/activity_vertical_margin"
app:customFont="boldCondensed" />
<com.kayan.letsapp.CustomComponents.CustomEditText
android:layout_marginTop="@dimen/activity_vertical_margin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPersonName"
android:layout_below="@+id/invitee_form_subtitle"
android:hint="@string/name_input"
android:ems="10"
android:id="@+id/name_input"
android:background="@color/grayLightest"
android:textColorHint="@color/grayLight"
android:padding="10dp"
android:layout_weight="0.2"/>
<com.kayan.letsapp.CustomComponents.CustomEditText
android:layout_marginTop="@dimen/activity_vertical_margin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/name_input"
android:inputType="textEmailAddress"
android:hint="@string/email_hint"
android:ems="10"
android:id="@+id/email_input"
android:background="@color/grayLightest"
android:textColorHint="@color/grayLight"
android:layout_weight="0.2"
android:padding="10dp"/>
<com.kayan.letsapp.CustomComponents.CustomButton
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/add_label"
android:layout_below="@+id/email_input"
android:id="@+id/add_invitee"
android:background="@drawable/primary_button"
android:textColor="@color/white"
android:layout_marginTop="@dimen/activity_vertical_margin"
android:layout_gravity="center_horizontal"
/>
</RelativeLayout>
</RelativeLayout>
And this CustomEditText
class is just for setting a custom font on EditText
public class CustomEditText extends EditText{
private static final String TAG = "EditText";
public CustomEditText(Context context) {
super(context);
}
public CustomEditText(Context context, AttributeSet attrs) {
super(context, attrs);
setCustomFont(context, attrs);
}
public CustomEditText(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
setCustomFont(context, attrs);
}
private void setCustomFont(Context ctx, AttributeSet attrs) {
TypedArray a = ctx.obtainStyledAttributes(attrs, R.styleable.CustomEditText);
String customFont = a.getString(R.styleable.CustomEditText_customFont);
setCustomFont(ctx, customFont);
a.recycle();
}
public boolean setCustomFont(Context ctx, String fontName) {
Typeface tf = FontHandler.getFont(fontName);
if (tf == null){
setTypeface(FontHandler.getFont("regularCondensed"));
}
else {
setTypeface(tf);
}
return true;
}