Search in sources :

Example 91 with ListView

use of android.widget.ListView in project XobotOS by xamarin.

the class ChooseAccountActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mAccounts = getIntent().getParcelableArrayExtra(AccountManager.KEY_ACCOUNTS);
    mAccountManagerResponse = getIntent().getParcelableExtra(AccountManager.KEY_ACCOUNT_MANAGER_RESPONSE);
    // KEY_ACCOUNTS is a required parameter
    if (mAccounts == null) {
        setResult(RESULT_CANCELED);
        finish();
        return;
    }
    getAuthDescriptions();
    AccountInfo[] mAccountInfos = new AccountInfo[mAccounts.length];
    for (int i = 0; i < mAccounts.length; i++) {
        mAccountInfos[i] = new AccountInfo(((Account) mAccounts[i]).name, getDrawableForType(((Account) mAccounts[i]).type));
    }
    setContentView(R.layout.choose_account);
    // Setup the list
    ListView list = (ListView) findViewById(android.R.id.list);
    // Use an existing ListAdapter that will map an array of strings to TextViews
    list.setAdapter(new AccountArrayAdapter(this, android.R.layout.simple_list_item_1, mAccountInfos));
    list.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
    list.setTextFilterEnabled(true);
    list.setOnItemClickListener(new AdapterView.OnItemClickListener() {

        public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
            onListItemClick((ListView) parent, v, position, id);
        }
    });
}
Also used : ListView(android.widget.ListView) AdapterView(android.widget.AdapterView) ImageView(android.widget.ImageView) TextView(android.widget.TextView) View(android.view.View) AdapterView(android.widget.AdapterView) ListView(android.widget.ListView)

Example 92 with ListView

use of android.widget.ListView in project physical-web by google.

the class NearbyBeaconsFragment method initialize.

private void initialize(View rootView) {
    setHasOptionsMenu(true);
    mGroupIdQueue = new ArrayList<>();
    mHandler = new Handler();
    mSwipeRefreshWidget = (SwipeRefreshWidget) rootView.findViewById(R.id.swipe_refresh_widget);
    mSwipeRefreshWidget.setColorSchemeResources(R.color.swipe_refresh_widget_first_color, R.color.swipe_refresh_widget_second_color);
    mSwipeRefreshWidget.setOnRefreshListener(this);
    getActivity().getActionBar().setTitle(R.string.title_nearby_beacons);
    mNearbyDeviceAdapter = new NearbyBeaconsAdapter();
    setListAdapter(mNearbyDeviceAdapter);
    //Get the top drawable
    mScanningAnimationTextView = (TextView) rootView.findViewById(android.R.id.empty);
    mScanningAnimationDrawable = (AnimationDrawable) mScanningAnimationTextView.getCompoundDrawables()[1];
    ListView listView = (ListView) rootView.findViewById(android.R.id.list);
    mDiscoveryServiceConnection = new DiscoveryServiceConnection();
    mWifiDirectConnect = new WifiDirectConnect(getActivity());
    mBluetoothSite = new BluetoothSite(getActivity());
    mTouchListener = new SwipeDismissListViewTouchListener(listView, new SwipeDismissListViewTouchListener.DismissCallbacks() {

        @Override
        public boolean canDismiss(int position) {
            return true;
        }

        @Override
        public void onDismiss(ListView listView, int position) {
            Utils.addBlocked(mNearbyDeviceAdapter.getItem(position));
            Utils.saveBlocked(getActivity());
            if (mMissedEmptyGroupIdQueue) {
                mMissedEmptyGroupIdQueue = false;
                emptyGroupIdQueue();
            }
        }
    });
    listView.setOnTouchListener(mTouchListener);
    // Setting this scroll listener is required to ensure that during ListView scrolling,
    // we don't look for swipes.
    listView.setOnScrollListener(mTouchListener.makeScrollListener());
    Utils.restoreFavorites(getActivity());
    Utils.restoreBlocked(getActivity());
}
Also used : ListView(android.widget.ListView) Handler(android.os.Handler)

