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

Commit 982f7cd1 authored by Nishith  Khanna's avatar Nishith Khanna
Browse files

Merge branch '11-r-calendar_ui_improvements' into 'v1-r'

UI Improvements

See merge request e/os/android_packages_apps_etar!7
parents 9dbf2472 d3c79c44
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -362,7 +362,7 @@ public class DayView extends View implements View.OnCreateContextMenuListener,
    protected final EventGeometry mEventGeometry;

    private static float GRID_LINE_LEFT_MARGIN = 0;
    private static final float GRID_LINE_INNER_WIDTH = 1;
    private static final float GRID_LINE_INNER_WIDTH = 2;

    private static final int DAY_GAP = 1;
    private static final int HOUR_GAP = 1;
+18 −5
Original line number Diff line number Diff line
@@ -282,7 +282,6 @@ public class MonthWeekEventsView extends SimpleWeekView {
                mTextSizeEvent *= mScale;
                mTextSizeEventTitle *= mScale;
                mTextSizeWeekNum *= mScale;
                mDaySeparatorInnerWidth *= mScale;
                mEventYOffsetPortrait *= mScale;
                mEventSquareWidth *= mScale;
                mEventSquareHeight *= mScale;
@@ -457,7 +456,8 @@ public class MonthWeekEventsView extends SimpleWeekView {
    protected void onDraw(Canvas canvas) {
        drawBackground(canvas);
        drawWeekNums(canvas);
        drawDaySeparators(canvas);
        drawHorizontalDaySeparators(canvas);
        drawVerticalDaySeparators(canvas);
        if (mShowDetailsInMonth) {
            drawEvents(canvas);
        } else {
@@ -489,7 +489,7 @@ public class MonthWeekEventsView extends SimpleWeekView {
    }

    @Override
    protected void drawDaySeparators(Canvas canvas) {
    protected void drawHorizontalDaySeparators(Canvas canvas) {
        final int coordinatesPerLine = 4;
        // There are mNumDays - 1 vertical lines and 1 horizontal, so the total is mNumDays
        float[] lines = new float[mNumDays * coordinatesPerLine];
@@ -500,6 +500,19 @@ public class MonthWeekEventsView extends SimpleWeekView {
        lines[i++] = 0;
        lines[i++] = mWidth;
        lines[i++] = 0;


        p.setColor(mDaySeparatorInnerColor);
        p.setStrokeWidth(mDaySeparatorInnerWidth * 4);
        canvas.drawLines(lines, 0, lines.length, p);
    }
    @Override
    protected void drawVerticalDaySeparators(Canvas canvas) {
        final int coordinatesPerLine = 4;
        // There are mNumDays - 1 vertical lines and 1 horizontal, so the total is mNumDays
        float[] lines = new float[mNumDays * coordinatesPerLine];
        int i = 0;

        int y0 = 0;
        int y1 = mHeight;

@@ -512,7 +525,7 @@ public class MonthWeekEventsView extends SimpleWeekView {
            lines[i++] = y1;
        }
        p.setColor(mDaySeparatorInnerColor);
        p.setStrokeWidth(mDaySeparatorInnerWidth);
        p.setStrokeWidth(mDaySeparatorInnerWidth * 2);
        canvas.drawLines(lines, 0, lines.length, p);
    }

@@ -520,7 +533,7 @@ public class MonthWeekEventsView extends SimpleWeekView {
    protected void drawBackground(Canvas canvas) {
        int i = 0;
        int offset = 0;
        r.top = mDaySeparatorInnerWidth;
        r.top = 0;
        r.bottom = mHeight;
        if (mShowWeekNum) {
            i++;
+16 −2
Original line number Diff line number Diff line
@@ -395,7 +395,8 @@ public class SimpleWeekView extends View {
    protected void onDraw(Canvas canvas) {
        drawBackground(canvas);
        drawWeekNums(canvas);
        drawDaySeparators(canvas);
        drawHorizontalDaySeparators(canvas);
        drawVerticalDaySeparators(canvas);
    }

    /**
@@ -460,7 +461,20 @@ public class SimpleWeekView extends View {
     *
     * @param canvas The canvas to draw on
     */
    protected void drawDaySeparators(Canvas canvas) {
    protected void drawHorizontalDaySeparators(Canvas canvas) {
        if (mHasSelectedDay) {
            r.top = 1;
            r.bottom = mHeight - 1;
            r.left = mSelectedLeft + 1;
            r.right = mSelectedRight - 1;
            p.setStrokeWidth(MINI_TODAY_OUTLINE_WIDTH);
            p.setStyle(Style.STROKE);
            p.setColor(mTodayOutlineColor);
            canvas.drawRect(r, p);
        }
    }

    protected void drawVerticalDaySeparators(Canvas canvas) {
        if (mHasSelectedDay) {
            r.top = 1;
            r.bottom = mHeight - 1;