Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@
<meta-data android:name="android.app.shortcuts"
android:resource="@xml/shortcuts" />

<meta-data android:name="${applicationId}.dynamic_icons"
android:resource="@array/calendar_icons_dynamic" />

</activity>

<activity-alias android:name="com.android.calendar.LaunchActivity"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ protected void setUpHeader() {
mDayLabels = new String[7];
for (int i = Calendar.SUNDAY; i <= Calendar.SATURDAY; i++) {
mDayLabels[i - Calendar.SUNDAY] = DateUtils.getDayOfWeekString(i,
DateUtils.LENGTH_MEDIUM).toUpperCase();
DateUtils.LENGTH_SHORTEST).toUpperCase();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public class MonthWeekEventsView extends SimpleWeekView {
private static int mEventTextColor = Color.WHITE;
private static int mDefaultEdgeSpacing = 0;
private static int mSidePaddingMonthNumber = 4;
private static int mTopPaddingMonthNumber = 3;
private static int mTopPaddingMonthNumber = 4;
private static int mTopPaddingWeekNumber = 4;
private static int mSidePaddingWeekNumber = 12;
private static int mDaySeparatorInnerWidth = 1;
Expand Down Expand Up @@ -312,7 +312,7 @@ protected void initView() {
mMonthNumPaint.setTextSize(mTextSizeMonthNumber);
mMonthNumPaint.setColor(mMonthNumColor);
mMonthNumPaint.setStyle(Style.FILL);
mMonthNumPaint.setTextAlign(Align.RIGHT);
mMonthNumPaint.setTextAlign(Align.CENTER);
mMonthNumPaint.setTypeface(Typeface.DEFAULT);

mMonthNumAscentHeight = (int) (-mMonthNumPaint.ascent() + 0.5f);
Expand Down Expand Up @@ -490,26 +490,22 @@ private int computeDayLeftPosition(int day) {
@Override
protected void drawDaySeparators(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];
// Draw only horizontal lines (top and bottom) to separate weeks
float[] lines = new float[2 * coordinatesPerLine];
int i = 0;

// Horizontal line
// Top horizontal line
lines[i++] = 0;
lines[i++] = 0;
lines[i++] = mWidth;
lines[i++] = 0;
int y0 = 0;
int y1 = mHeight;

// 6 vertical lines
while (i < lines.length) {
int x = computeDayLeftPosition(i / coordinatesPerLine);
lines[i++] = x;
lines[i++] = y0;
lines[i++] = x;
lines[i++] = y1;
}
// Bottom horizontal line
lines[i++] = 0;
lines[i++] = mHeight;
lines[i++] = mWidth;
lines[i++] = mHeight;

p.setColor(mDaySeparatorInnerColor);
p.setStrokeWidth(mDaySeparatorInnerWidth);
canvas.drawLines(lines, 0, lines.length, p);
Expand Down Expand Up @@ -634,7 +630,9 @@ protected void drawWeekNums(Canvas canvas) {
isFocusMonth = mFocusDay[i];
mMonthNumPaint.setColor(isFocusMonth ? mMonthNumColor : mMonthNumOtherColor);
}
x = computeDayLeftPosition(i - offset) - (mSidePaddingMonthNumber);
int dayPosition = mShowWeekNum ? (i - 1) : i;
int dayWidth = mWidth / mNumDays;
x = computeDayLeftPosition(dayPosition) + (dayWidth / 2);
canvas.drawText(mDayNumbers[i], x, y, mMonthNumPaint);
if (isBold) {
mMonthNumPaint.setFakeBoldText(isBold = false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,9 @@ protected void updateHeader() {
int position = (offset + i) % 7;
label.setText(mDayLabels[position]);
label.setVisibility(View.VISIBLE);
label.setGravity(android.view.Gravity.CENTER);
label.setTextAlignment(View.TEXT_ALIGNMENT_CENTER);
label.setPadding(0, 0, 0, 0);
if (position == Time.SATURDAY) {
label.setTextColor(mSaturdayColor);
} else if (position == Time.SUNDAY) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,8 @@ protected void drawBackground(Canvas canvas) {
* @param canvas The canvas to draw on
*/
protected void drawWeekNums(Canvas canvas) {
int y = ((mHeight + MINI_DAY_NUMBER_TEXT_SIZE) / 2) - DAY_SEPARATOR_WIDTH;
int topPadding = (int) (3 * mScale);
int y = ((mHeight + MINI_DAY_NUMBER_TEXT_SIZE) / 2) - DAY_SEPARATOR_WIDTH + topPadding;
int nDays = mNumCells;

int i = 0;
Expand Down
17 changes: 17 additions & 0 deletions app/src/main/res/drawable-anydpi-v26/logo_calendar_01_adaptive.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2023 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<adaptive-icon
xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground>
<layer-list>
<item android:drawable="@drawable/logo_calendar_midlayer" />
<item android:drawable="@drawable/logo_calendar_dyn_day_01" />
<item android:drawable="@drawable/logo_calendar_finish" />
</layer-list>
</foreground>
<monochrome android:drawable="@drawable/logo_calendar_monochrome_dyn_day_01" />
</adaptive-icon>
17 changes: 17 additions & 0 deletions app/src/main/res/drawable-anydpi-v26/logo_calendar_02_adaptive.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2023 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<adaptive-icon
xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground>
<layer-list>
<item android:drawable="@drawable/logo_calendar_midlayer" />
<item android:drawable="@drawable/logo_calendar_dyn_day_02" />
<item android:drawable="@drawable/logo_calendar_finish" />
</layer-list>
</foreground>
<monochrome android:drawable="@drawable/logo_calendar_monochrome_dyn_day_02" />
</adaptive-icon>
17 changes: 17 additions & 0 deletions app/src/main/res/drawable-anydpi-v26/logo_calendar_03_adaptive.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2023 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<adaptive-icon
xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground>
<layer-list>
<item android:drawable="@drawable/logo_calendar_midlayer" />
<item android:drawable="@drawable/logo_calendar_dyn_day_03" />
<item android:drawable="@drawable/logo_calendar_finish" />
</layer-list>
</foreground>
<monochrome android:drawable="@drawable/logo_calendar_monochrome_dyn_day_03" />
</adaptive-icon>
17 changes: 17 additions & 0 deletions app/src/main/res/drawable-anydpi-v26/logo_calendar_04_adaptive.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2023 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<adaptive-icon
xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground>
<layer-list>
<item android:drawable="@drawable/logo_calendar_midlayer" />
<item android:drawable="@drawable/logo_calendar_dyn_day_04" />
<item android:drawable="@drawable/logo_calendar_finish" />
</layer-list>
</foreground>
<monochrome android:drawable="@drawable/logo_calendar_monochrome_dyn_day_04" />
</adaptive-icon>
17 changes: 17 additions & 0 deletions app/src/main/res/drawable-anydpi-v26/logo_calendar_05_adaptive.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2023 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<adaptive-icon
xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground>
<layer-list>
<item android:drawable="@drawable/logo_calendar_midlayer" />
<item android:drawable="@drawable/logo_calendar_dyn_day_05" />
<item android:drawable="@drawable/logo_calendar_finish" />
</layer-list>
</foreground>
<monochrome android:drawable="@drawable/logo_calendar_monochrome_dyn_day_05" />
</adaptive-icon>
17 changes: 17 additions & 0 deletions app/src/main/res/drawable-anydpi-v26/logo_calendar_06_adaptive.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2023 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<adaptive-icon
xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground>
<layer-list>
<item android:drawable="@drawable/logo_calendar_midlayer" />
<item android:drawable="@drawable/logo_calendar_dyn_day_06" />
<item android:drawable="@drawable/logo_calendar_finish" />
</layer-list>
</foreground>
<monochrome android:drawable="@drawable/logo_calendar_monochrome_dyn_day_06" />
</adaptive-icon>
17 changes: 17 additions & 0 deletions app/src/main/res/drawable-anydpi-v26/logo_calendar_07_adaptive.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2023 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<adaptive-icon
xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground>
<layer-list>
<item android:drawable="@drawable/logo_calendar_midlayer" />
<item android:drawable="@drawable/logo_calendar_dyn_day_07" />
<item android:drawable="@drawable/logo_calendar_finish" />
</layer-list>
</foreground>
<monochrome android:drawable="@drawable/logo_calendar_monochrome_dyn_day_07" />
</adaptive-icon>
17 changes: 17 additions & 0 deletions app/src/main/res/drawable-anydpi-v26/logo_calendar_08_adaptive.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2023 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<adaptive-icon
xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground>
<layer-list>
<item android:drawable="@drawable/logo_calendar_midlayer" />
<item android:drawable="@drawable/logo_calendar_dyn_day_08" />
<item android:drawable="@drawable/logo_calendar_finish" />
</layer-list>
</foreground>
<monochrome android:drawable="@drawable/logo_calendar_monochrome_dyn_day_08" />
</adaptive-icon>
17 changes: 17 additions & 0 deletions app/src/main/res/drawable-anydpi-v26/logo_calendar_09_adaptive.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2023 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<adaptive-icon
xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground>
<layer-list>
<item android:drawable="@drawable/logo_calendar_midlayer" />
<item android:drawable="@drawable/logo_calendar_dyn_day_09" />
<item android:drawable="@drawable/logo_calendar_finish" />
</layer-list>
</foreground>
<monochrome android:drawable="@drawable/logo_calendar_monochrome_dyn_day_09" />
</adaptive-icon>
17 changes: 17 additions & 0 deletions app/src/main/res/drawable-anydpi-v26/logo_calendar_10_adaptive.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2023 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<adaptive-icon
xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground>
<layer-list>
<item android:drawable="@drawable/logo_calendar_midlayer" />
<item android:drawable="@drawable/logo_calendar_dyn_day_10" />
<item android:drawable="@drawable/logo_calendar_finish" />
</layer-list>
</foreground>
<monochrome android:drawable="@drawable/logo_calendar_monochrome_dyn_day_10" />
</adaptive-icon>
17 changes: 17 additions & 0 deletions app/src/main/res/drawable-anydpi-v26/logo_calendar_11_adaptive.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2023 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<adaptive-icon
xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground>
<layer-list>
<item android:drawable="@drawable/logo_calendar_midlayer" />
<item android:drawable="@drawable/logo_calendar_dyn_day_11" />
<item android:drawable="@drawable/logo_calendar_finish" />
</layer-list>
</foreground>
<monochrome android:drawable="@drawable/logo_calendar_monochrome_dyn_day_11" />
</adaptive-icon>
17 changes: 17 additions & 0 deletions app/src/main/res/drawable-anydpi-v26/logo_calendar_12_adaptive.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2023 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<adaptive-icon
xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground>
<layer-list>
<item android:drawable="@drawable/logo_calendar_midlayer" />
<item android:drawable="@drawable/logo_calendar_dyn_day_12" />
<item android:drawable="@drawable/logo_calendar_finish" />
</layer-list>
</foreground>
<monochrome android:drawable="@drawable/logo_calendar_monochrome_dyn_day_12" />
</adaptive-icon>
17 changes: 17 additions & 0 deletions app/src/main/res/drawable-anydpi-v26/logo_calendar_13_adaptive.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2023 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<adaptive-icon
xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground>
<layer-list>
<item android:drawable="@drawable/logo_calendar_midlayer" />
<item android:drawable="@drawable/logo_calendar_dyn_day_13" />
<item android:drawable="@drawable/logo_calendar_finish" />
</layer-list>
</foreground>
<monochrome android:drawable="@drawable/logo_calendar_monochrome_dyn_day_13" />
</adaptive-icon>
17 changes: 17 additions & 0 deletions app/src/main/res/drawable-anydpi-v26/logo_calendar_14_adaptive.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2023 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<adaptive-icon
xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground>
<layer-list>
<item android:drawable="@drawable/logo_calendar_midlayer" />
<item android:drawable="@drawable/logo_calendar_dyn_day_14" />
<item android:drawable="@drawable/logo_calendar_finish" />
</layer-list>
</foreground>
<monochrome android:drawable="@drawable/logo_calendar_monochrome_dyn_day_14" />
</adaptive-icon>
17 changes: 17 additions & 0 deletions app/src/main/res/drawable-anydpi-v26/logo_calendar_15_adaptive.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2023 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<adaptive-icon
xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground>
<layer-list>
<item android:drawable="@drawable/logo_calendar_midlayer" />
<item android:drawable="@drawable/logo_calendar_dyn_day_15" />
<item android:drawable="@drawable/logo_calendar_finish" />
</layer-list>
</foreground>
<monochrome android:drawable="@drawable/logo_calendar_monochrome_dyn_day_15" />
</adaptive-icon>
17 changes: 17 additions & 0 deletions app/src/main/res/drawable-anydpi-v26/logo_calendar_16_adaptive.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2023 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<adaptive-icon
xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground>
<layer-list>
<item android:drawable="@drawable/logo_calendar_midlayer" />
<item android:drawable="@drawable/logo_calendar_dyn_day_16" />
<item android:drawable="@drawable/logo_calendar_finish" />
</layer-list>
</foreground>
<monochrome android:drawable="@drawable/logo_calendar_monochrome_dyn_day_16" />
</adaptive-icon>
Loading