Skip to content

Commit

Permalink
#364 - Fixed text & size of create PDF button on home page (#377)
Browse files Browse the repository at this point in the history
  • Loading branch information
vyankatesh24 authored and Swati4star committed Aug 12, 2018
1 parent 5a42904 commit 9a54796
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import android.app.Activity;
import android.support.annotation.ColorRes;
import android.support.annotation.DimenRes;
import android.widget.FrameLayout;

import com.dd.morphingbutton.MorphingButton;

Expand Down Expand Up @@ -35,9 +36,12 @@ public int color(@ColorRes int resId) {
*/
public void morphToSquare(final MorphingButton btnMorph, int duration) {
MorphingButton.Params square = defaultButton(duration);
String text = btnMorph.getText().toString().isEmpty() ?
mActivity.getString(R.string.create_pdf) :
btnMorph.getText().toString();
square.color(color(R.color.mb_blue));
square.colorPressed(color(R.color.mb_blue_dark));
square.text(btnMorph.getText().toString());
square.text(text);
btnMorph.morph(square);
}

Expand Down Expand Up @@ -81,7 +85,7 @@ private MorphingButton.Params defaultButton(int duration) {
return MorphingButton.Params.create()
.duration(duration)
.cornerRadius(dimen(R.dimen.mb_corner_radius_2))
.width(dimen(R.dimen.mb_width_328))
.height(dimen(R.dimen.mb_height_48));
.width(FrameLayout.LayoutParams.MATCH_PARENT)
.height(FrameLayout.LayoutParams.WRAP_CONTENT);
}
}

0 comments on commit 9a54796

Please sign in to comment.