Android view layout design help - android

Last week i started to develop an android app and almost done the coding part but the layout design for the app is too confusing...
The following is the design what i wanted,
Anyone please give me the coding part to create the design/layout. Thanks in advance...

This may be helpful - http://developer.android.com/resources/articles/layout-tricks-efficiency.html.
Also read about ListView (http://developer.android.com/resources/tutorials/views/hello-listview.html)

Have a look on the code. It wil produce the result exactly same as you want.
Donot forget to vote the answer.
have a look here also
<?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:background="#ffffff">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/a_thumb" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20sp"
android:text="name"
android:textColor="#000000"
android:layout_marginBottom="5dip" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="data"
android:textColor="#000000" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Time-Like-Comment"
android:textColor="#000000"
android:typeface="sans"
android:textSize="12sp"
android:layout_marginTop="5dip" />
</LinearLayout>
</LinearLayout>
Thanks
Deepak

You should check , creating custom listview , and all the things you require can easily be achieved.
Check here,
http://www.softwarepassion.com/android-series-custom-listview-items-and-adapters/

Related

navigation drawer test not showing

I have problem when I add text in arabic lag
it showing from right side
enter image description here
can you please help me to fix it?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:weightSum="2"
android:padding="5dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:tint="#000"
android:id="#+id/imgIcon"
android:layout_width="40dp"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:layout_marginRight="15dp"
android:layout_marginEnd="15dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp" />
<TextView
android:id="#+id/txtTitle"
android:layout_weight="1"
android:fontFamily="curier"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:textSize="17dp"
android:textColor="#ff0000"
android:text="#string/app_name"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp" />
</LinearLayout>
android:textDirection="locale"
This answer provided in the below link:
How to make the text direction from right to left
I don't have points to put this in comments. Please refer above link you can get. By default arabic text will get showed from right side from latest version. Arabic text letters will always start from right that's the reason.
Thank you

Custom Header in Mono for Android App

I'm working on my first app using Mono for Android. I feel like I'm trying to do something basic but I'm not having any luck. Essentially, I want to have a custom "banner" at the top of my app. The banner is simply a black rectangle with two words: "Hello" and "World". Hello is in red, and World is in Blue.
I'm not getting anywhere with this. Does anyone know how to do this?
Thank you!
Here is a very basic layout example to get you started.
<?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" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#000000"
android:padding="5dp" >
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="2dp"
android:text="Hello"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#FF0000" />
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="World"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#0000FF" />
</LinearLayout>
<!-- The rest of your activity layout goes here. -->
</LinearLayout>

Center This Android Layout?

I can't for the life of me figure out how to get my box centered on BOTH the horizontal and vertical.
Heres my 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="match_parent"
android:background="#drawable/dragon"
android:orientation="vertical" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="#drawable/playerinfosquare"
android:orientation="vertical">
<TextView
android:id="#+id/spellinfotitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_margin="10px"
android:text="Spellventory"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/spell1info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_margin="10px"
android:text="No Spell Equipped"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/spell2info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_margin="10px"
android:text="No Spell Equipped"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/spell3info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_margin="10px"
android:text="No Spell Equipped"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
</LinearLayout>
Help?
Are you kidding me? Stack overflow thinks it knows better than me and says that I don't have enough content to explain my code sections. Well, here you go! This is what you get for having arbitrary rules that don't always make sense.
Put your second LinearLayout into a RelativeLayout. You can then center it much easier by setting
android:layout_centerInParent="true"
on the second LinearLayout
You need to set android:gravity="center" on your first LinearLayout.

Tabactivity android Vs Iphone

hi i just fixed the issue i had with
my application, now i am stuck with
another problem, please help :)
most of my code is here
"unknown Exception android"
now i want to make my main page look like this as shown in iphone
application given below,
"http://wwwm.coventry.ac.uk/app/Pages/iPhoneApp.aspx"
i dont know if i need to use tab activity or option menu or inflator,
as for call, email and web, i will have to call services as far as i
know.
and last if i can see any tutorial or code which will help me to solve my
problem, please give me a link.
thanks alot**
Main.xml looks like this
<?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"
>
<AbsoluteLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="#+id/AbsoluteLayout01">
<TextView android:layout_x="61dip" android:layout_y="176dip" android:id="#+id/TextView02" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="#string/courses"></TextView>
<ImageButton android:id="#+id/CoursesButton" android:layout_x="62dip" android:layout_y="107dip" android:background="#drawable/a" android:layout_height="65dp" android:layout_width="65dp"></ImageButton>
<TextView android:gravity="center" android:textSize="25dp" android:layout_height="wrap_content" android:layout_width="fill_parent" android:text="#string/LabelNescot" android:layout_x="1dip" android:layout_y="39dip" android:id="#+id/TextView"></TextView>
<ImageButton android:id="#+id/ILoveNescotButton" android:background="#drawable/b" android:layout_height="65dp" android:layout_width="65dp" android:layout_x="179dip" android:layout_y="106dip"></ImageButton>
<ImageButton android:id="#+id/GettingHereButton" android:background="#drawable/d" android:layout_height="65dp" android:layout_width="65dp" android:layout_x="185dip" android:layout_y="208dip"></ImageButton>
<TextView android:id="#+id/TextView05" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="#string/Directions" android:layout_x="182dip" android:layout_y="283dip"></TextView>
<TextView android:id="#+id/TextView03" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="#string/facility" android:layout_x="180dip" android:layout_y="177dip"></TextView>
<ImageButton android:background="#drawable/c" android:id="#+id/CampusMapButton" android:layout_height="65dp" android:layout_width="65dp" android:layout_x="48dip" android:layout_y="208dip"></ImageButton>
<TextView android:text="#string/Map" android:layout_height="wrap_content" android:id="#+id/TextView04" android:layout_width="wrap_content" android:layout_x="37dip" android:layout_y="285dip"></TextView>
</AbsoluteLayout>
z
</LinearLayout>
Hello Tab Layout.

ListActivity layout Custom

I'm trying to make a list where each row has a text at the top and bottom and another one image aligned right (like the image attached).
but I can not. Could anyone help me?
sample image:
http://www.freeimagehosting.net/uploads/fb6e2055f5.png
There are plenty of tutorial and questions about it.
Just to mention a few from a google search:
http://www.softwarepassion.com/android-series-custom-listview-items-and-adapters/
http://developerlife.com/tutorials/?p=327
http://tech-droid.blogspot.com/2009/07/custom-listview-for-android.html
I didn't test it, but your row xml should be something like this:
<?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="wrap_content">
<TextView android:id="#+id/green_title"
android:textSize="25sp"
android:textColor="#00FF00"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="Text1"/>
<TextView android:id="#+id/sub_title"
android:textSize="15sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/green_title"
android:text="Text2"/>
<ImageView android:id="#+id/image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/image"
android:layout_alignParentRight="true"
android:layout_below="#id/green_title"/>
</RelativeLayout>

Categories

Resources