android-ui

Disabling the send button when the EditText is empty when using imeOption= actionSend

烂漫一生 提交于 2019-11-30 18:04:01
问题 When the text is empty, we want to disable the button (which is how it's set on portrait mode) Any ideas? Edit: I don't think it's clear but I can enable/disable my own button.. But when using the landscape mode, when the keyboard pops up, the screen is covered by an android specific text area with it's own button (hence the imeOption) So I don't have a problem enabling/disabling the button I have.. It's this Android button that I want to disable when the text area is empty.. 回答1: Add a

How to Customize AppCompat Material Button Style?

巧了我就是萌 提交于 2019-11-30 17:53:07
I am using the AppCompat theme and I want set the minHeight attribute on my buttons: <style name="Theme.MyTheme" parent="Theme.AppCompat"> <item name="android:buttonStyle">@style/MyButtonStyle</item> </style> <style name="MyButtonStyle" parent="...?"> <item name="android:minHeight">60dp</item> </style> However, there is no Widget.AppCompat.Button style to set as the parent for MyButtonStyle . If I use android:Widget.Button , then all my buttons look like the old crappy style. I tried various other AppCompat themes like TextAppearance.AppCompat.Button , but they do not work. Leaving out a

Android, concerning the User Interface design

大憨熊 提交于 2019-11-30 16:17:27
问题 the more I read the Supporting Multiple Screens guide, the more I get confused. if the layout folder's qualifier is based on size ( small, normal, large and xlarge ) and the drawable folder's qualifier is based on density ( ldpi, mdpi,hdpi and xhdpi ), then how can I specify the size of the drawables/images?? should all the images inside the drawable folders have the same size (based on the normal screen size) but different densities ( i.e. pic.png inside drawable.ldpi has the same width and

Android, concerning the User Interface design

最后都变了- 提交于 2019-11-30 15:58:08
the more I read the Supporting Multiple Screens guide, the more I get confused. if the layout folder's qualifier is based on size ( small, normal, large and xlarge ) and the drawable folder's qualifier is based on density ( ldpi, mdpi,hdpi and xhdpi ), then how can I specify the size of the drawables/images?? should all the images inside the drawable folders have the same size (based on the normal screen size) but different densities ( i.e. pic.png inside drawable.ldpi has the same width and height of pic.png inside drawable.mdpi but has different density)?? the problem is that each screen

List view with custom view items with partially overlaps (Android)

被刻印的时光 ゝ 提交于 2019-11-30 15:57:00
问题 I want to implement a list in Android that contains some customized views. My problem is that I want the the views will be put one after the other with a little overlap between them. like in the following schema: I also want to control this overlap in such a way that when the user clicks on one of the items, they will move apart from each other. I tried to extend ListView but it seems to be very obscured, any suggestions? Edit: This can be more clear: I did it by setting the divider height to

List view with custom view items with partially overlaps (Android)

£可爱£侵袭症+ 提交于 2019-11-30 15:26:40
I want to implement a list in Android that contains some customized views. My problem is that I want the the views will be put one after the other with a little overlap between them. like in the following schema: I also want to control this overlap in such a way that when the user clicks on one of the items, they will move apart from each other. I tried to extend ListView but it seems to be very obscured, any suggestions? Edit: This can be more clear: I did it by setting the divider height to -50dp. this is exactly what I want to achieve, but somehow it doesn't reflect on my app. Marc Van

Android 3.0 CalendarView

别说谁变了你拦得住时间么 提交于 2019-11-30 15:07:31
问题 I'm trying to implement a CalendarView, it takes an absurd amount of time (about 10 seconds) to appear on screen and it only loads the month and weekday headers, it does not display any calendar content. Using the same code from this video but not seeing the same result. I'm trying to launch it in a dialog: CalendarView calendarView = new CalendarView(this); dialog.setContentView(calendarView); but when I tried to embed it in an activity it took the screen the same amount of time to load and

Android 3.0 CalendarView

我怕爱的太早我们不能终老 提交于 2019-11-30 13:36:45
I'm trying to implement a CalendarView , it takes an absurd amount of time (about 10 seconds) to appear on screen and it only loads the month and weekday headers, it does not display any calendar content. Using the same code from this video but not seeing the same result. I'm trying to launch it in a dialog: CalendarView calendarView = new CalendarView(this); dialog.setContentView(calendarView); but when I tried to embed it in an activity it took the screen the same amount of time to load and similarly failed to display correctly. The tracing helped reveal that GregorianCalendar was being

Android: How to build tabs like the ones show on Android UI Page

假如想象 提交于 2019-11-30 09:59:50
So android goes out of its way to build this nice UI guide for everyone to use. But I don't see anywhere where it shows code examples of how to build these elements. The UI guidelines for tabs can be found here. http://developer.android.com/design/building-blocks/tabs.html . Does anyone know how to create tabs likes the this one? Any help would be appreciated, thanks. SOLUTION POSTED Ok, so here is what I ended up doing after probably wasting about 10 hours trying to make some good looking tabs. First I scrapped the whole idea of using android's implementation of tabs. For one reason the tab

Creating ring shape in Android code

℡╲_俬逩灬. 提交于 2019-11-30 08:53:05
问题 I have the following shape XML: <?xml version="1.0" encoding="utf-8"?> <shape xmlns:a="http://schemas.android.com/apk/res/android" a:shape="ring" a:innerRadiusRatio="3" a:thicknessRatio="8" a:useLevel="false"> <!-- some other stuff goes here --> </gradient> </shape> I would like to use code instead to create this shape, since some things need to be calculated on the fly before I do it, so static pre-defined layout doesn't cut it. I'm new to Android and can't quite figure out how XML