Line up text under each other in Layout - android-linearlayout

I have created a payment info screen but would like to adjust it to make it look more like the image below. I have added below my attempted code. How do I go about doing this? Any help would be greatly appreciated. I would like to know how to split the layout into 3 sections and have buttons like the image. Also how would I align my text to be under each other?
Image of what I would like to achieve
Code Below
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="#color/colorPrimary"
android:layout_gravity="center">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical">
<ImageView
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/solver"/>
<View
android:layout_marginTop="5dp"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#android:color/darker_gray"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="center">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Record phone calls"
android:textColor="#color/colorWhite"
android:layout_gravity="center"
android:textSize="18sp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Know who viewed your profile"
android:textColor="#color/colorWhite"
android:layout_gravity="center"
android:textSize="18sp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Option to view profiles privately"
android:textColor="#color/colorWhite"
android:layout_gravity="center"
android:textSize="18sp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Get the Premium badge on your profile"
android:textColor="#color/colorWhite"
android:layout_gravity="center"
android:textSize="18sp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="30 contact requests a month"
android:layout_gravity="center"
android:textColor="#color/colorWhite"
android:textSize="18sp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="No ads"
android:layout_gravity="center"
android:textColor="#color/colorWhite"
android:textSize="18sp"/>
</LinearLayout>
</LinearLayout>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Monthly Premium R19,19"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Yearly Premium R179,99"/>
</LinearLayout>
</ScrollView>

Don't use scrollView. Use a vertical LinearLayout and give it's children suitable weights
Something Like this:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:orientation="vertical">
<ImageView android:layout_width="match_parent"
android:layout_height="match_parent"
android:weight="1.25">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:weight="1"
android:orientation="vertical">
</LinearLayout>
</LinearLayout>
And for transparensy use this style for your activity in manifest
<style name="Theme.Transparent" parent="android:Theme">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">#66000000</item>
<item name="android:windowContentOverlay">#null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">false</item>
<item name="android:backgroundDimEnabled">false</item>
<item name="android:windowFullscreen">true</item>
</style>

Related

android studio: center ProgressPar on top of RoundedImageView

