Assistance required for designing a Customized Android View -
i'm designing simple multimeter look-alike android app. idea have rotary control knob control enable me select parameter want measure. i.e voltage, current or resistance.
although i'm quite clear functionalities (w.r.t multimeter inner workings), i'm falling short of ideas ui.
with inkscape able create stylish multimeter alike image , rotary select knob. idea use multimeter image background , rotary knob placed on top of multimeter image. also, should able rotate image of knob using matrix class available in android.graphics.matrix
the question how design such thing in android ?
should have use compound views in android or
should have create custom views , include in main layout file. ?
or there better solution make use of ?
any appreciated.
cheers vatsa
here recent project:
view (controller_activity.xml):
<?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"> <imageview android:id="@+id/controller_image" android:src="@drawable/your_knob_image" android:layout_margintop="10dp" android:layout_alignparenttop="true" android:layout_centerhorizontal="true" android:scaletype="matrix" android:layout_width="wrap_content" android:layout_height="wrap_content"> </imageview> </relativelayout> activity (controlleractivity.java) (logic [and rest] http://hub.tutsplus.com/tutorials/android-sdk-creating-a-rotating-dialer--mobile-8868):
public class controlleractivity extends activity { //your fields @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); requestwindowfeature(window.feature_no_title); setcontentview(r.layout.controller_activity); imageview controllerimage = (imageview) findviewbyid(r.id.controller_image); //the rest link } }
Comments
Post a Comment