Search in sources :

Example 21 with OnItemClickListener

use of android.widget.AdapterView.OnItemClickListener in project k-9 by k9mail.

the class FolderList method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (UpgradeDatabases.actionUpgradeDatabases(this, getIntent())) {
        finish();
        return;
    }
    mActionBarProgressView = getActionBarProgressView();
    mActionBar = getActionBar();
    initializeActionBar();
    setContentView(R.layout.folder_list);
    mListView = getListView();
    mListView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
    mListView.setLongClickable(true);
    mListView.setFastScrollEnabled(true);
    mListView.setScrollingCacheEnabled(false);
    mListView.setOnItemClickListener(new OnItemClickListener() {

        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            onOpenFolder(((FolderInfoHolder) mAdapter.getItem(position)).name);
        }
    });
    registerForContextMenu(mListView);
    mListView.setSaveEnabled(true);
    mInflater = getLayoutInflater();
    context = this;
    onNewIntent(getIntent());
    if (isFinishing()) {
        /*
             * onNewIntent() may call finish(), but execution will still continue here.
             * We return now because we don't want to display the changelog which can
             * result in a leaked window error.
             */
        return;
    }
    ChangeLog cl = new ChangeLog(this);
    if (cl.isFirstRun()) {
        cl.getLogDialog().show();
    }
}
Also used : OnItemClickListener(android.widget.AdapterView.OnItemClickListener) ChangeLog(de.cketti.library.changelog.ChangeLog) View(android.view.View) AdapterView(android.widget.AdapterView) TextView(android.widget.TextView) ListView(android.widget.ListView) SearchView(android.widget.SearchView) SuppressLint(android.annotation.SuppressLint)

Example 22 with OnItemClickListener

use of android.widget.AdapterView.OnItemClickListener in project standup-timer by jwood.

the class TeamDetails method createMeetingListClickListener.

private OnItemClickListener createMeetingListClickListener() {
    return new OnItemClickListener() {

        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            String meetingTime = meetingListAdapter.getItem(position);
            Intent intent = new Intent(TeamDetails.this, MeetingDetails.class);
            intent.putExtra("teamName", team.getName());
            intent.putExtra("meetingTime", meetingTime);
            startActivity(intent);
        }
    };
}
Also used : OnItemClickListener(android.widget.AdapterView.OnItemClickListener) AdapterView(android.widget.AdapterView) Intent(android.content.Intent) View(android.view.View) AdapterView(android.widget.AdapterView) TextView(android.widget.TextView) ListView(android.widget.ListView)

Example 23 with OnItemClickListener

use of android.widget.AdapterView.OnItemClickListener in project qksms by moezbhatti.

the class QKDialog method setDoubleLineItems.

public QKDialog setDoubleLineItems(String[] titles, String[] bodies, final OnItemClickListener onClickListener) {
    int size = Math.min(titles.length, bodies.length);
    DoubleLineListItem[] doubleLineListItems = new DoubleLineListItem[size];
    for (int i = 0; i < size; i++) {
        doubleLineListItems[i] = new DoubleLineListItem();
        doubleLineListItems[i].title = titles[i];
        doubleLineListItems[i].body = bodies[i];
    }
    ArrayAdapter adapter = new DoubleLineArrayAdapter(mContext, doubleLineListItems);
    ListView listView = new ListView(mContext);
    listView.setAdapter(adapter);
    listView.setDivider(null);
    listView.setPadding(0, Units.dpToPx(mContext, 8), 0, Units.dpToPx(mContext, 8));
    listView.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            if (onClickListener != null) {
                onClickListener.onItemClick(parent, view, position, id);
                dismiss();
            }
        }
    });
    return setCustomView(listView);
}
Also used : ListView(android.widget.ListView) OnItemClickListener(android.widget.AdapterView.OnItemClickListener) QKTextView(com.moez.QKSMS.ui.view.QKTextView) View(android.view.View) AdapterView(android.widget.AdapterView) RecyclerView(android.support.v7.widget.RecyclerView) ScrollView(android.widget.ScrollView) ListView(android.widget.ListView) ArrayAdapter(android.widget.ArrayAdapter)

Example 24 with OnItemClickListener

use of android.widget.AdapterView.OnItemClickListener in project android-app-common-tasks by multidots.

