mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-26 11:51:10 +01:00
Add scroll buttons to CFV2.
This commit is contained in:
@@ -3,6 +3,9 @@ package org.thoughtcrime.securesms.components;
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.view.animation.Animation;
|
||||
import android.view.animation.AnimationUtils;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
@@ -14,11 +17,14 @@ import androidx.annotation.Nullable;
|
||||
import com.airbnb.lottie.SimpleColorFilter;
|
||||
|
||||
import org.thoughtcrime.securesms.R;
|
||||
import org.thoughtcrime.securesms.util.ViewUtil;
|
||||
|
||||
public final class ConversationScrollToView extends FrameLayout {
|
||||
|
||||
private final TextView unreadCount;
|
||||
private final ImageView scrollButton;
|
||||
private final Animation inAnimation;
|
||||
private final Animation outAnimation;
|
||||
|
||||
public ConversationScrollToView(@NonNull Context context) {
|
||||
this(context, null);
|
||||
@@ -44,6 +50,20 @@ public final class ConversationScrollToView extends FrameLayout {
|
||||
|
||||
array.recycle();
|
||||
}
|
||||
|
||||
inAnimation = AnimationUtils.loadAnimation(context, R.anim.fade_scale_in);
|
||||
outAnimation = AnimationUtils.loadAnimation(context, R.anim.fade_scale_out);
|
||||
|
||||
inAnimation.setDuration(100);
|
||||
outAnimation.setDuration(50);
|
||||
}
|
||||
|
||||
public void setShown(boolean isShown) {
|
||||
if (isShown) {
|
||||
ViewUtil.animateIn(this, inAnimation);
|
||||
} else {
|
||||
ViewUtil.animateOut(this, outAnimation, View.INVISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
public void setWallpaperEnabled(boolean hasWallpaper) {
|
||||
|
||||
Reference in New Issue
Block a user