Example usage for android.widget ImageView ImageView

List of usage examples for android.widget ImageView ImageView

Introduction

In this page you can find the example usage for android.widget ImageView ImageView.

Prototype

public ImageView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) 

Source Link

Usage

From source file:android.hqs.view.pager.indicator.IconPageIndicator.java

public void notifyDataSetChanged() {
    mIconsLayout.removeAllViews();//  w  w w  .  j av a2  s .  c o m
    IconPagerAdapter iconAdapter = (IconPagerAdapter) mViewPager.getAdapter();
    int count = iconAdapter.getCount();
    for (int i = 0; i < count; i++) {
        ImageView view = new ImageView(getContext(), null, R.attr.vpiIconPageIndicatorStyle);
        view.setImageResource(iconAdapter.getIconResId(i));
        mIconsLayout.addView(view);
    }
    if (mSelectedIndex > count) {
        mSelectedIndex = count - 1;
    }
    setCurrentItem(mSelectedIndex);
    requestLayout();
}

From source file:com.angui.exam.widget.IconPageIndicator.java

public void notifyDataSetChanged() {
    mIconsLayout.removeAllViews();// w w w  . j ava 2s.  c om
    IconPagerAdapter iconAdapter = (IconPagerAdapter) mViewPager.getAdapter();
    int count = iconAdapter.getCount();
    for (int i = 0; i < count; i++) {
        ImageView view = new ImageView(getContext(), null, R.attr.vpiIconPageIndicatorStyle);
        view.setImageResource(iconAdapter.getIconResId(i));
        final int j = i;
        view.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                // TODO Auto-generated method stub
                setCurrentItem(j);
            }
        });
        mIconsLayout.addView(view);
    }
    if (mSelectedIndex > count) {
        mSelectedIndex = count - 1;
    }
    setCurrentItem(mSelectedIndex);
    requestLayout();
}

From source file:com.moxm.frameworks.support.indicator.IconPageIndicator.java

public void notifyDataSetChanged() {
    mIconsLayout.removeAllViews();/* ww w. ja  va  2 s  .co m*/
    IconPagerAdapter iconAdapter = (IconPagerAdapter) mViewPager.getAdapter();
    int count = iconAdapter.getCount();
    for (int i = 0; i < count; i++) {
        ImageView view = new ImageView(getContext(), null, 0);
        view.setImageResource(iconAdapter.getIconResId(i));
        view.setPadding(3, 0, 3, 0);
        mIconsLayout.addView(view);
    }
    if (mSelectedIndex > count) {
        mSelectedIndex = count - 1;
    }
    setCurrentItem(mSelectedIndex);
    requestLayout();
}

From source file:com.example.face.IconPageIndicator.java

public void notifyDataSetChanged() {
    mIconsLayout.removeAllViews();//from   w  ww  .  ja v  a 2s .  com
    IconPagerAdapter iconAdapter = (IconPagerAdapter) mViewPager.getAdapter();
    int count = iconAdapter.getCount();
    for (int i = 0; i < count; i++) {
        ImageView view = new ImageView(getContext(), null, R.attr.vpiIconPageIndicatorStyle);
        view.setImageResource(iconAdapter.getIconResId(i));
        LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,
                LayoutParams.WRAP_CONTENT);
        layoutParams.setMargins(10, 0, 10, 0);
        mIconsLayout.addView(view, layoutParams);
    }
    if (mSelectedIndex > count) {
        mSelectedIndex = count - 1;
    }
    setCurrentItem(mSelectedIndex);
    requestLayout();
}

From source file:com.app.laundry.tabs.lib.IconPageIndicator2.java

public void notifyDataSetChanged() {
    mIconsLayout.removeAllViews();/*from ww  w  .  j  av a2  s .  co  m*/
    IconPagerAdapter2 iconAdapter = (IconPagerAdapter2) mViewPager.getAdapter();
    int count = iconAdapter.getCount();
    for (int i = 0; i < count; i++) {
        ImageView view = new ImageView(getContext(), null, R.attr.vpiIconPageIndicatorStyle);
        view.setImageResource(iconAdapter.getIconResId(i));
        mIconsLayout.addView(view);
    }
    if (mSelectedIndex > count) {
        mSelectedIndex = count - 1;
    }
    setCurrentItem(mSelectedIndex);
    requestLayout();
}

