Add light and dark spinner lotties with correct coloring.
parent
fbfa3abffd
commit
0bb9c1d650
|
@ -23,6 +23,7 @@ import org.thoughtcrime.securesms.megaphone.Megaphones;
|
|||
import org.thoughtcrime.securesms.registration.RegistrationUtil;
|
||||
import org.thoughtcrime.securesms.storage.StorageSyncHelper;
|
||||
import org.thoughtcrime.securesms.util.SpanUtil;
|
||||
import org.thoughtcrime.securesms.util.ThemeUtil;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
|
@ -103,13 +104,13 @@ public class ConfirmKbsPinFragment extends BaseKbsPinFragment<ConfirmKbsPinViewM
|
|||
lottieProgress.cancelAnimation();
|
||||
break;
|
||||
case LOADING:
|
||||
lottieProgress.setAnimation(R.raw.lottie_kbs_loading);
|
||||
lottieProgress.setAnimation(ThemeUtil.getThemedResourceId(requireContext(), R.attr.kbs_confirm_lottie_loading));
|
||||
lottieProgress.setRepeatMode(LottieDrawable.RESTART);
|
||||
lottieProgress.setRepeatCount(LottieDrawable.INFINITE);
|
||||
lottieProgress.playAnimation();
|
||||
break;
|
||||
case SUCCESS:
|
||||
startEndAnimationOnNextProgressRepetition(R.raw.lottie_kbs_success, new AnimationCompleteListener() {
|
||||
startEndAnimationOnNextProgressRepetition(ThemeUtil.getThemedResourceId(requireContext(), R.attr.kbs_confirm_lottie_success), new AnimationCompleteListener() {
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
requireActivity().setResult(Activity.RESULT_OK);
|
||||
|
@ -120,7 +121,7 @@ public class ConfirmKbsPinFragment extends BaseKbsPinFragment<ConfirmKbsPinViewM
|
|||
});
|
||||
break;
|
||||
case FAILURE:
|
||||
startEndAnimationOnNextProgressRepetition(R.raw.lottie_kbs_failure, new AnimationCompleteListener() {
|
||||
startEndAnimationOnNextProgressRepetition(ThemeUtil.getThemedResourceId(requireContext(), R.attr.kbs_confirm_lottie_failure), new AnimationCompleteListener() {
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
RegistrationUtil.maybeMarkRegistrationComplete(requireContext());
|
||||
|
|
|
@ -25,6 +25,17 @@ public class ThemeUtil {
|
|||
return getAttribute(context, R.attr.theme_type, "light").equals("dark");
|
||||
}
|
||||
|
||||
public static int getThemedResourceId(@NonNull Context context, @AttrRes int attr) {
|
||||
TypedValue typedValue = new TypedValue();
|
||||
Resources.Theme theme = context.getTheme();
|
||||
|
||||
if (theme.resolveAttribute(attr, typedValue, true)) {
|
||||
return typedValue.resourceId;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
public static boolean getThemedBoolean(@NonNull Context context, @AttrRes int attr) {
|
||||
TypedValue typedValue = new TypedValue();
|
||||
Resources.Theme theme = context.getTheme();
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -41,6 +41,9 @@
|
|||
<attr name="avatar_selection_remove_photo" format="reference" />
|
||||
|
||||
<attr name="kbs_splash_image" format="reference" />
|
||||
<attr name="kbs_confirm_lottie_loading" format="reference" />
|
||||
<attr name="kbs_confirm_lottie_success" format="reference" />
|
||||
<attr name="kbs_confirm_lottie_failure" format="reference" />
|
||||
|
||||
<attr name="conversation_sent_card_background" format="reference|color"/>
|
||||
<attr name="conversation_group_member_name" format="reference|color"/>
|
||||
|
|
|
@ -198,6 +198,9 @@
|
|||
<!--<item name="android:windowContentOverlay">@drawable/compat_actionbar_shadow_background</item>-->
|
||||
|
||||
<item name="kbs_splash_image">@drawable/ic_kbs_splash_light_svg</item>
|
||||
<item name="kbs_confirm_lottie_loading">@raw/lottie_kbs_loading_light</item>
|
||||
<item name="kbs_confirm_lottie_success">@raw/lottie_kbs_success_light</item>
|
||||
<item name="kbs_confirm_lottie_failure">@raw/lottie_kbs_fail_light</item>
|
||||
|
||||
<item name="attachment_type_selector_background">@color/white</item>
|
||||
<item name="attachment_document_icon_small">@drawable/ic_document_small_light</item>
|
||||
|
@ -510,6 +513,9 @@
|
|||
<item name="tinted_circle_background">@drawable/tinted_circle_dark</item>
|
||||
|
||||
<item name="kbs_splash_image">@drawable/ic_kbs_splash_dark_svg</item>
|
||||
<item name="kbs_confirm_lottie_loading">@raw/lottie_kbs_loading_dark</item>
|
||||
<item name="kbs_confirm_lottie_success">@raw/lottie_kbs_success_dark</item>
|
||||
<item name="kbs_confirm_lottie_failure">@raw/lottie_kbs_fail_dark</item>
|
||||
|
||||
<item name="attachment_type_selector_background">@color/core_grey_95</item>
|
||||
<item name="attachment_document_icon_small">@drawable/ic_document_small_dark</item>
|
||||
|
|
Loading…
Reference in New Issue