Add new chat colors megaphone.
This commit is contained in:
parent
8992f59c3b
commit
66c3b1388a
4 changed files with 27 additions and 9 deletions
|
@ -10,15 +10,17 @@ import android.widget.TextView;
|
|||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.airbnb.lottie.LottieAnimationView;
|
||||
|
||||
import org.thoughtcrime.securesms.R;
|
||||
|
||||
public class BasicMegaphoneView extends FrameLayout {
|
||||
|
||||
private ImageView image;
|
||||
private TextView titleText;
|
||||
private TextView bodyText;
|
||||
private Button actionButton;
|
||||
private Button secondaryButton;
|
||||
private LottieAnimationView image;
|
||||
private TextView titleText;
|
||||
private TextView bodyText;
|
||||
private Button actionButton;
|
||||
private Button secondaryButton;
|
||||
|
||||
private Megaphone megaphone;
|
||||
private MegaphoneActionController megaphoneListener;
|
||||
|
@ -62,6 +64,10 @@ public class BasicMegaphoneView extends FrameLayout {
|
|||
} else if (megaphone.getImageRequest() != null) {
|
||||
image.setVisibility(VISIBLE);
|
||||
megaphone.getImageRequest().into(image);
|
||||
} else if (megaphone.getLottieRes() != 0) {
|
||||
image.setVisibility(VISIBLE);
|
||||
image.setAnimation(megaphone.getLottieRes());
|
||||
image.playAnimation();
|
||||
} else {
|
||||
image.setVisibility(GONE);
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@ import org.thoughtcrime.securesms.util.LocaleFeatureFlags;
|
|||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||
import org.thoughtcrime.securesms.util.VersionTracker;
|
||||
import org.thoughtcrime.securesms.util.dynamiclanguage.DynamicLanguageContextWrapper;
|
||||
import org.thoughtcrime.securesms.wallpaper.ChatWallpaperActivity;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
|
@ -132,7 +133,7 @@ public final class Megaphones {
|
|||
case NOTIFICATIONS:
|
||||
return buildNotificationsMegaphone(context);
|
||||
case CHAT_COLORS:
|
||||
return buildChatColorsMegaphone();
|
||||
return buildChatColorsMegaphone(context);
|
||||
default:
|
||||
throw new IllegalArgumentException("Event not handled!");
|
||||
}
|
||||
|
@ -304,11 +305,18 @@ public final class Megaphones {
|
|||
.build();
|
||||
}
|
||||
|
||||
private static @NonNull Megaphone buildChatColorsMegaphone() {
|
||||
return new Megaphone.Builder(Event.CHAT_COLORS, Megaphone.Style.POPUP)
|
||||
private static @NonNull Megaphone buildChatColorsMegaphone(@NonNull Context context) {
|
||||
return new Megaphone.Builder(Event.CHAT_COLORS, Megaphone.Style.BASIC)
|
||||
.setTitle(R.string.ChatColorsMegaphone__new_chat_colors)
|
||||
.setBody(R.string.ChatColorsMegaphone__we_switched_up_chat_colors)
|
||||
.setLottie(R.raw.color_bubble_64)
|
||||
.setActionButton(R.string.ChatColorsMegaphone__appearance, (megaphone, listener) -> {
|
||||
listener.onMegaphoneNavigationRequested(ChatWallpaperActivity.createIntent(context));
|
||||
listener.onMegaphoneCompleted(Event.CHAT_COLORS);
|
||||
})
|
||||
.setSecondaryButton(R.string.ChatColorsMegaphone__not_now, (megaphone, listener) -> {
|
||||
listener.onMegaphoneCompleted(Event.CHAT_COLORS);
|
||||
})
|
||||
.build();
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
android:paddingEnd="8dp"
|
||||
android:paddingBottom="8dp">
|
||||
|
||||
<ImageView
|
||||
<com.airbnb.lottie.LottieAnimationView
|
||||
android:id="@+id/basic_megaphone_image"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="64dp"
|
||||
|
|
|
@ -3510,8 +3510,12 @@
|
|||
<string name="EditReactionsFragment_save">Save</string>
|
||||
<string name="ChatColorSelectionFragment__auto_matches_the_color_to_the_wallpaper">Auto matches the color to the wallpaper</string>
|
||||
<string name="CustomChatColorCreatorFragment__drag_to_change_the_direction_of_the_gradient">Drag to change the direction of the gradient</string>
|
||||
|
||||
<!-- ChatColorsMegaphone -->
|
||||
<string name="ChatColorsMegaphone__new_chat_colors">New Chat Colors</string>
|
||||
<string name="ChatColorsMegaphone__we_switched_up_chat_colors">We switched up chat colors to give you more options and make chats easier to read.</string>
|
||||
<string name="ChatColorsMegaphone__appearance">Appearance</string>
|
||||
<string name="ChatColorsMegaphone__not_now">Not now</string>
|
||||
|
||||
<!-- EOF -->
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue