facebookarchive / shimmer-android

An easy, flexible way to add a shimmering effect to any view in an Android app.
http://facebook.github.io/shimmer-android/
Other
5.32k stars 697 forks source link

White shimmer above children #78

Closed mianaliasjad closed 5 years ago

mianaliasjad commented 5 years ago

i have imageview insdie shimmer Frame i want to just white shimmer over it i have tried so many ways but can't achieve anything i just want white shimmer over my image view currently i am doing this but nothing happening i started it pragmatically

            <com.facebook.shimmer.ShimmerFrameLayout
                android:id="@+id/shimmer_view_img"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                ads:shimmer_highlight_color="@color/m_color_sky_blue"
                ads:shimmer_base_alpha="1"
                app:shimmer_auto_start="false">

                <ImageView
                    android:id="@+id/iv_app_icon"
                    android:layout_width="70dp"
                    android:layout_height="70dp"
                    android:layout_gravity="center"
                    ads:srcCompat="@mipmap/white_lock" />

            </com.facebook.shimmer.ShimmerFrameLayout>
xiphirx commented 5 years ago

Try specifying shimmer_colored="true"

mianaliasjad commented 5 years ago

shimmer_colored makes my imageView white.

mecoFarid commented 5 years ago

Plus shimmer_colored = true applies to the first parent in the complex view hierarchy. All the children are gone now.

xiphirx commented 5 years ago

Shimmer.ColorHighlightBuilder().setBaseAlpha(0.5f).setHighlightColor(0xffffffff.toInt())

This works for me.

omkar-tenkale commented 3 years ago

Shimmer.ColorHighlightBuilder().setBaseAlpha(0.5f).setHighlightColor(0xffffffff.toInt())

This works for me.

Doesnt work, makes the child white

omkar-tenkale commented 3 years ago
        Shimmer.ColorHighlightBuilder colorHighlightBuilder = new Shimmer.ColorHighlightBuilder();
        colorHighlightBuilder.setHighlightColor(getResources().getColor(R.color.colorWhite));
        colorHighlightBuilder.setHighlightAlpha(0.3f);
        colorHighlightBuilder.setRepeatCount(0);
        colorHighlightBuilder.setBaseAlpha(0);
        shimmerContainer.setShimmer(colorHighlightBuilder.build())
        shimmerContainer.startShimmer();
        <FrameLayout
            android:id="@+id/actionRoot"
            android:background="@drawable/bg_round_button_green"
            android:layout_margin="8dp"
            android:layout_width="match_parent"
            android:layout_height="48dp" >

            <TextView
                android:textColor="@color/white"
                android:id="@+id/action"
                android:gravity="center"
                android:textSize="16dp"
                android:text="CHARGE  $ 232.23"
                android:layout_width="match_parent"
                android:layout_height="match_parent" />

            <com.facebook.shimmer.ShimmerFrameLayout
                android:id="@+id/shimmerContainer"
                android:layout_width="match_parent"
                android:layout_height="wrap_content">
                <View
                    android:background="#000"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"/>
            </com.facebook.shimmer.ShimmerFrameLayout>

        </FrameLayout>

ezgif com-gif-maker

Nice na! :)

Mistake i was doing was

    <com.facebook.shimmer.ShimmerFrameLayout
            android:id="@+id/shimmerContainer"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">
            <TextView
                android:textColor="@color/white"
                android:id="@+id/action"
                android:gravity="center"
                android:textSize="16dp"
                android:text="CHARGE  $ 232.23"
                android:layout_width="match_parent"
                android:layout_height="match_parent" />
        </com.facebook.shimmer.ShimmerFrameLayout>