the class MainActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    mContext = MainActivity.this;
    //Activity mActivity = MainActivity.this;
    tvText = (TextView) findViewById(R.id.text);
    String[] sdkFunctionalityListValue = new String[] { "Validations", /* 0 */
    "Internet availability", /* 1 */
    "Date formats", /* 2 */
    "Device id", /* 3 */
    "Set preferences", /* 4 */
    "Get preferences", /* 5 */
    "Get current location", /* 6 */
    "Pinchzoom image", /* 7 */
    "Get application icon", /* 8 */
    "Send notification", /* 9 */
    "Get random character from A to Z", /* 10 */
    "Screen sleep mode on off", /* 11 */
    "Open image from path", /* 12 */
    "Open video from path", /* 13 */
    "Open url in browser", /* 14 */
    "Show address on map", /* 15 */
    "Create folder or directory", /* 16 */
    "Download image from url", /* 17 */
    "Open date picker", /* 18 */
    "Open time picker", /* 19 */
    "Get files count in directory", /* 20 */
    "Get date difference", /* 21 */
    "Convert string date to dateformat", /* 22 */
    "Get device height", /* 23 */
    "Get device width", /* 24 */
    "Generate random number", /* 25 */
    "Postfix for number", /* 26 */
    "Convert comma separated string to arraylist and viseversa", /* 27 */
    "Music ON OFF", /* 28 */
    "Apply blur bffect on image", /* 29 */
    "Drawable to bitmap and viceversa", /* 30 */
    "Set device volume as app volume", /* 31 */
    "Set and get image from preferences", /* 32 */
    "Application version", /* 33 */
    "Vertical text views", /* 34 */
    "Is SDCard available?", /* 35 */
    "Show share dialog", /* 36 */
    "Change device profile", /* 37 */
    "Change bitmap to rounded cornered", /* 38 */
    "Show toast", /* 39 */
    "Prevent double click", /* 40 */
    "Bluetooth/wifi ON OFF", /* 41 */
    "Pick/capture/preview image/video and crop image", /* 42 */
    "Url validation & ripple effect", /* 43 */
    "Contacts with email id & screenshot", /* 44 */
    "Social integration", /* 45 */
    "Pick color", /* 46 */
    "Remote file size or download file" };
    ListView sdkFunctionalityList = (ListView) findViewById(R.id.Md_list_company);
    ArrayAdapter<String> stringArrayAdapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, sdkFunctionalityListValue);
    sdkFunctionalityList.setAdapter(stringArrayAdapter);
    sdkFunctionalityList.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
            selectedListItem(position);
        }
    });
    sdkFunctionalityList.setOnScrollListener(new AbsListView.OnScrollListener() {

        @Override
        public void onScrollStateChanged(AbsListView view, int scrollState) {
            tvText.setText("");
        }

        @Override
        public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
        }
    });
}
Also used : OnItemClickListener(android.widget.AdapterView.OnItemClickListener) AbsListView(android.widget.AbsListView) View(android.view.View) AdapterView(android.widget.AdapterView) AbsListView(android.widget.AbsListView) TextView(android.widget.TextView) ListView(android.widget.ListView) AbsListView(android.widget.AbsListView) ListView(android.widget.ListView) ArrayAdapter(android.widget.ArrayAdapter)

Example 25 with OnItemClickListener

use of android.widget.AdapterView.OnItemClickListener in project android-app-common-tasks by multidots.

