Scrollview in NestedScrollview is not working kitkat 4.4 - android

Scrollview in nestedScrollview is working fine with other versions of android but in kitkat it is not working.
I have addded onItemClick() function to nestedscrollview. while clicking on nested scrollview only scrollview(parent) working.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:padding="10dp"
>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/parentScrollview"
android:nestedScrollingEnabled="true"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout
android:id="#+id/relative1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/navyBlue"
android:orientation="horizontal">
<ImageView
android:id="#+id/remarksLogo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="#dimen/header_left_padding_size"
android:src="#drawable/ic_action_remarks_report_white"/>
<TextView
android:id="#+id/remarksTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="#id/remarksLogo"
android:textColor="#color/white"
android:layout_marginRight="10dp"
android:gravity="center"
android:textSize="#dimen/header_text_size"
android:text=""
android:textStyle="bold"/>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="0dp"
android:paddingTop="10dp"
android:weightSum="6">
<TextView
android:id="#+id/datedTitles"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.5"
android:textAlignment="center"
android:padding="5dp"
android:background="#color/navyBlue"
android:textColor="#color/white"
android:paddingLeft="5dp"
android:textSize="#dimen/sub_header_text_size"
android:text=""/>
<TextView
android:id="#+id/fromTitle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.5"
android:padding="5dp"
android:background="#drawable/left_right_border_white"
android:textColor="#color/white"
android:paddingLeft="5dp"
android:textSize="#dimen/sub_header_text_size"
android:text=""/>
<TextView
android:id="#+id/detailsTitle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="3"
android:padding="5dp"
android:background="#color/navyBlue"
android:textColor="#color/white"
android:paddingLeft="5dp"
android:textSize="#dimen/sub_header_text_size"
android:text=""/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="180dp"
android:orientation="vertical"
android:layout_marginBottom="20dp">
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:isScrollContainer="true"
android:id="#+id/childNestedScrollView"
android:scrollbarAlwaysDrawVerticalTrack="true"
android:scrollbars="vertical"
android:fadeScrollbars="false"
android:nestedScrollingEnabled="true"
android:fillViewport="true">
<com.iflytechsoft.studentsuccess.utils.studentsuccessutils.ListViewForEmbeddingInScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/remarksListView"
android:choiceMode="singleChoice"
android:background="#drawable/background_white_border_navyblue"
android:layout_marginBottom="20dp"
/>
</android.support.v4.widget.NestedScrollView>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="0dp"
android:id="#+id/announcementDetailLayout"
android:visibility="gone"
android:background="#color/navyBlue"
android:weightSum="6">
<TextView
android:id="#+id/dated"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1.5"
android:gravity="center"
android:background="#color/navyBlue"
android:textColor="#color/white"
android:paddingLeft="5dp"
android:textSize="#dimen/sub_header_text_size"
android:text=""/>
<TextView
android:id="#+id/from"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:background="#drawable/left_right_border_white"
android:textColor="#color/white"
android:paddingLeft="5dp"
android:textSize="#dimen/sub_header_text_size"
android:text=""/>
<TextView
android:id="#+id/subject"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="3.7"
android:background="#color/navyBlue"
android:textColor="#color/white"
android:paddingLeft="5dp"
android:textSize="#dimen/sub_header_text_size"
android:text=""/>
</LinearLayout>
<ir.noghteh.JustifiedTextView xmlns:noghteh="http://noghteh.ir"
android:id="#+id/details"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:paddingLeft="5dp"
noghteh:textSize="#dimen/sub_header_text_size"
android:background="#drawable/background_white_border_navyblue"
/>
</LinearLayout>
</ScrollView>
</LinearLayout>

Related

How to fixed header when keyboard shown android

