Change Android AnalogClock Color - android-widget

I try to change the AnalogClock color.
I want it Black instead of White.
Anybody know how can I overide this widget theme.
Thanks a lot .
<AnalogClock
android:id="#+id/analogClock1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="40dp"
android:layout_marginTop="500dp" />

You can change the images of the dial, hand_hour and hand_minute:
<AnalogClock
android:id="#+id/analogClock1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
**android:dial="#drawable/my_dial_image"
android:hand_hour="#drawable/my_hand_hour_image"
android:hand_minute="#drawable/my_hand_minute_image"** />
Eduardo
connect-motion.com

Related

text in textview seems to be in white color in real device but in emulator is OK

The properties in a vertical layout are
<LinearLayout
android:id="#+id/buscador"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="10dp"
android:focusable="false"
android:focusableInTouchMode="false"
android:orientation="horizontal" >
<AutoCompleteTextView
android:id="#+id/autoCompleteTextView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:hint="#string/searchcity"/>
<Button
android:id="#+id/button1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="2"
android:text="#string/climaB" />
</LinearLayout>
In the Eclipse emulator for Android 3.0, the submitted text is perfectly seen but in my Android Froyo tablet it is not >:( . The app has minimun SDK = 8. Somebody had the same issue? What can be going on ? I also tried with Plain text TextView but in this case there was not problem neither of both, emulator and device. Sorry, forget to mention that the text in the textview is in color white when run the app in the Tablet, in the emulator is visible in dark color (black).
For Tablet and some android versions default Text Color is white , That is why you are getting white text color, add android:textColor attribute
check if you have dark mode on. If yes try again after disabling it.

TabWidget background color on Samsung devices

My TabWidget's background color is light grey on HTC and Nexus devices...however it's blue-ish/dark grey on Samsung devices. Why is that? I'm even using a custom theme for the tabwidget, as created by android-holo-colors.com
Here's the style and the layout for the tab:
<style name="AppBaseTheme" parent="android:Theme.Light">
</style>
<style name="TabMyTheme">
<item name="android:gravity">center_horizontal</item>
<item name="android:paddingLeft">16dip</item>
<item name="android:paddingRight">16dip</item>
<item name="android:background">#drawable/mytheme_tab_indicator_holo</item>
<item name="android:layout_width">0dip</item>
<item name="android:layout_weight">1</item>
<item name="android:minWidth">80dip</item>
</style>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="#dimen/tab_host_default_height"
android:orientation="horizontal"
style="#style/TabMyTheme"
android:gravity="center">
<ImageView
android:id="#android:id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal"
android:visibility="gone"
android:adjustViewBounds="true"
android:scaleType="fitCenter"
android:contentDescription="#null" />
<TextView
android:id="#android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
style="#style/TabTextMyTheme" />
</LinearLayout>
I believe the problem is the fact that the default look of tabs is different for Samsung, and given that the background images generated by android-color-colors are transparent on top, and have the color just for the bottom part (ie: the thin or thick colored line at the bottom of each tab), on the top they just use the system default color.
I changed each and every image generated by the website, replacing the transparent color with my grey, and now it looks fine everywhere.

How to change subtitle color in listVIew

I have a listView. Each list item consists of a title and a subtitle under title. I want to change the color of the subtitle. Please help me to change.
This is the layout you can use to make a different color textview for your subtitle:
<?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"
android:background="#999999">
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Large Text"
android:textAppearance="?android:attr/textAppearanceLarge" />
Color Change on this text view
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Small Text"
android:textColor="#FFFFFF"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
After this you can make your own adapter and inflate your row and you will get the different color on your txtview in the listview you mentioned.
Hope this helps.

TextView blocking ListView onItemClickListener

I have simple list view with list items defined by following layout:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/list_item_selector" >
<TextView
android:id="#+id/menuItemTextView"
android:clickable="false"
android:focusable="false"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:background="#00000000"
android:padding="20dp"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/blue"
android:textIsSelectable="true" />
<ImageView
android:id="#+id/arrow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:paddingRight="10dp"
android:src="#drawable/arrow" />
> </RelativeLayout>
When I click TextView the listView.onItemClickListener is not called. The problem occurs on Android 4. Android 2.x is OK. Is there any trick to pass an event from TextView to its ListView without defining onClickListner on the TextView?
In your main activity just make you listview as focusable true. This worked for me. If you are using a custom list view the focus is passed to its childs and not the list so to get the focus back to listview use
listView.focusable(true);
and the other things as textview just set their focus as false.
It was the android:textIsSelectable="true" attribute. Don't follow lint hints blindly.
android:inputType="textMultiLine" can also cause this problem. If you've included that attribute in your TextView xml, try removing it.

Can any one point me to this "Take a picture" widget in google plus android app. Want to know how to create a UI of that type

Can any one help me out how how this widget can be developed as in attached.The widget in the attached is of "Take a photo" or select photo" UI. Just want to know how can we create this UI widget. Any tutorials/and discussions/reference would help.Thank You.
Use hierarchyviewer tool from Android SDK. I tried.
You can learn that this menu is a custom baked dialog or activity, created from FrameLayout, ScrollView, LinearLayout and Buttons.
So to make one, you'll have to roll your own in similar style.
Here is how the xml would look like. You'd have to have a background for the FrameLayout and also 2 for the buttons. One with a full rectangle and the other without the top line. Then some margins/paddings tweaking and you should be fine.
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ScrollView
android:id="#+id/scrollView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<LinearLayout
android:id="#+id/linearLayout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" android:layout_gravity="center_vertical|center_horizontal">
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" android:background="#444" android:textColor="#fff" android:layout_marginBottom="1dp"/>
<Button
android:id="#+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" android:background="#444" android:textColor="#fff"/>
</LinearLayout>
</ScrollView>
</FrameLayout>
Note: this is based on Mice's answer.
I don't think its native android widget. May be you can find it on github try searching over there.
Use GreenDroid library, it has what you are looking for. It is a nice library with host of features. To test it download this sample application