android seekbar height in drawable - android

I have a seekbar which was very thick earlier. Later in the drawable i set height attribute and it is fine but it works only for SDK 23 or more.
SchedulePickupFragment.xml
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:id="#+id/imgFragment">
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:context="in.junkart.junkart.SchedulePickupFragment"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#E4E4E4">
<LinearLayout
tools:context="in.junkart.junkart.SchedulePickupFragment"
android:id="#+id/pickup_linearLayout"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:background="#drawable/layout_bg"
android:orientation="vertical"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:paddingTop="20dp"
android:paddingBottom="20dp"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true"
android:layout_alignParentEnd="true">
<android.support.design.widget.TextInputLayout
android:id="#+id/input_layout_name"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<AutoCompleteTextView
android:id="#+id/input_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:inputType="textAutoComplete|textPersonName"
android:imeOptions="actionNext"
android:hint="Name"
android:textColorHint="#color/colorPrimaryLight"
android:paddingLeft="15dp" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/input_layout_phone"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<AutoCompleteTextView
android:id="#+id/input_phone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text|phone"
android:imeOptions="actionNext"
android:hint="Phone"
android:textColorHint="#color/colorPrimaryLight"
android:paddingLeft="15dp" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/input_layout_pickup_time"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<AutoCompleteTextView
android:id="#+id/input_pickup_time"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:imeOptions="actionDone"
android:hint="Pickup Time"
android:focusable="false"
android:textColorHint="#color/colorPrimaryLight"
android:paddingLeft="15dp" />
</android.support.design.widget.TextInputLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="45dp"
android:orientation="horizontal">
<TextView
android:layout_width="150sp"
android:layout_height="wrap_content"
android:text="Estimate Weight:"
android:textSize="15sp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"/>
<TextView
android:id="#+id/estmtWght"
android:layout_width="70sp"
android:layout_height="wrap_content"
android:text="20 Kg"
android:textSize="15sp"
android:textColor="#color/colorPrimaryDark"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"/>
</LinearLayout>
<SeekBar
android:id="#+id/seekbar"
android:layout_width="300dp"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:max="10"
android:layout_marginTop="10dp"
android:progressDrawable="#drawable/progress"
android:thumb="#drawable/thumb"
>
</SeekBar>
<android.support.design.widget.TextInputLayout
android:id="#+id/input_layout_address"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp">
<AutoCompleteTextView
android:id="#+id/input_address"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:imeOptions="actionNext"
android:hint="Address"
android:textColorHint="#color/colorPrimaryLight"
android:paddingLeft="15dp" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/input_layout_locality"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp">
<AutoCompleteTextView
android:id="#+id/input_locality"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:imeOptions="actionNext"
android:hint="Locality"
android:textColorHint="#color/colorPrimaryLight"
android:paddingLeft="15dp" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/input_layout_pin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp">
<AutoCompleteTextView
android:id="#+id/input_pin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:imeOptions="actionNext"
android:hint="Pin"
android:textColorHint="#color/colorPrimaryLight"
android:paddingLeft="15dp" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/input_layout_email"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<AutoCompleteTextView
android:id="#+id/input_email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textEmailAddress|textAutoComplete"
android:imeOptions="actionDone"
android:hint="Email"
android:textColorHint="#color/colorPrimaryLight"
android:paddingStart="15dp" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/input_layout_message"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<AutoCompleteTextView
android:id="#+id/input_message"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:imeOptions="actionNext"
android:hint="Message (If Any)"
android:textColorHint="#color/colorPrimaryLight"
android:paddingLeft="15dp"
android:paddingStart="15dp"/>
</android.support.design.widget.TextInputLayout>
<ImageButton
android:layout_width="290dp"
android:layout_height="70dp"
android:id="#+id/btn_schedule_pickup"
android:layout_below="#+id/pickup_linearLayout"
android:layout_alignParentBottom="true"
android:src="#drawable/confirm_button_normal"
android:layout_centerHorizontal="true"
android:layout_marginBottom="0dp"
android:scaleType="fitXY"
android:background="#color/white"
android:layout_marginLeft="0dp"
android:layout_marginTop="30dp"
android:layout_marginRight="0dp" />
</LinearLayout>
<!-- Fix user request form (weight, mandatory location - address autofill, state hidden field, locality, pincode)-->
</RelativeLayout>
</ScrollView>
Progress.xml(in drawable)
<item
android:id="#android:id/background"
android:drawable="#drawable/background_fill"
android:height="4dp"
android:layout_height="4dp"
android:top="6dp">
</item>
<item
android:id="#android:id/progress"
android:height="4dp"
android:layout_height="4dp"
android:top="6dp">
<clip android:drawable="#drawable/progress_fill"/>
</item>
The height attribute in progress.xml seems to not work for sdk 22 and less.

