android-layout

how to set a footer at top layer of the app in android?

i want set my footer at the top layer of my app. it should not have any shakes and moves while the activity navigation or showing up the keyboard. it should always settled in the bottom of the screen. how to do that? any ideas plz. ...

LinearLayout not expanding inside a ScrollView

I have a LinearLayout inside a ScrollView that has android:layout_height="fill_parent", but it doesn't expand to the full height of the ScrollView. My layout looks something like: level layout layout_width layout_height 1 LinearLayout fill_parent fill_parent 2 LinearLayout fill_parent wrap_content 3 (some i...

Android layout with 2 evenly spaced Buttons

I have this layout that works correctly, a relative layout with a text view and two buttons spaced evenly below it. <RelativeLayout android:id="@+id/entrypopup" android:layout_width="fill_parent" android:layout_height="wrap_content" android:padding="5px" android:visibility="gone" android:layout_below="@+id/ad" ...

What is the object of the Contact application search option ?

Hi all, I am wondering what is the kind of object that shows up when in the Contact application, you hit search option, what is it ? a Custom Quick Search Bar, a custom notificaction bar, other idea ... An image of what I am talking about is available here : http://www.developpez.net/forums/attachments/p60921d1270798944/java/general-ja...

How to manage a MotionEvent going from one View to another?

I have a SurfaceView that takes up part of the screen, and some buttons along the bottom. When a button is pressed and the user drags, I want to be able to drag a picture (based on the button) onto the SurfaceView and have it drawn there. I want to be able to use clickListeners and the like, and not just have a giant SurfaceView with m...

How to do this layout? (Link on Image)

Hi all, I was wondering how to obtain this result : http://img718.imageshack.us/img718/6173/screenshot20100411at126.png This is what I tried : <RelativeLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="#CCCCCC" android:orientation="...

Snapping elements / conditional layouts

Sorry for the extremely bad title, I have no other idea what to call this question. What I'm trying to do is this: have a RelativeLayout which has two children: one with layout_centerInParent="true" one with layout_alignParentBottom="true" However, when the device is in landscape mode, element (1) appears slightly over or under eleme...

Can I add a portrait layout on top of a landscape Camera SurfaceView?

My application should hold a camera preview surface. The camera is fixed to landscape view via AndroidMainfest.xml <application android:icon="@drawable/icon" android:label="Camera"> <uses-library android:name="com.google.android.maps" /> <uses-feature android:name="android.hardware.camera" /> <uses-feature android:name...

Problem with Android Layout

I'm having a very hard time getting the 2 buttons in the 2nd child linearlayout to display as I want them to... I want them centered, on the same row but they appear left-aligned and on the same row. Can anyone help me with this? <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/andro...

How to align Buttons in a TableLayout to different directions?

Hello, probably I don't understand the layout properties of TableLayout yet. It doesn't seem to be possible to achieve such a flexible table like in HTML, because there are no cells. My target is it to achieve such a layout: Link to draft How can I do that? I thought about using a GridView but this doesn't seem to be useful in XML. My...

Activity should be transparent, but has black background

My use case is writing an overlay controller activity for a landscape camera preview. I followed the instructions from a couple of tutorials for writing a transparent theme. So my res/values/style.xml looks like this: <resources> <style name="Theme" parent="android:Theme" /> <style name="Theme.Transparent"> <item name="andr...

Android Runtime Layout Tutorial

Does anyone know how to perform or have a good reference for doing an activity layout at runtime in android? Here is the code for my activity. I'm sure I'm just neglecting to do something here: package com.isi.sa; import android.app.Activity; import android.os.Bundle; import android.widget.LinearLayout; import android.widget.TextView;...

Any way to change the color of a radio button?

I'm working on an android form with a radio group containing a set of radio buttons. From what I can tell there is no way to set the color a radio button highlights when you select it. It seems to always default to some bright green color. Is this something that is editable or no? Thanks ...

Radio Buttons not highlighting as though they are selected

I'm working on an android activity with a RadioGroup containing 10 RadioButtons. For some reason or another sometimes, only sometimes, when you select a RadioButton in the RadioGroup it doesn't highlight as if it's selected but through some tests I've determined that it really IS selected even though it isn't highlighted. Another odd thi...

Setting an ImageView resource as a Drawable.

Hey Everyone, I am trying to create a drawable in code and change the color based on some criteria. When I try and set the Drawable as the background of the ImageView it displays but won't let me set any padding. I realized I need to set the ImageView image via the setImageDrawable() function in order to be able to set the padding. T...

Background Image Placement

Hi, I'm trying to set my root LinearLayout element (which is set to fill_parent in both dimensions) to have a background image which is always located in the lower left corner of the screen no matter the orientation of the device. It would be excellent if there were some way to set the background image position such as that which you ca...

How can I specify a dynamic height for an ImageView?

I have an ImageView at the top of my display that looks like the following: ╔══════════════════════════════════════════════╗ ║ ImageView ╔══════════════╗ ║ ║ ║ ║ ║ ║ ║ Actual image ║ ║ ║ ║ ║ ║ ║ ║ ...

Tunning up Activity with dialog theme

I need to launch a Dialog from home screen widget, so I created an Activity with android:theme="@android:style/Theme.Dialog" The problem is, that I would like make it look like standard dialog window ( buttons on the gray background, font and text size, paddings etc), like here: This is how my "dialog" Activity looks like: Is ther...

How to implement custom view with variable fields?

I have a ListView that displays a set of notes, each with varying ammounts of data (i.e. some have a due date, others don't). Currently, each view in the list is a RelativeLayout containing a TextView for each field, plus two Button and a CheckBox. I then simply hide the unused fields by setting visible false on each one. This has wor...

Interface Builder(User Interface Designer) for Android

I am working on Android since last 7 months....Also knowing brief about I-phone application. In Android, There is a bad layout editor in Eclipse, but it's neither good nor User Friendly as I-phone Interface Builder is. Is there any visual designer that would be on par with the iPhone "Interface Builder" ? Ya, DroidDraw is there but n...