Search in sources :

Example 96 with OnItemClickListener

use of android.widget.AdapterView.OnItemClickListener in project FlycoDialog_Master by H07000223.

the class NormalListDialog method setUiBeforShow.

@SuppressWarnings("deprecation")
@Override
public void setUiBeforShow() {
    /**
     * title
     */
    float radius = dp2px(mCornerRadius);
    mTvTitle.setBackgroundDrawable(CornerUtils.cornerDrawable(mTitleBgColor, new float[] { radius, radius, radius, radius, 0, 0, 0, 0 }));
    mTvTitle.setText(mTitle);
    mTvTitle.setTextSize(TypedValue.COMPLEX_UNIT_SP, mTitleTextSize);
    mTvTitle.setTextColor(mTitleTextColor);
    mTvTitle.setVisibility(mIsTitleShow ? View.VISIBLE : View.GONE);
    /**
     * listview
     */
    mLv.setDivider(new ColorDrawable(mDividerColor));
    mLv.setDividerHeight(dp2px(mDividerHeight));
    if (mIsTitleShow) {
        mLv.setBackgroundDrawable(CornerUtils.cornerDrawable(mLvBgColor, new float[] { 0, 0, 0, 0, radius, radius, radius, radius }));
    } else {
        mLv.setBackgroundDrawable(CornerUtils.cornerDrawable(mLvBgColor, radius));
    }
    if (mAdapter == null) {
        mAdapter = new ListDialogAdapter();
    }
    mLv.setAdapter(mAdapter);
    mLv.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            if (mOnOperItemClickL != null) {
                mOnOperItemClickL.onOperItemClick(parent, view, position, id);
            }
        }
    });
    mLv.setLayoutAnimation(mLac);
}
Also used : ColorDrawable(android.graphics.drawable.ColorDrawable) OnItemClickListener(android.widget.AdapterView.OnItemClickListener) ImageView(android.widget.ImageView) TextView(android.widget.TextView) View(android.view.View) AdapterView(android.widget.AdapterView) ListView(android.widget.ListView)

Example 97 with OnItemClickListener

use of android.widget.AdapterView.OnItemClickListener in project FlycoDialog_Master by H07000223.

the class ActionSheetDialog method setUiBeforShow.

@Override
public void setUiBeforShow() {
    /**
     * title
     */
    float radius = dp2px(mCornerRadius);
    mTvTitle.setHeight(dp2px(mTitleHeight));
    mTvTitle.setBackgroundDrawable(CornerUtils.cornerDrawable(mTitleBgColor, new float[] { radius, radius, radius, radius, 0, 0, 0, 0 }));
    mTvTitle.setText(mTitle);
    mTvTitle.setTextSize(TypedValue.COMPLEX_UNIT_SP, mTitleTextSize);
    mTvTitle.setTextColor(mTitleTextColor);
    mTvTitle.setVisibility(mIsTitleShow ? View.VISIBLE : View.GONE);
    /**
     * title underline
     */
    mVLineTitle.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, dp2px(mDividerHeight)));
    mVLineTitle.setBackgroundColor(mDividerColor);
    mVLineTitle.setVisibility(mIsTitleShow ? View.VISIBLE : View.GONE);
    /**
     * mCancel btn
     */
    mTvCancel.setHeight(dp2px(mItemHeight));
    mTvCancel.setText(mCancelText);
    mTvCancel.setTextSize(TypedValue.COMPLEX_UNIT_SP, mCancelTextSize);
    mTvCancel.setTextColor(mCancelTextColor);
    mTvCancel.setBackgroundDrawable(CornerUtils.listItemSelector(radius, mLvBgColor, mItemPressColor, 1, 0));
    mTvCancel.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            dismiss();
        }
    });
    /**
     * listview
     */
    mLv.setDivider(new ColorDrawable(mDividerColor));
    mLv.setDividerHeight(dp2px(mDividerHeight));
    if (mIsTitleShow) {
        mLv.setBackgroundDrawable(CornerUtils.cornerDrawable(mLvBgColor, new float[] { 0, 0, 0, 0, radius, radius, radius, radius }));
    } else {
        mLv.setBackgroundDrawable(CornerUtils.cornerDrawable(mLvBgColor, radius));
    }
    if (mAdapter == null) {
        mAdapter = new ListDialogAdapter();
    }
    mLv.setAdapter(mAdapter);
    mLv.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            if (mOnOperItemClickL != null) {
                mOnOperItemClickL.onOperItemClick(parent, view, position, id);
            }
        }
    });
    mLv.setLayoutAnimation(mLac);
}
Also used : LayoutParams(android.widget.LinearLayout.LayoutParams) ColorDrawable(android.graphics.drawable.ColorDrawable) OnItemClickListener(android.widget.AdapterView.OnItemClickListener) ImageView(android.widget.ImageView) TextView(android.widget.TextView) View(android.view.View) AdapterView(android.widget.AdapterView) ListView(android.widget.ListView)

Example 98 with OnItemClickListener

use of android.widget.AdapterView.OnItemClickListener in project Diaspora-Webclient by voidcode.

the class PodSettingsActivity method fillListview.

public void fillListview(String[] _lvPods_arr) {
    lvPods.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, _lvPods_arr));
    lvPods.setOnItemClickListener(new OnItemClickListener() {

        public void onItemClick(AdapterView<?> a, View v, int position, long id) {
            // onclick put select pod to editTextCurrentpod
            editTextCurrentpod.setText(lvPods.getItemAtPosition(position).toString());
        }
    });
}
Also used : OnItemClickListener(android.widget.AdapterView.OnItemClickListener) View(android.view.View) AdapterView(android.widget.AdapterView) ListView(android.widget.ListView)

Example 99 with OnItemClickListener

use of android.widget.AdapterView.OnItemClickListener in project android-app by eoecn.

the class BlogFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    super.onCreateView(inflater, container, savedInstanceState);
    listview.setXListViewListener(this);
    // construct the RelativeLayout
    listview.setXListViewListener(this);
    // construct the RelativeLayout
    mAdapter = new MyAdapter();
    mAdapter.appendToList(items_list);
    listview.setAdapter(mAdapter);
    listview.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            // TODO Auto-generated method stub
            BlogContentItem item = (BlogContentItem) mAdapter.getItem(position - 1);
            startDetailActivity(mActivity, item.getDetail_url(), "博客", item.getTitle());
        }
    });
    return view;
}
Also used : OnItemClickListener(android.widget.AdapterView.OnItemClickListener) BlogContentItem(cn.eoe.app.entity.BlogContentItem) ImageView(android.widget.ImageView) TextView(android.widget.TextView) View(android.view.View) AdapterView(android.widget.AdapterView)

Example 100 with OnItemClickListener

use of android.widget.AdapterView.OnItemClickListener in project android-app by eoecn.

the class NewsFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreateView(inflater, container, savedInstanceState);
    listview.setXListViewListener(this);
    // construct the RelativeLayout
    mAdapter = new MyAdapter();
    mAdapter.appendToList(items_list);
    listview.setAdapter(mAdapter);
    listview.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            // TODO Auto-generated method stub
            NewsContentItem item = (NewsContentItem) mAdapter.getItem(position - 1);
            startDetailActivity(mActivity, item.getDetail_url(), "资讯", item.getTitle());
        }
    });
    return view;
}
Also used : OnItemClickListener(android.widget.AdapterView.OnItemClickListener) NewsContentItem(cn.eoe.app.entity.NewsContentItem) ImageView(android.widget.ImageView) TextView(android.widget.TextView) View(android.view.View) AdapterView(android.widget.AdapterView) SuppressLint(android.annotation.SuppressLint)

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