Skip to content

Commit

Permalink
Decreased the sensitivity of the scale slider
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel Peal committed Apr 8, 2017
1 parent 2281a22 commit c00b7ec
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public class AnimationFragment extends Fragment {

static final String EXTRA_ANIMATION_NAME = "animation_name";
static final String EXTRA_URL = "json_url";
public static final float SCALE_SLIDER_FACTOR = 50f;

static AnimationFragment newInstance() {
return new AnimationFragment();
Expand Down Expand Up @@ -149,7 +150,7 @@ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,

scaleSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
animationView.setScale(progress / 20f);
animationView.setScale(progress / SCALE_SLIDER_FACTOR);
scaleTextView.setText(String.format(Locale.US, "%.2f", animationView.getScale()));
}

Expand Down Expand Up @@ -220,7 +221,8 @@ private void setComposition(LottieComposition composition, String name) {
animationView.setComposition(composition);
animationNameView.setText(name);
scaleTextView.setText(String.format(Locale.US, "%.2f", animationView.getScale()));
scaleSeekBar.setProgress((int) (animationView.getScale() * 20f));
scaleSeekBar.setProgress((int) (animationView.getScale() * SCALE_SLIDER_FACTOR));

}

@OnClick(R.id.play_button)
Expand Down

0 comments on commit c00b7ec

Please sign in to comment.