Я использую circularRevealAnimation
, чтобы начать один из фрагментов. Вот его layout
.Фрагмент родительский макет прозрачный
<?xml version="1.0" encoding="utf-8"?>
<io.codetail.widget.RevealFrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/main_container"
android:background="@color/red"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/container2"
android:layout_width="match_parent"
android:background="@color/white"
android:layout_height="match_parent"
android:orientation="vertical">
....
</LinearLayout>
</io.codetail.widget.RevealFrameLayout>
В моем Fragment
классе я вызвать revealAnimation
в onStart()
методе.
@Override
public void onStart() {
super.onStart();
// SupportAnimator animator = ViewAnimationUtils.createCircularReveal(container2, 720, 0, 0, 1386); ->line from onCreateView
animator.setDuration(500);
animator.setInterpolator(new AccelerateDecelerateInterpolator());
animator.start();
animator.addListener(new SupportAnimator.AnimatorListener() {
@Override
public void onAnimationStart() {
System.out.println("lol222");
}
@Override
public void onAnimationEnd() {
System.out.println("end");
}
@Override
public void onAnimationCancel() {
}
@Override
public void onAnimationRepeat() {
}
});
}
Как вы видите, родительский макет имеет красный цвет, когда его ребенок белый. Когда я начал это Fragment
, я вижу белый круговой рельеф на красном фоне, когда хочу увидеть такой аниматор над предыдущим фрагментом. Как я могу это достичь?
Я пытался сделать background="@null" and so on, while reading SOF related topics. Nothing helped me. So what is write way to set
Фрагмент parent
макет as
transparent`?
setAlpha сделать прозрачным? – mjstam
@mjstam делает все макет прозрачным, поэтому я ничего не вижу о следующем фрагменте –