I'm working on a chat app where users can send Texts/Images to another user. so if the sender is the current user then the messages(text/Image) will appear on the right of the page. and if the current user is the receiver then messages appear on left. Like this:
I want to add progressBar on the centre of the image on both sides. (for loading image purposes).
Here is the XML of the right-side:
<RelativeLayout
android:layout_width="#dimen/_280sdp"
android:layout_alignParentEnd="true"
android:layout_height="wrap_content">
<com.makeramen.roundedimageview.RoundedImageView
android:id="#+id/imageIV"
android:layout_width="200dp"
android:layout_height="200dp"
android:scaleType="centerCrop"
android:layout_alignParentEnd="true"
android:adjustViewBounds="true"
app:riv_corner_radius="15dp"
android:layout_below="#+id/date"
android:src="#drawable/ic_baseline_image_24"
/>
<ProgressBar
android:visibility="gone"
android:id="#+id/pb"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignStart="#+id/imageIV"
android:layout_alignBottom="#+id/imageIV"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_marginStart="85dp"
android:layout_marginTop="85dp"
android:layout_marginEnd="85dp"
android:layout_marginBottom="85dp" />
<LinearLayout
android:orientation="vertical"
android:id="#+id/message_wrapper"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/imageIV"
android:padding="#dimen/_5sdp"
android:layout_alignParentEnd="true"
android:background="#drawable/background_right"
android:layout_marginTop="10dip">
<TextView
android:id="#+id/show_message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="hello"
android:visibility="gone"
android:textSize="18sp"
android:textColor="#fff"
android:paddingLeft="5dp"
android:paddingRight="5dp"/>
<TextView
android:id="#+id/messageTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:text="time"
android:textColor="#fff"
android:textSize="10dp" />
</LinearLayout>
<TextView
android:id="#+id/date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="date"
android:layout_alignParentEnd="true"
android:textColor="#AEAEAE"
android:paddingEnd="#dimen/_5sdp"
android:textSize="8dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/txt_seen"
android:paddingTop="#dimen/_5sdp"
android:layout_below="#+id/message_wrapper"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
/>
</RelativeLayout>
and Here is the XML of the Left-side:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="#dimen/_280sdp"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:padding="5dp"
android:id="#+id/messageLayout"
android:layout_height="wrap_content">
<de.hdodenhof.circleimageview.CircleImageView
android:id="#+id/profile_image"
android:layout_width="40dp"
android:layout_height="40dp"
android:padding="#dimen/_3sdp"
android:src="#drawable/pl"/>
<com.makeramen.roundedimageview.RoundedImageView
android:id="#+id/imageIV"
android:layout_width="200dp"
android:layout_height="200dp"
android:scaleType="centerCrop"
android:layout_toEndOf="#+id/profile_image"
android:adjustViewBounds="true"
app:riv_corner_radius="15dp"
android:layout_below="#+id/date"
android:src="#drawable/ic_baseline_image_24"
/>
<ProgressBar
android:id="#+id/pb"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignStart="#+id/imageIV"
android:layout_alignBottom="#+id/imageIV"
android:layout_marginStart="85dp"
android:layout_marginTop="85dp"
android:layout_marginEnd="85dp"
android:layout_marginBottom="85dp" />
<LinearLayout
android:id="#+id/message_wrapper"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="#dimen/_5sdp"
android:layout_below="#+id/imageIV"
android:layout_toEndOf="#id/profile_image"
android:background="#drawable/background_left"
android:layout_marginTop="10dip">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="#+id/show_message"
android:visibility="gone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:textSize="18sp"
android:text="Hello"
android:paddingLeft="5dp"
android:paddingRight="5dp"
/>
<TextView
android:id="#+id/messageTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="time"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:textSize="8dp" />
</LinearLayout>
</LinearLayout>
<TextView
android:id="#+id/date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="date"
android:layout_toRightOf="#+id/profile_image"
android:textColor="#AEAEAE"
android:paddingRight="#dimen/_5sdp"
android:textSize="8dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/txt_seen"
android:paddingTop="#dimen/_5sdp"
android:visibility="gone"
android:layout_below="#+id/message_wrapper"
/>
</RelativeLayout>
How can I do this? please help.
You can add extra progress layout_alignEnd/layout_alignTop attributes for right layout:
<ProgressBar
android:id="#+id/pb"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignStart="#+id/imageIV"
android:layout_alignBottom="#+id/imageIV"
android:layout_alignEnd="#+id/imageIV"
android:layout_alignTop="#+id/imageIV" />
and layout_alignTop/layout_alignEnd for the left layout:
<ProgressBar
android:id="#+id/pb"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignStart="#+id/imageIV"
android:layout_alignBottom="#+id/imageIV"
android:layout_alignTop="#+id/imageIV"
android:layout_alignEnd="#+id/imageIV"
/>

How to constrain a ScrollView with dynamic contents?

<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:layout_editor_absoluteY="25dp">
<TableLayout
android:id="#+id/tableLayoutHeader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:layout_marginTop="8dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/textViewDeviceName">
</TableLayout>
<ScrollView
android:id="#+id/scrollViewLayoutFoo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:minWidth="150dp"
android:minHeight="60dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/tableLayoutHeader">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#color/red"
android:orientation="vertical">
<LinearLayout
android:id="#+id/linearLayoutFragments1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" />
<LinearLayout
android:id="#+id/linearLayoutFragments2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"></LinearLayout>
</LinearLayout>
</ScrollView>
</android.support.constraint.ConstraintLayout>
linearLayoutFragments1 and linearLayoutFragments2 have many fragments added at runtime. Unfortunately, scrollViewLayoutFoo is not constrained below tableLayoutHeader, but overflows into tableLayoutHeader.
Could anyone offer a tip on how to fix this?
You were missing some constraints.
You need to constraint the TabLayout to the parent from start/top/end and scroll view constraint to the bottom of it.
There are also referenced some views that are not in the example so you might have to update them accordingly.
<android.support.constraint.ConstraintLayout 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">
<TableLayout
android:id="#+id/tableLayoutHeader"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:layout_height="48dp" />
<ScrollView
android:id="#+id/scrollViewLayoutFoo"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:minHeight="60dp"
android:minWidth="150dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/tableLayoutHeader">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#FF0000"
android:orientation="vertical">
<LinearLayout
android:id="#+id/linearLayoutFragments1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" />
<LinearLayout
android:id="#+id/linearLayoutFragments2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" />
</LinearLayout>
</ScrollView>
</android.support.constraint.ConstraintLayout>

