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

direktori cari
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
watak


SimpleExpandableListAdapter

譯者博客:http://sd6733531.javaeye.com/

版本:Android 2.3 r1

?

結(jié)構(gòu)

繼承關(guān)系

public abstract class SimpleExpandableListAdapter extends BaseExpandableListAdapter

?

java.lang.Object

android.widget.BaseExpandableListAdapter

???????? android.widget.SimpleExpandableListAdapter

?

類概述

一個使用Map存儲組元素和子元素的靜態(tài)數(shù)據(jù),使用XML資源文件定義組元素和子元素View如何顯示的簡單適配器。你可以區(qū)分指定組元素返回的數(shù)據(jù)是List<Map>類型。在ArrayList中的每個實體對應(yīng)ExpandalbeList中的一個組。實體中的Map列表包含了組下的每行數(shù)據(jù)。你也可以指定一個XML文件來定義用于在組元素的View的顯示。此時Map中的鍵值將與指定的View(XML中定義的view id)對應(yīng)起來。子元素的處理情況類似。注意當可折疊的深度若不只1層,返回的數(shù)據(jù)將被指定為List類型。首個List對應(yīng)子元素中所代表的組,第二個List對應(yīng)孫子元素在子元素組中的位置。Map亦將支持這樣的特殊元素。(子元素嵌套組元素的情況)

(譯者注:ExpandableList支持深度大于1的情況。在andorid自帶的ApiDomos的例子中有這個的代碼:App/View/ExpandableList3)。

?

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

public?SimpleExpandableListAdapter?(Context?context,?List<??extends?Map<String,??>> groupData, int groupLayout,?String[]?groupFrom, int[] groupTo,?List<??extends?List<??extends?Map<String,??>>> childData, int childLayout,?String[]?childFrom, int[] childTo)

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

參數(shù)

?????????????????? context??? ??? SimpleExpandableListAdapter關(guān)聯(lián)的ExpandableListView的上下文。

?????????????????? groupData? ?? 一個Maps列表(List)。集合中的每個字典項與可折疊列表中的每個組元素一致。字典項提供了組元素包含的所有數(shù)據(jù),并包含所有在"groupFrom"中指定的記錄。

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

?????????????????? groupFrom?????? 一個鍵值列表。對應(yīng)與組相關(guān)聯(lián)的Map中的鍵值。

?????????????????? grouptTo?????????? View應(yīng)當顯示groupFrom參數(shù)中的所有列數(shù)據(jù)。這些數(shù)據(jù)應(yīng)當都用TextView來顯示。列表中的前NView從前NgroupFrom參數(shù)獲得列元素的數(shù)據(jù)。

?????????????????? childData? ???? 一個Map列表的列表。外部列表中的每個實體對應(yīng)一個組(按照組的位置編號)。在內(nèi)部列表的每個實體對應(yīng)某個組的子元素(按照子元素的位置編號)。該Map對應(yīng)了子元素的數(shù)據(jù)。(按照childFrom數(shù)組中的值編號)。該Map包含了每個子元素的數(shù)據(jù),并且應(yīng)當包括所有在childFrom中指定的實體。

?????????????????? childLayout?????? 顯示子元素的資源文件。該資源文件定義了如何顯示子元素。布局文件至少應(yīng)該包括所有在childTo中定義的View(childTo中的view id數(shù)組必須都在該布局文件中找到)

?????????????????? childFrom ?????? 定義顯示子元素的列名。該列名與childData中的子元素屬性(字典鍵值)對應(yīng)。

?????????????????? childTo????? View應(yīng)當顯示childFrom參數(shù)中的所有列數(shù)據(jù)。這些數(shù)據(jù)應(yīng)當都用TextView來顯示。列表中的前NView從前NchildFrom參數(shù)獲得列元素的數(shù)據(jù)。

?

public?SimpleExpandableListAdapter?(Context?context,?List<??extends?Map<String,??>> groupData, int expandedGroupLayout, int collapsedGroupLayout,?String[]?groupFrom, int[] groupTo,?List<??extends?List<??extends?Map<String,??>>> childData, int childLayout,?String[]?childFrom, int[] childTo)

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

參數(shù)

?????????????????? context??? ??? SimpleExpandableListAdapter關(guān)聯(lián)的ExpandableListView的上下文。