Related

Is it possible to manage the tooltip in widget.TextInputLayout

As Edittext it is not the only one in the group widget. With TextInputLayout the hint didn't work. Tell me is there any way else to summon help?
This is my layout:
<android.support.design.widget.TextInputLayout
android:id="#+id/til_account"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="10dp"
android:layout_weight="1"
android:textColorHint="#color/colorTextHint">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<EditText
android:id="#+id/et_account_tint"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="#color/colorTextHint"
android:maxLines="1"
android:theme="#style/EditText"
android:textSize="16sp" />
<EditText
android:id="#+id/et_account"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:drawableRight="#mipmap/ic_selectcontact"
android:hint="#string/enter_phone_number_contact_name"
android:inputType="text"
android:maxLines="1"
android:textColorHint="#color/colorTextHint"
android:textSize="16sp"
android:theme="#style/EditText" />
<TextView
android:id="#+id/et_account_button"
android:layout_width="70dp"
android:layout_height="35dp"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:background="#android:color/transparent"
android:onClick="#{presenter::onClick}"
android:textSize="16sp"
tools:ignore="LabelFor" />
</RelativeLayout>
</android.support.design.widget.TextInputLayout>
Do like this
<android.support.design.widget.TextInputLayout
android:id="#+id/til_account"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="10dp"
android:layout_weight="1"
app:hintEnabled="true" app:hintAnimationEnabled="false"
android:textColorHint="#color/colorTextHint">
<EditText
android:id="#+id/et_account_tint"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="#color/colorTextHint"
android:maxLines="1"
android:theme="#style/EditText"
android:textSize="16sp" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/til_account"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="10dp"
android:layout_weight="1"
app:hintEnabled="true"
app:hintAnimationEnabled="false"
android:textColorHint="#color/colorTextHint">
<EditText
android:id="#+id/et_account"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:drawableRight="#mipmap/ic_selectcontact" android:hint="#string/enter_phone_number_contact_name"
android:inputType="text"
android:maxLines="1"
android:textColorHint="#color/colorTextHint"
android:textSize="16sp"
android:theme="#style/EditText" />
</android.support.design.widget.TextInputLayout>
<TextView
android:id="#+id/et_account_button"
android:layout_width="70dp"
android:layout_height="35dp"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:background="#android:color/transparent"
android:onClick="#{presenter::onClick}"
android:textSize="16sp"
tools:ignore="LabelFor" />

TextInputLayout error icon appear in both side

