I put him in one of my ScrollView LinearLayout and it works but the problem is that the names of the buttons do not see them anymore as if the buttons were huge.
This is the XML file:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/bg"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:keepScreenOn="true"
android:orientation="horizontal"
android:weightSum="100" >
<LinearLayout
android:id="#+id/Graph10"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_weight="15"
android:orientation="vertical" android:scrollbars="vertical"
android:scrollbarAlwaysDrawVerticalTrack="true"
android:background="#drawable/sfondo">
<LinearLayout
android:id="#+id/Graph"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_weight="15"
android:orientation="horizontal" >
</LinearLayout>
</LinearLayout>
<ScrollView
android:layout_width="950sp"
android:layout_height="match_parent"
android:scrollbars="vertical" >
<LinearLayout
android:id="#+id/LL2"
android:layout_width="950sp"
android:layout_height="match_parent"
android:layout_weight="85"
android:orientation="vertical" >
<Button
android:id="#+id/bConnect"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Connect"
android:textSize="14dp"
style="#style/btnStyleBeige" />
<Button
android:id="#+id/bDisconnect"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Disconnect"
android:textSize="14dp"
style="#style/btnStyleBeige"
android:layout_marginTop="5dp"/>
<LinearLayout
android:id="#+id/LLY"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="vertical"
android:weightSum="100" >
<Button
android:id="#+id/bFreeze"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Freeze"
android:textSize="14sp"
style="#style/btnStyleBeige"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp" />
<Button
android:id="#+id/bAbsolute"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Absolute"
android:textSize="14sp"
style="#style/btnStyleBeige"
android:layout_marginBottom="5dp" />
<Button
android:id="#+id/bRelative"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Relative"
android:textSize="14sp"
style="#style/btnStyleBeige"
android:layout_marginBottom="5dp" />
<Button
android:id="#+id/bPoc"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="P.O.C."
android:textSize="14sp"
style="#style/btnStyleBeige"
android:layout_marginBottom="5dp" />
</LinearLayout>
<LinearLayout
android:id="#+id/Label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="horizontal"
android:weightSum="100"
android:background="#drawable/rotondo">
<TextView
android:id="#+id/Ch1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:text="• TA DX: "
android:textSize="14sp"
android:textStyle="bold|italic"
/>
<TextView
android:id="#+id/Valore1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:text="0 µV"
android:textSize="14sp"
android:textStyle="bold|italic"/>
</LinearLayout>
<LinearLayout
android:id="#+id/Label2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="horizontal"
android:weightSum="100"
android:background="#drawable/rotondo">
<TextView
android:id="#+id/Ch2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:text="• TA DX: "
android:textSize="14sp"
android:textStyle="bold|italic"
/>
<TextView
android:id="#+id/Valore2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:text="0 µV"
android:textSize="14sp"
android:textStyle="bold|italic"/>
</LinearLayout>
<LinearLayout
android:id="#+id/Label3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="horizontal"
android:weightSum="100"
android:background="#drawable/rotondo">
<TextView
android:id="#+id/Ch3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:text="• TA DX: "
android:textSize="14sp"
android:textStyle="bold|italic"
/>
<TextView
android:id="#+id/Valore3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:text="0 µV"
android:textSize="14sp"
android:textStyle="bold|italic"/>
</LinearLayout>
<LinearLayout
android:id="#+id/Label4"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="horizontal"
android:weightSum="100"
android:background="#drawable/rotondo">
<TextView
android:id="#+id/Ch4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:text="• TA DX: "
android:textSize="14sp"
android:textStyle="bold|italic"
/>
<TextView
android:id="#+id/Valore4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:text="0 µV"
android:textSize="14sp"
android:textStyle="bold|italic"/>
</LinearLayout>
<LinearLayout
android:id="#+id/Label5"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="horizontal"
android:weightSum="100"
android:background="#drawable/rotondo">
<TextView
android:id="#+id/Poc1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:text="• TA P.O.C.: "
android:textColor="#color/black"
android:textSize="14sp"
android:textStyle="bold|italic"
/>
<TextView
android:id="#+id/ValorePoc1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:text="0 %"
android:textColor="#color/black"
android:textSize="14sp"
android:textStyle="bold|italic"/>
</LinearLayout>
<LinearLayout
android:id="#+id/Label6"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="horizontal"
android:weightSum="100"
android:background="#drawable/rotondo">
<TextView
android:id="#+id/Poc2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:text="• MM P.O.C.: "
android:textColor="#color/black"
android:textSize="14sp"
android:textStyle="bold|italic"
/>
<TextView
android:id="#+id/ValorePoc2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:text="0 %"
android:textColor="#color/black"
android:textSize="14sp"
android:textStyle="bold|italic"/>
</LinearLayout>
</LinearLayout>
</ScrollView>
you can tell me where am I wrong? I can not find the problem. Thanks in advance.
Change fill_parent to wrap_content for the button width.
Add weight management:
<LinearLayout
android:id="#+id/LL2"
android:layout_width="950sp"
android:layout_height="match_parent"
android:layout_weight="85"
android:weightSum="2"
android:orientation="vertical" >
<Button
android:id="#+id/bConnect"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:text="Connect"
android:textSize="14dp"
style="#style/btnStyleBeige" />
<Button
android:id="#+id/bDisconnect"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:text="Disconnect"
android:textSize="14dp"
style="#style/btnStyleBeige"
android:layout_marginTop="5dp"/>
Bon courage!
Related
I am new to android development, I am building an app and on that I want to show Imageview and Textview side by side in android layout. Below code is showing textview below the imagview. Here I am using linearlayout.
In this layout I am showing some data from database.
Expected layout design:
Imageview Text1
Text2
Code:
<?xml version="1.0" encoding="utf-8"?>
<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="fill_parent"
android:layout_height="fill_parent"
tools:context="com.example.spand.krishnasoftwares.Main2Activity">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="#color/colorBackground">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="20px"
android:id="#+id/vly">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/imageView"
android:src="#drawable/gym_logo1"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="#+id/ly1">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Exercise 1"
android:textAlignment="center"
android:textAllCaps="true"
android:textColor="#ffffff"
android:layout_marginTop="20px"
android:textSize="10dp"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/ly1"
android:paddingLeft="5px"
android:paddingRight="5px"
android:id="#+id/ly2"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Exercise Name:"
android:textColor="#ffffff"
android:layout_marginTop="20px"
android:layout_weight="1"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/en1"
android:textColor="#ffffff"
android:layout_marginTop="20px"
android:layout_weight="1"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/ly2"
android:id="#+id/ly3"
android:paddingLeft="5px"
android:paddingRight="5px"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Speed: "
android:textColor="#ffffff"
android:layout_marginTop="10px"
android:layout_weight="1"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/es1"
android:textColor="#ffffff"
android:layout_marginTop="10px"
android:layout_weight="1"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/ly3"
android:paddingLeft="5px"
android:paddingRight="5px"
android:orientation="horizontal"
android:id="#+id/ly4">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Repetition: "
android:textColor="#ffffff"
android:layout_marginTop="10px"
android:layout_weight="1"/>
<TextView
android:id="#+id/erep1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10px"
android:layout_weight="1"
android:textColor="#ffffff"
android:textDirection="ltr" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/erep2"
android:textColor="#ffffff"
android:layout_marginTop="10px"
android:layout_weight="1"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/erep3"
android:textColor="#ffffff"
android:layout_marginTop="10px"
android:layout_weight="1"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/ly4"
android:paddingLeft="5px"
android:paddingRight="5px"
android:orientation="horizontal"
android:id="#+id/ly5">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Weight: "
android:textColor="#ffffff"
android:layout_marginTop="10px"
android:layout_weight="1"/>
<TextView
android:id="#+id/ew1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10px"
android:layout_weight="1"
android:textColor="#ffffff"
android:textDirection="ltr" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
Check this.. It will creates layout view hows you want.
<?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"
android:orientation="vertical">
<LinearLayout
android:id="#+id/vly"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="20px"
android:weightSum="3">
<ImageView
android:id="#+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="#drawable/add" />
<LinearLayout
android:id="#+id/ly"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:orientation="vertical">
<LinearLayout
android:id="#+id/ly1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20px"
android:text="Exercise 1"
android:textAlignment="center"
android:textAllCaps="true"
android:textSize="10dp" />
</LinearLayout>
<LinearLayout
android:id="#+id/ly2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/ly1"
android:orientation="horizontal"
android:paddingLeft="5px"
android:paddingRight="5px">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20px"
android:layout_weight="1"
android:text="Exercise Name:" />
<TextView
android:id="#+id/en1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20px"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:id="#+id/ly3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/ly2"
android:orientation="horizontal"
android:paddingLeft="5px"
android:paddingRight="5px">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10px"
android:layout_weight="1"
android:text="Speed: " />
<TextView
android:id="#+id/es1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10px"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:id="#+id/ly4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/ly3"
android:orientation="horizontal"
android:paddingLeft="5px"
android:paddingRight="5px">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10px"
android:layout_weight="1"
android:text="Repetition: " />
<TextView
android:id="#+id/erep1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10px"
android:layout_weight="1"
android:textDirection="ltr" />
<TextView
android:id="#+id/erep2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10px"
android:layout_weight="1"
android:textColor="#ffffff" />
<TextView
android:id="#+id/erep3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10px"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:id="#+id/ly5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/ly4"
android:orientation="horizontal"
android:paddingLeft="5px"
android:paddingRight="5px">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10px"
android:layout_weight="1"
android:text="Weight: " />
<TextView
android:id="#+id/ew1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10px"
android:layout_weight="1"
android:textDirection="ltr" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
why don't you use drawable left?
Use drawable left in first text-view and with proper padding between drawable and text you can easily achieve what you intend.
<?xml version="1.0" encoding="utf-8"?>
<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="fill_parent"
android:layout_height="fill_parent"
tools:context="com.example.spand.krishnasoftwares.Main2Activity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Exercise 1"
android:textAlignment="center"
android:textAllCaps="true"
android:textColor="#ffffff"
android:drawableLeft="#drawable/"
android:layout_marginTop="20px"
android:textSize="10dp"/>
</android.support.constraint.ConstraintLayout>
BENEFITS:
You can save extra nesting of multiple view groups.
Lesser rendering time in case of recycler view or list view.
Recommended by Google developers resource.
you can't use ConstraintLayout in this way, follow the this code;
<LinearLayout
android:weightSum="2"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"/>
</LinearLayout>
Looks like #drawable/gym_logo1 is the child of #+id/vly LinearLayout that has android:orientation="vertical". You should try making it the child of #+id/ly1
Create your layout like this it'll work for you...but remind one thing search first if you don't get solution then ask...
<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="fill_parent"
android:layout_height="fill_parent"
>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="#color/colorBackground">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/imageView"
android:src="#drawable/gym_logo1"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="20px"
android:layout_toRightOf="#+id/imageView"
android:id="#+id/vly">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="#+id/ly1">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Exercise 1"
android:textAlignment="center"
android:textAllCaps="true"
android:textColor="#ffffff"
android:layout_marginTop="20px"
android:textSize="10dp"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/ly1"
android:paddingLeft="5px"
android:paddingRight="5px"
android:id="#+id/ly2"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Exercise Name:"
android:textColor="#ffffff"
android:layout_marginTop="20px"
android:layout_weight="1"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/en1"
android:textColor="#ffffff"
android:layout_marginTop="20px"
android:layout_weight="1"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/ly2"
android:id="#+id/ly3"
android:paddingLeft="5px"
android:paddingRight="5px"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Speed: "
android:textColor="#ffffff"
android:layout_marginTop="10px"
android:layout_weight="1"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/es1"
android:textColor="#ffffff"
android:layout_marginTop="10px"
android:layout_weight="1"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/ly3"
android:paddingLeft="5px"
android:paddingRight="5px"
android:orientation="horizontal"
android:id="#+id/ly4">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Repetition: "
android:textColor="#ffffff"
android:layout_marginTop="10px"
android:layout_weight="1"/>
<TextView
android:id="#+id/erep1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10px"
android:layout_weight="1"
android:textColor="#ffffff"
android:textDirection="ltr" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/erep2"
android:textColor="#ffffff"
android:layout_marginTop="10px"
android:layout_weight="1"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/erep3"
android:textColor="#ffffff"
android:layout_marginTop="10px"
android:layout_weight="1"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/ly4"
android:paddingLeft="5px"
android:paddingRight="5px"
android:orientation="horizontal"
android:id="#+id/ly5">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Weight: "
android:textColor="#ffffff"
android:layout_marginTop="10px"
android:layout_weight="1"/>
<TextView
android:id="#+id/ew1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10px"
android:layout_weight="1"
android:textColor="#ffffff"
android:textDirection="ltr" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
</android.support.constraint.ConstraintLayout>
Change your .xml to
<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="fill_parent"
android:layout_height="fill_parent">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="#color/colorBackground">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="20px"
android:id="#+id/vly">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/imageView"
android:src="#drawable/gym_logo1"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:id="#+id/ly1">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Exercise 1"
android:textAlignment="center"
android:textAllCaps="true"
android:textColor="#ffffff"
android:layout_marginTop="20px"
android:textSize="10dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Exercise Name:"
android:textColor="#ffffff"
android:layout_marginTop="20px"
android:layout_weight="1"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/en1"
android:textColor="#ffffff"
android:layout_marginTop="20px"
android:layout_weight="1"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Speed: "
android:textColor="#ffffff"
android:layout_marginTop="10px"
android:layout_weight="1"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/es1"
android:textColor="#ffffff"
android:layout_marginTop="10px"
android:layout_weight="1"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Repetition: "
android:textColor="#ffffff"
android:layout_marginTop="10px"
android:layout_weight="1"/>
<TextView
android:id="#+id/erep1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10px"
android:layout_weight="1"
android:textColor="#ffffff"
android:textDirection="ltr" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/erep2"
android:textColor="#ffffff"
android:layout_marginTop="10px"
android:layout_weight="1"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/erep3"
android:textColor="#ffffff"
android:layout_marginTop="10px"
android:layout_weight="1"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Weight: "
android:textColor="#ffffff"
android:layout_marginTop="10px"
android:layout_weight="1"/>
<TextView
android:id="#+id/ew1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10px"
android:layout_weight="1"
android:textColor="#ffffff"
android:textDirection="ltr" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
</android.support.constraint.ConstraintLayout>
`
I would like to know if there is a way to place all the textviews that start with little bit space regarding the layout they located. For example I want that in the follwoing image all the textvies will not touch in the border of layout sucah as the word "place","location","Between","When" are doing.
This is current situation:
and this is my xml 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:id="#+id/relativlayoutGcmMessage"
android:background="#ffffff">
<View
android:layout_width="fill_parent"
android:layout_height="1dp"
android:id="#+id/separatorUp"
android:visibility="visible"
android:background="#FF0000"
android:layout_marginTop="25dp"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<RelativeLayout
android:layout_width="match_parent"
android:id="#+id/textlayout"
android:layout_marginTop="5dp"
android:layout_below="#+id/separatorUp"
android:background="#drawable/edit_text_style_focused"
android:layout_margin="10dp"
android:layout_height="wrap_content"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="User ,"
android:gravity="center"
android:id="#+id/textViewUser"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:textStyle="bold"
android:layout_marginLeft="5dp"
android:layout_marginTop="5dp"
android:textSize="20sp"
android:textColor="#FF0000" />
<TextView
android:id="#+id/message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="this is the message"
android:textSize="20sp"
android:layout_marginLeft="5dp"
android:layout_below="#+id/textViewUser"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:textColor="#000000" />
</RelativeLayout>
<LinearLayout
android:id="#+id/linearLayoutBtn"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<Button
android:text="Join"
android:id="#+id/ButtonJoin"
android:textColor="#ffffff"
android:background="#606060"
android:layout_margin="10dp"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_alignParentBottom="true"
android:layout_height="wrap_content"
>
</Button>
<Button
android:text="Deny"
android:id="#+id/ButtonDeny"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_margin="10dp"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:textColor="#ffffff"
android:background="#606060"
>
</Button>
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:id="#+id/relativeLayoutTextVals"
android:layout_marginTop="20dp"
android:layout_margin="10dp"
android:background="#drawable/edit_text_style_focused"
android:layout_below="#+id/textlayout"
android:layout_height="wrap_content">
<TableRow
android:layout_width="match_parent"
android:id="#+id/row2"
android:layout_below="#+id/row1"
android:layout_height="wrap_content">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Between:"
android:id="#+id/textViewbtwn"
android:textColor="#FF0000"
android:textStyle="bold"
android:textSize="20sp"
android:layout_weight="0.62" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Time"
android:id="#+id/textViewtime"
android:layout_marginLeft="10dp"
android:textSize="20sp"
android:layout_weight="1.45"
android:textColor="#000000" />
</TableRow>
<TableRow
android:layout_width="match_parent"
android:id="#+id/row3"
android:layout_below="#+id/row2"
android:layout_height="wrap_content">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Location:"
android:id="#+id/textViewloc"
android:textStyle="bold"
android:textColor="#FF0000"
android:textSize="20sp"
android:layout_weight="1" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="place"
android:layout_marginLeft="10dp"
android:id="#+id/textViewPlace"
android:textSize="20sp"
android:layout_weight="2.28"
android:textColor="#000000" />
</TableRow>
<TableRow
android:layout_width="match_parent"
android:id="#+id/row1"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_gravity="center">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="When:"
android:id="#+id/textViewWhen"
android:textStyle="bold"
android:textSize="20sp"
android:textColor="#FF0000"
android:layout_weight="51.15" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Date"
android:layout_marginLeft="10dp"
android:id="#+id/textViewDate"
android:textSize="20sp"
android:layout_weight="115.29"
android:textColor="#000000" />
</TableRow>
</RelativeLayout>
</RelativeLayout>
Try another approach as follows , it works as per your requirement
<?xml version="1.0" encoding="UTF-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/relativlayoutGcmMessage"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ffffff">
<View
android:id="#+id/separatorUp"
android:layout_width="fill_parent"
android:layout_height="1dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginTop="25dp"
android:background="#FF0000"
android:visibility="visible" />
<RelativeLayout
android:id="#+id/textlayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/separatorUp"
android:layout_margin="10dp"
android:layout_marginTop="5dp"
android:padding="10dp">
<TextView
android:id="#+id/textViewUser"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginLeft="5dp"
android:layout_marginTop="5dp"
android:gravity="center"
android:text="User ,"
android:textColor="#FF0000"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="#+id/message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/textViewUser"
android:layout_marginLeft="5dp"
android:text="this is the message"
android:textColor="#000000"
android:textSize="20sp" />
</RelativeLayout>
<LinearLayout
android:id="#+id/linearLayoutBtn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:orientation="horizontal">
<Button
android:id="#+id/ButtonJoin"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="#606060"
android:text="Join"
android:textColor="#ffffff"></Button>
<Button
android:id="#+id/ButtonDeny"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="#606060"
android:text="Deny"
android:textColor="#ffffff">
</Button>
</LinearLayout>
<RelativeLayout
android:id="#+id/relativeLayoutTextVals"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/textlayout"
android:layout_margin="10dp"
android:layout_marginTop="20dp">
<LinearLayout
android:id="#+id/row2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/row1"
android:layout_margin="5dp">
<TextView
android:id="#+id/textViewbtwn"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Between:"
android:textColor="#FF0000"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="#+id/textViewtime"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:text="Time"
android:textColor="#000000"
android:textSize="20sp" />
</LinearLayout>
<LinearLayout
android:id="#+id/row3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/row2"
android:layout_margin="5dp">
<TextView
android:id="#+id/textViewloc"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Location:"
android:textColor="#FF0000"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="#+id/textViewPlace"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:text="place"
android:textColor="#000000"
android:textSize="20sp" />
</LinearLayout>
<LinearLayout
android:id="#+id/row1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_gravity="center"
android:layout_margin="5dp"
android:orientation="horizontal"
android:weightSum="2">
<TextView
android:id="#+id/textViewWhen"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="When:"
android:textColor="#FF0000"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="#+id/textViewDate"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:text="Date"
android:textColor="#000000"
android:textSize="20sp" />
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
I have a SlidingDrawer. And I want use ScrollView in my SlidingDrawer. I Try but app is not running.
I am tried ScrollView in LinearLayout but still not running app.
How can I do this.
Here İs Code:
.
.
.
.
.
.
<LinearLayout
android:id="#+id/LinearLayout01"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="vertical" >
<SlidingDrawer
android:layout_width="wrap_content"
android:layout_height="330dp"
android:content="#+id/content"
android:handle="#+id/handle"
android:id="#+id/slidingDrawer"
android:layout_gravity="center_horizontal"
android:padding="10dip">
<Button
android:id="#+id/handle"
android:layout_width="200dp"
android:layout_height="33dp"
android:text="== ÇÖZÜM =="
android:textSize="10dp"/>
<!-- I Try Add LinearLayout here But still not ronning.-->
<ScrollView
android:id="#+id/content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="#ababab"
android:gravity="center|top"
android:padding="10dip">
.
.
.
.
.
.
</ScrollView>
</SlidingDrawer>
</LinearLayout>
THANKS!
This is my layout design that i had used in one of my project and it worked perfect check this :
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >
<com.wholesaleraja.touch_image.TouchImageZoom
android:id="#+id/singe_image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:src="#drawable/raja" />
<RelativeLayout
android:id="#+id/det"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/single_item_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:padding="5dp"
android:text="Single Name"
android:textColor="#000000"
android:textSize="20sp"
android:textStyle="bold" />
<View
android:id="#+id/view"
android:layout_width="fill_parent"
android:layout_height="1dp"
android:layout_below="#+id/single_item_text"
android:background="#color/list_divider" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/view"
android:orientation="horizontal" >
<TextView
android:id="#+id/code"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:text="Product Code : "
android:textColor="#000000"
android:textSize="17sp"
android:textStyle="bold" />
<TextView
android:id="#+id/code_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="5dp"
android:textColor="#000000"
android:textSize="14sp" />
</LinearLayout>
<Button
android:id="#+id/price_tag"
style="#style/button_text"
android:layout_width="wrap_content"
android:layout_height="45dp"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_marginBottom="5dp"
android:layout_marginRight="5dp"
android:background="#drawable/price_button_background"
android:clickable="false"
android:padding="5dp"
android:text="Price"
android:textColor="#ffffff" />
</RelativeLayout>
<SlidingDrawer
android:id="#+id/SlidingDrawer"
android:layout_width="fill_parent"
android:layout_height="400dp"
android:layout_alignParentBottom="true"
android:content="#+id/contentLayout"
android:handle="#+id/slideButton"
android:orientation="vertical"
android:padding="0dip"
android:rotation="0" >
<ImageView
android:id="#+id/slideButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:background="#drawable/up" />
<ScrollView
android:id="#+id/contentLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#e5e5e5" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="7dp" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Lot Size : "
android:textSize="15sp" />
<TextView
android:id="#+id/lot_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1 "
android:textSize="15sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Piece(s)/Lot"
android:textSize="15sp" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="10dp" >
<TableLayout
android:id="#+id/details"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#color/list_divider"
android:orientation="vertical"
android:stretchColumns="*" >
<TableRow
android:id="#+id/row3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="Lot(s) "
android:textSize="22sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="Discount"
android:textSize="22sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="Price/Lot"
android:textSize="22sp" />
</TableRow>
<View
android:layout_width="fill_parent"
android:layout_height="1dp"
android:background="#color/list_divider" />
</TableLayout>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="5dp" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="Lot Qty : "
android:textSize="18sp" />
<Button
android:id="#+id/minus"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginLeft="10dp"
android:background="#drawable/round_button"
android:text="-"
android:textSize="30sp"
android:textStyle="bold" />
<EditText
android:id="#+id/count"
android:layout_width="40dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="#drawable/round_edittext"
android:focusable="false"
android:gravity="center"
android:inputType="number" >
</EditText>
<Button
android:id="#+id/plus"
android:layout_width="40dp"
android:layout_height="40dp"
android:background="#drawable/round_button"
android:text="+"
android:textSize="30sp"
android:textStyle="bold" />
</LinearLayout>
<Button
android:id="#+id/addtocart"
style="#style/button_text"
android:layout_width="wrap_content"
android:layout_height="45dp"
android:background="#drawable/cart_button_background"
android:padding="5dp"
android:text="Add to Cart"
android:textColor="#ffffff" />
<View
android:layout_width="fill_parent"
android:layout_height="1dp"
android:background="#color/list_divider" />
<TextView
android:id="#+id/description"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="7dp"
android:text="Description"
android:textSize="20sp"
android:textStyle="bold" />
<View
android:layout_width="fill_parent"
android:layout_height="1.5dp"
android:background="#color/list_divider" />
<TextView
android:id="#+id/full_desc"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="left"
android:padding="5dp"
android:paddingBottom="5dp"
android:textSize="15sp" />
</LinearLayout>
</ScrollView>
</SlidingDrawer>
</RelativeLayout>
</FrameLayout>
I want last two textview in the bottom of the screen and outside the scrollview...but with my code i can get the linear layout inside the scrollview, If i will define them outside the scrollview..It gives me error:root element must be formated at the last linear layout structure
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#+id/textView2"
android:background="#drawable/back1"
android:scrollbars="horizontal" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="33dp"
android:layout_marginTop="2dp"
android:text=""
android:textColor="#FFFFFF" />
<TextView
android:id="#+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="33dp"
android:text=""
android:textColor="#FFFFFF" />
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="33dp"
android:text=""
android:textColor="#FFFFFF" />
<TextView
android:id="#+id/textView5"
android:layout_width="264dp"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:text=""
android:textColor="#FFFFFF" />
<TableLayout
android:id="#+id/maintable"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginBottom="5dp"
android:layout_marginLeft="20dp" >
</TableLayout>
<TableLayout
android:id="#+id/maintable1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginBottom="5dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="10dp" >
</TableLayout>
<TextView
android:id="#+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#android:id/list"
android:text=""
android:textColor="#FFFFFF" />
<ListView
android:id="#android:id/list"
style=" android:listViewStyle"
android:layout_width="fill_parent"
android:layout_height="70dp"
android:layout_below="#+id/textView6"
android:layout_marginLeft="33dp"
android:drawSelectorOnTop="true"
android:textColor="#FFFFFF" >
</ListView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="0dp"
android:orientation="horizontal"
>
<TextView
android:id="#+id/textView8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="7dp"
android:layout_gravity="bottom"
android:text=""
android:layout_marginBottom="5dp"
android:textColor="#FFFFFF"
android:textColorLink="#FFFFFF" />
<TextView
android:id="#+id/textView7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="12dp"
android:layout_marginTop="1dp"
android:layout_marginBottom="5dp"
android:text=""
android:layout_gravity="bottom"
android:textColor="#FFFFFF"
android:textColorLink="#FFFFFF" />
</LinearLayout>
</LinearLayout>
</ScrollView>
Try this, add/change the design yourself :)
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/darkblue">
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/scrollView"
android:scrollbars="horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="33dp"
android:layout_marginTop="2dp"
android:text="Hello"
android:textColor="#FFFFFF" />
<TextView
android:id="#+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="33dp"
android:text="Hello"
android:textColor="#FFFFFF" />
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="33dp"
android:text="Hello"
android:textColor="#FFFFFF" />
<TextView
android:id="#+id/textView5"
android:layout_width="264dp"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:text="Hello"
android:textColor="#FFFFFF" />
<TableLayout
android:id="#+id/maintable"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginLeft="20dp" >
</TableLayout>
<TableLayout
android:id="#+id/maintable1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="10dp" >
</TableLayout>
<TextView
android:id="#+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#android:id/list"
android:text="Hello"
android:textColor="#FFFFFF" />
<ListView
android:id="#android:id/list"
style=" android:listViewStyle"
android:layout_width="match_parent"
android:layout_height="70dp"
android:layout_below="#+id/textView6"
android:layout_marginLeft="33dp"
android:drawSelectorOnTop="true"
android:textColor="#FFFFFF" >
</ListView>
</LinearLayout>
</ScrollView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/scrollView"
android:orientation="horizontal">
<TextView
android:id="#+id/textView8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="7dp"
android:layout_gravity="bottom"
android:text="Hello"
android:layout_marginBottom="5dp"
android:textColor="#FFFFFF"
android:textColorLink="#FFFFFF" />
<TextView
android:id="#+id/textView7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="12dp"
android:layout_marginTop="1dp"
android:layout_marginBottom="5dp"
android:text="Hello"
android:layout_gravity="bottom"
android:textColor="#FFFFFF"
android:textColorLink="#FFFFFF" />
</LinearLayout>
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="#+id/linhaCliente"
android:clickable="false"
android:paddingLeft="10dp"
android:paddingTop="10dp"
android:paddingRight="10dp"
android:paddingBottom="5dp">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:background="#drawable/pedidos_shape"
android:layout_height="wrap_content"
android:clickable="false">
<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_gravity="center_vertical"
android:layout_weight="1">
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:weightSum="1"
android:paddingLeft="10dp"
android:paddingTop="10dp"
android:paddingRight="10dp"
android:paddingBottom="5dp">
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center|left"
android:layout_weight="0.28">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/numeroPedido"
android:text="123456 "
android:textStyle="bold"
android:textSize="20dp"
android:textColor="#color/pedidos_cinza"
android:layout_marginRight="5dp"
android:paddingLeft="5dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/pedidoID"
android:visibility="gone" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center|right"
android:columnCount="2"
android:layout_weight="0.28"
android:paddingRight="30dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="19/10/2014 às 14:30"
android:id="#+id/data_criado"
android:textStyle="bold"
android:textColor="#color/pedidos_cinza"
android:textSize="15dp"
android:textIsSelectable="false"
android:editable="false"
android:focusable="false"
android:layout_marginTop="3dp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingBottom="10dp">
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center">
<LinearLayout
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center|left"
android:layout_weight="0.20"
android:paddingRight="5dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="R$ 16.450,00 "
android:textStyle="bold"
android:textColor="#color/pedido_preco"
android:textSize="#dimen/textSize2"
android:id="#+id/valorPedido"
android:paddingLeft="10dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="(Condição: "
android:textStyle="bold"
android:textColor="#color/pedido_preco"
android:textSize="#dimen/textSize2"
android:id="#+id/condicao" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="2x "
android:textStyle="bold"
android:textColor="#color/pedido_preco"
android:textSize="#dimen/textSize2"
android:id="#+id/condicaoPedido" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<View
android:id="#+id/ViewEndereco"
android:layout_height="8dip"
android:layout_width="match_parent"
android:background="#drawable/dot"
android:layerType="software"
android:orientation="horizontal" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/statusPedido"
android:text="Status"
android:textColor="#color/pedidos_cinza"
android:textStyle="bold"
android:textSize="20dp"
android:layout_marginRight="5dp"
android:layout_marginLeft="5dp"
android:padding="10dp" />
</LinearLayout>
</LinearLayout>
The above xml code gives me that result:
I need to add an arrow like the following image:
The problem is that I can't get that arrow to be aligned as it was suppose to be, either I put it aligned with the date or with the price, but I need it to be independent, exactly like the image above.
I manage that doing this:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="10dp"
android:id="#+id/linhaCliente"
android:clickable="false">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:background="#drawable/pedidos_shape"
android:orientation="vertical"
android:id="#+id/linearLayout8"
android:layout_margin="10dp">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:orientation="horizontal"
android:id="#+id/linearLayout">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:orientation="vertical">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:orientation="horizontal"
android:id="#+id/linearLayout9">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/numeroPedido"
android:text="123456 "
android:textStyle="bold"
android:textSize="20dp"
android:textColor="#color/pedidos_cinza"
android:layout_marginRight="5dp"
android:paddingLeft="5dp"
android:paddingBottom="5dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="19/10/2014 às 14:30"
android:id="#+id/data_criado"
android:textStyle="bold"
android:textColor="#color/pedidos_cinza"
android:textSize="15dp"
android:gravity="right" />
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/pedidoID"
android:visibility="gone" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:orientation="horizontal"
android:id="#+id/linearLayout10" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="R$ 16.450,00 "
android:textStyle="bold"
android:textColor="#color/pedido_preco"
android:textSize="#dimen/textSize2"
android:id="#+id/valorPedido"
android:paddingLeft="10dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="(Condição: "
android:textStyle="bold"
android:textColor="#color/pedido_preco"
android:textSize="#dimen/textSize2"
android:id="#+id/condicao" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="2x "
android:textStyle="bold"
android:textColor="#color/pedido_preco"
android:textSize="#dimen/textSize2"
android:id="#+id/condicaoPedido" />
</LinearLayout>
</LinearLayout>
<ImageView
android:id="#+id/phone"
android:layout_width="48dp"
android:layout_height="48dp"
android:clickable="true"
android:src="#drawable/ic_action_name"
android:background="?attr/selectableItemBackground"
/>
</LinearLayout>
<View
android:id="#+id/ViewEndereco"
android:layout_height="8dip"
android:layout_width="match_parent"
android:background="#drawable/dot"
android:layerType="software"
android:orientation="horizontal"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/statusPedido"
android:text="Status"
android:textColor="#color/pedidos_cinza"
android:textStyle="bold"
android:textSize="20dp"
android:padding="10dp" />
</LinearLayout>
</LinearLayout>