Creating custom XML widgets for Android UI
-
25-09-2019 - |
Question
I'm trying to encapsulate certain layouts that I've made, to help me dry up my android xml ui files.
I have the following code:
<LinearLayout
android:id="@+id/LinearLayout02"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="horizontal">
<TextView
style="@style/text_view_small"
android:id="@+id/time"></TextView>
<TextView
style="@style/text_view_small"
android:id="@+id/number_of_worlds">
</TextView>
</LinearLayout>
I want to simply convert it to the following
<DoubleTextView></DoubleTextView>
Once done I want to be able to use the "widgit" in other xml files. Are there any particular resources or examples that I can look at to help me figure out how to do this?
Solution
I like this explanation better: Declaring a custom android UI element using XML
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow