Search in sources :

Example 66 with OnItemClickListener

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;
}
Also used : OnItemClickListener(android.widget.AdapterView.OnItemClickListener) LayoutInflater(android.view.LayoutInflater) ImageView(android.widget.ImageView) View(android.view.View) AdapterView(android.widget.AdapterView) TextView(android.widget.TextView) ListView(android.widget.ListView)

Example 67 with OnItemClickListener

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);
    }
}
Also used : OnItemClickListener(android.widget.AdapterView.OnItemClickListener) TextView(android.widget.TextView) View(android.view.View) AdapterView(android.widget.AdapterView) ListView(android.widget.ListView)

Example 68 with OnItemClickListener

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();
        }
    });
}
Also used : Account(de.pixart.messenger.entities.Account) OnItemClickListener(android.widget.AdapterView.OnItemClickListener) Jid(de.pixart.messenger.xmpp.jid.Jid) InvalidJidException(de.pixart.messenger.xmpp.jid.InvalidJidException) Conversation(de.pixart.messenger.entities.Conversation) AccountAdapter(de.pixart.messenger.ui.adapter.AccountAdapter) View(android.view.View) AdapterView(android.widget.AdapterView) ListView(android.widget.ListView)

Example 69 with OnItemClickListener

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);
}
Also used : OnItemClickListener(android.widget.AdapterView.OnItemClickListener) InvalidJidException(de.pixart.messenger.xmpp.jid.InvalidJidException) AccountAdapter(de.pixart.messenger.ui.adapter.AccountAdapter) View(android.view.View) AdapterView(android.widget.AdapterView) ListView(android.widget.ListView)

Example 70 with OnItemClickListener

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);
}
Also used : OnItemClickListener(android.widget.AdapterView.OnItemClickListener) Intent(android.content.Intent) View(android.view.View) AdapterView(android.widget.AdapterView) ListView(android.widget.ListView)

Aggregations

OnItemClickListener (android.widget.AdapterView.OnItemClickListener)241 AdapterView (android.widget.AdapterView)238 View (android.view.View)237 ListView (android.widget.ListView)188 TextView (android.widget.TextView)135 ImageView (android.widget.ImageView)86 Intent (android.content.Intent)68 OnClickListener (android.view.View.OnClickListener)44 SuppressLint (android.annotation.SuppressLint)32 LayoutInflater (android.view.LayoutInflater)32 AlertDialog (android.app.AlertDialog)27 DialogInterface (android.content.DialogInterface)27 GridView (android.widget.GridView)26 ArrayAdapter (android.widget.ArrayAdapter)24 Bundle (android.os.Bundle)23 Dialog (android.app.Dialog)22 ArrayList (java.util.ArrayList)21 Paint (android.graphics.Paint)17 File (java.io.File)17 AbsListView (android.widget.AbsListView)16