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