i'm working on android application for registration operations
i'm using
compile SdkVersion 24
buildToolsVersion "24.0.1"
compile 'com.android.support:appcompat-v7:24.2.1'
compile
'com.android.support:design:24.2.1'
and the xml code for this layout is:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fitsSystemWindows="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="24dp"
android:paddingRight="24dp"
android:paddingTop="56dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="72dp"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="24dp"
android:src="#drawable/logo" />
<!-- Full Name Label -->
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp">
<EditText
android:id="#+id/input_full_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="#string/Full_Name"
android:inputType="textCapWords" />
</android.support.design.widget.TextInputLayout>
<!-- User Name Label -->
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp">
<EditText
android:id="#+id/input_user_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="#string/User_Name"
android:inputType="textCapWords" />
</android.support.design.widget.TextInputLayout>
<!--Gender-->
<RadioGroup
android:id="#+id/RG"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal">
<RadioButton
android:id="#+id/male"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:drawableLeft="#drawable/man"
android:text="#string/Male" />
<RadioButton
android:id="#+id/female"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:drawableLeft="#drawable/woman"
android:text="#string/FeMale" />
</RadioGroup>
<!--Birthday-->
<TextView
android:id="#+id/input_birthday"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:text="#string/BirthDay"></TextView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal">
<android.support.design.widget.TextInputLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_weight="1">
<EditText
android:id="#+id/spinner_day"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="#string/Day"
android:inputType="number" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_weight="1">
<EditText
android:id="#+id/spinner_month"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="#string/Month"
android:inputType="number" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_weight="1">
<EditText
android:id="#+id/spinner_year"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="#string/Year"
android:inputType="number" />
</android.support.design.widget.TextInputLayout>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="#+id/txt_lable_p"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:text="#string/Add_Contact_Info"
android:textColor="#color/ColorPrimaryDark"
android:textSize="#dimen/textSize_medium3" />
<ImageView
android:id="#+id/infoContact"
android:layout_marginTop="12dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#android:drawable/ic_menu_info_details"/>
</LinearLayout>
<!-- WhatsApp Label -->
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp">
<EditText
android:id="#+id/input_whatsApp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="#string/WhatsApp"
android:inputType="number" />
</android.support.design.widget.TextInputLayout>
<!-- PhoneNumber Label -->
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp">
<EditText
android:id="#+id/input_phoneNumber"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="#string/PhoneNumber"
android:inputType="number" />
</android.support.design.widget.TextInputLayout>
<!-- Facebook Label -->
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp">
<EditText
android:id="#+id/input_facebook"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="#string/Facebook"
android:inputType="textWebEditText" />
</android.support.design.widget.TextInputLayout>
<!-- Twitter Label -->
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp">
<EditText
android:id="#+id/input_twitter"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="#string/Twitter"
android:inputType="textWebEditText" />
</android.support.design.widget.TextInputLayout>
<!-- Password Label -->
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp">
<EditText
android:id="#+id/input_password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="#string/Password"
android:inputType="textPassword" />
</android.support.design.widget.TextInputLayout>
<!-- Confirm Password Label -->
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp">
<EditText
android:id="#+id/input_confirm_password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="#string/Confirm_Password"
android:inputType="textPassword" />
</android.support.design.widget.TextInputLayout>
<!-- Question Password Label -->
<TextView
android:id="#+id/QPassword"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:text="#string/QPassword" />
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp">
<android.support.v7.widget.AppCompatEditText
android:id="#+id/input_Q_password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="#string/Q1"
android:inputType="text" />
</android.support.design.widget.TextInputLayout>
<!--job-->
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<RadioGroup
android:id="#+id/RGJob"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<RadioButton
android:id="#+id/lookjob"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/LookJob" />
<ImageView
android:id="#+id/infoLookJob"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#android:drawable/ic_menu_info_details"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<RadioButton
android:id="#+id/havejob"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/HaveJob" />
<ImageView
android:id="#+id/infoHaveJob"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#android:drawable/ic_menu_info_details"/>
</LinearLayout>
<RadioButton
android:id="#+id/None"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:text="#string/NoThing" />
</RadioGroup>
</LinearLayout>
<TextView
android:id="#+id/attchjob"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:text="#string/AttachAds"
android:visibility="gone" />
<android.support.design.widget.TextInputLayout
android:id="#+id/ads_layout"
android:layout_width="match_parent"
android:layout_height="170dp"
android:layout_margin="10dp"
android:background="#drawable/et"
android:visibility="gone">
<EditText
android:id="#+id/input_ads"
android:layout_width="match_parent"
android:layout_height="160dp"
android:layout_margin="10dp"
android:gravity="top"
android:inputType="textCapSentences|textMultiLine" />
</android.support.design.widget.TextInputLayout>
<Button
android:id="#+id/attach_img"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_margin="10dp"
android:text="#string/Image"
android:textAllCaps="false"
android:textColor="#ffffff"
android:theme="#style/MyButton"
android:visibility="gone" />
<TextView
android:id="#+id/url"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:visibility="gone" />
<ImageView
android:id="#+id/urlimage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:adjustViewBounds="true"
android:visibility="gone" />
<!-- Signup Button -->
<android.support.v7.widget.AppCompatButton
android:id="#+id/btn_signup"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="24dp"
android:layout_marginTop="24dp"
android:padding="12dp"
android:text="#string/signUp" />
<TextView
android:id="#+id/link_login"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="24dp"
android:gravity="center"
android:text="#string/AlreadyLogin"
android:textColor="#color/primary_dark"
android:textSize="16dip" />
</LinearLayout>
</ScrollView>
when i run it , it appeared like this
register layout
java code for this field:
if (answerPassword.isEmpty() || Password.length() < 2 ) {
Answer.setError(getResources().getString(R.string.ErrorAnswer));
}
the error icon appear in both side of textinputlayout , why ?
Try to rebuild the project with com.android.support:design:24.1.0. There is some issue with 24.2.1 library. using another version in my project i couldn't even get error message. So 24.2.1 is the issue. change it to 24.1.0 and rebuild.

