当前位置: 首页>>代码示例>>Java>>正文


Java AppCompatImageView.setOnClickListener方法代码示例

本文整理汇总了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);
}
 
开发者ID:techstar-cloud,项目名称:techstar-shop,代码行数:19,代码来源:ActivitySplashScreen.java

示例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);

}
 
开发者ID:penghongru,项目名称:Coder,代码行数:26,代码来源:MainActivity.java

示例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) {
    };
}
 
开发者ID:loonggg,项目名称:RecyclerViewBanner,代码行数:20,代码来源:RecyclerViewBanner.java

示例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);
}
 
开发者ID:tianyuan168326,项目名称:nono-android,代码行数:17,代码来源:RegisterActivity.java

示例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);
}
 
开发者ID:tianyuan168326,项目名称:nono-android,代码行数:26,代码来源:PhotoLayout.java

示例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;
}
 
开发者ID:hearsilent,项目名称:Android-Course-Samples,代码行数:16,代码来源:SecondFragment.java

示例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;
}
 
开发者ID:gandulf,项目名称:DsaTab,代码行数:12,代码来源:FABToolbarHelper.java


注:本文中的android.support.v7.widget.AppCompatImageView.setOnClickListener方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。