Mismatched tag in code and APPT2 error

I have this code where I always get an error about a mismatched tag, I cant see the error myself, can someone help me? thanks a million.
And I also get this error: Error:java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout 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"
tools:context=".DetailsSongs">
<android.support.design.widget.AppBarLayout
android:layout_widht="match_parent"
android:layout_height="wrap_content">
<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/AppTheme.PopupOverlay" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="FFECB3"
android:padding="16dp"
android:text="#string/songdetailsdescription" />
</android.support.design.widget.AppBarLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientaion="vertical"
android:weightSum="1"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<Linearlayout
android:layout_width="match_parent"
android:layouth_height="wrap_content"
android:layout_marginEnd="16dp"
android:layout_marginStart="16dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layouth_height="match_content"
android:layout_marginBottom="16dp"
android:layout_marginTop="16dp"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="#drawable/image_placeholder_dark_large"
android:contentDescription="#string/songdetailscontentdescriptionalbumart"
android:scaleType="center" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:paddingTop="16dp"
android:text="#string/songnameplaceholder"
android:textSize="24sp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:paddingTop="4dp"
android:text="#string/songauthorplaceholder"
android:textSize="16sp"
android:textStyle="bold" />
<Button
style="?android:attr/buttonBarButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableEnd="#drawable/media_controls_play_dark_small"
android:gravity="center"
android:paddingBottom="2dp"
android:paddingBtottom="2dp"
android:text="#string/songdetailsplaynow" />
This is where is says that there is an error (LinearLayout) below this comment
</Linearlayout>
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/songdetailssimilarsongs"
android:textSize="18sp" />
<HorizontalScrollView
android:id="#+id/related_albums"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp" >
<include layout="#layout/relatedsongslist" />
</HorizontalScrollView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="16dp"
android:text="#string/songdescriptionplaceholder" />
</LinearLayout>
</ScrollView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_weight="1">
<include layout="#layout/player" />
</LinearLayout>
</LinearLayout>
</android.support.design.widget.CoordinatorLayout>
almost all your tags are mismatched and its causing the problem, i dont know what you trying but i think your best bet will be to try and restart the design again
but this is what i could help. rewrote your xml.
<android.support.design.widget.CoordinatorLayout 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"
tools:context=".DetailsSongs">
<android.support.design.widget.AppBarLayout
android:layout_widht="match_parent"
android:layout_height="wrap_content">
<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/AppTheme.PopupOverlay" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="FFECB3"
android:padding="16dp"
android:text="#string/songdetailsdescription" />
</android.support.design.widget.AppBarLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientaion="vertical"
android:weightSum="1"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<Linearlayout
android:layout_width="match_parent"
android:layouth_height="wrap_content"
android:layout_marginEnd="16dp"
android:layout_marginStart="16dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layouth_height="match_content"
android:layout_marginBottom="16dp"
android:layout_marginTop="16dp"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="#drawable/image_placeholder_dark_large"
android:contentDescription="#string/songdetailscontentdescriptionalbumart"
android:scaleType="center" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:paddingTop="16dp"
android:text="#string/songnameplaceholder"
android:textSize="24sp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:paddingTop="4dp"
android:text="#string/songauthorplaceholder"
android:textSize="16sp"
android:textStyle="bold" />
<Button
style="?android:attr/buttonBarButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableEnd="#drawable/media_controls_play_dark_small"
android:gravity="center"
android:paddingBottom="2dp"
android:paddingBtottom="2dp"
android:text="#string/songdetailsplaynow" />
</LinearLayout>
</Linearlayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/songdetailssimilarsongs"
android:textSize="18sp" />
<HorizontalScrollView
android:id="#+id/related_albums"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp" >
<include layout="#layout/relatedsongslist" />
</HorizontalScrollView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="16dp"
android:text="#string/songdescriptionplaceholder" />
</ScrollView>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_weight="1">
<include layout="#layout/player" />
</LinearLayout>
</android.support.design.widget.CoordinatorLayout>
Try this out and hopefully could help you

