com\maxmpz\audioplayer\widget\listwrappers\D800DC00 這個(gè)package 主要用于 PlayList 模型的操作。
com\maxmpz\audioplayer\widget\listwrappers\D800DC00\D803DC04.java
里面有個(gè)
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;
}
{
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 實(shí)現(xiàn)控件屬性與XML定義綁定的代碼。
TypedArray其實(shí)就是一個(gè)存放資源的Array,首先從上下文中獲取到R.styleable。。。這個(gè)屬性資源的資源數(shù)組。 attrs是構(gòu)造函數(shù)傳進(jìn)來(lái),應(yīng)該就是對(duì)應(yīng)attrs.xml文件。 a.getString(R.styleable。。。);這句代碼就是獲取attrs.xml中定義的屬性,并將這個(gè)屬性的值傳給本控件的mValue.最后,返回一個(gè)綁定結(jié)束的信號(hào)給資源:a.recycle();綁定結(jié)束
相關(guān)學(xué)習(xí)文章:http://blog.csdn.net/aomandeshangxiao/article/details/7449973
com.maxmpz.audioplayer.widget.listwrappers.0xE9 這個(gè)類,用于顯示文件夾列表,右上方有2個(gè)自定義的RadioButton,用來(lái)設(shè)置是平鋪模式顯示還是層級(jí)顯示。
定義了一個(gè)ID為:flat_hier_group 的RadioGroup,里面有個(gè)2個(gè)自定義的RadioButton。
matte_flat_folders_selector的XML定義為:
定義了一個(gè)ID為:flat_hier_group 的RadioGroup,里面有個(gè)2個(gè)自定義的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>
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>
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實(shí)際上就是張背景透明的圖片罷了。
播放器列表的Layout布局文件為 list_with_big_header.xml。
里面有個(gè)android:ellipsize屬性:
EidtText和textview中內(nèi)容過(guò)長(zhǎng)的話自動(dòng)換行,使用android:ellipsize與android:singleine可以解決,使只有一行。EditText不支持marquee
關(guān)于android:ellipsize屬性更詳細(xì)的文章:http://www.cnblogs.com/chiao/archive/2011/08/20/2147250.html
里面還有個(gè) android:textAppearance 屬性,這里涉及到了Android的theme和style設(shè)置了,更詳細(xì)的文章參見:http://jiayanjujyj.iteye.com/blog/1392541