From source file:de.qabel.qabelbox.ui.views.IconPageIndicator.java

public void notifyDataSetChanged() {

    mIconsLayout.removeAllViews();/*from ww w .j  a  v a 2 s.co  m*/
    IconPagerAdapter iconAdapter = (IconPagerAdapter) mViewPager.getAdapter();
    int count = iconAdapter.getCount();
    for (int i = 0; i < count; i++) {
        ImageView view = new ImageView(getContext(), null, R.attr.vpiIconPageIndicatorStyle);
        view.setImageResource(iconAdapter.getIconResId(i));
        mIconsLayout.addView(view);
    }
    if (mSelectedIndex > count) {
        mSelectedIndex = count - 1;
    }
    setCurrentItem(mSelectedIndex);
    requestLayout();
}

From source file:com.maedi.user.godok.v1.viewpagerindicator.IconPageIndicator.java

public void notifyDataSetChanged() {
    mIconsLayout.removeAllViews();// ww w .  j a  v a2  s  .  c o m
    com.viewpagerindicator.IconPagerAdapter iconAdapter = (IconPagerAdapter) mViewPager.getAdapter();
    int count = iconAdapter.getCount();
    for (int i = 0; i < count; i++) {
        ImageView view = new ImageView(getContext(), null, R.attr.vpiIconPageIndicatorStyle);
        view.setImageResource(iconAdapter.getIconResId(i));
        mIconsLayout.addView(view);
    }
    if (mSelectedIndex > count) {
        mSelectedIndex = count - 1;
    }
    setCurrentItem(mSelectedIndex);
    requestLayout();
}

From source file:com.benefit.buy.library.viewpagerindicator.IconPageIndicator.java

@Override
public void notifyDataSetChanged() {
    mIconsLayout.removeAllViews();/*from w w w.  jav a 2 s . c om*/
    IconPagerAdapter iconAdapter = (IconPagerAdapter) mViewPager.getAdapter();
    int count = iconAdapter.getCount();
    for (int i = 0; i < count; i++) {
        ImageView view = new ImageView(getContext(), null, R.attr.vpiIconPageIndicatorStyle);
        view.setImageResource(iconAdapter.getIconResId(i));
        mIconsLayout.addView(view);
    }
    if (mSelectedIndex > count) {
        mSelectedIndex = count - 1;
    }
    setCurrentItem(mSelectedIndex);
    requestLayout();
}

From source file:com.futureinst.viewpagerindicator.IconPageIndicator.java

public void notifyDataSetChanged() {
    mIconsLayout.removeAllViews();/*from   w  w w  . j  a  va  2 s.c  o m*/
    IconPagerAdapter iconAdapter = (IconPagerAdapter) mViewPager.getAdapter();
    int count = iconAdapter.getCount();
    for (int i = 0; i < count; i++) {
        ImageView view = new ImageView(getContext(), null, com.futureinst.R.attr.vpiIconPageIndicatorStyle);
        view.setImageResource(iconAdapter.getIconResId(i));
        mIconsLayout.addView(view);
    }
    if (mSelectedIndex > count) {
        mSelectedIndex = count - 1;
    }
    setCurrentItem(mSelectedIndex);
    requestLayout();
}

From source file:com.viewpagerindicator.IconTitlePageIndicator.java

@Override
public void notifyDataSetChanged() {
    mIconsLayout.removeAllViews();/*from   w  w  w .j  av  a  2  s .  co  m*/
    IconPagerAdapter iconAdapter = (IconPagerAdapter) mViewPager.getAdapter();
    int count = iconAdapter.getCount();
    for (int i = 0; i < count; i++) {
        ImageView view = new ImageView(getContext(), null, R.attr.vpiIconPageIndicatorStyle);
        if (iconAdapter.getIconResId(i) > 0) {
            view.setImageResource(iconAdapter.getIconResId(i));
        } else if (!TextUtils.isEmpty(iconAdapter.getImageUrl(i))) {
            // ImageLoaderUtil.getIntance(getContext()).loadImageFromUrl(iconAdapter.getDefaultIconResId(i),
            // iconAdapter.getDefaultIconResId(i), view,
            // iconAdapter.getImageUrl(i), null);
        }
        mIconsLayout.addView(view);
    }
    if (mSelectedIndex > count) {
        mSelectedIndex = count - 1;
    }
    setCurrentItem(mSelectedIndex);
    requestLayout();
}