I am working on fixed header, when focus edittext-> keyboard pushed the header will not be pushed but only the content is pushed. My problem here is that when I use fullscreen + adjustsize code, the header is kept but the content is covered by the keyboard, I add fitsystemwindow in xml is but when the keyboard hide empty space at the bottom Make sure you hide navigation. So how can I keep the header is not scroll, but fullscreen, hide navigation. thanks
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/layoutCRC"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/base"
android:baselineAligned="false"
android:orientation="vertical"
android:fitsSystemWindows="true"
android:weightSum="1">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="12dp"
android:layout_marginTop="10dp"
android:layout_marginLeft="#dimen/layout_marginLeftPL"
android:layout_marginRight="#dimen/layout_marginRightPL"
android:layout_weight="0.23"
android:background="#drawable/layout_crc"
android:orientation="vertical"
android:weightSum="3">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:layout_weight="1.35"
android:gravity="center"
android:orientation="horizontal">
<com.fecredit.hostedkios.widgets.TextViewPlus
android:id="#+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:text="#string/textOCredit"
android:textColor="#color/colortext_loan"
android:textSize="#dimen/textSize"
android:textStyle="bold"
app:font="#string/FtraBd" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1.1"
android:orientation="vertical"
android:weightSum="2">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:layout_marginLeft="20dp"
android:layout_weight="1.5"
android:gravity="center_vertical"
android:orientation="vertical">
<com.fecredit.hostedkios.widgets.TextViewPlus
android:id="#+id/textView6"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:gravity="center_vertical"
android:text="#string/textStep1"
android:textColor="#color/colorButton"
android:textSize="#dimen/textSizeContentPL"
android:textStyle="bold"
app:font="#string/SVN" />
</LinearLayout>
<RadioGroup
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="20dp"
android:layout_weight="0.5"
android:orientation="vertical"
android:weightSum="2">
<com.fecredit.hostedkios.widgets.RadioButtonPlus
android:id="#+id/radioPayroll"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="0.9"
android:buttonTint="#color/colortext_loan"
android:text="#string/textpayroll"
android:textColor="#color/colorButton"
app:radiofont="#string/FtraBk" />
<com.fecredit.hostedkios.widgets.RadioButtonPlus
android:id="#+id/rdbVehicleRegistration"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1.1"
android:buttonTint="#color/colortext_loan"
android:gravity="center_vertical"
android:text="#string/textcarparachute"
android:textColor="#color/colorButton"
app:radiofont="#string/FtraBk" />
</RadioGroup>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="5dp"
android:layout_weight="0.55"
android:orientation="vertical"
android:weightSum="4">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1.1"
android:orientation="horizontal">
<com.fecredit.hostedkios.widgets.TextViewPlus
android:layout_width="match_parent"
android:layout_height="30dp"
android:layout_marginBottom="15dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:gravity="center_vertical"
android:text="#string/step2"
android:textColor="#color/colorButton"
android:textSize="#dimen/textSizeContentPL"
android:textStyle="bold"
app:font="#string/SVN" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="25dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_weight="0.97"
android:orientation="horizontal">
<LinearLayout
android:id="#+id/lvname"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginRight="30dp"
android:layout_weight="0.5"
android:gravity="center_vertical">
<com.fecredit.hostedkios.widgets.EditTextViewPlus
android:id="#+id/edtFullNameCRC"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/custom_input"
android:hint="#string/name"
android:imeOptions="actionNext"
android:inputType="textNoSuggestions"
android:nextFocusForward="#+id/edtPhoneCRC"
android:paddingBottom="7dp"
android:paddingLeft="10dp"
android:paddingRight="5dp"
android:paddingTop="7dp"
android:textColorHint="#color/colorButton"
app:editfont="#string/FtraBk" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="30dp"
android:layout_weight="0.5"
android:gravity="center_vertical">
<com.fecredit.hostedkios.widgets.EditTextViewPlus
android:id="#+id/edtIndentifyCRC"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/custom_input"
android:hint="#string/ID"
android:imeOptions="actionNext"
android:inputType="numberPassword"
android:maxLength="12"
android:nextFocusForward="#+id/edtEmailCRC"
android:paddingBottom="7dp"
android:paddingLeft="10dp"
android:paddingRight="5dp"
android:paddingTop="7dp"
android:textColorHint="#color/colorButton"
app:editfont="#string/FtraBk" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="25dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_weight="0.97"
android:orientation="horizontal"
android:weightSum="1">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginRight="30dp"
android:layout_weight="0.5"
android:gravity="center_vertical">
<com.fecredit.hostedkios.widgets.EditTextViewPlus
android:id="#+id/edtPhoneCRC"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/custom_input"
android:hint="#string/phoneNumber"
android:imeOptions="actionNext"
android:inputType="numberPassword"
android:maxLength="11"
android:nextFocusForward="#+id/edtIndentifyCRC"
android:paddingBottom="7dp"
android:paddingLeft="10dp"
android:paddingRight="5dp"
android:paddingTop="7dp"
android:textColorHint="#color/colorButton"
app:editfont="#string/FtraBk" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="30dp"
android:layout_weight="0.5"
android:gravity="center_vertical">
<com.fecredit.hostedkios.widgets.EditTextViewPlus
android:id="#+id/edtEmailCRC"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/custom_input"
android:hint="#string/email"
android:imeOptions="actionDone"
android:inputType="textEmailAddress"
android:paddingBottom="7dp"
android:paddingLeft="10dp"
android:paddingRight="5dp"
android:paddingTop="7dp"
android:textColorHint="#color/colorButton"
app:editfont="#string/FtraBk" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="25dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_weight="0.96"
android:orientation="horizontal"
android:weightSum="1">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:layout_marginRight="30dp"
android:layout_weight="0.5"
android:gravity="center_horizontal">
<com.fecredit.hostedkios.widgets.EditTextViewPlus
android:id="#+id/edtDateCRC"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="#drawable/custom_input"
android:focusable="false"
android:hint="#string/date"
android:inputType="textPersonName"
android:nextFocusForward="#+id/edtIndentifyCRC"
android:paddingBottom="7dp"
android:paddingLeft="10dp"
android:paddingRight="5dp"
android:paddingTop="7dp"
android:textColorHint="#color/colorButton"
app:editfont="#string/FtraBk" />
<ImageView
android:id="#+id/imgDateCRC"
android:layout_width="#dimen/imgDate"
android:layout_height="#dimen/imgHeightDate"
android:layout_gravity="right|center_vertical"
app:srcCompat="#drawable/calendarblack" />
</FrameLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:layout_marginLeft="30dp"
android:layout_weight="0.5"
android:gravity="center_vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical">
<Spinner
android:id="#+id/spinnerProvinceCRC"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="#drawable/custom_input"
android:gravity="center"
android:imeOptions="actionDone"
android:inputType="textPersonName"
android:paddingBottom="7dp"
android:paddingTop="7dp"
android:popupBackground="#drawable/custom_spinner"
android:spinnerMode="dropdown"
android:textColorHint="#color/colorButton" />
</LinearLayout>
<ImageView
android:id="#+id/imageView6"
android:layout_width="#dimen/imgDate"
android:layout_height="#dimen/imgHeightProvince"
android:layout_gravity="right|center_vertical"
app:srcCompat="#drawable/loction" />
</FrameLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:layout_weight="0.77"
android:gravity="center_vertical"
android:orientation="horizontal">
<FrameLayout
android:id="#+id/layoutFooter"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="125dp"
android:background="#drawable/thanhmain"
android:gravity="right">
<com.fecredit.hostedkios.widgets.ButtonPlus
android:id="#+id/btnSendCRC"
android:layout_width="#dimen/layout_widthButtonSelect"
android:layout_height="#dimen/layout_heightButtonSelect"
android:layout_gravity="center"
android:layout_marginBottom="17dp"
android:layout_marginRight="#dimen/layout_marginRightPL"
android:background="#drawable/custom_button"
android:text="#string/btnSend"
android:textAllCaps="false"
android:textColor="#color/colorWhite"
android:textSize="#dimen/textSizeButton"
android:textStyle="bold"
app:buttonfont="#string/FtraBd" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="30dp">
<ImageView
android:id="#+id/imgBackCRC"
android:layout_width="#dimen/layout_widthImageBack"
android:layout_height="#dimen/layout_heightImageBack"
android:layout_gravity="center"
android:layout_marginBottom="5dp"
android:layout_marginLeft="30dp"
android:layout_marginRight="25dp"
app:srcCompat="#drawable/goback" />
</LinearLayout>
</FrameLayout>
</RelativeLayout>
</LinearLayout>
</ScrollView>

