当前位置: 首页>>代码示例>>Java>>正文


Java ListView.setId方法代码示例

本文整理汇总了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;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:24,代码来源:PullToRefreshListView.java

示例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;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:25,代码来源:ListFragment.java

示例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;
}
 
开发者ID:ultrasonic,项目名称:ultrasonic,代码行数:9,代码来源:PullToRefreshListView.java

示例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);
}
 
开发者ID:datalink747,项目名称:Sortable_tableview_soussidev,代码行数:28,代码来源:TableView.java

示例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);
}
 
开发者ID:Datatellit,项目名称:xlight_android_native,代码行数:10,代码来源:SlidingListActivity.java

示例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);
}
 
开发者ID:HueToYou,项目名称:ChatExchange-old,代码行数:11,代码来源:SlidingListActivity.java

示例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;
}
 
开发者ID:ccfish86,项目名称:sctalk,代码行数:11,代码来源:PullToRefreshListViewForNoneHeaderDivider.java

示例9: createRefreshableView

import android.widget.ListView; //导入方法依赖的package包/类
protected ListView createRefreshableView(Context context, AttributeSet attrs) {
    ListView lv = createListView(context, attrs);
    lv.setId(16908298);
    return lv;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:6,代码来源:PullToRefreshListView.java

示例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 );

}
 
开发者ID:alfredayibonte,项目名称:QuestionnaireView,代码行数:55,代码来源:QuestionnaireView.java


注:本文中的android.widget.ListView.setId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。