?????????????????? groupData? ?? 一個Maps列表(List)。集合中的每個字典項與可折疊列表中的每個組元素一致。字典項提供了組元素包含的所有數(shù)據(jù),并包含所有在"groupFrom"中指定的記錄。

expandedGroupLayout? ???????? 定義組展開時的ViewXML資源布局。該布局文件應(yīng)當至少包括所有在groupTo中所定義的View(groupTo中的View id數(shù)組必須都在該布局文件中找到)

collapasedGroupLayout??????????? 定義組折疊時的ViewXML資源布局。該布局文件應(yīng)當至少包括所有在groupTo中所定義的View(groupTo中的View id數(shù)組必須都在該布局文件中找到)

?????????????????? groupFrom?????? 一個鍵值列表。對應(yīng)與組相關(guān)聯(lián)的Map中的鍵值。

?????????????????? grouptTo?????????? View應(yīng)當顯示groupFrom參數(shù)中的所有列數(shù)據(jù)。這些數(shù)據(jù)應(yīng)當都用TextView來顯示。列表中的前NView從前NgroupFrom參數(shù)獲得列元素的數(shù)據(jù)。

?????????????????? childData ??????? 一個Map列表的列表。外部列表中的每個實體對應(yīng)一個組(按照組的位置編號)。在內(nèi)部列表的每個實體對應(yīng)某個組的子元素(按照子元素的位置編號)。該Map對應(yīng)了子元素的數(shù)據(jù)。(按照childFrom數(shù)組中的值編號)。該Map包含了每個子元素的數(shù)據(jù),并且應(yīng)當包括所有在childFrom中指定的實體。

?????????????????? childLayout?????? 顯示子元素的資源文件。該資源文件定義了如何顯示子元素。布局文件至少應(yīng)該包括所有在childTo中定義的View(childTo中的view id數(shù)組必須都在該布局文件中找到)

?????????????????? childFrom ?????? 定義顯示子元素的列名。該列名與childData中的子元素屬性(字典鍵值)對應(yīng)。

?????????????????? childTo????? View應(yīng)當顯示childFrom參數(shù)中的所有列數(shù)據(jù)。這些數(shù)據(jù)應(yīng)當都用TextView來顯示。列表中的前NView從前NchildFrom參數(shù)獲得列元素的數(shù)據(jù)。

?

public?SimpleExpandableListAdapter?(Context?context,?List<??extends?Map<String,??>> groupData, int expandedGroupLayout, int collapsedGroupLayout,?String[]?groupFrom, int[] groupTo,?List<??extends?List<??extends?Map<String,??>>> childData, int childLayout, int lastChildLayout,?String[]?childFrom, int[] childTo)

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

參數(shù)

?????????????????? context??? ??? SimpleExpandableListAdapter關(guān)聯(lián)的ExpandableListView的上下文。

?????????????????? groupData? ?? 一個Maps列表(List)。集合中的每個字典項與可折疊列表中的每個組元素一致。字典項提供了組元素包含的所有數(shù)據(jù),并包含所有在"groupFrom"中指定的記錄

expandedGroupLayout? 定義組展開時的ViewXML資源布局。該布局文件應(yīng)當至少包括所有在groupTo中所定義的View(groupTo中的View id數(shù)組必須都在該布局文件中找到)

collapasedGroupLayout? 定義組折疊時的ViewXML資源布局。該布局文件應(yīng)當至少包括所有在groupTo中所定義的View。(groupTo中的View id數(shù)組必須都在該布局文件中找到)

?????????????????? groupFrom?????? 一個鍵值列表。對應(yīng)與組相關(guān)聯(lián)的Map中的鍵值。

?????????????????? grouptTo? View應(yīng)當顯示groupFrom參數(shù)中的所有列數(shù)據(jù)。這些數(shù)據(jù)應(yīng)當都用TextView來顯示。列表中的前NView從前NgroupFrom參數(shù)獲得列元素的數(shù)據(jù)。

?????????????????? childData ??????? 一個Map列表的列表。外部列表中的每個實體對應(yīng)一個組(按照組的位置編號)。在內(nèi)部列表的每個實體對應(yīng)某個組的子元素(按照子元素的位置編號)。該Map對應(yīng)了子元素的數(shù)據(jù)。(按照childFrom數(shù)組中的值編號)。該Map包含了每個子元素的數(shù)據(jù),并且應(yīng)當包括所有在childFrom中指定的實體。

