dimanche 10 septembre 2017

Scroll view implemented on specific linear layout and relative layout

I am trying to scroll the relative layout using linear layout as child ayour and scroll view as parent to both of them, but unable to scroll the specific part of the layout. My code is attached below, plese guide me through it.

I have tried every options, although dont want to use Android ListView Checkbox, there's a little bit of problem with this layout, please help me to figure it out.

<RelativeLayout xmlns:android="http://ift.tt/nIICcg"
xmlns:app="http://ift.tt/GEGVYd"
xmlns:tools="http://ift.tt/LrGmb4"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="com.noumannaeem.mistreemazdoor.mistremazdoortest2.SearchFilterActivity"
tools:showIn="@layout/activity_search_filter">



<RelativeLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/scrollView">

<TextView
    android:layout_width="130dp"
    android:layout_height="wrap_content"
    android:paddingRight="@dimen/activity_horizontal_margi"
    android:textAppearance="?android:attr/textAppearanceSmall"
    android:text="Work Category"
    android:id="@+id/textView8"
    android:layout_alignParentTop="true"
    android:layout_alignParentStart="true"
    android:layout_marginStart="20dp"
    android:layout_marginTop="20dp" />

    <Spinner
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:layout_marginEnd="20dp"
        android:id="@+id/spinner2"
        android:background="@color/button_material_light"
        android:clickable="true"
        android:layout_marginTop="10dp"
        android:layout_below="@+id/textView8"
        android:layout_alignStart="@+id/textView8" />


<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceSmall"
    android:text="Worker Rating"
    android:id="@+id/textView9"
    android:layout_marginTop="30dp"
    android:layout_marginEnd="20dp"
    android:layout_below="@+id/spinner2"
    android:layout_alignStart="@+id/spinner2" />

<RadioGroup
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_below="@+id/textView9"
    android:layout_alignStart="@+id/textView9"
    android:layout_marginTop="10dp"
    android:layout_marginEnd="20dp"
    android:orientation="horizontal"
    android:id="@+id/radioGroup">


    <RadioButton
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text=">= 1"
        android:id="@+id/radioButton"
        android:checked="false"
        android:layout_weight="0.13" />

    <RadioButton
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="> 2"
        android:id="@+id/radioButton2"
        android:checked="false"
        android:layout_weight="0.13" />

    <RadioButton
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="> 3"
        android:id="@+id/radioButton3"
        android:checked="false"
        android:layout_weight="0.13" />

    <RadioButton
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="> 4"
        android:id="@+id/radioButton4"
        android:checked="false"
        android:layout_weight="0.13" />



</RadioGroup>

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceSmall"
    android:text="Location"
    android:id="@+id/textView10"
    android:layout_below="@+id/radioGroup"
    android:layout_alignStart="@+id/radioGroup"
    android:layout_marginEnd="20dp"
    android:layout_marginTop="30dp" />

<ImageButton
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/imageButton2"
    android:src="@drawable/placeholder"
    android:background="@null"
    android:layout_alignTop="@+id/autoCompleteTextView"
    android:layout_alignEnd="@+id/radioGroup" />

<AutoCompleteTextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:hint="Enter your location"
    android:textSize="18dp"
    android:id="@+id/autoCompleteTextView"
    android:layout_below="@+id/textView10"
    android:layout_alignLeft="@+id/radioGroup"
    android:layout_toStartOf="@+id/imageButton2"
    android:inputType="textMultiLine" />


</RelativeLayout>


<ScrollView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_below="@+id/scrollView">   // this scroll view is not performing it's action

<LinearLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">

<RelativeLayout
    android:layout_width="wrap_content"
    android:layout_height="150dp">

<CheckBox
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="New  1"
    android:id="@+id/checkBox"
    android:layout_alignParentStart="true"
    android:layout_marginStart="20dp"
    android:layout_marginTop="10dp" />

<CheckBox
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="New  2"
    android:id="@+id/checkBox2"
    android:layout_marginStart="35dp"
    android:layout_alignTop="@+id/checkBox"
    android:layout_toEndOf="@+id/checkBox" />

