use of android.widget.ViewFlipper in project Hummingbird-for-Android by xiprox.
the class FavoriteAnimeAdapter method getView.
@Override
public View getView(int position, View convertView, ViewGroup parent) {
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View rootView = inflater.inflate(R.layout.item_favorite_grid, null);
FavoriteAnime fav = mItems.get(position);
final ImageView mCover = (ImageView) rootView.findViewById(R.id.item_favorite_cover);
final TextView mTitle = (TextView) rootView.findViewById(R.id.item_favorite_title);
ViewFlipper mFlipper = (ViewFlipper) rootView.findViewById(R.id.item_favorite_flipper);
Picasso.with(context).load(fav.getCoverImage()).into(mCover, new Callback() {
@Override
public void onSuccess() {
int darkMutedColor;
Bitmap bitmap = ((BitmapDrawable) mCover.getDrawable()).getBitmap();
darkMutedColor = Palette.generate(bitmap).getDarkMutedSwatch().getRgb();
mTitle.setBackgroundDrawable(new ColorDrawable(darkMutedColor));
}
@Override
public void onError() {
}
});
mTitle.setText(fav.getTitle());
if (mFlipper.getDisplayedChild() == 0)
mFlipper.showNext();
return rootView;
}
use of android.widget.ViewFlipper in project mobile-android by photo.
the class FeatherActivity method onContentChanged.
/*
* (non-Javadoc)
*
* @see android.app.Activity#onContentChanged()
*/
@Override
public void onContentChanged() {
super.onContentChanged();
mDragLayer = (DragLayer) findViewById(R.id.dragLayer);
mToolbar = (ToolbarView) findViewById(R.id.toolbar);
mBottomBarFlipper = (BottombarViewFlipper) findViewById(R.id.bottombar_view_flipper);
mWorkspace = (Workspace) mBottomBarFlipper.findViewById(R.id.workspace);
mImageView = (ImageViewTouch) findViewById(R.id.image);
mDrawingViewContainer = (ViewGroup) findViewById(R.id.drawing_view_container);
mInlineProgressLoader = findViewById(R.id.image_loading_view);
mWorkspaceIndicator = (WorkspaceIndicator) findViewById(R.id.workspace_indicator);
mViewFlipper = ((ViewAnimator) findViewById(R.id.main_flipper));
mToolbarMainAnimator = ((ViewFlipper) mToolbar.findViewById(R.id.top_indicator_main));
mToolbarContentAnimator = ((ViewFlipper) mToolbar.findViewById(R.id.top_indicator_panel));
mPopupContainer = (ViewGroup) findViewById(R.id.feather_dialogs_container);
// update the progressbar animation drawable
AnimatedRotateDrawable d = new AnimatedRotateDrawable(getResources(), R.drawable.feather_spinner_white_16);
ProgressBar view = (ProgressBar) mToolbarContentAnimator.getChildAt(1);
view.setIndeterminateDrawable(d);
// adding the bottombar content view at runtime, otherwise fail to get the corrent child
// LayoutInflater inflater = (LayoutInflater) getSystemService( Context.LAYOUT_INFLATER_SERVICE );
// View contentView = inflater.inflate( R.layout.feather_option_panel_content, mBottomBarFlipper, false );
// FrameLayout.LayoutParams p = new FrameLayout.LayoutParams( FrameLayout.LayoutParams.MATCH_PARENT,
// FrameLayout.LayoutParams.WRAP_CONTENT );
// p.gravity = Gravity.BOTTOM;
// mBottomBarFlipper.addView( contentView, 0, p );
mBottomBarFlipper.setDisplayedChild(1);
}
use of android.widget.ViewFlipper in project android_frameworks_base by ResurrectionRemix.
the class ViewFlipperActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final LayoutInflater inflater = getLayoutInflater();
final View widget = inflater.inflate(R.layout.widget, null);
widget.setLayoutParams(new FrameLayout.LayoutParams(180, 180, Gravity.CENTER));
ViewFlipper flipper = (ViewFlipper) widget.findViewById(R.id.flipper);
View view = inflater.inflate(R.layout.flipper_item, flipper, false);
flipper.addView(view);
((ImageView) view.findViewById(R.id.widget_image)).setImageResource(R.drawable.sunset1);
((TextView) view.findViewById(R.id.widget_text)).setText("This is a long line of text, " + "enjoy the wrapping and drawing");
view = inflater.inflate(R.layout.flipper_item, flipper, false);
flipper.addView(view);
((ImageView) view.findViewById(R.id.widget_image)).setImageResource(R.drawable.sunset3);
((TextView) view.findViewById(R.id.widget_text)).setText("Another very long line of text, " + "enjoy the wrapping and drawing");
FrameLayout layout = new FrameLayout(this);
layout.addView(widget);
setContentView(layout);
}
Aggregations