com\maxmpz\audioplayer\widget\listwrappers\D800DC00 這個package 主要用于 PlayList 模型的操作。
com\maxmpz\audioplayer\widget\listwrappers\D800DC00\D803DC04.java
里面有個
private static int D801DC01(Activity activity, int i)
{
TypedArray typedarray = activity.obtainStyledAttributes(null, com.maxmpz.audioplayer.j.true.p, 0, 0);
int j = typedarray.getResourceId(i, 0);
typedarray.recycle();
return j;
}
Context.obtainStyledAttributes 實現控件屬性與XML定義綁定的代碼。
TypedArray其實就是一個存放資源的Array,首先從上下文中獲取到R.styleable。。。這個屬性資源的資源數組。 attrs是構造函數傳進來,應該就是對應attrs.xml文件。 a.getString(R.styleable。。。);這句代碼就是獲取attrs.xml中定義的屬性,并將這個屬性的值傳給本控件的mValue.最后,返回一個綁定結束的信號給資源:a.recycle();綁定結束
相關學習文章:http://blog.csdn.net/aomandeshangxiao/article/details/7449973
com.maxmpz.audioplayer.widget.listwrappers.0xE9 這個類,用于顯示文件夾列表,右上方有2個自定義的RadioButton,用來設置是平鋪模式顯示還是層級顯示。
定義了一個ID為:flat_hier_group 的RadioGroup,里面有個2個自定義的RadioButton。
<RadioGroup android:gravity="right" android:orientation="horizontal" android:id="@id/flat_hier_group" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_centerVertical="true"
xmlns:android="http://schemas.android.com/apk/res/android">
<RadioButton android:id="@id/flat_folders_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="0.0dip" android:button="@drawable/matte_flat_folders_selector" />
<RadioButton android:id="@id/hier_folders_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="-8.0dip" android:button="@drawable/matte_hier_folders_selector" />
</RadioGroup>
matte_flat_folders_selector的XML定義為:
<selector
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true" android:drawable="@drawable/matte_flat_folders_selected" />
<item android:state_checked="false" android:drawable="@drawable/matte_flat_folders" />
</selector>
自定義的RadioButton實際上就是張背景透明的圖片罷了。
播放器列表的Layout布局文件為 list_with_big_header.xml。
里面有個android:ellipsize屬性:
EidtText和textview中內容過長的話自動換行,使用android:ellipsize與android:singleine可以解決,使只有一行。EditText不支持marquee
關于android:ellipsize屬性更詳細的文章:
http://www.cnblogs.com/chiao/archive/2011/08/20/2147250.html
里面還有個 android:textAppearance 屬性,這里涉及到了Android的theme和style設置了,更詳細的文章參見:http://jiayanjujyj.iteye.com/blog/1392541