Example 93 with ListView

use of android.widget.ListView in project physical-web by google.

the class BlockedFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    setHasOptionsMenu(true);
    getActivity().getActionBar().setDisplayHomeAsUpEnabled(true);
    View rootView = inflater.inflate(R.layout.fragment_blocked, container, false);
    ListView listView = (ListView) rootView.findViewById(android.R.id.list);
    mAdapter = new BlockedAdapter();
    listView.setAdapter(mAdapter);
    return rootView;
}
Also used : ListView(android.widget.ListView) TextView(android.widget.TextView) View(android.view.View) ListView(android.widget.ListView)

Example 94 with ListView

use of android.widget.ListView in project PLDroidPlayer by pili-engineering.

the class VideoFileActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_video_file);
    mVideoListView = (ListView) findViewById(R.id.FileListView);
    mVideoAdapter = new VideoAdapter(this);
    mVideoListView.setAdapter(mVideoAdapter);
    mVideoListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> parent, View view, final int position, final long id) {
            Intent intent = new Intent();
            intent.putExtra("videoPath", mVideoAdapter.getVideoPath(position));
            setResult(Activity.RESULT_OK, intent);
            finish();
        }
    });
    getSupportLoaderManager().initLoader(1, null, this);
}
Also used : AdapterView(android.widget.AdapterView) Intent(android.content.Intent) View(android.view.View) AdapterView(android.widget.AdapterView) ListView(android.widget.ListView)

Example 95 with ListView

use of android.widget.ListView in project PocketHub by pockethub.

the class ItemListFragment method onViewCreated.

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    swipeLayout = (SwipeRefreshLayout) view.findViewById(R.id.swipe_item);
    swipeLayout.setOnRefreshListener(this);
    swipeLayout.setColorSchemeResources(R.color.pager_title_background_top_start, R.color.pager_title_background_end, R.color.text_link, R.color.pager_title_background_end);
    listView = (ListView) view.findViewById(android.R.id.list);
    listView.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            onListItemClick((ListView) parent, view, position, id);
        }
    });
    listView.setOnItemLongClickListener(new OnItemLongClickListener() {

        @Override
        public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
            return onListItemLongClick((ListView) parent, view, position, id);
        }
    });
    progressBar = (ProgressBar) view.findViewById(R.id.pb_loading);
    emptyView = (TextView) view.findViewById(android.R.id.empty);
    configureList(getActivity(), getListView());
}
Also used : ListView(android.widget.ListView) OnItemClickListener(android.widget.AdapterView.OnItemClickListener) TextView(android.widget.TextView) View(android.view.View) AdapterView(android.widget.AdapterView) ListView(android.widget.ListView) OnItemLongClickListener(android.widget.AdapterView.OnItemLongClickListener)

Aggregations

ListView (android.widget.ListView)1139 View (android.view.View)739 AdapterView (android.widget.AdapterView)444 TextView (android.widget.TextView)389 ImageView (android.widget.ImageView)167 Intent (android.content.Intent)148 AbsListView (android.widget.AbsListView)135 OnItemClickListener (android.widget.AdapterView.OnItemClickListener)97 ArrayAdapter (android.widget.ArrayAdapter)97 ArrayList (java.util.ArrayList)81 ViewGroup (android.view.ViewGroup)75 ListAdapter (android.widget.ListAdapter)71 OnClickListener (android.view.View.OnClickListener)65 LayoutInflater (android.view.LayoutInflater)63 Bundle (android.os.Bundle)57 Button (android.widget.Button)55 LinearLayout (android.widget.LinearLayout)50 SuppressLint (android.annotation.SuppressLint)34 DialogInterface (android.content.DialogInterface)34 ScrollView (android.widget.ScrollView)31