android-ui

Android UI examples [closed]

我只是一个虾纸丫 提交于 2019-12-02 15:54:46
I am new with Android UI and I am looking for some resources about best practices to design a UI (examples of UI elements, tutorials, etc.) I've been looking in Google or http://developer.android.com/resources/tutorials but there is nothing helpful at all. Can anyone provide me some resources/links ? There is actually a nice web which explains the most usable UI Design patters used by many apps already: http://www.androidpatterns.com/ If you have no experience with Android UI but you know a little Java already, maybe this is something for you: SimpleUi ( https://github.com/bitstars/SimpleUi )

Android - ListViews inside tableLayout

╄→尐↘猪︶ㄣ 提交于 2019-12-02 11:02:33
I'm trying to build and app that shows organized data so I'm thinking that basically a TableLayout would be a good idea, just to keep them in rows, so I'm wondering whats the correct way to do it? I have this in 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:orientation="vertical" > <TableLayout android:id="@+id/tableLayout1" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TableRow> <TextView android:layout_width="fill

Listview item's background with gradient in Fragment

℡╲_俬逩灬. 提交于 2019-12-02 09:58:48
I've got a problem, using gradient in background for listview's items inside fragment activity (using ABS). So, first of all I've got a background, that is succesfully using in other application. It has a gradient from (r = g = b = 91) to (r = g = b = 81). And thats how it looks in simple activity: And thats how it looks inside fragment activity: At first I think that it is very big gradient and I did a gradient only for 2 points, from (r = g = b = 80) to (r = g = b = 78). And thats what I gоt: I'm still want to use gradients in listview's items backgrounds in order items not seemed to be

Thumbnail does not fill_parent as expected

谁说胖子不能爱 提交于 2019-12-02 08:25:37
I'm attempting to get my thumbnail (userVideoThumbImageView) to extend to the edge of the screen but it does not seem to do so. I have the width set to fill_parent so I'm not sure why it isn't doing so: Screenshot: http://www.flickr.com/photos/110503723@N07/11207214295 list_item_user_video.xml: <?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="fill_parent" android:gravity="center_vertical" android:orientation="vertical" > <com.blundell.tut.ui.widget.UrlImageView android:id="@

Replacing a fragment does not replace the previous fragment entirely. Why so?

时间秒杀一切 提交于 2019-12-02 01:50:48
问题 I'm implementing a "fragments-101" program, where-in I replace a fragment when its corresponding button is clicked. However, the below thing happens: Why does this happen? Why is the initial fragment not replaced completely? MainActivity and both fragment xml files use LinearLayout. I searched here about the problem, and found that the replace() method can sometimes be buggy, so I tried using add(), but to no avail. There is no special code in the fragments, it's a simple hello-world-type

Get delay on UI thread

这一生的挚爱 提交于 2019-12-01 19:43:54
I'm setting color of a listview item using the following code parent.getChildAt(itemPosition).setBackgroundColor(Color.parseColor("#FF9494")); This piece of code I'm writing in OnItemClickListener . After setting the color I want to keep this color for a time of 4 Seconds and then restore the color of the item to its previous(say White). I tried putting a sleep on the UI thread, but I know that it is not a correct approach. Can anyone suggest me how to achieve this? parent.getChildAt(itemPosition).setBackgroundColor(Color.parseColor("#FF9494")); // Start new Thread that sets the color back in

keyboard hides actionbar while using adjustPan

只愿长相守 提交于 2019-12-01 17:11:11
问题 I have a chat which is "mixed", the editText and send button is in java / native and my chat system is in a server and I load it inside of a webview. I would like to adjust my webview with my keyboard when the user starts typing. I used adjustPan for that and works, but now my actionbar somehow is hidden when the keyboard is open. Here is part of my android manifest for my Activity: <activity android:name=".MainActivity" android:label="@string/app_name" android:configChanges="keyboard

How to gradient fill a button's background?

岁酱吖の 提交于 2019-12-01 10:52:04
I have to create a colored button with gradient fill(starting from the middle of the button along Y axis). If I set the background property of the button to the color I want, I lose the rounded look and feel of a button and also the gradient fill(It looks like a TextView with a background). Also, I want this color to change when the user depresses the button. Can i specify this via selector XMLs( Color State Lists )? Any tutorials or links that can help me here is appreciated. Thanks. CommonsWare How to set background color of a View You will need to define a custom StateListDrawable resource,

Android, Checkboxes Randomly Checked/Unchecked in Expandable List

丶灬走出姿态 提交于 2019-12-01 10:49:16
Using this Expandable List checkbox example code as an baseline, I am trying to save and maintain the checkbox state. However, random checkboxes are being checked and unchecked ( triggering my OnCheckedChangeListener with the new values ) when I scroll them out of sight, minimize their group, or even minimize/maximize a nearby group! public Object getChild(int groupPosition, int childPosition) { return colors.get( groupPosition ).get( childPosition ); } public long getChildId(int groupPosition, int childPosition) { return (long)( groupPosition*1024+childPosition ); // Max 1024 children per

Android, Checkboxes Randomly Checked/Unchecked in Expandable List

只谈情不闲聊 提交于 2019-12-01 10:19:06
问题 Using this Expandable List checkbox example code as an baseline, I am trying to save and maintain the checkbox state. However, random checkboxes are being checked and unchecked ( triggering my OnCheckedChangeListener with the new values ) when I scroll them out of sight, minimize their group, or even minimize/maximize a nearby group! public Object getChild(int groupPosition, int childPosition) { return colors.get( groupPosition ).get( childPosition ); } public long getChildId(int