Commit 461ebc3c authored by Varun Patil's avatar Varun Patil

Fix calendar heat inset size on O+

parent 078e5574
......@@ -4,6 +4,7 @@ package app.insti.fragment;
import android.animation.ArgbEvaluator;
import android.graphics.drawable.GradientDrawable;
import android.graphics.drawable.InsetDrawable;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.design.widget.FloatingActionButton;
......@@ -171,10 +172,19 @@ public class CalendarFragment extends BaseFragment {
@Override
public void decorate(DayViewFacade view) {
// Color background with alpha
GradientDrawable gD = new GradientDrawable();
gD.setColor((int) new ArgbEvaluator().evaluate(((float) alpha / 255.0f), white, color));
gD.setShape(GradientDrawable.OVAL);
InsetDrawable iD = new InsetDrawable(gD, 15);
// Inset to show border on selected
InsetDrawable iD;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
iD = new InsetDrawable(gD, 0.1f);
} else {
iD = new InsetDrawable(gD, 10);
}
view.setBackgroundDrawable(iD);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment