Overlap the layout in the android ExpandableListView - expandablelistview

In the following template , at the above New vhd text,
overlap the row , I want to fix this problem .I tried to change the height of the Main File but no used.I just increase the text Size 14 to 15 PX in the all template ,size increased in main template programmatically, this problem occur. I attached my code with the question also see the commented section in XML file.Please suggest me solution if any.I am new to android .Not familiar with the android.I also attached the image below.Thank you.
//Main file
<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent" //Changed the height but not work
android:background="#ffffff">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="35dp"
android:orientation="vertical"
android:background="#color/green">
<TextView
android:id="#+id/queue_header"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textColor="#color/white"
android:text="Inbox"
android:textStyle="bold"
android:gravity="center_vertical"
android:layout_marginLeft="10dp" />
</LinearLayout>
<ExpandableListView android:id="#+id/que_list"
android:layout_width="fill_parent"
android:layout_height="wrap_content" //changed as fill_parent but not worked
android:groupIndicator="#drawable/settings_selector"/>
</LinearLayout>
//Second File
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"> //changed as fill_parent but not worked
<TextView android:id="#+id/groupname"
android:paddingLeft="50px"
android:paddingTop="10px"//changed as 15px not worked
android:paddingBottom="10px"//changed as 15px not worked
android:textSize="15px"
android:textColor="#0b730b"
android:layout_width="250px"
android:layout_height="wrap_content"/>//changed as fill_parent but not worked
</LinearLayout>
//Third file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content">//changed as fill_parent but not worked
<ImageView
android:id="#+id/imageView1"
android:paddingLeft="40px"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:src="#drawable/green" />
<TextView android:id="#+id/childname"
android:paddingLeft="20px"
android:paddingTop="10px"
android:paddingBottom="10px"
android:textSize="15px"
android:textColor="#0b730b"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView android:id="#+id/child_id"
android:visibility="gone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView android:id="#+id/dept_id"
android:visibility="gone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView android:id="#+id/rgb"
android:textSize="16px"
android:layout_marginLeft="10px"
android:textColor="#0b730b"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>

Related

About android layout with two imageView

I have movies Application
and I am working in the details of the movie layout
now I have two posters for each movie (orginal poster and backdrop poster)
I am working to make some thing like this:
I am trying to do that but I have problem which is: the backdrop poster came to the front of orginal poster and hide it (backdrop poster hide the orginal poster)
how I can send the original poster to the front of backdrop poster
this is my code:
<?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:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ffffff"
android:orientation="vertical"
android:scrollbarAlwaysDrawVerticalTrack="true">
<ImageView
android:id="#+id/iv_movie_poster1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="67dp"
android:src="#drawable/ic_launcher_background" />
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_above="#+id/relativeLayout2"
>
<ImageView
android:id="#+id/iv_movie_poster_back"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:src="#drawable/ic_launcher_background" />
<!--android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true"-->
</RelativeLayout>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/iv_movie_poster1"
android:layout_centerHorizontal="true"
android:background="#ffff"
android:elevation="4dp"
android:orientation="vertical"
android:padding="8dp"
android:id="#+id/relativeLayout2">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="30dp">
<TextView
android:id="#+id/tv_movie_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#57486c"
android:padding="16dp"
android:textSize="36sp"
tools:text="The Hunger Games" />
<TextView
android:id="#+id/tv_movie_lang"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="18sp"
android:textStyle="italic"
tools:text="English" />
<TextView
android:id="#+id/tv_movie_rating"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="7.4/10" />
<TextView
android:id="#+id/tv_movie_year"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="30sp"
tools:text="2015"
/>
<TextView
android:id="#+id/tv_movie_overview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
tools:text="Katniss Everdeen and Peeta Mellark become targets of the Capitol after their victory in the 74th Hunger Games sparks a rebellion in the Districts of Panem. " />
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
and thankyou
Made the layout i think it will fulfill your requirement. Using Frame Layout overlay the poster image on the back image and accordingly manage.
Follow this XML part for upper layer. Make changes accordingly relate to images you used.
<?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="match_parent"
android:orientation="vertical">
<LinearLayout
android:id="#+id/llMain"
android:layout_width="match_parent"
android:layout_height="280dp">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFFFFF">
<ImageView
android:id="#+id/iv_movie_poster1"
android:layout_width="match_parent"
android:layout_height="200dp"
android:contentDescription="#string/app_name"
android:scaleType="fitXY"
android:src="#drawable/testimage" />
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:layout_gravity="center_horizontal">
<ImageView
android:id="#+id/iv_movie_poster_back"
android:layout_width="150dp"
android:layout_height="150dp"
android:contentDescription="#string/app_name"
android:scaleType="fitXY"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:src="#drawable/com_facebook_button_icon_blue" />
</RelativeLayout>
</FrameLayout>
</LinearLayout>
</LinearLayout>
Here you can view the upper layer output.

recycle view inside scroll view not scrolling

