Closed omkar-tenkale closed 2 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); ui.shimmerContainer.setShimmer(colorHighlightBuilder.build()); ui.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>
Avoid this:
<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>
Self answered for helping others :)
Avoid this: