From ebed37b1da3fd118a5f52ba99bf8494ca5bbe07a Mon Sep 17 00:00:00 2001 From: Oscar Li <58122003+oscarli9@users.noreply.github.com> Date: Sun, 1 Mar 2020 11:45:49 -0800 Subject: [PATCH] Changed the duration of no tags available message Added two other configurations for styles based on Crouton text duration, changed the duration of no tags available message from DURATION_SHORT(950ms) to DURATION_MEDIUM(1650ms) to fix issue #663 --- .../android/omninotes/models/ONStyle.java | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/omniNotes/src/main/java/it/feio/android/omninotes/models/ONStyle.java b/omniNotes/src/main/java/it/feio/android/omninotes/models/ONStyle.java index 027b08cd82..9a653acbca 100644 --- a/omniNotes/src/main/java/it/feio/android/omninotes/models/ONStyle.java +++ b/omniNotes/src/main/java/it/feio/android/omninotes/models/ONStyle.java @@ -35,7 +35,9 @@ private ONStyle() { public static final int DURATION_MEDIUM = 1650; public static final int DURATION_LONG = 2300; - public static final Configuration CONFIGURATION; + public static final Configuration CONFIGURATION_DURATION_SHORT; + public static final Configuration CONFIGURATION_DURATION_MEDIUM; + public static final Configuration CONFIGURATION_DURATION_LONG; public static final Style ALERT; public static final Style WARN; public static final Style CONFIRM; @@ -48,38 +50,48 @@ private ONStyle() { static { - CONFIGURATION = new Configuration.Builder() + CONFIGURATION_DURATION_SHORT = new Configuration.Builder() .setDuration(DURATION_SHORT) .setInAnimation(R.animator.fade_in_support) .setOutAnimation(R.animator.fade_out_support) .build(); + CONFIGURATION_DURATION_MEDIUM = new Configuration.Builder() + .setDuration(DURATION_MEDIUM) + .setInAnimation(R.animator.fade_in_support) + .setOutAnimation(R.animator.fade_out_support) + .build(); + CONFIGURATION_DURATION_LONG = new Configuration.Builder() + .setDuration(DURATION_LONG) + .setInAnimation(R.animator.fade_in_support) + .setOutAnimation(R.animator.fade_out_support) + .build(); ALERT = new Style.Builder() .setBackgroundColor(ALERT_COLOR) .setHeight(LayoutParams.MATCH_PARENT) .setGravity(Gravity.CENTER) .setTextAppearance(R.style.crouton_text) - .setConfiguration(CONFIGURATION) + .setConfiguration(CONFIGURATION_DURATION_SHORT) .build(); WARN = new Style.Builder() .setBackgroundColor(WARN_COLOR) .setHeight(LayoutParams.MATCH_PARENT) .setGravity(Gravity.CENTER) .setTextAppearance(R.style.crouton_text) - .setConfiguration(CONFIGURATION) + .setConfiguration(CONFIGURATION_DURATION_MEDIUM) .build(); CONFIRM = new Style.Builder() .setBackgroundColor(CONFIRM_COLOR) .setHeight(LayoutParams.MATCH_PARENT) .setGravity(Gravity.CENTER) .setTextAppearance(R.style.crouton_text) - .setConfiguration(CONFIGURATION) + .setConfiguration(CONFIGURATION_DURATION_SHORT) .build(); INFO = new Style.Builder() .setBackgroundColor(INFO_COLOR) .setHeight(LayoutParams.MATCH_PARENT) .setGravity(Gravity.CENTER) .setTextAppearance(R.style.crouton_text) - .setConfiguration(CONFIGURATION) + .setConfiguration(CONFIGURATION_DURATION_SHORT) .build(); } }