Recycle view is not scrolling inside Scroll View. I have Used Nested Scroll View instead but it doesn't work either. here is My xml code
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/coordinatorlayout"
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:fitsSystemWindows="true">
<include layout="#layout/content_main" />
<android.support.design.widget.AppBarLayout
android:id="#+id/appbarlayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="#style/AppTheme.AppBarOverlay"
app:behavior_scrolling_appbar_peek_height="#dimen/bottom_sheet_peek_height"
app:layout_behavior="com.example.deepdepindersingh.adore.ui.lib.ScrollingAppBarLayoutBehavior">
</android.support.design.widget.AppBarLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#android:color/white"
app:behavior_peekHeight="#dimen/bottom_sheet_peek_height"
android:paddingTop="8dp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:paddingBottom="8dp"
android:id="#+id/bottom_sheet"
app:layout_behavior="com.example.deepdepindersingh.adore.ui.lib.BottomSheetBehaviorGoogleMapsLike"
app:anchorPoint="#dimen/anchor_point"
android:fitsSystemWindows="true">
<ScrollView
android:fillViewport="true"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:nestedScrollingEnabled="true"
android:layout_below="#+id/llOptions">
<android.support.v7.widget.RecyclerView
android:id="#+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="16dp"
android:layout_marginTop="16dp"
android:background="#fff">
</android.support.v7.widget.RecyclerView>
</ScrollView>
</LinearLayout>
<android.support.design.widget.FloatingActionButton
android:id="#+id/fab"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
app:layout_anchor="#id/bottom_sheet"
app:layout_anchorGravity="top|right|end"
android:src="#android:drawable/ic_dialog_map"
android:layout_margin="#dimen/fab_margin"
app:layout_behavior="com.example.deepdepindersingh.adore.ui.lib.ScrollAwareFABBehavior"
android:clickable="true"/>
</android.support.design.widget.CoordinatorLayout>
and i am using Grid Adapter to display array list
grid-Single.xml
<?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="wrap_content"
android:padding="5dp">
<ImageView
android:id="#+id/grid_image"
android:layout_width="50dp"
android:layout_height="50dp">
</ImageView>
<TextView
android:id="#+id/grid_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:textSize="9sp" />
</LinearLayout>
Please Help in solving my problem.

How to align with view element present in the included layout in Android

I would like to align the view element in the current layout with the view element which I included through tag in Android.
Layout1: (Layout1.xml)
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<ImageView
android:id="#+id/click_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="#string/desc"
android:padding="4dp"
android:src="#drawable/icon_click" />
<RelativeLayout
android:id="#+id/relativeLayout"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:gravity="bottom"
android:paddingLeft="8dp"
android:paddingTop="6dp"
android:text="#string/textview1"
/>
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/textView1"
android:text="#string/textView2"
/>
</RelativeLayout>
</LinearLayout>
Layout2:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<include
android:id="#+id/includedLayout"
layout="#layout/Layout1" />
<View
android:id="#+id/seperator"
android:layout_width="wrap_content"
android:layout_height="1dp"
android:alpha="0.3"
android:background="#FFFFFF" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<!-- I want to align this layout with relative layout present in the
Layout1.xml file which is included above -->
</LinearLayout>
</LinearLayout>
I want to align the second LinearLayout in the Layout2.xml with the RelativeLayout in the Layout1.xml file which is included in the Layout2.xml file.
Please let me know if anyone knows the solution.
Thanks.
whay dont you try putting the layout part that you want to align in to another file and only include that file in to the your layout2.xml and manually coding remining part in the layout2.xml.
What i mean is to take
`
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:gravity="bottom"
android:paddingLeft="8dp"
android:paddingTop="6dp"
android:text="#string/textview1"
/>
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/textView1"
android:text="#string/textView2"
/>
</RelativeLayout>`
this part in to another separate file and manually add imageview in to layout2.xml

Admob Layout for Android

I have the following code....and I can't seem to get the ads to run outside my scroll view. I have tried to follow other questions on this topic. please assist. All of my adds are showing on top of my content. I would prefer the ads run outside my scroll view.
my code:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<com.google.ads.AdView
android:id="#+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adSize="BANNER"
ads:adUnitId="xxxxxxxxxxxxxxxxx"
ads:loadAdOnCreate="true" />
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:fillViewport="true" >
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/layoutbottom"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentBottom="true"
android:orientation="vertical"
android:padding="5dp" >
<!-- android:layout_height="456dp" -->
<TextView
android:id="#+id/txtPlaceName"
style="#style/HeaderText"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="#+id/txtAddress"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<ImageView
android:id="#+id/img"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="#+id/txtStory"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="#+id/txtURL"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:autoLink="web" />
</LinearLayout>
</ScrollView>
</RelativeLayout>
Try adding android:layout_alignParentTop="true" on your AdView and android:layout_below="#id/adView" on your ScrollView.

Visual separator in RelativeView

Is there a way to create a visual divider in a relative layout similar to the way you can using a list divider?
This is what I have currently.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:layout_height="wrap_content"
android:text="Screen Ratio:"
android:id="#+id/ScreenRatio"
android:layout_width="100dip"
android:layout_alignTop="#+id/ratio_spinner"
android:layout_alignBottom="#+id/ratio_spinner"
android:gravity="center_vertical"/>
<Spinner android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="#+id/ScreenRatio"
android:id="#+id/ratio_spinner"/>
<TextView
android:layout_height="wrap_content"
android:text="Units:"
android:id="#+id/Units"
android:layout_width="wrap_content"
android:layout_toLeftOf="#+id/unit_spinner"
android:layout_alignTop="#+id/unit_spinner"
android:layout_alignBottom="#+id/unit_spinner"
android:gravity="center_vertical"
android:layout_alignParentLeft="true"/>
<Spinner android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="#+id/ScreenRatio"
android:layout_below="#+id/ratio_spinner"
android:id="#+id/unit_spinner"/>
<Button
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="Clear"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:gravity="fill"
android:paddingLeft="50dip"
android:paddingRight="50dip"/>
</RelativeLayout>
So far , i have tried to add separator inside the TableLayout using the below code:
<View android:id="#+id/view_separator"
android:background="#FFFFFF"
android:layout_centerVertical ="true"
android:layout_width = "fill_parent"
android:layout_height="2dip"
android:layout_alignParentTop="true"/>
It may helps you, just try it.

Resources