本文整理匯總了Java中android.widget.ListView.setId方法的典型用法代碼示例。如果您正苦於以下問題:Java ListView.setId方法的具體用法?Java ListView.setId怎麽用?Java ListView.setId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.widget.ListView
的用法示例。
在下文中一共展示了ListView.setId方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createRefreshableView
import android.widget.ListView; //導入方法依賴的package包/類
protected final ListView createRefreshableView(Context context, AttributeSet attrs) {
ListView lv = new InternalListView(this, context, attrs);
lv.setLayoutParams(new LayoutParams(-1, -1));
int mode = getMode();
String pullLabel = context.getString(2131100695);
String refreshingLabel = context.getString(2131100699);
String releaseLabel = context.getString(2131100700);
if (mode == 1 || mode == 3) {
FrameLayout frame = new FrameLayout(context);
this.mHeaderLoadingView = new PullToRefreshHeaderView(context, 1, releaseLabel, pullLabel, refreshingLabel, this.objs);
frame.addView(this.mHeaderLoadingView, -1, -2);
this.mHeaderLoadingView.setVisibility(8);
lv.addHeaderView(frame, null, false);
}
if (mode == 2 || mode == 3) {
this.mLvFooterLoadingFrame = new FrameLayout(context);
this.mFooterLoadingView = new PullToRefreshHeaderView(context, 2, releaseLabel, pullLabel, refreshingLabel, this.objs);
this.mLvFooterLoadingFrame.addView(this.mFooterLoadingView, -1, -2);
this.mFooterLoadingView.setVisibility(8);
}
lv.setId(16908298);
return lv;
}
示例2: onCreateView
import android.widget.ListView; //導入方法依賴的package包/類
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
Context context = getActivity();
FrameLayout root = new FrameLayout(context);
LinearLayout pframe = new LinearLayout(context);
pframe.setId(INTERNAL_PROGRESS_CONTAINER_ID);
pframe.setOrientation(1);
pframe.setVisibility(8);
pframe.setGravity(17);
pframe.addView(new ProgressBar(context, null, 16842874), new LayoutParams(-2, -2));
root.addView(pframe, new LayoutParams(-1, -1));
FrameLayout lframe = new FrameLayout(context);
lframe.setId(INTERNAL_LIST_CONTAINER_ID);
TextView tv = new TextView(getActivity());
tv.setId(INTERNAL_EMPTY_ID);
tv.setGravity(17);
lframe.addView(tv, new LayoutParams(-1, -1));
ListView lv = new ListView(getActivity());
lv.setId(16908298);
lv.setDrawSelectorOnTop(false);
lframe.addView(lv, new LayoutParams(-1, -1));
root.addView(lframe, new LayoutParams(-1, -1));
root.setLayoutParams(new LayoutParams(-1, -1));
return root;
}
示例3: createRefreshableView
import android.widget.ListView; //導入方法依賴的package包/類
@Override
protected ListView createRefreshableView(Context context, AttributeSet attrs) {
ListView lv = createListView(context, attrs);
// Set it to this so it can be used in ListActivity/ListFragment
lv.setId(android.R.id.list);
return lv;
}
示例4: setupTableDataView
import android.widget.ListView; //導入方法依賴的package包/類
private void setupTableDataView(final AttributeSet attributes, final int styleAttributes) {
final LayoutParams dataViewLayoutParams = new LayoutParams(getWidthAttribute(attributes), LayoutParams.MATCH_PARENT);
if (isInEditMode()) {
tableDataAdapter = new EditModeTableDataAdapter(getContext());
} else {
tableDataAdapter = new DefaultTableDataAdapter(getContext());
}
tableDataAdapter.setRowBackgroundProvider(dataRowBackgroundProvider);
tableDataView = new ListView(getContext(), attributes, styleAttributes);
tableDataView.setOnItemClickListener(new InternalDataClickListener());
tableDataView.setOnItemLongClickListener(new InternalDataLongClickListener());
tableDataView.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
tableDataView.setAdapter(tableDataAdapter);
tableDataView.setId(R.id.table_data_view);
tableDataView.setOnScrollListener(new InternalOnScrollListener());
swipeRefreshLayout = new SwipeRefreshLayout(getContext());
swipeRefreshLayout.setLayoutParams(dataViewLayoutParams);
swipeRefreshLayout.addView(tableDataView);
swipeRefreshLayout.setColorSchemeColors(headerColor);
swipeRefreshLayout.setEnabled(false);
addView(swipeRefreshLayout);
}
示例5: onCreateDialog
import android.widget.ListView; //導入方法依賴的package包/類
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
LayoutInflater inflater = getActivity().getLayoutInflater();
View v = inflater.inflate(R.layout.sync_passphrase_types, null);
// Configure the passphrase type list
ListView list = (ListView) v.findViewById(R.id.passphrase_types);
Adapter adapter = createAdapter(getCurrentTypeFromArguments());
list.setAdapter(adapter);
list.setId(R.id.passphrase_type_list);
list.setOnItemClickListener(this);
list.setDividerHeight(0);
PassphraseType currentType = getCurrentTypeFromArguments();
list.setSelection(adapter.getPositionForType(currentType));
// Configure the hint to reset the passphrase settings
// Only show this hint if encryption has been set to use sync passphrase
if (currentType == PassphraseType.CUSTOM_PASSPHRASE) {
TextView instructionsView = (TextView) v.findViewById(R.id.reset_sync_text);
instructionsView.setVisibility(View.VISIBLE);
instructionsView.setMovementMethod(LinkMovementMethod.getInstance());
instructionsView.setText(getResetText());
}
// Create and return the dialog
return new AlertDialog.Builder(getActivity(), R.style.AlertDialogTheme)
.setNegativeButton(R.string.cancel, this)
.setTitle(R.string.sync_passphrase_type_title)
.setView(v)
.create();
}
開發者ID:rkshuai,項目名稱:chromium-for-android-56-debug-video,代碼行數:32,代碼來源:PassphraseTypeDialogFragment.java
示例6: onCreate
import android.widget.ListView; //導入方法依賴的package包/類
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mHelper = new SlidingActivityHelper(this);
mHelper.onCreate(savedInstanceState);
ListView listView = new ListView(this);
listView.setId(android.R.id.list);
setContentView(listView);
}
示例7: onCreate
import android.widget.ListView; //導入方法依賴的package包/類
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
mHelper = new SlidingActivityHelper(this);
mHelper.onCreate(savedInstanceState);
ListView listView = new ListView(this);
listView.setId(android.R.id.list);
setContentView(listView);
}
示例8: createRefreshableView
import android.widget.ListView; //導入方法依賴的package包/類
@Override
protected ListView createRefreshableView(Context context, AttributeSet attrs) {
ListView lv = createListView(context, attrs);
// Set it to this so it can be used in ListActivity/ListFragment
lv.setId(android.R.id.list);
lv.setHeaderDividersEnabled(false);
return lv;
}
示例9: createRefreshableView
import android.widget.ListView; //導入方法依賴的package包/類
protected ListView createRefreshableView(Context context, AttributeSet attrs) {
ListView lv = createListView(context, attrs);
lv.setId(16908298);
return lv;
}
示例10: drawInnerViews
import android.widget.ListView; //導入方法依賴的package包/類
private void drawInnerViews(Context context, AttributeSet attrs){
float density = context.getResources().getDisplayMetrics().density;
int value16 = (int)(16*density);
int value10 = (int)(10*density);
int value40 = (int)(40*density);
LayoutParams mainLayoutParams = new LayoutParams(
LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
mainLayoutParams.setMargins(value16,value16,value16,value16);
setLayoutParams(mainLayoutParams);
//creation & addition of webview
webview = new WebView(context, attrs);
webview.setId(android.R.id.content);
webview.setLayoutParams(
new LayoutBuilder()
.addWidth(LayoutParams.MATCH_PARENT)
.addHeight(LayoutParams.WRAP_CONTENT)
.setMargin(value10,value40,0,0)
.create()
);
webview.getSettings();
webview.setBackgroundColor(Color.argb(0,0,0,0));
addView(webview);
//creation of list view
listView = new ListView(context, attrs);
listView.setId(android.R.id.list);
listView.setLayoutParams(
new LayoutBuilder()
.addWidth(LayoutParams.MATCH_PARENT)
.addHeight(LayoutParams.WRAP_CONTENT)
.setMargin(0,value10,0,0)
.addRule(BELOW, webview.getId() )
.create()
);
addView(listView );
//creation & addition of editText
editTv = new AppCompatEditText(context, attrs);
editTv.setVisibility(GONE);
editTv.setId(android.R.id.text1);
editTv.setLayoutParams(
new LayoutBuilder()
.addWidth(LayoutParams.MATCH_PARENT)
.addHeight(LayoutParams.WRAP_CONTENT)
.setMargin(value10, value10, 0, 0)
.addRule(BELOW, webview.getId())
.create()
);
editTv.setInputType(InputType.TYPE_CLASS_TEXT);
editTv.setImeOptions(EditorInfo.IME_ACTION_DONE);
addView(editTv );
}