<CheckBox
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="New  3"
    android:id="@+id/checkBox3"
    android:layout_marginStart="35dp"
    android:layout_alignTop="@+id/checkBox2"
    android:layout_toEndOf="@+id/checkBox2" />

<CheckBox
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="New  4"
    android:id="@+id/checkBox4"
    android:layout_below="@+id/checkBox"
    android:layout_alignStart="@+id/checkBox"
    android:layout_marginTop="20dp" />

<CheckBox
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="New  5"
    android:id="@+id/checkBox5"
    android:layout_alignTop="@+id/checkBox4"
    android:layout_alignStart="@+id/checkBox2" />

<CheckBox
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="New  6"
    android:id="@+id/checkBox6"
    android:layout_alignTop="@+id/checkBox5"
    android:layout_alignStart="@+id/checkBox3" />

<CheckBox
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="New  7"
    android:id="@+id/checkBox7"
    android:layout_below="@+id/checkBox4"
    android:layout_alignStart="@+id/checkBox4"
    android:layout_marginTop="20dp" />

<CheckBox
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="New  8"
    android:id="@+id/checkBox8"
    android:layout_alignTop="@+id/checkBox7"
    android:layout_alignStart="@+id/checkBox5" />

<CheckBox
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="New  9"
    android:id="@+id/checkBox9"
    android:layout_alignTop="@+id/checkBox8"
    android:layout_alignStart="@+id/checkBox6" />



    <CheckBox
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="New  10"
        android:id="@+id/checkBox10"
        android:layout_below="@+id/checkBox7"
        android:layout_alignStart="@+id/checkBox7"
        android:layout_marginTop="20dp" />

    <CheckBox
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="New  11"
        android:id="@+id/checkBox11"
        android:layout_alignTop="@+id/checkBox10"
        android:layout_alignStart="@+id/checkBox8" />



    <CheckBox
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="New  12"
        android:id="@+id/checkBox12"
        android:layout_alignTop="@+id/checkBox11"
        android:layout_alignStart="@+id/checkBox9" />


    <CheckBox
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="New  13"
        android:id="@+id/checkBox13"
        android:layout_below="@+id/checkBox10"
        android:layout_alignStart="@+id/checkBox10"
        android:layout_marginTop="20dp" />



    <CheckBox
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="New  14"
        android:id="@+id/checkBox14"
        android:layout_alignTop="@+id/checkBox13"
        android:layout_alignStart="@+id/checkBox11" />



    <CheckBox
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="New  15"
        android:id="@+id/checkBox15"
        android:layout_alignTop="@+id/checkBox14"
        android:layout_alignStart="@+id/checkBox12" />

</RelativeLayout>
</LinearLayout>
</ScrollView>




<RelativeLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginTop="400dp"
    android:id="@+id/relativeLayout2">

    <ProgressBar
        style="?android:attr/progressBarStyleHorizontal"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/progress"
        android:max="100"
        android:visibility="gone"
        android:progress="10"
        android:layout_above="@+id/button2"
        android:layout_centerHorizontal="true" />



    <Button
        android:layout_width="150dp"
        android:layout_height="65dp"
        android:background="@drawable/my_button_selector_two"
        android:text="Reset"
        android:layout_alignParentLeft="true"
        android:id="@+id/button2"
        android:layout_alignParentBottom="true"
        android:layout_alignParentStart="true"
        android:textColor="#ffffff"
        android:textSize="18dp"
        android:layout_gravity="bottom" />

    <Button
        android:layout_width="wrap_content"
        android:layout_height="65dp"
        android:paddingRight="@dimen/activity_horizontal_margi"
        android:background="@drawable/my_button_selector"
        android:text="Search"
        android:id="@+id/button3"
        android:layout_alignParentBottom="true"
        android:textColor="#ffffff"
        android:textSize="18dp"
        android:layout_gravity="bottom"
        android:layout_alignParentEnd="true"
        android:layout_toEndOf="@+id/button2" />


</RelativeLayout>


</RelativeLayout>




Aucun commentaire:

Enregistrer un commentaire