ScrollView is not scrolling in android

Hi i am new for android and I cant understand why this is happening. I am unable to scroll my scrollview. It has a textView , an imageview and few linear layouts inside of it and my code is below
can some one help me please
code:-
<?xml version="1.0" encoding="utf-8"?>
<ScrollView 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:background="#android:color/white"
android:orientation="vertical"
android:theme="#style/Content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="15dp"
android:animateLayoutChanges="true"
android:orientation="vertical"
android:scrollbars="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/enter_basicinformation_title" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="3">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/edit_text_margin_top"
android:layout_weight="2">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<fr.ganfra.materialspinner.MaterialSpinner
android:id="#+id/spinState"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
app:ms_arrowColor="#color/text_hint_color"
app:ms_arrowSize="16dp"
app:ms_floatingLabelColor="#color/text_hint_color"
app:ms_floatingLabelText="#string/sir_name_title"
app:ms_highlightColor="#color/colorAccent"
app:ms_hint="#string/sir_name_title"
app:ms_multiline="true" />
</RelativeLayout>
</LinearLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:theme="#style/TextFieldInputLayout">
<EditText
android:id="#+id/username_id"
style="#style/MaterialDesignEditTextStyle"
android:drawablePadding="10dp"
android:hint="#string/username_hint"
android:imeOptions="actionNext"
android:inputType="textPersonName"
android:nextFocusDown="#+id/lastname_id" />
</android.support.design.widget.TextInputLayout>
</LinearLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/edit_text_margin_top"
android:theme="#style/TextFieldInputLayout">
<EditText
android:id="#+id/lastname_id"
style="#style/MaterialDesignEditTextStyle"
android:drawablePadding="10dp"
android:hint="#string/last_name_hint"
android:imeOptions="actionNext"
android:inputType="textPersonName"
android:nextFocusDown="#+id/email_id" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/edit_text_margin_top"
android:theme="#style/TextFieldInputLayout">
<EditText
android:id="#+id/email_id"
style="#style/MaterialDesignEditTextStyle"
android:drawablePadding="10dp"
android:hint="#string/email_id_hint"
android:imeOptions="actionNext"
android:inputType="textPersonName"
android:nextFocusDown="#+id/re_email_id" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/edit_text_margin_top"
android:theme="#style/TextFieldInputLayout">
<EditText
android:id="#+id/re_email_id"
style="#style/MaterialDesignEditTextStyle"
android:drawablePadding="10dp"
android:hint="#string/re_email_id_hint"
android:imeOptions="actionNext"
android:inputType="textPersonName" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/edit_text_margin_top"
android:theme="#style/TextFieldInputLayout">
<EditText
android:id="#+id/password_id"
style="#style/MaterialDesignEditTextStyle"
android:drawablePadding="10dp"
android:hint="#string/password_hint"
android:imeOptions="actionNext"
android:inputType="textPersonName"
android:nextFocusDown="#+id/re_password_id" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="#style/TextFieldInputLayout">
<EditText
android:id="#+id/re_password_id"
style="#style/MaterialDesignEditTextStyle"
android:drawablePadding="10dp"
android:hint="#string/re_reenter_password_hint"
android:imeOptions="actionNext"
android:inputType="textPersonName" />
</android.support.design.widget.TextInputLayout>
<Button
android:id="#+id/register_button_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_weight="1"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:text="#string/register_title"
android:theme="#style/greenColorButton" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="25dp"
android:text="#string/existing_user_title" />
</LinearLayout>
</ScrollView>
screen:-
// Make parent layout scroll and put linear layout inside .
<ScrollView
android:id="#+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:animateLayoutChanges="true"
android:orientation="vertical"
android:scrollbars="vertical" >
...
...
</LinearLayout>
</ScrollView>
Try this:
I have removed the #style/content, add it later again. The rest is modified like i have told you in the comments
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:background="#android:color/white"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="15dp"
android:animateLayoutChanges="true"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/enter_basicinformation_title" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="3">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/edit_text_margin_top"
android:layout_weight="2">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<fr.ganfra.materialspinner.MaterialSpinner
android:id="#+id/spinState"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
app:ms_arrowColor="#color/text_hint_color"
app:ms_arrowSize="16dp"
app:ms_floatingLabelColor="#color/text_hint_color"
app:ms_floatingLabelText="#string/sir_name_title"
app:ms_highlightColor="#color/colorAccent"
app:ms_hint="#string/sir_name_title"
app:ms_multiline="true" />
</RelativeLayout>
</LinearLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:theme="#style/TextFieldInputLayout">
<EditText
android:id="#+id/username_id"
style="#style/MaterialDesignEditTextStyle"
android:drawablePadding="10dp"
android:hint="#string/username_hint"
android:imeOptions="actionNext"
android:inputType="textPersonName"
android:nextFocusDown="#+id/lastname_id" />
</android.support.design.widget.TextInputLayout>
</LinearLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/edit_text_margin_top"
android:theme="#style/TextFieldInputLayout">
<EditText
android:id="#+id/lastname_id"
style="#style/MaterialDesignEditTextStyle"
android:drawablePadding="10dp"
android:hint="#string/last_name_hint"
android:imeOptions="actionNext"
android:inputType="textPersonName"
android:nextFocusDown="#+id/email_id" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/edit_text_margin_top"
android:theme="#style/TextFieldInputLayout">
<EditText
android:id="#+id/email_id"
style="#style/MaterialDesignEditTextStyle"
android:drawablePadding="10dp"
android:hint="#string/email_id_hint"
android:imeOptions="actionNext"
android:inputType="textPersonName"
android:nextFocusDown="#+id/re_email_id" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/edit_text_margin_top"
android:theme="#style/TextFieldInputLayout">
<EditText
android:id="#+id/re_email_id"
style="#style/MaterialDesignEditTextStyle"
android:drawablePadding="10dp"
android:hint="#string/re_email_id_hint"
android:imeOptions="actionNext"
android:inputType="textPersonName" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/edit_text_margin_top"
android:theme="#style/TextFieldInputLayout">
<EditText
android:id="#+id/password_id"
style="#style/MaterialDesignEditTextStyle"
android:drawablePadding="10dp"
android:hint="#string/password_hint"
android:imeOptions="actionNext"
android:inputType="textPersonName"
android:nextFocusDown="#+id/re_password_id" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="#style/TextFieldInputLayout">
<EditText
android:id="#+id/re_password_id"
style="#style/MaterialDesignEditTextStyle"
android:drawablePadding="10dp"
android:hint="#string/re_reenter_password_hint"
android:imeOptions="actionNext"
android:inputType="textPersonName" />
</android.support.design.widget.TextInputLayout>
<Button
android:id="#+id/register_button_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_weight="1"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:text="#string/register_title"
android:theme="#style/greenColorButton" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="25dp"
android:text="#string/existing_user_title" />
</LinearLayout>
</ScrollView>
</FrameLayout>

