Java Code Examples for android.widget.ListView.setId()

The following are Jave code examples for showing how to use setId() of the android.widget.ListView class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: letv   File: PullToRefreshListView.java   View Source Code Vote up 6 votes
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;
}
 
Example 2
Project: letv   File: ListFragment.java   View Source Code Vote up 6 votes
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;
}
 
Example 3
Project: boohee_v5.6   File: ListFragment.java   View Source Code Vote up 6 votes
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;
}
 
Example 4
Project: ultrasonic   File: PullToRefreshListView.java   View Source Code Vote up 5 votes
@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;
}
 
Example 5
Project: CustomListView   File: PullToRefreshListView.java   View Source Code Vote up 5 votes
@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;
}
 
Example 6
Project: ywApplication   File: PullToRefreshListView.java   View Source Code Vote up 5 votes
@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;
}
 
Example 7
Project: Hotspot-master-devp   File: PullToRefreshListView.java   View Source Code Vote up 5 votes
@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;
}
 
Example 8
Project: Hotspot-master-devp   File: PullToRefreshCustomListView.java   View Source Code Vote up 5 votes
@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;
}
 
Example 9
Project: Sortable_tableview_soussidev   File: TableView.java   View Source Code Vote up 5 votes
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);
}
 
Example 10
Project: chromium-for-android-56-debug-video   File: PassphraseTypeDialogFragment.java   View Source Code Vote up 5 votes
@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();
}
 
Example 11
Project: xlight_android_native   File: SlidingListActivity.java   View Source Code Vote up 5 votes
@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);
}
 
Example 12
Project: Tribe   File: PullToRefreshListView.java   View Source Code Vote up 5 votes
@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;
}
 
Example 13
Project: ChatExchange-old   File: SlidingListActivity.java   View Source Code Vote up 5 votes
@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);
}
 
Example 14
Project: CustomAndroidOneSheeld   File: PullToRefreshListView.java   View Source Code Vote up 5 votes
@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;
}
 
Example 15
Project: LiuAGeAndroid   File: SlidingListActivity.java   View Source Code Vote up 5 votes
@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);
}
 
Example 16
Project: DailyZhiHu   File: SlidingListActivity.java   View Source Code Vote up 5 votes
@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);
}
 
Example 17
Project: sctalk   File: PullToRefreshListView.java   View Source Code Vote up 5 votes
@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;
}
 
Example 18
Project: sctalk   File: PullToRefreshListViewForNoneHeaderDivider.java   View Source Code Vote up 5 votes
@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;
}
 
Example 19
Project: boohee_v5.6   File: PullToRefreshListView.java   View Source Code Vote up 4 votes
protected ListView createRefreshableView(Context context, AttributeSet attrs) {
    ListView lv = createListView(context, attrs);
    lv.setId(16908298);
    return lv;
}
 
Example 20
Project: QuestionnaireView   File: QuestionnaireView.java   View Source Code Vote up 4 votes
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 );

}