Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 13af16f6 authored by Patrick Scott's avatar Patrick Scott
Browse files

Fix multiple allocations of the typeface.

Bug: 2999402
Change-Id: I682803e4386fc2f6a75cce1a57f950246e2bcd3a
parent aaeb8a22
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -67,6 +67,8 @@ public class DigitalClock extends LinearLayout {
            }
        };

    private static Typeface sTypeface;

    static class AmPm {
        private TextView mAmPm;
        private String mAmString, mPmString;
@@ -111,10 +113,12 @@ public class DigitalClock extends LinearLayout {
    protected void onFinishInflate() {
        super.onFinishInflate();

        Typeface tf = Typeface.createFromAsset(getContext().getAssets(),
        if (sTypeface == null) {
            sTypeface = Typeface.createFromAsset(getContext().getAssets(),
                "fonts/Clockopia.ttf");
        }
        mTimeDisplay = (TextView) findViewById(R.id.timeDisplay);
        mTimeDisplay.setTypeface(tf);
        mTimeDisplay.setTypeface(sTypeface);
        mAmPm = new AmPm(this);
        mCalendar = Calendar.getInstance();