Hi All,
Wondering if you all can input your 2 cents. I am trying to learn more about
Android graphics. I am trying to put a VU meter on my application. Don't
worry about how the level readings are created and other backend aspects. I
am more interested in learning how to present the the levels (using gradient
colors) on the application.
What I have created so far is a vertical line using:
<View
android:id="@+id/vuView"
adroid:layout_width="10px"
android:layout_height="180px"
android:background="@drawable/vu_meter1"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true">
</View>
And I have created a drawable file which specifies the gradient color for
the vertical line. Basically red at the top, yellow in the center and green
at bottom. Here is the vu_meter1.xml file
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:startColor="#d70344"
android:centerColor="#eef114"
android:endColor="#0ce10c"
android:angle="270" >
</gradient>
</shape>
So far so good. What I am trying to achieve is:
1. When I receive some reading from external source I need to accordingly
show the relevant colors on this vertical line. How can I do this? How can I
dim/hide the rest of the vertical line? I would prefer to dim the
non-relevant levels rather than hiding it.
2. Is there a better approach to achieving what I am trying to do?
Thanks
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en