亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

?? ??? ??
android Manifest Manifest.permission Manifest.permission_group android.accessibilityservice AccessibilityService android.accounts Account android.app NotificationManager android.bluetooth BluetoothAdapter BluetoothClass BluetoothClass.Device BluetoothClass.Device.Major BluetoothClass.Service BluetoothDevice BluetoothServerSocket BluetoothSocket android.content SharedPreferences android.database.sqlite SQLiteCursorDriver SQLiteOpenHelper android.graphics Bitmap android.location LocationListener Geocoder GpsStatus GpsStatus.Listener GpsStatus.NmeaListener GpsSatellite android.media AudioFormat AsyncPlayer AudioRecord AudioRecord.OnRecordPositionUpdateListener ThumbnailUtils AudioManager android.net TrafficStats MailTo LocalSocket android.os AsyncTask AsyncTask.Status CountDownTimer Message MessageQueue HandlerThread android.text Html android.util JsonWriter android.view ContextMenu ContextMenu.ContextMenuInfo Display ViewManager View ViewStub ViewTreeObserver ViewParent WindowManager GestureDetector Gravity MenuInflater ScaleGestureDetector SoundEffectConstants android.view.inputmethod InputConnection InputMethod InputMethodSession BaseInputConnection InputMethodManager android.widget AbsListView AbsListView.LayoutParams AbsListView.OnScrollListener AbsListView.RecyclerListener AbsoluteLayout AbsoluteLayout.LayoutParams AbsSeekBar AbsSpinner AdapterView AdapterView.AdapterContextMenuInfo AdapterView.OnItemLongClickListener AdapterView.OnItemSelectedListener AdapterView.OnItemClickListener AnalogClock BaseAdapter BaseExpandableListAdapter Button CheckBox CheckedTextView Checkable Chronometer Chronometer.OnChronometerTickListener CompoundButton CompoundButton.OnCheckedChangeListener CursorAdapter CursorTreeAdapter DatePicker DatePicker.OnDateChangedListener DialerFilter DigitalClock EditText Filter Filter.FilterListener Filter.FilterResults ExpandableListAdapter ExpandableListView.OnChildClickListener ExpandableListView.OnGroupClickListener ExpandableListView.OnGroupCollapseListener ExpandableListView.OnGroupExpandListener Filterable Gallery Gallery.LayoutParams GridView GridLayout GridLayout.Alignment RadioGroup ImageView ImageView.ScaleType HorizontalScrollView ImageButton ImageSwitcher FilterQueryProvider ListAdapter ListView MediaController MultiAutoCompleteTextView MultiAutoCompleteTextView.CommaTokenizer MultiAutoCompleteTextView.Tokenizer QuickContactBadge RadioButton RatingBar RatingBar.OnRatingBarChangeListener RelativeLayout RemoteViews ResourceCursorAdapter ResourceCursorTreeAdapter Scroller ScrollView SearchView SearchView.OnCloseListener SearchView.OnQueryTextListener SearchView.OnSuggestionListener SeekBar SeekBar.OnSeekBarChangeListener SimpleAdapter SimpleAdapter.ViewBinder SimpleCursorAdapter SimpleCursorAdapter.CursorToStringConverter SimpleCursorAdapter.ViewBinder SimpleCursorTreeAdapter SimpleCursorTreeAdapter.ViewBinder SimpleExpandableListAdapter SlidingDrawer SlidingDrawer.OnDrawerCloseListener SlidingDrawer.OnDrawerOpenListener SlidingDrawer.OnDrawerScrollListener Spinner SpinnerAdapter WrapperListAdapter TabHost TabHost.TabSpec TextView TimePicker TimePicker.OnTimeChangedListener Toast TableLayout TableLayout.LayoutParams TableRow TableRow.LayoutParams TabWidget TextSwitcher ToggleButton TwoLineListItem VideoView ViewAnimator ViewFlipper ViewSwitcher ViewSwitcher.ViewFactory ZoomButtonsController ZoomButtonsController.OnZoomListener ZoomButton ZoomControls dalvik.system DexFile
??


