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

Commit 3a752b23 authored by Nihanth Subramanya's avatar Nihanth Subramanya
Browse files

Add configurable offset for drawing time label on Lense unlock screen

This is mainly for LDPI devices, time was around 20-30 px off for us. Looked ugly.

Change-Id: I74f071d7b0635a38eeb3f9f8e34885540a8649d4
parent 3bef0265
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -456,11 +456,14 @@ public class RotarySelector extends View {
                    mTimeString=mTime.format("%l:%M %P");
                String mDate=(String) DateFormat.format(mDateFormatString, new Date());

                //Add offset specified in config file
                int customTimeOffset = getContext().getResources().getInteger(R.integer.config_lenseTimeLabelOffsetDIP);

                canvas.translate(0, 0);
                mLensePaint.setTextSize(LENSE_TIME_SIZE_DIP * mDensity * mDensityScaleFactor);
                canvas.drawText(mTimeString, mBackgroundWidth / 2 * mDensityScaleFactor, mRotaryOffsetY + mMarginBottom + LENSE_TIME_SIZE_DIP * mDensity, mLensePaint);
                canvas.drawText(mTimeString, mBackgroundWidth / 2 * mDensityScaleFactor, mRotaryOffsetY + mMarginBottom + LENSE_TIME_SIZE_DIP * mDensity + customTimeOffset, mLensePaint);
                mLensePaint.setTextSize(LENSE_DATE_SIZE_DIP * mDensity * mDensityScaleFactor);
                canvas.drawText(mDate, mBackgroundWidth / 2 * mDensityScaleFactor, mRotaryOffsetY + mMarginBottom + LENSE_DATE_SIZE_DIP * mDensity * 3, mLensePaint);
                canvas.drawText(mDate, mBackgroundWidth / 2 * mDensityScaleFactor, mRotaryOffsetY + mMarginBottom + LENSE_DATE_SIZE_DIP * mDensity * 3 + customTimeOffset, mLensePaint);
            }
            return;
        }
+3 −0
Original line number Diff line number Diff line
@@ -404,6 +404,9 @@
    <!-- Configure rotary stroke width -->
    <integer name="config_rotaryStrokeWidthDIP">83</integer>

    <!-- Configure lense unlock time label offset -->
    <integer name="config_lenseTimeLabelOffsetDIP">0</integer>

    <!-- Do not translate. Defines the slots is Two Digit Number for dialing normally not USSD -->
    <string-array name="config_twoDigitNumberPattern">
    </string-array>