?????????????????? childLayout?????? 顯示子元素的資源文件。該資源文件定義了如何顯示子元素。布局文件至少應(yīng)該包括所有在childTo中定義的View。(childTo中的view id數(shù)組必須都在該布局文件中找到)

lastChildLayout? 定義每組中最后一個子元素的View資源布局情況。該布局文件應(yīng)當至少包括所有在childTo中所定義的View。(childTo中的View id數(shù)組必須都在該布局文件中找到)

?????????????????? childFrom ?????? 定義顯示子元素的列名。該列名與childData中的子元素屬性(字典鍵值)對應(yīng)。

?????????????????? childTo????? ? View應(yīng)當顯示childFrom參數(shù)中的所有列數(shù)據(jù)。這些數(shù)據(jù)應(yīng)當都用TextView來顯示。列表中的前NView從前NchildFrom參數(shù)獲得列元素的數(shù)據(jù)。

?

公共方法

public?Object?getChild?(int groupPosition, int childPosition)

?

public long?getChildId?(int groupPosition, int childPosition)

(譯者注:獲取與在給定組給予孩子相關(guān)的數(shù)據(jù)。)

?

public?View?getChildView?(int groupPosition, int childPosition, boolean isLastChild,?View?convertView,?ViewGroup?parent)

(譯者注:獲取子項)

?

public int?getChildrenCount?(int groupPosition)

(譯者注:返回在指定GroupChild數(shù)目。)

?

public?Object?getGroup?(int groupPosition)

?

public int?getGroupCount?()

(譯者注:返回Group的總數(shù)目。)

?

public long?getGroupId?(int groupPosition)

?

public?View?getGroupView?(int groupPosition, boolean isExpanded,?View?convertView,?ViewGroup?parent)

(譯者注:獲取父項)

?

public boolean?hasStableIds?()

?

public boolean?isChildSelectable?(int groupPosition, int childPosition)

(譯者注:是否child獲得焦點

?

public?View?newChildView?(boolean isLastChild,?ViewGroup?parent)

新建一個子元素View。

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

??????????? isLastChild ? child是否是組中的最后一個元素

??????????? parent?? ??? 新的View的最終父親。

??????? 返回

??????????? 新的子元素View對象。

?

public?View?newGroupView?(boolean isExpanded,?ViewGroup?parent)

新建一個組元素View。

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

??????? ??? isExpanded 該組元素是否當前處于折疊狀態(tài)

??????? ??? parent?? View的最終父親。

??? ??? 返回

??????? ??? 新的組元素View對象。

?

補充

??? 文章精選

??????? ExpandableListActivitySimpleExpandableListAdapter的使用方法

??????? Expandable lists[blogspot]

示例代碼:

? ????? List<Map<String, String>> groupData = new ArrayList<Map<String, String>>();

??????? List<List<Map<String, String>>> childData = new ArrayList<List<Map<String, String>>>();

??????? for (int i = 0; i < 20; i++) {

??????????? Map<String, String> curGroupMap = new HashMap<String, String>();

??????????? groupData.add(curGroupMap);

??????????? curGroupMap.put(NAME, "Group " + i);

??????????? curGroupMap.put(IS_EVEN, (i % 2 == 0) ? "This group is even" : "This group is odd");

???????????

??????????? List<Map<String, String>> children = new ArrayList<Map<String, String>>();

??????????? for (int j = 0; j < 15; j++) {

??????????????? Map<String, String> curChildMap = new HashMap<String, String>();

?????? ?????????children.add(curChildMap);

??????????????? curChildMap.put(NAME, "Child " + j);

??????????????? curChildMap.put(IS_EVEN, (j % 2 == 0) ? "This child is even" : "This child is odd");

??????????? }

??????????? childData.add(children);

??????? }

???? ???

??????? // Set up our adapter

??????? mAdapter = new SimpleExpandableListAdapter(

??????????????? this,

??????????????? groupData,

??????????????? android.R.layout.simple_expandable_list_item_1,

??????????????? new String[] { NAME, IS_EVEN },

???????? ???????new int[] { android.R.id.text1, android.R.id.text2 },

??????????????? childData,

??????????????? android.R.layout.simple_expandable_list_item_2,

??????????????? new String[] { NAME, IS_EVEN },

??????????????? new int[] { android.R.id.text1, android.R.id.text2 }

??????????????? );


Artikel sebelumnya: Artikel seterusnya: