Search in sources :

Example 6 with ViewFlipper

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;
}
Also used : ViewFlipper(android.widget.ViewFlipper) Bitmap(android.graphics.Bitmap) Callback(com.squareup.picasso.Callback) ColorDrawable(android.graphics.drawable.ColorDrawable) FavoriteAnime(tr.bcxip.hummingbird.api.objects.FavoriteAnime) LayoutInflater(android.view.LayoutInflater) TextView(android.widget.TextView) ImageView(android.widget.ImageView) ImageView(android.widget.ImageView) TextView(android.widget.TextView) View(android.view.View)

Example 7 with ViewFlipper

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);
}
Also used : BottombarViewFlipper(com.aviary.android.feather.widget.BottombarViewFlipper) ViewFlipper(android.widget.ViewFlipper) ViewAnimator(android.widget.ViewAnimator) AnimatedRotateDrawable(com.aviary.android.feather.graphics.AnimatedRotateDrawable) ProgressBar(android.widget.ProgressBar)

Example 8 with ViewFlipper

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);
}
Also used : ViewFlipper(android.widget.ViewFlipper) LayoutInflater(android.view.LayoutInflater) FrameLayout(android.widget.FrameLayout) TextView(android.widget.TextView) ImageView(android.widget.ImageView) TextView(android.widget.TextView) ImageView(android.widget.ImageView) View(android.view.View)

Aggregations

ViewFlipper (android.widget.ViewFlipper)8 LayoutInflater (android.view.LayoutInflater)6 View (android.view.View)6 ImageView (android.widget.ImageView)6 TextView (android.widget.TextView)6 FrameLayout (android.widget.FrameLayout)5 Intent (android.content.Intent)1 SharedPreferences (android.content.SharedPreferences)1 Bitmap (android.graphics.Bitmap)1 ColorDrawable (android.graphics.drawable.ColorDrawable)1 LinearLayout (android.widget.LinearLayout)1 ProgressBar (android.widget.ProgressBar)1 ViewAnimator (android.widget.ViewAnimator)1 AnimatedRotateDrawable (com.aviary.android.feather.graphics.AnimatedRotateDrawable)1 BottombarViewFlipper (com.aviary.android.feather.widget.BottombarViewFlipper)1 Callback (com.squareup.picasso.Callback)1 CacheWordHandler (info.guardianproject.cacheword.CacheWordHandler)1 FavoriteAnime (tr.bcxip.hummingbird.api.objects.FavoriteAnime)1