I am using android:windowSoftInputMode="stateHidden|adjustResize" to adjust keyboard on screen. It is not working in Tablets with OS 4.4 but it is working fine in Mobile devices. Below I am attaching image.
Here is my layout
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:custom="http://schemas.android.com/apk/res-auto"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/bg_main"
android:id="#+id/parentCanvas">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar_edit_screen"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_alignParentTop="true"
android:background="#color/toolbarTransparent"
android:elevation="4dp"
app:titleTextColor="#color/setting_button"
android:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar"
android:popupTheme="#style/ThemeOverlay.AppCompat.Light"
></android.support.v7.widget.Toolbar>
<RelativeLayout
android:layout_width="414.75dp"
android:layout_height="233.25dp"
android:id="#+id/parentCanvas1"
android:layout_below="#id/toolbar_edit_screen"
android:layout_marginTop="10.00dp"
android:layout_marginLeft="10.00dp"
android:layout_alignParentLeft="true">
<ImageView
android:id="#+id/imageView1"
android:layout_width="414.75dp"
android:layout_height="233.25dp"
android:background="#android:color/white"
android:adjustViewBounds="true"
android:scaleType="fitCenter"
/>
<ProgressBar
android:id="#+id/progressBarMainImage"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_centerInParent="true"
android:visibility="gone"
/>
</RelativeLayout>
<LinearLayout
android:id="#+id/relativeLayoutButtons"
android:layout_width="64.00dp"
android:layout_height="match_parent"
android:layout_below="#id/toolbar_edit_screen"
android:paddingLeft="10.00dp"
android:paddingRight="10.00dp"
android:layout_alignTop="#id/parentCanvas1"
android:layout_toRightOf="#id/parentCanvas1"
android:weightSum="5"
android:orientation="vertical"
android:layout_alignBottom="#id/parentCanvas1"
>
<ImageButton
android:id="#+id/buttonAdd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_ic__add"
android:background="#android:color/transparent"
android:paddingTop="19dp"
android:paddingBottom="19dp"
android:paddingLeft="19dp"
android:paddingRight="19dp"
android:layout_alignParentTop="true"
android:layout_weight="1"
android:layout_marginBottom="2dp"/>
<ImageButton
android:id="#+id/buttonCopy"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/buttonAdd"
android:src="#drawable/ic_dup"
android:background="#android:color/transparent"
android:layout_weight="1"
android:layout_marginBottom="2dp"
android:paddingTop="19dp"
android:paddingBottom="19dp"
android:paddingLeft="19dp"
android:paddingRight="19dp"
/>
<ImageButton
android:id="#+id/buttonSlideShow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/buttonCopy"
android:src="#drawable/ic_play"
android:background="#android:color/transparent"
android:layout_marginBottom="2dp"
android:paddingTop="19dp"
android:paddingBottom="19dp"
android:paddingLeft="19dp"
android:paddingRight="19dp"
android:layout_weight="1"/>
<ImageButton
android:id="#+id/buttonRemove"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/buttonSlideShow"
android:src="#drawable/ic_delete"
android:background="#android:color/transparent"
android:layout_marginBottom="2dp"
android:paddingTop="19dp"
android:paddingBottom="19dp"
android:paddingLeft="19dp"
android:paddingRight="19dp"
android:layout_weight="1"/>
<ImageButton
android:id="#+id/selectImag"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/buttonRemove"
android:src="#drawable/ic_imgimport"
android:background="#android:color/transparent"
android:layout_marginBottom="2dp"
android:layout_marginTop="4dp"
android:paddingTop="15dp"
android:paddingBottom="19dp"
android:paddingLeft="19dp"
android:paddingRight="19dp"
android:layout_weight="1"/>
</LinearLayout>
<View
android:id="#+id/straightLine"
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="#android:color/white"
android:layout_toRightOf="#id/relativeLayoutButtons"
android:layout_below="#id/toolbar_edit_screen"
/>
<RelativeLayout
android:id="#+id/relativeLayoutCircleDropdown"
android:layout_width="414.75dp"
android:layout_height="200px"
android:layout_alignParentBottom="true"
android:layout_alignLeft="#id/parentCanvas1"
android:layout_alignRight="#id/parentCanvas1"
android:layout_below="#+id/parentCanvas1">
<ImageButton
android:id="#+id/drawCircle"
android:layout_width="50.75dp"
android:layout_height="50.75dp"
android:scaleType="fitXY"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:src="#drawable/circle_img"
android:background="#android:color/transparent"
android:layout_marginRight="6.75dp"/>
<View
android:id="#+id/view_small_line"
android:layout_width="1dp"
android:layout_height="35.50dp"
android:layout_toRightOf="#id/drawCircle"
android:layout_marginLeft="7.00dp"
android:layout_marginRight="7.00dp"
android:layout_centerVertical="true"
android:background="#android:color/white"
android:layout_marginTop="8.00dp"
/>
<ssi.sarissa.views.EditTextWithBackEvent
android:id="#+id/editTextDescription"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="5dp"
android:layout_toRightOf="#id/view_small_line"
android:focusable="true"
android:inputType="text"
android:cursorVisible="false"
android:maxLines="1"
android:maxLength="160"
android:focusableInTouchMode="true"
android:layout_marginRight="3.00dp"
android:layout_centerVertical="true"
android:background="#drawable/edit_text_background"
android:textSize="16sp"
android:hint="Description"
/>
<Spinner
android:id="#+id/spinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:background="#drawable/spinner"
android:layout_toRightOf="#id/editTextDescription"
/>
</RelativeLayout>
<RelativeLayout
android:id="#+id/relativeLayoutList"
android:layout_width="158.50dp"
android:layout_height="match_parent"
android:layout_below="#id/toolbar_edit_screen"
android:layout_toRightOf="#id/straightLine"
android:layout_alignParentRight="true"
android:layout_alignTop="#id/relativeLayoutButtons"
>
<android.support.v7.widget.RecyclerView
android:id="#+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="none"
/>
</RelativeLayout>
</RelativeLayout>
I don't know where I am getting wrong.
Related
The .xml file is attached below.
The issue is my recycler view is not scrolling.
Also, to show how I'm adding Linearlayout manager, the code is below.
variantRecycler.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
ViewCompat. setNestedScrollingEnabled(variantRecycler, false);
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
android:layout_width="match_parent"
android:background="#color/transparent"
android:layout_height="match_parent">
<TextView
android:id="#+id/cross_icon"
style="#style/icon"
android:layout_width="#dimen/_30dp"
android:layout_height="#dimen/_30dp"
android:layout_gravity="right"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginEnd="#dimen/_10dp"
android:layout_marginRight="#dimen/_20dp"
android:layout_marginBottom="#dimen/_30dp"
android:background="#drawable/circular_cross_button" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/_40dp"
android:background="#color/app_grey"
android:orientation="vertical">
<RelativeLayout
android:id="#+id/product_details_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/white">
<TextView
android:id="#+id/pick_your_option_label"
style="#style/subheading_manrope_bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="#dimen/_15dp"
android:layout_marginTop="#dimen/_15dp"
android:layout_marginBottom="#dimen/_10dp"
android:text="#string/pick_your_option"
android:textColor="#color/product_name_lite_black_color"
android:textSize="#dimen/_18dp"
android:visibility="gone" />
<View
android:id="#+id/line1"
android:layout_width="match_parent"
android:layout_height="#dimen/_1dp"
android:layout_below="#id/pick_your_option_label"
android:layout_marginLeft="#dimen/_15dp"
android:layout_marginTop="#dimen/_10dp"
android:layout_marginRight="#dimen/_15dp"
android:layout_marginBottom="#dimen/_15dp"
android:background="#color/line_color"
android:visibility="invisible" />
<androidx.viewpager2.widget.ViewPager2
android:id="#+id/view_pager"
android:layout_width="#dimen/_136dp"
android:layout_height="#dimen/_136dp"
android:layout_below="#id/line1"
android:layout_marginLeft="#dimen/_16dp"
android:layout_marginTop="#dimen/_12dp"
android:layout_marginRight="#dimen/_12dp"
android:layout_marginBottom="#dimen/_8dp"
android:background="#drawable/grey_border_rounder_rectangle_8dp"
android:padding="#dimen/_1dp"
android:transitionName="#string/image" />
<LinearLayout
android:id="#+id/pager_dots"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/view_pager"
android:layout_gravity="center"
android:layout_marginLeft="#dimen/_16dp"
android:layout_marginBottom="#dimen/_15dp"
android:background="#android:color/transparent"
android:orientation="horizontal" />
<ImageView
android:id="#+id/product_image"
android:layout_width="#dimen/_120dp"
android:layout_height="#dimen/_120dp"
android:layout_marginLeft="#dimen/_10dp"
android:layout_marginRight="#dimen/_8dp"
android:layout_marginBottom="#dimen/_15dp"
android:transitionName="#string/image"
android:visibility="gone" />
<ImageView
android:id="#+id/elite_image"
android:layout_width="#dimen/_16dp"
android:layout_height="#dimen/_16dp"
android:layout_below="#id/line1"
android:layout_marginLeft="#dimen/_15dp"
android:visibility="gone"
app:srcCompat="#drawable/elite_icon" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
</RelativeLayout>
<TextView
android:id="#+id/product_name"
style="#style/body_manrope_bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/line1"
android:layout_marginTop="#dimen/_12dp"
android:layout_marginRight="#dimen/_10dp"
android:layout_toRightOf="#id/view_pager"
android:ellipsize="end"
android:maxLines="2"
android:textColor="#color/product_name_lite_black_color" />
<View
android:id="#+id/view"
android:layout_width="1dp"
android:layout_toRightOf="#id/product_name"
android:layout_marginTop="#dimen/_12dp"
android:layout_marginLeft="#dimen/_3dp"
android:background="#color/divider_grey"
android:layout_height="#dimen/_35dp"/>
<TextView
style="#style/icon"
android:id="#+id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/_12dp"
android:layout_gravity="center"
android:layout_toRightOf="#+id/view"
android:layout_marginLeft="#dimen/_3dp"
android:layout_marginRight="#dimen/_5dp"
android:background="?selectableItemBackground"
android:gravity="center"
android:text="#string/camera_icon_id"
android:textSize="#dimen/_24dp"
android:textStyle="bold" />
<TextView
android:id="#+id/try_on"
style="#style/subheading_manrope_bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/_3dp"
android:layout_toRightOf="#id/view"
android:layout_below="#+id/icon"
android:textColor="#color/add_to_cart_violet" />
<TextView
android:id="#+id/price"
style="#style/subheading_manrope_bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/product_name"
android:layout_marginTop="#dimen/_8dp"
android:layout_toRightOf="#id/view_pager"
android:textColor="#color/product_name_lite_black_color" />
<TextView
android:id="#+id/offer_price"
style="#style/subheading_manrope_bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/product_name"
android:layout_marginLeft="#dimen/_4dp"
android:layout_marginTop="#dimen/_8dp"
android:layout_toRightOf="#id/price"
android:textColor="#color/product_mrp_lite_gray_color" />
<TextView
android:id="#+id/save_offer"
style="#style/caption_manrope_medium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/product_name"
android:layout_marginLeft="#dimen/_4dp"
android:layout_marginTop="#dimen/_10dp"
android:layout_toRightOf="#id/offer_price"
android:textColor="#color/product_offer_price_color"
android:textSize="#dimen/_13dp"
android:visibility="gone" />
<TextView
android:id="#+id/offer_percantage"
style="#style/caption_manrope_medium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/product_name"
android:layout_marginLeft="#dimen/_2dp"
android:layout_marginTop="#dimen/_10dp"
android:layout_toRightOf="#id/save_offer"
android:textColor="#color/product_offer_price_color"
android:textSize="#dimen/_13dp" />
<include
layout="#layout/new_rating_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/price"
android:layout_marginTop="#dimen/_8dp"
android:layout_toRightOf="#id/view_pager" />
<TextView
android:id="#+id/product_qty"
style="#style/caption_manrope_medium2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/new_rating_layout"
android:layout_marginLeft="#dimen/_12dp"
android:layout_marginTop="#dimen/_11dp"
android:layout_toRightOf="#id/view_pager"
android:gravity="center_vertical"
android:text="20ml"
android:textColor="#color/ash_gray"
android:textSize="#dimen/_10dp" />
<HorizontalScrollView
android:layout_below="#+id/product_qty"
android:layout_toRightOf="#id/view_pager"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/_6dp"
android:layout_marginLeft="#dimen/_12dp"
android:scrollbars="none">
<com.google.android.material.chip.ChipGroup
android:id="#+id/chip_group"
app:singleLine="true"
app:singleSelection="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
</HorizontalScrollView>
<View
android:id="#+id/line2"
android:layout_width="match_parent"
android:layout_height="#dimen/_1dp"
android:layout_below="#id/view_pager"
android:layout_marginLeft="#dimen/_15dp"
android:layout_marginTop="#dimen/_10dp"
android:layout_marginRight="#dimen/_15dp"
android:layout_marginBottom="#dimen/_10dp"
android:background="#color/line_color"
android:visibility="invisible" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/product_details_layout"
android:layout_marginTop="#dimen/_8dp"
android:background="#color/white">
<TextView
android:id="#+id/shades_label"
style="#style/body_manrope_bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="#dimen/_2dp"
android:layout_marginTop="#dimen/_8dp"
android:layout_marginBottom="#dimen/_5dp"
android:layout_toRightOf="#+id/shade"
android:textColor="#color/dark_gray_color"
android:textStyle="bold"
android:visibility="gone" />
<androidx.recyclerview.widget.RecyclerView
android:id="#+id/variant_recycler"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:nestedScrollingEnabled="false"
android:layout_below="#+id/shade"
/>
</RelativeLayout>
</RelativeLayout>
<include
layout="#layout/variant_pop_up_bottom_bar_layout"
android:visibility="visible"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
This is my xml I want to keep one layout over another layout.
I have progress Bar and try again Textview in same place I am doing visible and invisible Textview and Progressbar programatically, so I want keep Progressbar over try again button, but I am unable to do this.
I have searched from google that we can do using Frame layout but its not working.
<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"
android:background="#color/tesco_blue"
android:paddingBottom="#dimen/margin_18"
android:paddingLeft="#dimen/margin_18"
android:paddingRight="#dimen/margin_12"
android:orientation="vertical"
android:paddingTop="#dimen/margin_18">
<LinearLayout
android:id="#+id/securebarcode_error_layout_variant_a"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical"
android:layout_marginLeft="#dimen/margin_56"
android:layout_marginRight="#dimen/margin_56"
android:visibility="visible"
tools:visibility="visible">
<android.support.v4.widget.Space
android:layout_width="match_parent"
android:layout_height="#dimen/margin_40" />
<TextView
android:id="#+id/errortitle"
style="#style/Typeface.Body.Bold.White"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="#android:color/transparent"
android:gravity="center"
android:lineSpacingExtra="4sp"
tools:text="#string/pwp_network_error" />
<TextView
android:id="#+id/errordesc"
style="#style/Typeface.Body.White"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:gravity="center"
android:layout_marginTop="#dimen/margin_12"
android:lineSpacingExtra="8sp"
tools:text="#string/pwp_network_error_description" />
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_gravity="center"
>
<ProgressBar
android:id="#+id/pwp_progressbarlayout_variant_a"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:visibility="visible"
android:paddingLeft="#dimen/cl_48"
android:paddingRight="#dimen/cl_48"
android:paddingTop="#dimen/padding_12"
android:paddingBottom="#dimen/padding_12"
android:indeterminateDrawable="#drawable/custom_progress_bar"/>
</FrameLayout>
<TextView
android:id="#+id/try_again"
style="#style/Typeface.Body.Bold.HighlightBlue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="#drawable/error_button_background"
android:gravity="center"
android:paddingLeft="#dimen/cl_48"
android:paddingRight="#dimen/cl_48"
android:paddingTop="#dimen/padding_12"
android:paddingBottom="#dimen/padding_12"
android:text="#string/Tryagain"
android:textColor="#color/fdv_pending_state_color" />
<android.support.v4.widget.Space
android:layout_width="match_parent"
android:layout_height="#dimen/margin_40" />
</LinearLayout>
</LinearLayout>
You can simply use constraint layout in your case as basically its
from the family of frame layout , you can implement the code below.just take your root layout as ConstraintLayout
<TextView
android:id="#+id/try_again"
style="#style/Typeface.Body.Bold.HighlightBlue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:background="#drawable/error_button_background"
android:gravity="center"
android:paddingLeft="#dimen/cl_48"
android:paddingRight="#dimen/cl_48"
android:paddingTop="#dimen/padding_12"
android:paddingBottom="#dimen/padding_12"
android:text="#string/Tryagain"
android:textColor="#color/fdv_pending_state_color" />
<ProgressBar
android:id="#+id/pwp_progressbarlayout_variant_a"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="#id/try_again"
app:layout_constraintBottom_toBottomOf="#id/try_again"
app:layout_constraintLeft_toLeftOf="#id/try_again"
app:layout_constraintRight_toRightOf="#id/try_again"
android:visibility="visible"
android:paddingLeft="#dimen/cl_48"
android:paddingRight="#dimen/cl_48"
android:paddingTop="#dimen/padding_12"
android:paddingBottom="#dimen/padding_12"
android:indeterminateDrawable="#drawable/custom_progress_bar"/>
You have to move your try_again TextView to inside of FrameLayout so the your Progressbar will show on TextView
<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"
android:background="#color/tesco_blue"
android:orientation="vertical"
android:paddingLeft="#dimen/margin_18"
android:paddingTop="#dimen/margin_18"
android:paddingRight="#dimen/margin_12"
android:paddingBottom="#dimen/margin_18">
<LinearLayout
android:id="#+id/securebarcode_error_layout_variant_a"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="#dimen/margin_56"
android:layout_marginRight="#dimen/margin_56"
android:orientation="vertical"
android:visibility="visible"
tools:visibility="visible">
<android.support.v4.widget.Space
android:layout_width="match_parent"
android:layout_height="#dimen/margin_40" />
<TextView
android:id="#+id/errortitle"
style="#style/Typeface.Body.Bold.White"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="#android:color/transparent"
android:gravity="center"
android:lineSpacingExtra="4sp"
tools:text="#string/pwp_network_error" />
<TextView
android:id="#+id/errordesc"
style="#style/Typeface.Body.White"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="#dimen/margin_12"
android:gravity="center"
android:lineSpacingExtra="8sp"
tools:text="#string/pwp_network_error_description" />
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center">
<ProgressBar
android:id="#+id/pwp_progressbarlayout_variant_a"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:indeterminateDrawable="#drawable/custom_progress_bar"
android:paddingLeft="#dimen/cl_48"
android:paddingTop="#dimen/padding_12"
android:paddingRight="#dimen/cl_48"
android:paddingBottom="#dimen/padding_12"
android:visibility="visible" />
<TextView
android:id="#+id/try_again"
style="#style/Typeface.Body.Bold.HighlightBlue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="#drawable/error_button_background"
android:gravity="center"
android:paddingLeft="#dimen/cl_48"
android:paddingTop="#dimen/padding_12"
android:paddingRight="#dimen/cl_48"
android:paddingBottom="#dimen/padding_12"
android:text="#string/Tryagain"
android:textColor="#color/fdv_pending_state_color" />
</FrameLayout>
<android.support.v4.widget.Space
android:layout_width="match_parent"
android:layout_height="#dimen/margin_40" />
Here it is the image what you want.
Update your Layout as below - Relative Layout can do the trick
<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"
android:background="#color/tesco_blue"
android:paddingBottom="#dimen/margin_18"
android:paddingLeft="#dimen/margin_18"
android:paddingRight="#dimen/margin_12"
android:orientation="vertical"
android:paddingTop="#dimen/margin_18">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="#+id/securebarcode_error_layout_variant_a"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical"
android:layout_marginLeft="#dimen/margin_56"
android:layout_marginRight="#dimen/margin_56"
android:visibility="visible"
tools:visibility="visible">
<android.support.v4.widget.Space
android:layout_width="match_parent"
android:layout_height="#dimen/margin_40" />
<TextView
android:id="#+id/errortitle"
style="#style/Typeface.Body.Bold.White"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="#android:color/transparent"
android:gravity="center"
android:lineSpacingExtra="4sp"
tools:text="#string/pwp_network_error" />
<TextView
android:id="#+id/errordesc"
style="#style/Typeface.Body.White"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:gravity="center"
android:layout_marginTop="#dimen/margin_12"
android:lineSpacingExtra="8sp"
tools:text="#string/pwp_network_error_description" />
<TextView
android:id="#+id/try_again"
style="#style/Typeface.Body.Bold.HighlightBlue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="#drawable/error_button_background"
android:gravity="center"
android:paddingLeft="#dimen/cl_48"
android:paddingRight="#dimen/cl_48"
android:paddingTop="#dimen/padding_12"
android:paddingBottom="#dimen/padding_12"
android:text="#string/Tryagain"
android:textColor="#color/fdv_pending_state_color" />
<android.support.v4.widget.Space
android:layout_width="match_parent"
android:layout_height="#dimen/margin_40" />
</LinearLayout>
<ProgressBar
android:id="#+id/pwp_progressbarlayout_variant_a"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_centerInParent="true"
android:visibility="visible"
android:indeterminateDrawable="#drawable/custom_progress_bar"/>
</RelativeLayout>
</LinearLayout>
In our chat app new message start first. For see old message user scroll up. For this we set reverseLayout true.
Ex: LayoutManager reverse so 0 position is botttom. when user scroll for old message suppose position is 10 . so i want to hide toolbar.when user go below from 10 position to 9 position i want to show toolbar.
LinearLayoutManager linearLayoutManager = new WrapContentLinearLayoutManager(context);
linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
linearLayoutManager.setReverseLayout(true);
We want to hide collapsing toolbar when user scroll up for fetch old message and show collapsing toolbar when user scroll down.
Any hints on how to achieve this?
XML Code as below :
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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/rlMain"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/whole_background_color"
android:orientation="vertical">
<ImageView
android:id="#+id/ivBackgroundWall"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop" />
<android.support.design.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="#+id/rlChatMessageSendView">
<android.support.design.widget.AppBarLayout
android:id="#+id/app_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#00000000"
app:elevation="0dp">
<android.support.design.widget.CollapsingToolbarLayout
android:id="#+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_scrollFlags="scroll|enterAlways">
<include
android:id="#+id/rlZoneDetail"
layout="#layout/include_layout_zone_option" />
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
app:layout_behavior="com.gochat.uIUtil.FixScrollingFooterBehavior">
<RelativeLayout
android:id="#+id/rel_root_recyclerview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="#+id/rlChat"
android:paddingBottom="#dimen/margin_five">
<android.support.v7.widget.RecyclerView
android:id="#+id/recyclerViewChat"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:overScrollMode="never"
android:scrollbars="none"
android:visibility="visible"
tools:listitem="#layout/chat_adapter_message_layout" />
<ProgressBar
android:id="#+id/progressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:theme="#style/AppTheme.ProgressBarColor"
android:visibility="gone" />
<android.support.v7.widget.AppCompatTextView
android:id="#+id/tvFollow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginRight="#dimen/padding_five"
android:layout_marginTop="#dimen/padding_ten"
android:background="#drawable/background_login_signup_small_radius"
android:gravity="center"
android:maxLines="1"
android:paddingBottom="#dimen/padding_five"
android:paddingLeft="#dimen/padding_twenty"
android:paddingRight="#dimen/padding_twenty"
android:paddingTop="#dimen/padding_five"
android:singleLine="true"
android:text="#string/start_follow"
android:textAllCaps="false"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/white"
android:textSize="#dimen/text_size_fifteen"
android:visibility="gone" />
<LinearLayout
android:id="#+id/llAnnounce"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/recyclerViewChat"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginBottom="#dimen/padding_five"
android:layout_marginRight="#dimen/padding_five"
android:layout_marginTop="#dimen/padding_five"
android:background="#drawable/background_login_signup_small_radius"
android:gravity="center"
android:visibility="gone">
<ImageView
android:layout_width="#dimen/padding_thirteen"
android:layout_height="#dimen/padding_thirteen"
android:layout_marginLeft="#dimen/margin_seven"
android:layout_marginStart="#dimen/margin_seven"
android:src="#drawable/iv_white_shout" />
<android.support.v7.widget.AppCompatTextView
android:id="#+id/tvAnnouncement"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="#dimen/margin_twenty"
android:layout_marginLeft="#dimen/margin_ten"
android:layout_marginRight="#dimen/margin_twenty"
android:layout_marginStart="#dimen/margin_ten"
android:gravity="center"
android:maxLines="1"
android:paddingBottom="#dimen/padding_five"
android:paddingTop="#dimen/padding_five"
android:singleLine="true"
android:text="#string/announce_text"
android:textAllCaps="false"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/white"
android:textSize="#dimen/text_size_thirteen"
android:visibility="visible" />
<ImageView
android:layout_width="#dimen/padding_thirteen"
android:layout_height="#dimen/padding_thirteen"
android:layout_marginEnd="#dimen/margin_seven"
android:layout_marginRight="#dimen/margin_seven"
android:src="#drawable/iv_white_send" />
</LinearLayout>
</RelativeLayout>
<LinearLayout
android:id="#+id/rlChat"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_gravity="bottom"
android:background="#color/bg_bottombar"
android:orientation="vertical"
android:visibility="visible"
app:layout_behavior="com.gochat.uIUtil.FixScrollingFooterBehavior">
<View
android:layout_width="match_parent"
android:layout_height="#dimen/onedp"
android:background="#color/create_zone_divider_color_whatsapp" />
<RelativeLayout
android:id="#+id/rl_send_message"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/bottom_tab"
android:padding="#dimen/padding_seven"
android:visibility="visible">
<RelativeLayout
android:id="#+id/rlAdd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:paddingBottom="#dimen/padding_ten"
android:paddingRight="#dimen/margin_eight"
android:paddingTop="#dimen/padding_ten">
<ImageView
android:id="#+id/ivAdd"
android:layout_width="#dimen/margin_twenty"
android:layout_height="#dimen/margin_twenty"
android:layout_centerVertical="true"
android:src="#drawable/iv_add_blue" />
</RelativeLayout>
<ImageView
android:id="#+id/ivFullscreen"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:src="#drawable/iv_add_blue"
android:visibility="gone" />
<ImageView
android:id="#+id/ivMenuOpen"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/rel_message"
android:layout_centerVertical="true"
android:layout_marginEnd="#dimen/margin_twenty"
android:layout_marginRight="#dimen/margin_twenty"
android:layout_toLeftOf="#+id/ivFullscreen"
android:layout_toStartOf="#+id/ivFullscreen"
android:src="#drawable/iv_menu_grid"
android:visibility="gone" />
<TextView
android:id="#+id/tv_Title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:gravity="center"
android:text="TITLE"
android:textStyle="bold"
android:visibility="gone" />
<RelativeLayout
android:id="#+id/rel_message"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toEndOf="#+id/rlAdd"
android:layout_toLeftOf="#+id/iv_send"
android:layout_toRightOf="#+id/rlAdd"
android:layout_toStartOf="#+id/iv_send"
android:background="#drawable/chat_send_message_background"
android:visibility="visible">
<RelativeLayout
android:id="#+id/rl_chat_send_message"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:orientation="horizontal">
<EditText
android:id="#+id/et_chat"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="#dimen/margin_ten"
android:layout_marginLeft="#dimen/margin_ten"
android:layout_marginRight="#dimen/margin_ten"
android:layout_marginStart="#dimen/margin_ten"
android:background="#null"
android:hint="#string/type_messsage"
android:inputType="textMultiLine"
android:maxLines="4"
android:padding="#dimen/padding_eight"
android:textColorHint="#color/hint_text_color"
android:textSize="#dimen/text_size_fifteen"
tools:text="zxnihxkbdfcdaaa" />
</RelativeLayout>
</RelativeLayout>
<ImageView
android:id="#+id/iv_send"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_margin="#dimen/margin_five"
android:src="#drawable/iv_send_message_light"
android:visibility="invisible" />
<ImageView
android:id="#+id/iv_record"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_margin="#dimen/margin_five"
android:src="#drawable/iv_audio_record"
android:visibility="visible" />
</RelativeLayout>
<FrameLayout
android:id="#+id/frame_layout"
android:layout_width="match_parent"
android:layout_height="250dp"
android:background="#color/white"
android:padding="#dimen/padding_fifteen"
android:visibility="gone" />
</LinearLayout>
</RelativeLayout>
</android.support.design.widget.CoordinatorLayout>
<RelativeLayout
android:id="#+id/rlChatMessageSendView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true">
<LinearLayout
android:id="#+id/llSpectatorZone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginTop="#dimen/margin_ten"
android:background="#color/white"
android:orientation="horizontal"
android:padding="#dimen/padding_ten"
android:visibility="gone">
<TextView
android:id="#+id/tvSpectatorZone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="#string/you_can_only_view_this_zone"
android:textColor="#color/unselected_item_color"
android:textSize="#dimen/text_size_seventeen" />
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
Please try below link. It may solve your problem.
http://xmodulo.com/hide-show-toolbar-scrolling-android.html
Thanks !
I am using this lib and when I open the menu it makes the shadow like i am using blur in the background. And loading the songs from the memory(in the main thread). The shadow appears some times. . I dont know why it is happening .In the following layout the background is transparent but the following menu is strong color. what can i do to fix this .I made the images in multiple size also ex hdpi , xhdpi etc. what is the mistake i am doing . The shadow appears when I open and close the menu.
the xml code
<RelativeLayout 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"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context="beatbox.Fragment.Songs">
<!-- TODO: Update blank fragment layout -->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="110dp">
<com.github.florent37.arclayout.ArcLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:rotation="180"
app:arc_cropDirection="cropInside"
app:arc_height="40dp"
app:theme="#style/Theme.AppCompat.Light">
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#7c2c3940" />
</com.github.florent37.arclayout.ArcLayout>
</RelativeLayout>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:layout_gravity="fill_vertical"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ListView
android:id="#+id/song_listview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="175dp"
android:divider="#null"
android:cacheColorHint="#00000000"
android:fadingEdgeLength="48dp"
android:requiresFadingEdge="vertical"
android:fadingEdge="horizontal"
android:overScrollMode="never" />
</LinearLayout>
</ScrollView>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="120dp">
<ImageButton
android:layout_width="70dp"
android:layout_height="70dp"
android:layout_marginRight="21dp"
android:layout_marginEnd="21dp"
android:id="#+id/imageButton"
android:background="#00000000"
android:scaleType="fitXY"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_marginTop="30dp" />
<TextView
android:id="#+id/textView16"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView15"
android:layout_alignStart="#+id/textView15"
android:layout_below="#+id/textView15"
android:maxLines="1"
android:layout_marginEnd="140dp"
android:layout_marginRight="140dp"
android:singleLine="true"
android:textSize="12sp"
android:textStyle="bold" />
<TextView
android:id="#+id/textView15"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_width="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginEnd="120dp"
android:layout_marginLeft="24dp"
android:layout_marginRight="120dp"
android:layout_marginStart="24dp"
android:layout_marginTop="31dp"
android:maxLines="1"
android:singleLine="true"
android:text="#string/total_songs"
android:textSize="26sp" />
</RelativeLayout>
</RelativeLayout>
<FrameLayout
android:id="#+id/edittextview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="invisible">
<com.github.stephenvinouze.shapeview.shapes.HalfCircleEdgeShapeView
android:layout_width="match_parent"
android:layout_height="66dp"
android:layout_marginLeft="16.5dp"
android:layout_marginRight="16.5dp"
android:layout_marginTop="105dp"
android:elevation="0dp"
app:shapeColor="#color/colorAccent">
<ImageButton
android:id="#+id/close_edittext"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_centerInParent="true"
android:layout_marginLeft="17dp"
android:layout_marginStart="17dp"
android:background="#00000000"
app:srcCompat="#drawable/ic_clear_white_48dp"
/>
<EditText
android:id="#+id/editText"
style="#android:style/Theme.Holo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginEnd="20dp"
android:layout_marginRight="20dp"
android:layout_toEndOf="#+id/close_edittext"
android:layout_toRightOf="#+id/close_edittext"
android:hint="Search"
android:inputType="textPersonName"
android:paddingEnd="20dp"
android:paddingRight="20dp"
android:textSize="18sp"
tools:ignore="HardcodedText" />
</com.github.stephenvinouze.shapeview.shapes.HalfCircleEdgeShapeView>
</FrameLayout>
<FrameLayout
android:id="#+id/menu"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true">
<com.srx.widget.TabBarView
android:id="#+id/tabBarView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="105dp"
android:elevation="0dp" >
</com.srx.widget.TabBarView>
</FrameLayout>
So in my program i have a layout implemented in which i want the image to alignTop of the parent. I used to exact same layout code for another activity (with minor changes) and it works perfectly but when using it in this activity it does not. My image still aligns to the center fo the view. Here is the layout xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/darkGray"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
tools:context="com.intellidev.fuzionvapor.HomeDetails"
tools:showIn="#layout/activity_home_details">
<ImageView
android:id="#+id/homeDetailsActivityImage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:scaleType="fitCenter" />
<TextView
android:id="#+id/homeDetailsActivityTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/homeDetailsActivityImage"
android:textColor="#color/white"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="#+id/homeDetailsActivityPrice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="#+id/homeDetailsActivityImage"
android:textColor="#color/fuzionRed"
android:textSize="20sp"
android:textStyle="bold" />
<View
android:id="#+id/homeDetailsActivityRuler"
android:layout_width="fill_parent"
android:layout_height="1dip"
android:layout_below="#+id/homeDetailsActivityTitle"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:background="#color/white" />
<TextView
android:id="#+id/homeDetailsActivityDescription"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/homeDetailsActivityRuler"
android:textColor="#color/white"
android:textSize="15sp" />
<LinearLayout
android:id="#+id/homeDetailsFooter"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/homeDetailsActivityButton"
android:layout_centerHorizontal="true"
android:orientation="horizontal">
<fr.ganfra.materialspinner.MaterialSpinner
android:id="#+id/homeDetailsActivitySizeSpinner"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_margin="1dp"
android:layout_weight="1"
app:ms_arrowColor="#color/fuzionRed"
app:ms_arrowSize="16dp"
app:ms_baseColor="#color/fuzionRed"
app:ms_enableFloatingLabel="true"
app:ms_floatingLabelColor="#color/fuzionRed"
app:ms_floatingLabelText="#string/sizeFloatingLabel"
app:ms_highlightColor="#color/fuzionRed"
app:ms_hintColor="#color/fuzionRed"
app:ms_hint="Size"
app:ms_multiline="false"
app:ms_thickness="1dp" />
<fr.ganfra.materialspinner.MaterialSpinner
android:id="#+id/homeDetailsActivityNicotineSpinner"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="1dp"
android:layout_weight="1"
app:ms_arrowColor="#color/fuzionRed"
app:ms_arrowSize="16dp"
app:ms_baseColor="#color/fuzionRed"
app:ms_enableFloatingLabel="true"
app:ms_floatingLabelColor="#color/fuzionRed"
app:ms_floatingLabelText="#string/nicotineFloatingLabel"
app:ms_highlightColor="#color/fuzionRed"
app:ms_hintColor="#color/fuzionRed"
app:ms_multiline="false"
app:ms_hint="Nicotine"
app:ms_thickness="1dp" />
</LinearLayout>
<Button
android:id="#+id/homeDetailsActivityButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:background="#color/fuzionRed"
android:text="Add To Cart"
android:textAlignment="center"
android:textColor="#color/white"
android:textSize="25sp"
android:textStyle="bold" />
</RelativeLayout>
change
<ImageView
android:id="#+id/homeDetailsActivityImage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:scaleType="fitCenter" />
to
<ImageView
android:id="#+id/homeDetailsActivityImage"
android:layout_width="match_parent"
android:layout_alignParentTop="true"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:adjustViewBounds="true"
android:scaleType="fitStart" />