Search in sources :

Example 51 with ImageView

use of android.widget.ImageView in project glimmr by brk3.

the class PhotoViewerFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    if (BuildConfig.DEBUG)
        Log.d(getLogTag(), "onCreateView");
    mLayout = (RelativeLayout) inflater.inflate(R.layout.photoviewer_fragment, container, false);
    mVideoButton = (ImageView) mLayout.findViewById(R.id.play_video_overlay);
    mImageView = (ImageView) mLayout.findViewById(R.id.image);
    mAttacher = new PhotoViewAttacher(mImageView);
    mTextViewTitle = (TextView) mLayout.findViewById(R.id.textViewTitle);
    mTextViewAuthor = (TextView) mLayout.findViewById(R.id.textViewAuthor);
    mProgress = (ProgressBar) mLayout.findViewById(R.id.progress);
    mAttacher.setOnPhotoTapListener(new OnPhotoTapListener() {

        @Override
        public void onPhotoTap(View view, float x, float y) {
            BusProvider.getInstance().post(new PhotoViewerVisibilityChangeEvent(!mActionBar.isShowing(), PhotoViewerFragment.this));
        }
    });
    /* If this fragment is new as part of a set, update it's overlay
         * visibility based on the state of the actionbar */
    setOverlayVisibility(mActionBar.isShowing());
    displayImage();
    return mLayout;
}
Also used : OnPhotoTapListener(uk.co.senab.photoview.PhotoViewAttacher.OnPhotoTapListener) PhotoViewAttacher(uk.co.senab.photoview.PhotoViewAttacher) ImageView(android.widget.ImageView) View(android.view.View) TextView(android.widget.TextView)

Example 52 with ImageView

use of android.widget.ImageView in project AppIntro by apl-devs.

the class CustomBackgroundIntro method onCreate.

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    addSlide(AppIntroFragment.newInstance("Welcome!", "This is a demo of the AppIntro library, with a custom background on each slide!", R.drawable.ic_slide1, Color.TRANSPARENT));
    addSlide(AppIntroFragment.newInstance("Clean App Intros", "This library offers developers the ability to add clean app intros at the start of their apps.", R.drawable.ic_slide2, Color.TRANSPARENT));
    addSlide(AppIntroFragment.newInstance("Simple, yet Customizable", "The library offers a lot of customization, while keeping it simple for those that like simple.", R.drawable.ic_slide3, Color.TRANSPARENT));
    addSlide(AppIntroFragment.newInstance("Explore", "Feel free to explore the rest of the library demo!", R.drawable.ic_slide4, Color.TRANSPARENT));
    // Declare a new image view
    ImageView imageView = new ImageView(this);
    // Bind a drawable to the imageview
    imageView.setImageResource(R.drawable.ic_sample_bg);
    // Set background color
    imageView.setBackgroundColor(Color.BLACK);
    // Set layout params
    imageView.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
    // Bind the background to the intro
    setBackgroundView(imageView);
}
Also used : FrameLayout(android.widget.FrameLayout) ImageView(android.widget.ImageView)

Example 53 with ImageView

use of android.widget.ImageView in project AppIntro by apl-devs.

the class AppIntro method setImageNextButton.

/**
     * Override Next button
     *
     * @param imageNextButton your drawable resource
     */
public void setImageNextButton(final Drawable imageNextButton) {
    final ImageView nextButton = (ImageView) findViewById(R.id.next);
    nextButton.setImageDrawable(imageNextButton);
}
Also used : ImageView(android.widget.ImageView)

Example 54 with ImageView

use of android.widget.ImageView in project platform_frameworks_base by android.

the class UserAdapter method getDropDownView.

@Override
public View getDropDownView(int position, View convertView, ViewGroup parent) {
    final View row = convertView != null ? convertView : createUser(parent);
    UserDetails user = data.get(position);
    ((ImageView) row.findViewById(android.R.id.icon)).setImageDrawable(user.mIcon);
    ((TextView) row.findViewById(android.R.id.title)).setText(getTitle(user));
    return row;
}
Also used : TextView(android.widget.TextView) ImageView(android.widget.ImageView) ImageView(android.widget.ImageView) TextView(android.widget.TextView) View(android.view.View)

Example 55 with ImageView

use of android.widget.ImageView in project platform_frameworks_base by android.

the class PageIndicator method setNumPages.

public void setNumPages(int numPages) {
    setVisibility(numPages > 1 ? View.VISIBLE : View.INVISIBLE);
    if (mAnimating) {
        Log.w(TAG, "setNumPages during animation");
    }
    while (numPages < getChildCount()) {
        removeViewAt(getChildCount() - 1);
    }
    while (numPages > getChildCount()) {
        ImageView v = new ImageView(mContext);
        v.setImageResource(R.drawable.minor_a_b);
        addView(v, new LayoutParams(mPageIndicatorWidth, mPageIndicatorHeight));
    }
    // Refresh state.
    setIndex(mPosition >> 1);
}
Also used : ImageView(android.widget.ImageView)

Aggregations

ImageView (android.widget.ImageView)2257 View (android.view.View)1144 TextView (android.widget.TextView)1005 Intent (android.content.Intent)200 Drawable (android.graphics.drawable.Drawable)197 LinearLayout (android.widget.LinearLayout)192 Bitmap (android.graphics.Bitmap)178 ViewGroup (android.view.ViewGroup)163 LayoutInflater (android.view.LayoutInflater)159 OnClickListener (android.view.View.OnClickListener)145 AdapterView (android.widget.AdapterView)111 ListView (android.widget.ListView)103 RecyclerView (android.support.v7.widget.RecyclerView)102 FrameLayout (android.widget.FrameLayout)97 Button (android.widget.Button)83 Bundle (android.os.Bundle)81 BitmapDrawable (android.graphics.drawable.BitmapDrawable)80 RelativeLayout (android.widget.RelativeLayout)72 Test (org.junit.Test)70 Context (android.content.Context)69