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);
}
});
}
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());
}
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;
}
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);
}
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());
}
Aggregations