How to edit the position of floating label in an edittext with icon

I have an editText with a floating label(hint).I have also added an icon to that editText. I want the label to be on the top of the icon but it appears on the top just after the icon.I am using this dependency -
compile 'com.github.vajro:MaterialDesignLibrary:1.6'
my xml :
<ScrollView xmlns:tools="http://schemas.android.com/tools"
tools:context="com.itjobnotification.first.app.signupActivity"
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/scrollView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:fillViewport="true"
android:scrollbars="none">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:materialdesign="http://schemas.android.com/apk/res-auto"
>
<android.support.v7.widget.CardView
xmlns:card_view="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/card_view"
android:layout_gravity="center"
android:layout_width="fill_parent"
android:layout_height="200dp"
android:layout_margin="5dp"
card_view:cardBackgroundColor="#android:color/transparent"
card_view:cardCornerRadius="2dp"
card_view:contentPadding="10dp">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:id="#+id/textView"
android:text="Personal Details"
android:layout_marginTop="4dp"
android:layout_marginLeft="5dp"
android:textSize="18dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"/>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="5dp"
android:background="#d7d7d8"
android:layout_below="#+id/textView"/>
<android.support.design.widget.TextInputLayout
android:id="#+id/input_layout_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/textView"
android:layout_marginTop="15dp"
android:layout_marginLeft="-4dp"
android:layout_marginRight="-4dp"
android:layout_alignParentLeft="true">
<EditText
android:id="#+id/name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Name"
android:paddingLeft="3dp"
android:drawableLeft="#drawable/name"
android:maxLines="1"/>
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/input_layout_email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/input_layout_name"
android:layout_marginTop="12dp"
android:layout_marginLeft="-4dp"
android:layout_marginRight="-4dp"
android:textColor="#ffffff"
android:layout_alignParentLeft="true">
<EditText
android:id="#+id/email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Email"
android:maxLines="1"
/>
</android.support.design.widget.TextInputLayout>
</RelativeLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
xmlns:card_view="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/card_view_professional"
android:layout_below="#+id/card_view"
android:layout_gravity="center"
android:layout_width="fill_parent"
android:layout_height="200dp"
android:layout_margin="5dp"
card_view:cardBackgroundColor="#android:color/transparent"
card_view:cardCornerRadius="2dp"
card_view:contentPadding="10dp">>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="#+id/prof">
<TextView
android:id="#+id/textView1"
android:text="Professional Details"
android:layout_marginTop="4dp"
android:layout_marginLeft="5dp"
android:textSize="18dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"/>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="5dp"
android:background="#d7d7d8"
android:layout_below="#+id/textView1"/>
<android.support.design.widget.TextInputLayout
android:id="#+id/input_layout_years"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/textView1"
android:layout_marginTop="15dp"
android:layout_marginLeft="-4dp"
android:layout_marginRight="-4dp"
android:layout_alignParentLeft="true">
<EditText
android:id="#+id/yearsOfExperience"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Years of Experience"
android:maxLines="1"/>
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/input_layout_ctc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/input_layout_years"
android:layout_marginTop="12dp"
android:layout_marginLeft="-4dp"
android:layout_marginRight="-4dp"
android:textColor="#ffffff"
android:layout_alignParentLeft="true">
<EditText
android:id="#+id/ctc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Current CTC (in LPA)"
android:maxLines="1"
/>
</android.support.design.widget.TextInputLayout>
<Spinner
android:id="#+id/college"
style="#android:style/Widget.ListView.DropDown"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:dropDownWidth="wrap_content"
android:layout_gravity="center"
android:entries="#array/college"
android:layout_marginTop="20dp"
android:layout_below="#+id/input_layout_ctc"
android:layout_weight="1"
android:focusable="false"
android:focusableInTouchMode="false"
android:text="1"
android:layout_alignLeft="#+id/input_layout_ctc" />
<Spinner
android:id="#+id/loc"
style="#android:style/Widget.ListView.DropDown"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:dropDownWidth="wrap_content"
android:layout_gravity="center"
android:entries="#array/location"
android:layout_marginTop="40dp"
android:layout_below="#+id/college"
android:layout_weight="1"
android:focusable="false"
android:focusableInTouchMode="false"
android:text="1"
android:layout_alignLeft="#+id/input_layout_ctc" />
</RelativeLayout>
</android.support.v7.widget.CardView>
<android.support.design.widget.TextInputLayout
android:id="#+id/input_layout_promo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/card_view_professional"
android:layout_marginTop="12dp"
android:layout_marginLeft="-4dp"
android:layout_marginRight="-4dp"
android:textColor="#ffffff"
android:layout_alignParentLeft="true">
<EditText
android:id="#+id/promocode"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Promo Code (Optional)"
android:maxLines="1"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
/>
</android.support.design.widget.TextInputLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:layout_below="#+id/button"
android:layout_marginTop="15dp"
android:layout_marginBottom="10dp"
android:layout_gravity="center_horizontal"
android:id="#+id/terms"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true" />
<com.gc.materialdesign.views.ButtonRectangle
android:id="#+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#1E88E5"
android:layout_marginTop="10dp"
android:text="Button"
android:layout_below="#+id/chooseSkills"
android:layout_alignLeft="#+id/card_view_professional"
android:layout_alignRight="#+id/card_view" />
<com.gc.materialdesign.views.ButtonRectangle
android:id="#+id/chooseSkills"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#1E88E5"
android:text="Choose skills"
android:layout_marginTop="10dp"
android:layout_below="#+id/input_layout_promo"
android:layout_alignLeft="#+id/button"
android:layout_alignRight="#+id/card_view" />
</RelativeLayout>
</ScrollView>
ok I don't get the issue entirely but I have had an issue with TextInputLayout when I add custom background that the padding were wrong so I ended up adding some extra padding using xml background maybe this will help you then add thia as a background to your edittext
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:drawable="#drawable/edittext_selector"
android:top="#dimen/activity_medim_margin">
<!--<your original background; can be <bitmap> or <shape> or whatever./>-->
</item>