CheckBox not working properly in new Android Material Library, not able to see actual checkmarks

I have done 2 things:
Migrate to Android X
Migrate App to AppCompat
After doing these 2, checkboxes are not working properly inside Listview. Here is my code:
build.gradle:
dependencies {
implementation files('libs/httpmime-4.3.jar')
implementation files('libs/httpcore-4.3.jar')
implementation 'androidx.appcompat:appcompat:1.0.0-rc01'
implementation 'androidx.legacy:legacy-support-v4:1.0.0-rc01'
implementation 'com.google.android.material:material:1.0.0-rc01'
}
CheckBox row:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/facets"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="#dimen/ten_dip"
android:gravity="center_vertical"
android:orientation="horizontal"
android:weightSum="1.0" >
<LinearLayout
android:layout_width="0px"
android:layout_height="wrap_content"
android:layout_weight="0.97"
android:orientation="horizontal" >
<TextView
android:id="#+id/title_tv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.25"
/>
<TextView
android:id="#+id/title_tv_number"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.75"
/>
</LinearLayout>
<CheckBox
android:id="#+id/facets_img_checkbox"
android:layout_width="wrap_content"
android:clickable="true"
android:layout_height="wrap_content"
/>
</LinearLayout>
ListView Layout:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:orientation="vertical"
android:clickable="true"
android:weightSum="1">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight=".1"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:background="#color/white"
android:elevation="2dp"
>
<LinearLayout
android:id="#+id/back_button_filter"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal"
android:layout_alignParentLeft="true"
android:paddingLeft="10dp"
android:paddingRight="10dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:id="#+id/back_button"
app:srcCompat="#drawable/ic_caret_back"
android:padding="5dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:paddingLeft="10dp"
android:text="Filters"
android:gravity="center_vertical"
android:textSize="18sp"
android:textColor="#color/black_555555"
android:fontFamily="sans-serif"/>
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:id="#+id/reset_button"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:layout_alignParentRight="true"
android:text="RESET"
android:textColor="#color/linkcolor"
android:gravity="center_vertical"
android:fontFamily="sans-serif"
android:textSize="18sp" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="#color/click_menu"
android:orientation="horizontal"
android:paddingTop="#dimen/five_dip"
android:paddingBottom="5dp"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:layout_gravity="center_vertical"
android:layout_weight=".1"
android:weightSum="1">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:text="Sort by"
android:gravity="center_vertical"
android:textColor="#color/black_555555"
android:fontFamily="sans-serif"
android:textSize="14sp"
android:layout_weight=".25"/>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight=".75"
android:orientation="horizontal"
android:weightSum="2"
android:layout_gravity="center_vertical"
android:gravity="center_vertical">
<TextView
android:id="#+id/relevence_facets"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#drawable/blue_rectangle_button"
android:gravity="center"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:textSize="14sp"
android:text="Relevance"
android:textColor="#color/white"
android:fontFamily="sans-serif"
android:layout_marginRight="10dp"/>
<TextView
android:id="#+id/freshness_facets"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:gravity="center"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:textSize="14sp"
android:text="Freshness"
android:fontFamily="sans-serif"
android:textColor="#color/black_555555" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/facets_item"
android:layout_width="match_parent"
android:layout_height="0dp"
android:orientation="horizontal"
android:layout_weight=".73"
android:weightSum="1">
<ScrollView
android:id="#+id/search_facets"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight=".35"
android:fillViewport="true"
android:background="#color/click_menu"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="7">
<TextView
android:id="#+id/location_tv"
android:layout_width="match_parent"
android:layout_height="0dp"
android:text="Location"
android:gravity="center|left"
android:paddingLeft="10dp"
android:textColor="#color/black_555555"
android:textSize="#dimen/fourteen_sp"
android:textStyle="bold"
android:background="#color/white"
android:layout_weight=".75"/>
<TextView
android:id="#+id/experience_tv"
android:layout_width="match_parent"
android:layout_height="0dp"
android:gravity="center|left"
android:paddingLeft="10dp"
android:text="#string/experience"
android:textColor="#color/black_555555"
android:textSize="#dimen/fourteen_sp"
android:layout_weight=".75"/>
<TextView
android:id="#+id/salary_tv"
android:layout_width="match_parent"
android:layout_height="0dp"
android:gravity="center|left"
android:paddingLeft="10dp"
android:text="#string/salary"
android:textColor="#color/black_555555"
android:textSize="#dimen/fourteen_sp"
android:layout_weight=".75"/>
<TextView
android:id="#+id/industry_tv"
android:layout_width="match_parent"
android:layout_height="0dp"
android:gravity="center|left"
android:paddingLeft="10dp"
android:text="Industry"
android:textColor="#color/black_555555"
android:textSize="#dimen/fourteen_sp"
android:layout_weight=".75"/>
<TextView
android:id="#+id/fun_area_tv"
android:layout_width="match_parent"
android:layout_height="0dp"
android:gravity="center|left"
android:paddingLeft="10dp"
android:text="Department"
android:textColor="#color/black_555555"
android:textSize="#dimen/fourteen_sp"
android:layout_weight=".75"/>
<TextView
android:id="#+id/job_type_tv"
android:layout_width="match_parent"
android:layout_height="0dp"
android:gravity="center|left"
android:paddingLeft="10dp"
android:text="Job type"
android:textColor="#color/black_555555"
android:textSize="#dimen/fourteen_sp"
android:layout_weight=".75"/>
<TextView
android:id="#+id/top_companies_tv"
android:layout_width="match_parent"
android:layout_height="0dp"
android:gravity="center|left"
android:paddingLeft="10dp"
android:text="Companies"
android:textColor="#color/black_555555"
android:textSize="#dimen/fourteen_sp"
android:layout_weight=".75"/>
</LinearLayout>
</ScrollView>
<ListView
android:id="#+id/list_view"
android:layout_width="0dp"
android:layout_weight=".65"
android:layout_height="match_parent"
android:background="#color/white"
android:divider="#e7e7e7"
android:dividerHeight="1dp"
android:horizontalSpacing="#dimen/ten_dip"
android:verticalSpacing="#dimen/ten_dip">
</ListView>
</LinearLayout>
<TextView
android:id="#+id/refine_text1"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight=".07"
android:background="#drawable/button_yellow"
android:gravity="center"
android:layout_gravity="bottom"
android:text="Apply filters"
android:textStyle="bold"
android:textColor="#fff"
android:textSize="#dimen/sixteen_sp" />
</LinearLayout>
ScreenShots:
I am not able to see actual checkmarks and on clicking one checkbox, it changes state of all the other in the list.
(Posted answer on behalf of the question author).
I got it working.
It is some sort of Google library compatibility issue with below Oreo versions. Just add checkbox.jumpDrawablesToCurrentState() to get it work.