SimpleCursorTreeAdapter

翻譯時(shí)間:2011-3-7

版本:Android 3.0 r1

結(jié)構(gòu)

繼承關(guān)系

public abstract class SimpleCusrorTreeAdapter extends ????

???????????????????????????????????? ?????? ResourceCusorTreeAdpater

java.lang.Object

android.widget.BaseExpandableListAdapter

???????? android.widget.CursorTreeAdapter

??????????????????????????? android.widget.ResourceCusorTreeAdapter

???????????????????????????????????? android.widget.SimpleCursorTreeAdapter

?

類概述

這是一個(gè)用起來很方便的適配器類,它主要將Cursor與在XML文件中定義的TextViewImageView進(jìn)行映射。比如,你想設(shè)定要展示三列,那么當(dāng)做好綁定之后,視圖就會(huì)展示你設(shè)定好的那些列;當(dāng)然了,視圖的外觀是定義在XML文件里面的,你只需用這個(gè)類與視圖做好綁定就可以了。(譯者注:Android推薦我們盡可能的將組視圖和子視圖分離開,也就是說不要把整體定義在一個(gè)布局文件當(dāng)中。)與視圖綁定有兩個(gè)階段。第一階段:如果使用SimpleCursorTreeAdapter.ViewBinder時(shí),那么就會(huì)調(diào)用setViewValue(android.view.View, android.database.Cursor, int)方法。該方法返回true就說明綁定成功,否則返回false,這就到了第二階段,SimpleCursorAdapter內(nèi)部開始自行綁定,過程是這樣的,若綁定到TextView上,調(diào)用setViewText(TextView, String);若綁定到ImageView上,調(diào)用setViewImage(ImageView, String),如果視圖不是TextViewImageView則拋出IllegalStateException異常。

?

內(nèi)部類

public interface SimpleCursorTreeAdapter.ViewBinder

???????? 這個(gè)內(nèi)部接口可以在外部通過SimpleCursorTreeAdapter.ViewBinder的方式進(jìn)行 CursorView的綁定。

?

構(gòu)造函數(shù)

public SimpleCursorTreeAdapter (Context context, Cursor cursor, int collapsedGroupLayout, int expandedGroupLayout, String[] groupFrom, int[] groupTo, int childLayout, int lastChildLayout, String[] childFrom, int[] childTo)

構(gòu)造函數(shù)。

?????????????????? 參數(shù)

??????????????????????????? context??? 上下文,多指ExpandableListView的上下文

??????????????????????????? cursor?????? 數(shù)據(jù)庫游標(biāo)

collapsedGroupLayout???? 布局資源文件標(biāo)識(shí)ID,其定義的是收縮時(shí)的ExpandableListView布局樣式,并且內(nèi)部至少要包含參數(shù)“groupTo”中指定的視圖ID。

expandedGroupLayout??? 布局資源文件標(biāo)識(shí)ID,其定義的是展開時(shí)的ExpandableListView布局樣式,并且內(nèi)部至少要包含參數(shù)“groupTo”中指定的視圖ID

??????????????????????????? groupFrom?????? 列名列表,顯示ExpandableListView的組節(jié)點(diǎn)。

groupTo???????????? 展示參數(shù)“groupFrom”中的列,也就是說ExpandableListView中的視圖顯示的是參數(shù) groupFrom”的列值,它們應(yīng)該都是TextView或是ImageView。

childLayout?????? 布局資源文件標(biāo)識(shí)ID,其定義的是子視圖的布局樣式 (不包括最后一個(gè)子視圖),內(nèi)部至少要包含參數(shù) childTo”中指定的視圖ID。lastChildLayout布局資源文件標(biāo)識(shí)ID,其定義的是最后一個(gè)子視圖的布局樣式,內(nèi)部至少要包含參數(shù)“childTo”中指定的視圖ID。

