You can override everything and create it from scratch. First create an xml describing the content you want. For example:
<!-- test.xml -->
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/white">
<ImageView android:id="@+id/ImageView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/facebook"></ImageView>
<TextView android:id="@+id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/ImageView01"
android:text="Facebook"
android:textSize="40sp"></TextView>
<RadioButton android:id="@+id/RadioButton01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/TextView01"></RadioButton>
</RelativeLayout>
Then build this xml using the alert dialog. You can let the activity handle your dialog and just override the onCreateDialog like this:
@Override
protected Dialog onCreateDialog(int id) {
View view = LayoutInflater.from(MainActivity.this).inflate(R.layout.test, null);
return new AlertDialog.Builder(MainActivity.this).setView(view).setTitle("Share")
.create();
}
You can then override onClick to store the state in your StaticPreferences files. This way you'll have complete control over all the elements in your view.
One final piece of advice, when creating the xml make sure that you create as flat a layout as possible so that the code is optimized. You can also play with the list layout to create something like this.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…