本文整理汇总了Java中android.support.v7.widget.AppCompatImageView.setOnClickListener方法的典型用法代码示例。如果您正苦于以下问题:Java AppCompatImageView.setOnClickListener方法的具体用法?Java AppCompatImageView.setOnClickListener怎么用?Java AppCompatImageView.setOnClickListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v7.widget.AppCompatImageView
的用法示例。
在下文中一共展示了AppCompatImageView.setOnClickListener方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import android.support.v7.widget.AppCompatImageView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash_screen);
prefManager = new PrefManager(this);
AppCompatImageView en = (AppCompatImageView)findViewById(R.id.langEn);
AppCompatImageView mn = (AppCompatImageView)findViewById(R.id.langMn);
AppCompatImageView cn = (AppCompatImageView)findViewById(R.id.langCn);
AppCompatImageView ru = (AppCompatImageView)findViewById(R.id.langRu);
mn.setOnClickListener(this);
en.setOnClickListener(this);
cn.setOnClickListener(this);
ru.setOnClickListener(this);
}
示例2: initActivity
import android.support.v7.widget.AppCompatImageView; //导入方法依赖的package包/类
@Override
protected void initActivity(@Nullable Bundle savedInstanceState) {
presenter = new MainPresenter(this);
homeBanner = (ImageView) findViewById(iv_home_banner);
tabLayout = (TabLayout) findViewById(R.id.tab_home_category);
appBarLayout = (AppBarLayout) findViewById(R.id.appbar);
viewPager = (ViewPager) findViewById(R.id.vp_home_category);
floatingActionButton = (FloatingActionButton) findViewById(R.id.fab_home_random);
coordinatorLayout = (CollapsingToolbarLayout) findViewById(R.id.collapsing_toolbar);
setting = (AppCompatImageView) findViewById(R.id.iv_home_setting);
setFabDynamicState();
homeBanner.setOnClickListener(this);
floatingActionButton.setOnClickListener(this);
setting.setOnClickListener(this);
presenter.getServerData();
viewPager.setAdapter(new MainPagerAdapter(getSupportFragmentManager()));
tabLayout.setupWithViewPager(viewPager);
}
示例3: onCreateViewHolder
import android.support.v7.widget.AppCompatImageView; //导入方法依赖的package包/类
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
AppCompatImageView img = new AppCompatImageView(parent.getContext());
RecyclerView.LayoutParams params = new RecyclerView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT);
img.setLayoutParams(params);
img.setId(R.id.rvb_banner_image_view_id);
img.setScaleType(AppCompatImageView.ScaleType.CENTER_CROP);
img.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (onRvBannerClickListener != null) {
onRvBannerClickListener.onClick(currentIndex % mData.size());
}
}
});
return new RecyclerView.ViewHolder(img) {
};
}
示例4: getDefinition
import android.support.v7.widget.AppCompatImageView; //导入方法依赖的package包/类
void getDefinition()
{
getSupportFragmentManager().beginTransaction().replace(R.id.container,registerAccountFragment).commit();
progBarRegister=(ProgressBar)this.findViewById(R.id.register_progress);
register_fab = (FloatingActionButton)this.findViewById(R.id.register_fab);
next_btn = (AppCompatImageView)findViewById(R.id.next_btn);
container = (FrameLayout)findViewById(R.id.container);
info_tv = (TextView)findViewById(R.id.info_tv);
register_fab.setOnClickListener(this);
next_btn.setOnClickListener(this);
bg = (ImageView)findViewById(R.id.bg);
Bitmap image = null;
image = BitmapFactory.decodeResource(getResources(),R.drawable.butiful_bg);
ImageHelper.fastblurSrc( image, 12);
bg.setImageBitmap(image);
}
示例5: initImgContainer
import android.support.v7.widget.AppCompatImageView; //导入方法依赖的package包/类
private void initImgContainer(){
LinearLayout linearLayout=new LinearLayout(getContext());
linearLayout.setOrientation(LinearLayout.VERTICAL);
linearLayout.setLayoutParams(new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
imageView=new AppCompatImageView(getContext());
LinearLayout.LayoutParams lp=new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
imageView.setLayoutParams(lp);
linearLayout.addView(imageView);
imageView.setOnClickListener(this);
editText=new AppCompatEditText(getContext());
linearLayout.addView(editText);
editText.setVisibility(GONE);
editText.setTextAppearance(getContext(),R.style.NoteTextAppearance);
editText.setGravity(Gravity.CENTER);
editText.setOnKeyListener(new OnKeyListener() {
@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
if(keyCode==KeyEvent.KEYCODE_DEL&&editText.getText().toString().isEmpty()){
editText.setVisibility(GONE);
}
return false;
}
});
this.addView(linearLayout);
}
示例6: onCreateView
import android.support.v7.widget.AppCompatImageView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View fl = inflater.inflate(R.layout.fragment_second, container, false);
imageView = (AppCompatImageView) fl.findViewById(R.id.imageView);
imageView.setOnClickListener(this);
textView1 = (AppCompatTextView) fl.findViewById(R.id.textView1);
textView1.setText(mParam1);
textView2 = (AppCompatTextView) fl.findViewById(R.id.textView2);
textView2.setText(mParam2);
// Inflate the layout for this fragment
return fl;
}
示例7: addToolbarItem
import android.support.v7.widget.AppCompatImageView; //导入方法依赖的package包/类
public ImageView addToolbarItem(int viewId, int resourceId,View.OnClickListener clickDelegate) {
AppCompatImageView modAdd = new AppCompatImageView(toolbar.getContext());
if (viewId>0) {
modAdd.setId(viewId);
}
modAdd.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
modAdd.setImageDrawable(ViewUtils.circleIcon(modAdd.getContext(), resourceId));
modAdd.setOnClickListener(clickDelegate);
toolbarLayout.addView(modAdd,toolbarLayout.getChildCount()-1, params);
return modAdd;
}