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
16 changes: 16 additions & 0 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,22 @@
android:exported="false"
android:permission="android.permission.BIND_REMOTEVIEWS">
</service-->
<receiver
android:exported="false"
android:name="com.android.calendar.widget.agenda.AgendaWidget" >
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
<action android:name="com.color.appwidget.list.UPDATE_LIST" />
</intent-filter>

<meta-data
android:name="android.appwidget.provider"
android:resource="@xml/agenda_widget_info" />
</receiver>

<service
android:name="com.android.calendar.widget.agenda.EventService"
android:permission="android.permission.BIND_REMOTEVIEWS" />

<service android:name="com.android.calendar.AsyncQueryServiceHelper" />

Expand Down
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ project(':external:chips') {

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
Expand Down
7 changes: 7 additions & 0 deletions res/drawable/widget_agenda_background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<solid android:color="@color/background_color"></solid>
<corners
android:bottomLeftRadius="15dp"
android:bottomRightRadius="15dp"/>
</shape>
7 changes: 7 additions & 0 deletions res/drawable/widget_agenda_background_black.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<solid android:color="@color/bg_black"></solid>
<corners
android:bottomLeftRadius="15dp"
android:bottomRightRadius="15dp"/>
</shape>
7 changes: 7 additions & 0 deletions res/drawable/widget_agenda_background_dark.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<solid android:color="@color/bg_dark"></solid>
<corners
android:bottomLeftRadius="15dp"
android:bottomRightRadius="15dp"/>
</shape>
7 changes: 7 additions & 0 deletions res/drawable/widget_agenda_background_header.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<solid android:color="@color/colorPrimary"></solid>
<corners
android:topRightRadius="15dp"
android:topLeftRadius="15dp"/>
</shape>
7 changes: 7 additions & 0 deletions res/drawable/widget_agenda_background_header_blue.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<solid android:color="@color/colorBluePrimary"></solid>
<corners
android:topRightRadius="15dp"
android:topLeftRadius="15dp"/>
</shape>
7 changes: 7 additions & 0 deletions res/drawable/widget_agenda_background_header_green.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<solid android:color="@color/colorGreenPrimary"></solid>
<corners
android:topRightRadius="15dp"
android:topLeftRadius="15dp"/>
</shape>
7 changes: 7 additions & 0 deletions res/drawable/widget_agenda_background_header_orange.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<solid android:color="@color/colorOrangePrimary"></solid>
<corners
android:topRightRadius="15dp"
android:topLeftRadius="15dp"/>
</shape>
7 changes: 7 additions & 0 deletions res/drawable/widget_agenda_background_header_purple.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<solid android:color="@color/colorPurplePrimary"></solid>
<corners
android:topRightRadius="15dp"
android:topLeftRadius="15dp"/>
</shape>
7 changes: 7 additions & 0 deletions res/drawable/widget_agenda_background_header_red.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<solid android:color="@color/colorRedPrimary"></solid>
<corners
android:topRightRadius="15dp"
android:topLeftRadius="15dp"/>
</shape>
24 changes: 24 additions & 0 deletions res/layout/agenda_widget.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/widget_margin">

<TextView
android:id="@+id/date"
android:layout_width="match_parent"
android:layout_height="48dp"
android:background="@drawable/widget_agenda_background_header"
android:gravity="end|center_vertical"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:text="Saturday, 22 August"
android:textSize="16sp" />

<ListView
android:id="@+id/agendaid"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/date"
android:divider="@null"
android:orientation="vertical"></ListView>
</RelativeLayout>
51 changes: 51 additions & 0 deletions res/layout/agenda_widget_row_item.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android2="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/row_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="10dp">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/headingLayout"
android:orientation="horizontal">

<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginEnd="8dp"
android:scaleType="center"
tools:srcCompat="@drawable/chips_ic_close_24dp" />

<LinearLayout
android:id="@+id/contentLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<TextView
android:id="@+id/primary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:singleLine="true"
android:text="Marshmallow"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@android:color/black" />

<TextView
android:id="@+id/secondary"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="TextView" />
</LinearLayout>
</LinearLayout>


</RelativeLayout>
44 changes: 44 additions & 0 deletions res/layout/agenda_widget_row_item_heading.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android2="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/row_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<RelativeLayout
android:id="@+id/headingLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="10dp">

<ImageView
android:id="@+id/dividerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/date_header"
android:scaleType="fitXY" />

<TextView
android:id="@+id/date_header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:gravity="end"
android:text="Date"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@android:color/secondary_text_light" />


</RelativeLayout>

<include
layout="@layout/agenda_widget_row_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/headingLayout" />

</RelativeLayout>
9 changes: 7 additions & 2 deletions res/values/dimens.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2011 The Android Open Source Project
<?xml version="1.0" encoding="utf-8"?><!-- Copyright (C) 2011 The Android Open Source Project

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -56,4 +55,10 @@
<dimen name="recurrence_picker_width">300dp</dimen>

<dimen name="fab_margin">16dp</dimen>

<!--
Refer to App Widget Documentation for margin information
http://developer.android.com/guide/topics/appwidgets/index.html#CreatingLayout
-->
<dimen name="widget_margin">8dp</dimen>
</resources>
Loading