the class MaterialLibrariesListActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_library_list);
    //Context mContext = MaterialLibrariesListActivity.this;
    //Activity mActivity = MaterialLibrariesListActivity.this;
    String[] sdkFunctionalityListValue = new String[] { "Material Design Library", /* 0 */
    "Drawer Arrow Drawable", /* 1 */
    "Material Tabs", /* 2 */
    "Pager Sliding Tab Strip", /* 3 */
    "Material Ripple", /* 4 */
    "Ripple Effect", /* 5 */
    "L Drawer", /* 6 */
    "Material Design Icons", /* 7 */
    "Android Material Design Toolbar", /* 8 */
    "Material Edit Text", /* 9 */
    "Material Menu", /* 10 */
    "Material Dialogs", /* 11 */
    "Alert Dialog Pro", /* 12 */
    "Material Navigation Drawer", /* 13 */
    "Material Dialog", /* 14 */
    "Materialish Progress", /* 15 */
    "Floating Action Button", /* 16 */
    "Android Floating Action Button", /* 17 */
    "Snack Bar", /* 18 */
    "Circular Reveal", /* 19 */
    "Material Range Bar", /* 20 */
    "Lollipop AppCompat Widgets Skeleton", /* 21 */
    "Carbon", /* 22 */
    "Material Calendar View", /* 23 */
    "Material", /* 24 */
    "Wave View", /* 25 */
    "Reside Layout", /* 26 */
    "Android Swipe Layout", /* 27 */
    "Free Flow", /* 28 */
    "Swipe Back Layout", /* 29 */
    "Maskable Layout", /* 30 */
    "Expandable Layout", /* 31 */
    "Android Pull Refresh Layout", /* 32 */
    "Tile View", /* 33 */
    "Showcase View", /* 34 */
    "Ultra Pull To Refresh", /* 35 */
    "Android View Hover", /* 36 */
    "Draggable Panel", /* 37 */
    "Pull to Refresh Rentals Android", /* 38 */
    "Pull to Refresh Tours", /* 39 */
    "Inbox Layout", /* 40 */
    "Swipe Back", /* 41 */
    "Arc Layout", /* 42 */
    "Dragger", // Buttons
    "Circular Progress Button", /* 44 */
    "Android Process Button", /* 45 */
    "Android Circle Button", /* 46 */
    "Android Flat Button", /* 47 */
    "Moving Button", "Label View", // List / Grid
    "Super Recycler View", "Flabby List View", "Recycler View Sticky Headers", "Parallax List View", "Pull Zoom View", "Swipe Menu List View", "Discroll View", "Sticky List Headers", "List Buddies", "Android Observable Scroll View", "Asymmetric Grid View", "Dynamic Grid", "Android Staggered Grid", "Swipe List View", "Android Parallax Recycler View", "Blur Sticky Header List View", "Recycler View Animators", "Recycler View Flexible Divider", "Android Tree View", "Recycler View Fast Scroller", "Recycler View Multiple View Types Adapter", // ViewPager
    "Parallax Pager Transformer", "View Pager Transforms", "Circle Indicator", "Android ViewPager Indicator", "Android Parallax Header ViewPager", "FreePager", "Spring Indicator", "Smart Tab Layout", // Label / Form
    "Shimmer Android", "Shimmer for Android", "Titanic", "MatchView", "Android AutoFitTextView", "Secret TextView", "TextJustify Android", "Rounded Letter View", "TextDrawable", "Babushka Text", "Expandable TextView", "Float Labeled EditText" };
    ListView sdkFunctionalityList = (ListView) findViewById(R.id.Md_list_company);
    ArrayAdapter<String> stringArrayAdapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, sdkFunctionalityListValue);
    sdkFunctionalityList.setAdapter(stringArrayAdapter);
    sdkFunctionalityList.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
            selectedListItem(position);
        }
    });
}
Also used : ListView(android.widget.ListView) OnItemClickListener(android.widget.AdapterView.OnItemClickListener) View(android.view.View) AdapterView(android.widget.AdapterView) ListView(android.widget.ListView) ArrayAdapter(android.widget.ArrayAdapter)

Aggregations

OnItemClickListener (android.widget.AdapterView.OnItemClickListener)135 AdapterView (android.widget.AdapterView)134 View (android.view.View)133 ListView (android.widget.ListView)102 TextView (android.widget.TextView)71 Intent (android.content.Intent)43 ImageView (android.widget.ImageView)41 OnClickListener (android.view.View.OnClickListener)24 Bundle (android.os.Bundle)18 ArrayAdapter (android.widget.ArrayAdapter)17 SuppressLint (android.annotation.SuppressLint)15 Paint (android.graphics.Paint)12 ColorDrawable (android.graphics.drawable.ColorDrawable)11 GridView (android.widget.GridView)11 LayoutInflater (android.view.LayoutInflater)10 DialogInterface (android.content.DialogInterface)9 CheckBox (android.widget.CheckBox)9 LinearLayout (android.widget.LinearLayout)9 ArrayList (java.util.ArrayList)7 OnItemLongClickListener (android.widget.AdapterView.OnItemLongClickListener)6