How to put fragment on top of soft kevboard?

I have an Android fragment with a EditText. Since I would like to enter there something, I managed to display the keyboard as well, when opening this fragment.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:id="#+id/viewgroup_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:id="#+id/viewgroup_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<View
android:id="#+id/view_placeholder"
android:layout_width="match_parent"
android:layout_height="336dp"
android:clickable="false"
android:src="#drawable/img_placeholder_400"
android:layout_weight="0.64" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="#dimen/margin_bot"
android:paddingLeft="#dimen/margin_left"
android:paddingRight="#dimen/margin_right"
android:paddingTop="20dp"
android:background="#color/dark"
android:focusableInTouchMode="true"
android:weightSum="1">
<RelativeLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Enter name"
android:id="#+id/textView_fragment_title"
android:textColor="#color/white"
android:clickable="false" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="You can enter your name here.. "
android:id="#+id/textView_fragment_subtitle"
android:textColor="#color/blueTone" />
</LinearLayout>
<ImageButton
android:id="#+id/btn_close_fragment_fragment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleType="center"
android:src="#drawable/ic_darkblue_20"
android:layout_gravity="right"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
</RelativeLayout>
<EditText
android:layout_width="match_parent"
android:layout_height="40dp"
android:id="#+id/editText_fragment_content"
android:background="#color/white"
android:inputType="text"
android:imeOptions="actionDone"
android:hint="Enter name here ..."
android:layout_marginTop="10dp">
<requestFocus/>
</EditText>
</LinearLayout>
</FrameLayout>
</LinearLayout>
</LinearLayout>
But my keyboard is in front of my fragment, and thus my fragment is not visible anymore.
I would like to have my keyboard on the bottom, and on top of my soft keybaord my fragment as in this example screenshot
How can I put my fragment on top of the Android soft keyboard?
Following solved my issue:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
android:id="#+id/viewgroup_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:focusableInTouchMode="true"
android:layout_alignParentBottom="true"
android:weightSum="1">
<MY_STUFF>
</LinearLayout>
</RelativeLayout>

adview not showing with bottom on linearlayout

I want to add applications to the ad. But I fail I want to add about the position advertised. Codes are as follows:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="info.androidhive.materialtabs.fragments.OneFragment">
<TextView
android:id="#+id/tarih"
android:textColor="#04B038"
android:textSize="15dp"
android:textStyle="bold"
android:layout_marginTop="5dp"
android:layout_gravity="center_horizontal"
android:text=""
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ListView
android:id="#+id/olaylar_liste"
android:layout_width="match_parent"
android:layout_height="wrap_content"></ListView>
<ProgressBar
android:layout_gravity="center_vertical|center_horizontal"
android:id="#+id/progress_olaylar"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</FrameLayout>
<LinearLayout
android:layout_gravity="bottom"
android:orientation="horizontal"
android:id="#+id/adLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"></LinearLayout>
</LinearLayout>
I want adview showing bottom on linearlayout. Adview # + id /adLayout will be displayed on the Layout
Please help me.
try this
<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:orientation="vertical"
tools:context="info.androidhive.materialtabs.fragments.OneFragment">
<TextView
android:id="#+id/tarih"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="5dp"
android:text="Header"
android:textColor="#04B038"
android:textSize="15dp"
android:textStyle="bold" />
<LinearLayout
android:id="#+id/adLayout"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
android:layout_gravity="bottom"
android:background="#ff0000"
android:orientation="horizontal"></LinearLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/adLayout"
android:layout_below="#+id/tarih">
<ListView
android:id="#+id/olaylar_liste"
android:layout_width="match_parent"
android:layout_height="wrap_content"></ListView>
<ProgressBar
android:id="#+id/progress_olaylar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal" />
</FrameLayout>
</RelativeLayout>

Resources