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