Why is this layout not looking the way it is supposed to?

I have a little bit issue here.
layout which i have been designed in photoshop looks like below
and the layout which i design in xml look like below:
So, you see that for some reason, the edittexts look very off.here is the full XML code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#1fed7b">
<LinearLayout
android:orientation="vertical"
android:gravity="center"
android:layout_weight="114"
android:layout_width="match_parent"
android:layout_height="0dp">
<ImageButton
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/txt_headline" />
</LinearLayout>
<LinearLayout
android:gravity="top"
android:orientation="horizontal"
android:layout_weight="281"
android:layout_width="match_parent"
android:layout_height="0dp">
<LinearLayout
android:gravity="center"
android:orientation="vertical"
android:layout_weight="44"
android:layout_width="0dp"
android:layout_height="match_parent" />
<LinearLayout
android:gravity="top"
android:orientation="vertical"
android:layout_weight="547"
android:layout_width="0dp"
android:layout_height="match_parent">
<ImageButton
android:layout_gravity="left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/txt_subline1" />
</LinearLayout>
<LinearLayout
android:gravity="center"
android:orientation="vertical"
android:layout_weight="44"
android:layout_width="0dp"
android:layout_height="match_parent" />
</LinearLayout>
<LinearLayout
android:gravity="center"
android:orientation="horizontal"
android:layout_weight="20"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:gravity="center"
android:orientation="horizontal"
android:layout_weight="10"
android:layout_width="0dp"
android:layout_height="match_parent" />
<LinearLayout
android:gravity="center"
android:orientation="horizontal"
android:layout_weight="10"
android:layout_width="0dp"
android:layout_height="wrap_content">
<EditText
android:id="#+id/txt_hours"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#00000000"
android:gravity="center"
android:hint="00"
android:inputType="number"
android:maxLength="2"
android:textColor="#ffffff"
android:textColorHint="#ffffff"
android:textSize="55sp" />
<TextView
android:text=":"
android:layout_gravity="top"
android:gravity="center_vertical"
android:id="#+id/txt_colon"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textColor="#ffffff"
android:textColorHint="#ffffff"
android:textSize="55sp" />
<EditText
android:id="#+id/txt_minutes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#00000000"
android:gravity="center_vertical"
android:hint="00"
android:inputType="number"
android:maxLength="2"
android:singleLine="true"
android:textColor="#ffffff"
android:textColorHint="#ffffff"
android:textSize="55sp" />
<LinearLayout
android:gravity="left"
android:orientation="horizontal"
android:layout_weight="10"
android:layout_width="0dp"
android:layout_height="match_parent">
<TextView
android:text="00"
android:layout_gravity="left"
android:gravity="bottom"
android:id="#+id/txt_seconds"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textColor="#ffffff"
android:textColorHint="#ffffff"
android:textSize="20sp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:gravity="center"
android:orientation="horizontal"
android:layout_weight="189"
android:layout_width="match_parent"
android:layout_height="0dp">
<LinearLayout
android:gravity="center"
android:orientation="vertical"
android:layout_weight="160"
android:layout_width="0dp"
android:layout_height="match_parent" />
<LinearLayout
android:gravity="top"
android:orientation="vertical"
android:layout_weight="140"
android:layout_width="0dp"
android:layout_height="match_parent">
<TextView
android:text="hh"
android:layout_gravity="left"
android:gravity="top"
android:id="#+id/txt_hh"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#ffffff"
android:textColorHint="#ffffff"
android:textSize="20sp" />
</LinearLayout>
<LinearLayout
android:gravity="center"
android:orientation="vertical"
android:layout_weight="110"
android:layout_width="0dp"
android:layout_height="match_parent" />
<LinearLayout
android:gravity="top"
android:orientation="vertical"
android:layout_weight="140"
android:layout_width="0dp"
android:layout_height="match_parent">
<TextView
android:text="mm"
android:layout_gravity="right"
android:gravity="top"
android:id="#+id/txt_mm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#ffffff"
android:textColorHint="#ffffff"
android:textSize="20sp" />
</LinearLayout>
<LinearLayout
android:gravity="center"
android:orientation="vertical"
android:layout_weight="160"
android:layout_width="0dp"
android:layout_height="match_parent" />
</LinearLayout>
<LinearLayout
android:gravity="center"
android:orientation="vertical"
android:layout_weight="250"
android:layout_width="match_parent"
android:layout_height="0dp">
<LinearLayout
android:gravity="center"
android:orientation="horizontal"
android:layout_weight="314"
android:layout_width="match_parent"
android:layout_height="0dp">
<LinearLayout
android:gravity="center"
android:orientation="vertical"
android:layout_weight="314"
android:layout_width="0dp"
android:layout_height="match_parent">
<ImageButton
android:id="#+id/btn_playstore"
android:layout_gravity="right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/btn_playstore" />
</LinearLayout>
<LinearLayout
android:gravity="center"
android:orientation="vertical"
android:layout_weight="5"
android:layout_width="0dp"
android:layout_height="match_parent" />
<LinearLayout
android:gravity="center"
android:orientation="vertical"
android:layout_weight="314"
android:layout_width="0dp"
android:layout_height="match_parent">
<ImageButton
android:id="#+id/btn_random"
android:layout_gravity="left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/btn_random" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:gravity="center"
android:orientation="vertical"
android:layout_weight="15"
android:layout_width="match_parent"
android:layout_height="0dp" />
<LinearLayout
android:gravity="center"
android:orientation="horizontal"
android:layout_weight="314"
android:layout_width="match_parent"
android:layout_height="0dp">
<LinearLayout
android:gravity="center"
android:orientation="vertical"
android:layout_weight="314"
android:layout_width="0dp"
android:layout_height="match_parent">
<ImageButton
android:id="#+id/btn_facebook"
android:layout_gravity="right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/btn_fb" />
</LinearLayout>
<LinearLayout
android:gravity="center"
android:orientation="vertical"
android:layout_weight="5"
android:layout_width="0dp"
android:layout_height="match_parent" />
<LinearLayout
android:gravity="center"
android:orientation="vertical"
android:layout_weight="314"
android:layout_width="0dp"
android:layout_height="match_parent">
<ImageButton
android:id="#+id/btn_start"
android:layout_gravity="left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/btn_start" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:gravity="center"
android:orientation="vertical"
android:layout_weight="209"
android:layout_width="match_parent"
android:layout_height="0dp">
<ImageButton
android:id="#+id/btn_skip"
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/btn_skip" />
</LinearLayout>
</LinearLayout>
I know, it is a lot of code, but I really need your help here. Can you do me a favor and look through it? That be so awesome!!!
Thank you!
here is solution for your problem,copy and past code.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#1fed7b">
<LinearLayout
android:orientation="vertical"
android:gravity="center"
android:layout_weight="114"
android:layout_width="match_parent"
android:layout_height="0dp">
<ImageButton
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/txt_headline" />
</LinearLayout>
<LinearLayout
android:gravity="top"
android:orientation="horizontal"
android:layout_weight="281"
android:layout_width="match_parent"
android:layout_height="0dp">
<LinearLayout
android:gravity="center"
android:orientation="vertical"
android:layout_weight="44"
android:layout_width="0dp"
android:layout_height="match_parent" />
<LinearLayout
android:gravity="top"
android:orientation="vertical"
android:layout_weight="547"
android:layout_width="0dp"
android:layout_height="match_parent">
<ImageButton
android:layout_gravity="left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/txt_subline1" />
</LinearLayout>
<LinearLayout
android:gravity="center"
android:orientation="vertical"
android:layout_weight="44"
android:layout_width="0dp"
android:layout_height="match_parent" />
</LinearLayout>
<LinearLayout
android:gravity="center"
android:orientation="horizontal"
android:layout_weight="20"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="90dp"
android:layout_height="match_parent"
android:orientation="vertical"></LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<EditText
android:id="#+id/txt_hours"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#00000000"
android:hint="00"
android:inputType="number"
android:maxLength="2"
android:layout_weight="1"
android:textColor="#ffffff"
android:textColorHint="#ffffff"
android:textSize="55sp" />
<TextView
android:id="#+id/txt_colon"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="top"
android:gravity="center"
android:text=":"
android:layout_weight="2"
android:textColor="#ffffff"
android:textColorHint="#ffffff"
android:textSize="55sp" />
<EditText
android:id="#+id/txt_minutes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#00000000"
android:layout_weight="1"
android:hint="00"
android:gravity="right"
android:inputType="number"
android:maxLength="2"
android:singleLine="true"
android:textColor="#ffffff"
android:textColorHint="#ffffff"
android:textSize="55sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="top"
android:orientation="horizontal">
<TextView
android:id="#+id/txt_mm"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_weight="1"
android:text="mm"
android:textColor="#ffffff"
android:textColorHint="#ffffff"
android:textSize="20sp" />
<TextView
android:id="#+id/txt_hh"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="right"
android:text="hh"
android:textColor="#ffffff"
android:textColorHint="#ffffff"
android:textSize="20sp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="90dp"
android:layout_height="match_parent"
>
<TextView
android:id="#+id/txt_seconds"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="00"
android:textColor="#ffffff"
android:textColorHint="#ffffff"
android:textSize="20sp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:gravity="center"
android:orientation="vertical"
android:layout_weight="250"
android:layout_width="match_parent"
android:layout_height="0dp">
<LinearLayout
android:gravity="center"
android:orientation="horizontal"
android:layout_weight="314"
android:layout_width="match_parent"
android:layout_height="0dp">
<LinearLayout
android:gravity="center"
android:orientation="vertical"
android:layout_weight="314"
android:layout_width="0dp"
android:layout_height="match_parent">
<ImageButton
android:id="#+id/btn_playstore"
android:layout_gravity="right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/btn_playstore" />
</LinearLayout>
<LinearLayout
android:gravity="center"
android:orientation="vertical"
android:layout_weight="5"
android:layout_width="0dp"
android:layout_height="match_parent" />
<LinearLayout
android:gravity="center"
android:orientation="vertical"
android:layout_weight="314"
android:layout_width="0dp"
android:layout_height="match_parent">
<ImageButton
android:id="#+id/btn_random"
android:layout_gravity="left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/btn_random" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:gravity="center"
android:orientation="vertical"
android:layout_weight="15"
android:layout_width="match_parent"
android:layout_height="0dp" />
<LinearLayout
android:gravity="center"
android:orientation="horizontal"
android:layout_weight="314"
android:layout_width="match_parent"
android:layout_height="0dp">
<LinearLayout
android:gravity="center"
android:orientation="vertical"
android:layout_weight="314"
android:layout_width="0dp"
android:layout_height="match_parent">
<ImageButton
android:id="#+id/btn_facebook"
android:layout_gravity="right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/btn_fb" />
</LinearLayout>
<LinearLayout
android:gravity="center"
android:orientation="vertical"
android:layout_weight="5"
android:layout_width="0dp"
android:layout_height="match_parent" />
<LinearLayout
android:gravity="center"
android:orientation="vertical"
android:layout_weight="314"
android:layout_width="0dp"
android:layout_height="match_parent">
<ImageButton
android:id="#+id/btn_start"
android:layout_gravity="left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/btn_start" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:gravity="center"
android:orientation="vertical"
android:layout_weight="209"
android:layout_width="match_parent"
android:layout_height="0dp">
<ImageButton
android:id="#+id/btn_skip"
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/btn_skip" />
</LinearLayout>
</LinearLayout>
hope this will solve your problem

