PowerAMP代码的研究……

PowerAMP代码的研究……
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

你可能感兴趣的:(PowerAMP代码的研究……)