use of android.widget.AdapterView.OnItemClickListener in project android_packages_apps_DU-Tweaks by DirtyUnicorns.
the class Recents method createDialogView.
private View createDialogView(final Context context, Map<String, IconPackInfo> supportedPackages) {
final LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
final View view = inflater.inflate(R.layout.dialog_iconpack, null);
final IconAdapter adapter = new IconAdapter(context, supportedPackages);
mListView = (ListView) view.findViewById(R.id.iconpack_list);
mListView.setAdapter(adapter);
mListView.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
if (adapter.isCurrentIconPack(position)) {
return;
}
String selectedPackage = adapter.getItem(position);
Settings.System.putString(getContext().getContentResolver(), Settings.System.RECENTS_ICON_PACK, selectedPackage);
mDialog.dismiss();
}
});
return view;
}
use of android.widget.AdapterView.OnItemClickListener in project PhoneProfiles by henrichg.
the class ShortcutCreatorListFragment method doOnViewCreated.
private void doOnViewCreated(View view) /*, Bundle savedInstanceState*/
{
listView = view.findViewById(R.id.shortcut_profiles_list);
textViewNoData = view.findViewById(R.id.shortcut_profiles_list_empty);
progressBar = view.findViewById(R.id.shortcut_profiles_list_linla_progress);
listView.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
createShortcut(position);
}
});
if (activityDataWrapper.profileList == null) {
LoadProfileListAsyncTask asyncTask = new LoadProfileListAsyncTask(this);
this.asyncTaskContext = new WeakReference<>(asyncTask);
asyncTask.execute();
} else {
listView.setAdapter(profileListAdapter);
}
}
use of android.widget.AdapterView.OnItemClickListener in project Pix-Art-Messenger by kriztan.
the class ShareViaAccountActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_manage_accounts);
accountListView = findViewById(R.id.account_list);
this.mAccountAdapter = new AccountAdapter(this, accountList);
accountListView.setAdapter(this.mAccountAdapter);
accountListView.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View view, int position, long arg3) {
final Account account = accountList.get(position);
final String body = getIntent().getStringExtra(EXTRA_BODY);
try {
final Jid contact = Jid.fromString(getIntent().getStringExtra(EXTRA_CONTACT));
final Conversation conversation = xmppConnectionService.findOrCreateConversation(account, contact, false, false);
switchToConversation(conversation, body, false);
} catch (InvalidJidException e) {
// ignore error
}
finish();
}
});
}
use of android.widget.AdapterView.OnItemClickListener in project Pix-Art-Messenger by kriztan.
the class ManageAccountActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_manage_accounts);
if (savedInstanceState != null) {
String jid = savedInstanceState.getString(STATE_SELECTED_ACCOUNT);
if (jid != null) {
try {
this.selectedAccountJid = Jid.fromString(jid);
} catch (InvalidJidException e) {
this.selectedAccountJid = null;
}
}
}
accountListView = findViewById(R.id.account_list);
this.mAccountAdapter = new AccountAdapter(this, accountList);
accountListView.setAdapter(this.mAccountAdapter);
accountListView.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View view, int position, long arg3) {
switchToAccount(accountList.get(position));
}
});
registerForContextMenu(accountListView);
}
use of android.widget.AdapterView.OnItemClickListener in project JavaForFun by gumartinm.
the class MobiAdsLatestList method onResume.
@Override
protected void onResume() {
super.onResume();
mAdapter = new AdsEntryLatestAdapter(this, R.layout.ads_entry_list_item);
setListAdapter(mAdapter);
getListView().setTextFilterEnabled(true);
// Tell the list view to show one checked/activated item at a time.
getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE);
getListView().setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(final AdapterView<?> parent, final View view, final int position, final long id) {
final AdsEntry entry = mAdapter.getItem(position);
if (!entry.isRead()) {
setIsReadEntry(entry);
}
// Change notification (if there is one)
Intent updateDatabase = new Intent("de.android.mobiads.MOBIADSSERVICERECEIVER");
sendBroadcast(updateDatabase);
mAdapter.remove(entry);
// Update view lists
updateDatabase = new Intent("de.android.mobiads.MOBIADSLISTRECEIVER");
sendBroadcast(updateDatabase);
// Going to web browser.
String url = entry.getURL();
if (!url.startsWith("http://") && !url.startsWith("https://")) {
url = "http://" + url;
}
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
mAdapter.notifyDataSetChanged();
}
});
registerForContextMenu(getListView());
getLoaderManager().initLoader(0, null, this);
}
Aggregations