Content not showing in CoordinatorLayout?

I am trying to implement Toolbar in Activity but when i try to run app after implementing Toolbar with
DrawerLayout >> CoordinatorLayout >> AppBarLayout
Content not showing. Here is layout file.
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:scrollbars="none"
android:background="#FFECECEC"
tools:openDrawer="start">
<android.support.design.widget.CoordinatorLayout
android:background="#FFECECEC"
android:id="#+id/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:id="#+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_scrollFlags="scroll|enterAlways">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="#style/ThemeOverlay.AppCompat.Light" />
</FrameLayout>
</android.support.design.widget.AppBarLayout>
<LinearLayout
android:id="#+id/RelativeLayout1"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="0.05"
android:background="#drawable/header"
android:baselineAligned="false"
android:gravity="center" >
<TextView
android:id="#+id/tv"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center|left"
android:text="Timer : "
android:textColor="#color/White"
android:textSize="12dp" />
<TextView
android:id="#+id/txtquesnum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="1/10"
android:textColor="#color/White"
android:textSize="14dp" />
<ToggleButton
android:id="#+id/toggleButton2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#xml/togglecheck"
android:checked="false" />
</LinearLayout>
<View
android:layout_width="fill_parent"
android:layout_height="1dp"
android:background="#drawable/seperator" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_margin="4dp"
android:layout_weight="0.2"
android:orientation="vertical" >
<ScrollView
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical" >
<TextView
android:id="#+id/taque"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_marginLeft="7dp"
android:layout_marginRight="7dp"
android:layout_marginTop="3dp"
android:gravity="center|left"
android:text="Question"
android:textColor="#color/Black"
android:textSize="16dp"
android:typeface="normal" />
<com.applidium.shutterbug.FetchableImageView
android:id="#+id/imageView1"
android:layout_width="120dp"
android:layout_height="120dp"
android:src="#drawable/splash_icon" />
</LinearLayout>
</ScrollView>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_margin="2dp"
android:layout_weight="0.3"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:baselineAligned="false"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_margin="2dp"
android:layout_weight="1"
android:background="#drawable/normal"
android:baselineAligned="false"
android:gravity="center" >
<TextView
android:id="#+id/taOpt5"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:layout_span="0"
android:gravity="center|left"
android:hint="Option 1"
android:padding="2dp"
android:singleLine="false"
android:textColor="#color/Black"
android:textSize="17dp"
android:typeface="serif"
android:visibility="visible" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_margin="2dp"
android:layout_weight="1"
android:background="#drawable/normal"
android:baselineAligned="false"
android:gravity="center" >
<TextView
android:id="#+id/taOpt6"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:gravity="center|left"
android:hint="Option 2"
android:padding="2dp"
android:shadowColor="#color/black"
android:singleLine="false"
android:textColor="#color/Black"
android:textSize="17dp"
android:typeface="serif"
android:visibility="visible" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_margin="2dp"
android:layout_weight="1"
android:background="#drawable/normal"
android:gravity="center" >
<TextView
android:id="#+id/taOpt7"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:gravity="center|left"
android:hint="Option 3"
android:inputType="none"
android:padding="2dp"
android:shadowColor="#color/black"
android:singleLine="false"
android:textColor="#color/Black"
android:textSize="17dp"
android:typeface="serif"
android:visibility="visible" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_margin="2dp"
android:layout_weight="1"
android:background="#drawable/normal"
android:gravity="center" >
<TextView
android:id="#+id/taOpt8"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:gravity="center|left"
android:hint="Option 4"
android:inputType="none"
android:padding="2dp"
android:shadowColor="#color/black"
android:singleLine="false"
android:textColor="#color/Black"
android:textSize="17dp"
android:typeface="serif"
android:visibility="visible" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</android.support.design.widget.CoordinatorLayout>
</android.support.v4.widget.DrawerLayout>
But when I move content inside AppBarLayout so everything is visible but inside appbar. how to fix this issue? Any idea.
While using Cordinator layout your layout should look like this
<CoordinatorLayout>
<AppBarLayout>
//Toolbar and other contents should come here
</AppBarLayout>
<Recycler Or Nested Scroll View>
<LinearLayout
app:layout_behavior="#string/appbar_scrolling_view_behavior">
//This is used when you have a collapsing toolbar and you need to add a scrolling behaviour for your views.
<LinearLayout/>
<Recycler Or Nested Scroll View/>
Instead try this layout.
<android.support.design.widget.CoordinatorLayout
android:background="#FFECECEC"
android:id="#+id/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:id="#+id/appbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#android:color/white">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_scrollFlags="scroll|enterAlways">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="#style/ThemeOverlay.AppCompat.Light" />
</FrameLayout>
<LinearLayout
android:id="#+id/RelativeLayout1"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:background="#drawable/header"
android:orientation="vertical"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
android:baselineAligned="false"
android:gravity="center" >
<TextView
android:id="#+id/tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center|left"
android:text="Timer : "
android:textColor="#color/White"
android:textSize="12dp" />
<TextView
android:id="#+id/txtquesnum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="1/10"
android:textColor="#color/White"
android:textSize="14dp" />
<ToggleButton
android:id="#+id/toggleButton2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#xml/togglecheck"
android:checked="false" />
</LinearLayout>
<View
android:layout_width="fill_parent"
android:layout_height="1dp"
android:background="#drawable/seperator" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_margin="4dp"
android:layout_weight="0.2"
android:orientation="vertical" >
<ScrollView
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical" >
<TextView
android:id="#+id/taque"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_marginLeft="7dp"
android:layout_marginRight="7dp"
android:layout_marginTop="3dp"
android:gravity="center|left"
android:text="Question"
android:textColor="#color/Black"
android:textSize="16dp"
android:typeface="normal" />
<com.applidium.shutterbug.FetchableImageView
android:id="#+id/imageView1"
android:layout_width="120dp"
android:layout_height="120dp"
android:src="#drawable/splash_icon" />
</LinearLayout>
</ScrollView>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_margin="2dp"
android:layout_weight="0.3"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:baselineAligned="false"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_margin="2dp"
android:layout_weight="1"
android:background="#drawable/normal"
android:baselineAligned="false"
android:gravity="center" >
<TextView
android:id="#+id/taOpt5"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:layout_span="0"
android:gravity="center|left"
android:hint="Option 1"
android:padding="2dp"
android:singleLine="false"
android:textColor="#color/Black"
android:textSize="17dp"
android:typeface="serif"
android:visibility="visible" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_margin="2dp"
android:layout_weight="1"
android:background="#drawable/normal"
android:baselineAligned="false"
android:gravity="center" >
<TextView
android:id="#+id/taOpt6"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:gravity="center|left"
android:hint="Option 2"
android:padding="2dp"
android:shadowColor="#color/black"
android:singleLine="false"
android:textColor="#color/Black"
android:textSize="17dp"
android:typeface="serif"
android:visibility="visible" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_margin="2dp"
android:layout_weight="1"
android:background="#drawable/normal"
android:gravity="center" >
<TextView
android:id="#+id/taOpt7"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:gravity="center|left"
android:hint="Option 3"
android:inputType="none"
android:padding="2dp"
android:shadowColor="#color/black"
android:singleLine="false"
android:textColor="#color/Black"
android:textSize="17dp"
android:typeface="serif"
android:visibility="visible" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_margin="2dp"
android:layout_weight="1"
android:background="#drawable/normal"
android:gravity="center" >
<TextView
android:id="#+id/taOpt8"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:gravity="center|left"
android:hint="Option 4"
android:inputType="none"
android:padding="2dp"
android:shadowColor="#color/black"
android:singleLine="false"
android:textColor="#color/Black"
android:textSize="17dp"
android:typeface="serif"
android:visibility="visible" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</android.support.design.widget.AppBarLayout>
</android.support.design.widget.CoordinatorLayout>
Your linear_layout height is fixed at 0 and hence not expandable. use wrap_content or match_parent.
Change
<LinearLayout
android:id="#+id/RelativeLayout1"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="0.05"
android:background="#drawable/header"
android:baselineAligned="false"
android:gravity="center" >
to
<LinearLayout
android:id="#+id/RelativeLayout1"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_weight="0.05"
android:background="#drawable/header"
android:baselineAligned="false"
android:gravity="center" >
Just change the height android:layout_height="match_parent"
All code .
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFECECEC"
android:fitsSystemWindows="true"
android:scrollbars="none"
tools:openDrawer="start">
<android.support.design.widget.CoordinatorLayout
android:id="#+id/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFECECEC">
<android.support.design.widget.AppBarLayout
android:id="#+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_scrollFlags="scroll|enterAlways">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="#style/ThemeOverlay.AppCompat.Light"/>
</FrameLayout>
</android.support.design.widget.AppBarLayout>
<LinearLayout
android:id="#+id/RelativeLayout1"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_weight="0.05"
android:background="#drawable/header"
android:baselineAligned="false"
android:gravity="center">
<TextView
android:id="#+id/tv"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center|left"
android:text="Timer : "
android:textColor="#color/White"
android:textSize="12dp"/>
<TextView
android:id="#+id/txtquesnum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="1/10"
android:textColor="#color/White"
android:textSize="14dp"/>
<ToggleButton
android:id="#+id/toggleButton2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#xml/togglecheck"
android:checked="false"/>
</LinearLayout>
<View
android:layout_width="fill_parent"
android:layout_height="1dp"
android:background="#drawable/seperator"/>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:layout_weight="0.2"
android:orientation="vertical">
<ScrollView
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="#+id/taque"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_marginLeft="7dp"
android:layout_marginRight="7dp"
android:layout_marginTop="3dp"
android:gravity="center|left"
android:text="Question"
android:textColor="#color/Black"
android:textSize="16dp"
android:typeface="normal"/>
<com.applidium.shutterbug.FetchableImageView
android:id="#+id/imageView1"
android:layout_width="120dp"
android:layout_height="120dp"
android:src="#drawable/splash_icon"/>
</LinearLayout>
</ScrollView>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_margin="2dp"
android:layout_weight="0.3"
android:orientation="vertical">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:baselineAligned="false"
android:orientation="vertical">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_margin="2dp"
android:layout_weight="1"
android:background="#drawable/normal"
android:baselineAligned="false"
android:gravity="center">
<TextView
android:id="#+id/taOpt5"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:layout_span="0"
android:gravity="center|left"
android:hint="Option 1"
android:padding="2dp"
android:singleLine="false"
android:textColor="#color/Black"
android:textSize="17dp"
android:typeface="serif"
android:visibility="visible"/>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_margin="2dp"
android:layout_weight="1"
android:background="#drawable/normal"
android:baselineAligned="false"
android:gravity="center">
<TextView
android:id="#+id/taOpt6"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:gravity="center|left"
android:hint="Option 2"
android:padding="2dp"
android:shadowColor="#color/black"
android:singleLine="false"
android:textColor="#color/Black"
android:textSize="17dp"
android:typeface="serif"
android:visibility="visible"/>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_margin="2dp"
android:layout_weight="1"
android:background="#drawable/normal"
android:gravity="center">
<TextView
android:id="#+id/taOpt7"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:gravity="center|left"
android:hint="Option 3"
android:inputType="none"
android:padding="2dp"
android:shadowColor="#color/black"
android:singleLine="false"
android:textColor="#color/Black"
android:textSize="17dp"
android:typeface="serif"
android:visibility="visible"/>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_margin="2dp"
android:layout_weight="1"
android:background="#drawable/normal"
android:gravity="center">
<TextView
android:id="#+id/taOpt8"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:gravity="center|left"
android:hint="Option 4"
android:inputType="none"
android:padding="2dp"
android:shadowColor="#color/black"
android:singleLine="false"
android:textColor="#color/Black"
android:textSize="17dp"
android:typeface="serif"
android:visibility="visible"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</android.support.design.widget.CoordinatorLayout>
</android.support.v4.widget.DrawerLayout>
Sometimes Coordinate Layout don't work with API version 25 or less if you are Using these for Application change it Other like Frame,Linear or Relative....
Layout also have Time Complexity i.e for Frame O(1), Linear (n), Relative O(n2)

