Feeling

              三人行,必有我師焉

             ::  :: 新隨筆 :: 聯系 ::  :: 管理 ::
            185 隨筆 :: 0 文章 :: 392 評論 :: 0 Trackbacks
          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, 00);
                  
          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
          posted on 2012-05-23 11:59 三人行,必有我師焉 閱讀(435) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          GitHub |  開源中國社區 |  maven倉庫 |  文件格式轉換 
          主站蜘蛛池模板: 榆中县| 潮安县| 湘乡市| 桐乡市| 伊春市| 苍山县| 垦利县| 高平市| 梧州市| 延川县| 青浦区| 永川市| 文水县| 海阳市| 邵阳市| 施甸县| 河北区| 灵丘县| 闽清县| 海阳市| 虹口区| 分宜县| 宁远县| 诸城市| 和平区| 高平市| 广宁县| 鄱阳县| 太湖县| 佛教| 淳化县| 乃东县| 于都县| 桐乡市| 洛扎县| 三台县| 磐石市| 九寨沟县| 嘉善县| 资源县| 玛纳斯县|