Skip to content

Commit

Permalink
Changed the duration of no tags available message
Browse files Browse the repository at this point in the history
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 federicoiosue#663
  • Loading branch information
oscarli9 authored Mar 1, 2020
1 parent 389fb4c commit ebed37b
Showing 1 changed file with 18 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();
}
}

0 comments on commit ebed37b

Please sign in to comment.