android:imeOptions="actionNext" is working great, but screen is scrolling to top

I have a layout, and want to get good navigation with "Next" Button.
All is working, but in field "et_numero", cursor focus to next field, this is ok, but screen scroll to top, I have no clue why!
Any help will be apreciated!
<LinearLayout
android:id="#+id/ll_addpdv1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin">
<!-- Aqui empieza el formulario -->
<android.support.design.widget.TextInputLayout
android:id="#+id/til_pdv_name"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="#+id/et_pdv_name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="#string/pdv_name"
android:inputType="text"
android:nextFocusDown="#+id/et_dueno" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/til_dueno"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:imeOptions="actionNext">
<EditText
android:id="#+id/et_dueno"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="#string/nombre_dueno"
android:imeOptions="actionNext"
android:inputType="text" />
</android.support.design.widget.TextInputLayout>
<Spinner
android:id="#+id/sp_proyectos"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/layout_bg"
android:focusable="true"
android:nextFocusDown="#+id/et_calle"
android:padding="20dp"
android:visibility="gone" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<android.support.design.widget.TextInputLayout
android:id="#+id/til_calle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.2">
<EditText
android:id="#+id/et_calle"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:hint="#string/calle2"
android:imeOptions="actionNext"
android:inputType="text" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/til_numero"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:nextFocusDown="#+id/et_colonia"
android:layout_weight="0.8">
<EditText
android:id="#+id/et_numero"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:hint="#string/numero"
android:imeOptions="actionNext"
android:inputType="number" />
</android.support.design.widget.TextInputLayout>
</LinearLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/til_colonia"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="#+id/et_colonia"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="#string/colonia2"
android:imeOptions="actionNext"
android:inputType="text" />
</android.support.design.widget.TextInputLayout>
<Spinner
android:id="#+id/sp_ciudades"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="true"
android:background="#drawable/layout_bg"
android:imeOptions="actionNext"
android:padding="20dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<android.support.design.widget.TextInputLayout
android:id="#+id/til_cp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.3"
>
<EditText
android:id="#+id/et_cp"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="#string/cp"
android:imeOptions="actionNext"
android:inputType="number"
android:maxLength="5"
/>
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/til_tel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.7"
>
<EditText
android:id="#+id/et_tel"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="#string/telefono2"
android:imeOptions="actionDone"
android:inputType="phone"
/>
</android.support.design.widget.TextInputLayout>
</LinearLayout>
</LinearLayout>
<Button
android:id="#+id/b_next1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#id/ll_addpdv1"
android:background="#drawable/button_azul_states"
android:paddingBottom="50dp"
android:paddingTop="50dp"
android:text="#string/siguiente"
android:textColor="#color/white" />
</RelativeLayout>

Categories

Resources