My ListView is hiding behind my parent layout when visibility is set to View.GONE

I am trying to set my list view when I click on image, it should be hidden or shown but the problem is that when I inflate my list view in my activity, it is hiding behind and not taking complete space. When I perform on click event it opens behind the parent layout.
SNAPSHOT
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/scroll_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:orientation="vertical"
tools:context="com.bitblue.dextronewproject.Avtivity.ReportActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:id="#+id/main_linear_layout">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center"
android:text="Fees History"
android:textSize="20sp"
android:typeface="monospace" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_margin="5dp"
android:background="#color/studentlogin" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Receipt"
android:typeface="monospace" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Amount"
android:typeface="monospace" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Date"
android:typeface="monospace" />
</LinearLayout>
<LinearLayout
android:id="#+id/ll_2"
android:layout_below="#+id/ll"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TableLayout
android:id="#+id/r_tablelayoutRAD"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
</TableLayout>
<ImageView
android:id="#+id/drop"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="5.5"
android:src="#drawable/ic_drop_down_round_button" />
</LinearLayout>
<ListView
android:layout_below="#id/ll_2"
android:id="#+id/lisstview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
</ListView>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:text="Unpaid"
android:textSize="20sp"
android:typeface="monospace" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingLeft="30dp"
android:text="Type"
android:textSize="15dp"
android:typeface="monospace" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingLeft="30dp"
android:text="Amount"
android:textSize="15dp"
android:typeface="monospace" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_margin="5dp"
android:background="#color/studentlogin" />
<ListView
android:layout_width="match_parent"
android:id="#+id/un_paid_list_view"
android:layout_height="wrap_content">
</ListView>
</LinearLayout>
</RelativeLayout>
Your effort is appreciable.Thanks in andvance
Your parent layouts are not matching. You have used layout_below in LinearlLayout where the parent is not RelativeLayout. Check the hierarchy of the layouts in your layout.
Try this:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/scroll_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:orientation="vertical"
tools:context="com.bitblue.dextronewproject.Avtivity.ReportActivity">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:text="Fees History"
android:textSize="20sp"
android:typeface="monospace"
android:id="#+id/textView1"/>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_margin="5dp"
android:background="#color/studentlogin"
android:layout_below="#+id/textView1"
android:id="#+id/view1"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_below="#+id/view1"
android:id="#+id/ll1">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Receipt"
android:typeface="monospace" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Amount"
android:typeface="monospace" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Date"
android:typeface="monospace" />
</LinearLayout>
<LinearLayout
android:id="#+id/ll_2"
android:layout_below="#+id/ll1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TableLayout
android:id="#+id/r_tablelayoutRAD"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
</TableLayout>
<ImageView
android:id="#+id/drop"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="5.5"
android:src="#drawable/ic_drop_down_round_button" />
</LinearLayout>
<ListView
android:layout_below="#+id/ll_2"
android:id="#+id/lisstview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:text="Unpaid"
android:textSize="20sp"
android:typeface="monospace"
android:layout_below="#+id/lisstview"
android:id="#+id/textView2"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_below="#+id/textView2"
android:id="#+id/ll3">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingLeft="30dp"
android:text="Type"
android:textSize="15dp"
android:typeface="monospace" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingLeft="30dp"
android:text="Amount"
android:textSize="15dp"
android:typeface="monospace" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_margin="5dp"
android:background="#color/studentlogin"
android:layout_below="#+id/ll3"
android:id="#+id/view3"/>
<ListView
android:layout_width="match_parent"
android:id="#+id/un_paid_list_view"
android:layout_height="wrap_content"
android:layout_below="#+id/ll3"/>

Categories

Resources