Custom widget in Android - android

I need to customize my Android application for ancient people, which typically have vision problems.
If is not so difficult increase the font size of EditText or TextView fields, I can't say the same about the TimePicker , DatePicker or NumberPicker. For these widget I think that I can't change the size. Right?
Someone knows how can I solve this problem? I need to create a custom plugin? If so, where I can found materials for this purpose?

What you want is call "Custom Widget" or "Custom View"
FYI : http://www.vogella.com/articles/AndroidCustomViews/article.html

Related

Adapting AlertDialog to a specific design

I need to edit default AlertDialog theme so that it will look like part of the design of my app. I don't want to create a whole new theme for it. I will just play with its own properties and make small changes. But the problem is I can't manage to reach the source code and I don't know what kind of attributes it has.
What I need to do is basically to give background a little transparency and roundness.
Does anyone know where can I get the AlertDialog style code? And which attributes do I need to edit for transparency and roundness of background?
Thanks.
Here's the style code for AlertDialog: https://github.com/android/platform_frameworks_base/blob/master/core/res/res/values/styles.xml
I don't know how to change it the way you want though.

Best Way to Implement Window + Multiline Text in Android

I'm really new to Android development. I have no idea what search keyword should I use for this.
Is it possible to create something like this in Android?
What component should I use for the window and also the text?
Thank you very much!
You could re-style an AlertDialog for the window (see the guide). Text is normally shown in a TextView.
For setting the TextView to multi-line, there is the android:inputType-attribute.

Android Font Change

I am trying to create an android app that will change the font at the push of a button. I have searched through stackoverflow and other sites on Google, but have come up empty handed. I am using Eclipse. The goal is to be able to simply touch a button that reads "times new roman" and then have the text above change to that font. I found people trying to change the font in Eclipse, or simply the default font for their app, but not have the user be able to change it. I got this idea after finding an app that changes background colors. Does anyone know what code I need for the buttons?
Typeface is what you are looking for.
In the onclicklistener of the button, try something like
TextView txt=(TextView)findViewById(...);
Typeface tf=Typeface.createFromAsset(...);
txt.setTypeface(tf);

Android Dropdown List (iPhone style)

Could anyone tell me either what this widget is or how it could be recreated? I'm having to port over a iPhone app, and my boss wants me to make it look as similar as possible, but while using android controls. Here is a picture of it in Android:
http://cdn3.staztic.com/screenshots/android-swim-32-2.jpg
Thanks!
It is not a standard thing, but for this purpose, there is a: QuickAction dialog.
this can be done with a PopupWindow (it can also be shown as dropdown) where the background is a custom nine-patch file and the content is a listview (or any other view that fits your needs).
I'm sure that GreenDroid Library can do this but I don't know the name of the class to use

Building an Android button with pictures and text

I am looking to build a button in my Android app which must contain:
A background picture
A picture
Some text
I am coming from iPhone dev and I am a little bit confused by Android development.
While I could addSubView: UIImageView or UILabel to my UIButton, I can't use addView() with a android.widget.Button :(
Does anyone have a solution?
EDIT : Thanks everybody for answers. I forgot to specify I have to do it programmatically, without using XML. I don't know how many element I will display (it depends on RSS).
android:background for background ... remeber that you can build your own 9 patch
android:drawableLeft, android:drawableRight, android:drawableTop, android:drawableBottom to add some picture to the left, right, ... of text
EDIT: i didn't mention ... but i was talking about android.widget.Button
2nd EDIT: after you provide more information i think that all what you need is ListView
check this sample http://esilo.pl/LooserSample.zip (don't take "looser" to yourself, it was sample for another guy)
it showing how to
download a JSON data
store it in db
build ContentProvider for sharing a data
use ContentProvider to take data from db and show it in ListView
dynamic loading images from internet
for simpler sample use your sdk samples like this C:\android\android-sdk-windows\samples\android-8\ApiDemos\src\com\example\android\apis\view\List*.java
if you alrady have code for downloading and storing data from RSS in array extend ArrayAdapter to fit your needs
Most, if not all, of the UI for android is built in the XML. Kind of like the UI builder in Xcode, but not near as advanced. The ADP will let you view the UI you have built in Eclipse, and adjust some basic widget properties.
I believe for what you are trying to do, if I understand right, you need to use an ImageButton widget. This widget allows you to use a complete image as a button. You can also define your own states (button pressed, gain focus, etc) with both the button and image button widgets. You can define a background and add images to both widgets.
More information here

Categories

Resources