lastChildLayout??????? 布局資源文件標(biāo)識(shí)ID,其定義的是最后一個(gè)子視圖的布局樣式,內(nèi)部至少要包含參數(shù)“childTo”中指定的視圖ID。lastChildLayout布局資源文件標(biāo)識(shí)ID,其定義的是最后一個(gè)子視圖的布局樣式,內(nèi)部至少要包含參數(shù)“childTo”中指定的視圖ID。

??????????????????????????? childFrom????????? 列名列表,顯示ExpandableListView的子節(jié)點(diǎn)。

childTo?????????????? 展示參數(shù)“childFrom ”中的列,也就是說ExpandableListView中的視圖顯示的是參數(shù) childFrom? ”的列值,它們應(yīng)該都是TextView或是ImageView。

?

public SimpleCursorTreeAdapter (Context context, Cursor cursor, int collapsedGroupLayout, int expandedGroupLayout, String[] groupFrom, int[] groupTo, int childLayout, String[] childFrom, int[] childTo)

構(gòu)造函數(shù)。(譯者注:該構(gòu)造函數(shù)只是少了一個(gè)參數(shù)lastChildLayout

???????? 參數(shù)

context??? 上下文,多指ExpandableListView的上下文

??????????????????????????? cursor?????? 數(shù)據(jù)庫游標(biāo)

collapsedGroupLayout???? 布局資源文件標(biāo)識(shí)ID,其定義的是收縮時(shí)的ExpandableListView布局樣式,并且內(nèi)部至少要包含參數(shù)“groupTo”中指定的視圖ID。

expandedGroupLayout??? 布局資源文件標(biāo)識(shí)ID,其定義的是展開時(shí)的ExpandableListView布局樣式,并且內(nèi)部至少要包含參數(shù)“groupTo”中指定的視圖ID。

??????????????????????????? groupFrom?????? 列名列表,顯示ExpandableListView的組節(jié)點(diǎn)。

groupTo???????????? 展示參數(shù)“groupFrom”中的列,也就是說ExpandableListView中的視圖顯示的是參數(shù) groupFrom”的列值,它們應(yīng)該都是TextView或是ImageView

childLayout?????? 布局資源文件標(biāo)識(shí)ID,其定義的是子視圖的布局樣式 (不包括最后一個(gè)子視圖),內(nèi)部至少要包含參數(shù) childTo”中指定的視圖ID。lastChildLayout布局資源文件標(biāo)識(shí)ID,其定義的是最后一個(gè)子視圖的布局樣式,內(nèi)部至少要包含參數(shù)“childTo”中指定的視圖ID。

childFrom????????? 列名列表,顯示ExpandableListView的子節(jié)點(diǎn)。

childTo?????????????? 展示參數(shù)“childFrom ”中的列,也就是說ExpandableListView中的視圖顯示的是參數(shù) childFrom? ”的列值,它們應(yīng)該都是TextView或是ImageView。

?

public SimpleCursorTreeAdapter (Context context, Cursor cursor, int groupLayout, String[] groupFrom, int[] groupTo, int childLayout, String[] childFrom, int[] childTo)

構(gòu)造函數(shù)。

???????? 參數(shù)

context??? 上下文,多指ExpandableListView的上下文

??????????????????????????? cursor?????? 數(shù)據(jù)庫游標(biāo)

?????????????????? groupLayout ?顯示組元素的資源文件。該資源文件定義了如何顯示組元素。該布局文件必須至少包括groupTo中所定義的View(groupTo中的View id數(shù)組必須都在該布局文件中找到)

??????????????????????????? groupFrom?????? 列名列表,顯示ExpandableListView的組節(jié)點(diǎn)。

groupTo???????????? 展示參數(shù)“groupFrom”中的列,也就是說ExpandableListView中的視圖顯示的是參數(shù) groupFrom”的列值,它們應(yīng)該都是TextView或是ImageView

childLayout?????? 布局資源文件標(biāo)識(shí)ID,其定義的是子視圖的布局樣式 (不包括最后一個(gè)子視圖),內(nèi)部至少要包含參數(shù) childTo”中指定的視圖ID。lastChildLayout布局資源文件標(biāo)識(shí)ID,其定義的是最后一個(gè)子視圖的布局樣式,內(nèi)部至少要包含參數(shù)“childTo”中指定的視圖ID。

childFrom????????? 列名列表,顯示ExpandableListView的子節(jié)點(diǎn)。

childTo?????????????? 展示參數(shù)“childFrom ”中的列,也就是說ExpandableListView中的視圖顯示的是參數(shù) childFrom? ”的列值,它們應(yīng)該都是TextView或是ImageView

?

?

公共方法

public SimpleCursorAdapter.ViewBinder getViewBinder ()

???????? 返回SimpleCursorTreeAdapter.ViewBinder引用,這個(gè)ViewBinder用來將數(shù)據(jù)綁定到 視圖上的。

返回值

??????????????????????????? 如果ViewBinder不存在,則返回null。

參考

???????? setViewBinder(android.widget.SimpleCursorTreeAdapter.ViewBinder)

?

public void setViewBinder (SimpleCursorTreeAdapter.ViewBinder viewBinder)

.??????? 設(shè)置視圖綁定器。

?????????????????? 參數(shù)

??????????????????????????? viewBinder? 視圖綁定器??梢栽O(shè)置為null來刪除已經(jīng)存在的綁定器。

?????????????????? 參考

???????? getViewBinder()

?

public void setViewText (TextView v, String text)

???????? 僅當(dāng)ViewBinder不存在或是當(dāng)ViewBinder不為TextView綁定時(shí)(也就是setViewValue()返回false),則這個(gè)方法會(huì)被bindView()調(diào)用,以便為TextView設(shè)置文本??芍貙戇m配器從數(shù)據(jù)庫中檢索過濾字符串。

?????????????????? 參數(shù)

??????????????????????????? v?????? ?? 文本控件引用

??????????????????????????? value??????為文本控件設(shè)置的文本信息(譯者注:是從Cursor獲取到的)。

?

受保護(hù)方法

protected void bindChildView (View view, Context context, Cursor cursor, boolean isExpanded)

???????? 通過參數(shù)cursor將數(shù)據(jù)綁定到已有的子視圖上。。

?????????????????? 參數(shù)

??????????????????????????? view? ?????????????? 已有視圖,返回之前調(diào)用newChildView創(chuàng)建的視圖。

??????????????????????????? context? ???????? 應(yīng)用程序上下文

??????????????????????????? cursor? ?????????? 用于獲取數(shù)據(jù)的CoursorCoursor已經(jīng)移到正確的位置。

??????????????????????????? isLastChild? ?子元素是否處于組中的最后一個(gè)

?

protected void bindGroupView (View view, Context context, Cursor cursor, boolean isExpanded)

???????? 通過參數(shù)cursor將數(shù)據(jù)綁定到已有組視圖上。

?????????????????? 參數(shù)???????????????????????????

??????????????????????????? view? ?????????????? 已有組視圖,返回之前調(diào)用newGroupView創(chuàng)建的視圖。

??????????????????????????? context? ???????? 應(yīng)用程序上下文

??????????????????????????? cursor? ?????????? 用于獲取數(shù)據(jù)的Coursor。Coursor已經(jīng)移到正確的位置。

??????????????????????????? isExpanded? ?組視圖是否呈展開狀態(tài)

?

protected void setViewImage (ImageView v, String value)

這個(gè)方法會(huì)被bindView()調(diào)用,以便為ImageView設(shè)置圖片。默認(rèn)情況下,參數(shù)value作為圖片資源ID來看待,否則會(huì)視為圖片的Uri。?? 另外還可以通過過濾器來獲得更靈活的設(shè)置。

?????????????????? 參數(shù)

??????????????????????????? v?????? ?? 圖片控件引用

??????????????????????????? value? 圖片資源ID,是從Cursor獲取到的。

?

補(bǔ)充

???????? 文章精選

?????????????????? android播放器(music player)源碼分析2


?? ??: ?? ??: