Commit 0d1b3b42 authored by RAUSHAN RAJ's avatar RAUSHAN RAJ

initial commit

parents
# built application files
*.apk
*.ap_
# files for the dex VM
*.dex
# Java class files
*.class
# generated files
bin/
gen/
out/
build/
.gradle/
# Project files
*.iml
.idea
# .idea/workspace.xml
# Local configuration file (sdk path, etc)
local.properties
keystore.properties
# Windows thumbnail db
.DS_Store
# Idea non-crucial project fileS
*.iws
# Sandbox stuff
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright {yyyy} {name of copyright owner}
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
# Remindly
Android reminder app
Features
-------
- Material Design UI
- Repeating reminders. Set intervals in minutes, hours, days, weeks and months
- Completely free and ad-free
<a href="https://play.google.com/store/apps/details?id=com.blanyal.remindly&utm_source=global_co&utm_medium=prtnr&utm_content=Mar2515&utm_campaign=PartBadge&pcampaignid=MKT-AC-global-none-all-co-pr-py-PartBadges-Oct1515-1"><img alt="Get it on Google Play" src="https://play.google.com/intl/en_us/badges/images/apps/en-play-badge.png" width="400"/></a>
Screenshots
-------
<img src="https://github.com/blanyal/Remindly/blob/master/screenshots/screenshot1.png" width="400">
<img src="https://github.com/blanyal/Remindly/blob/master/screenshots/screenshot2.png" width="400">
<img src="https://github.com/blanyal/Remindly/blob/master/screenshots/screenshot3.png" width="400">
License
-------
Copyright 2015 Blanyal D'Souza
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
/*
* Copyright 2015 Blanyal D'Souza.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.blanyal.remindme"
minSdkVersion 16
targetSdkVersion 29
versionCode 2
versionName "1.0.1"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'com.bignerdranch.android:recyclerview-multiselect:0.2'
implementation 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
// Lombok Dependencies
compileOnly 'org.projectlombok:lombok:1.18.10'
annotationProcessor 'org.projectlombok:lombok:1.18.10'
// add the Firebase SDK Dependencies
// implementation 'com.google.firebase:firebase-analytics:17.2.0'
// implementation 'com.google.firebase:firebase-database:19.2.0'
// implementation 'com.google.firebase:firebase-auth:19.1.0'
// implementation 'com.firebaseui:firebase-ui-auth:6.0.2'
// implementation 'com.google.firebase:firebase-appindexing:19.0.0'
// implementation 'com.google.firebase:firebase-firestore:21.2.0'
// implementation 'com.google.gms:google-services:4.3.2'
// implementation 'com.google.firebase:firebase-storage:19.1.0'
}
//apply plugin: 'com.google.gms.google-services'
\ No newline at end of file
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in C:\Program Files\Android SDK\sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
/*
* Copyright 2015 Blanyal D'Souza.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.blanyal.remindme;
import android.app.Application;
import android.test.ApplicationTestCase;
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
}
\ No newline at end of file
<!--
Copyright 2015 Blanyal D'Souza.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.blanyal.remindme" >
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<application
android:allowBackup="true"
tools:replace="android:icon,android:theme"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".ReminderAddActivity"
android:label="@string/title_activity_add_reminder"/>
<activity android:name=".ReminderEditActivity"
android:label="@string/title_activity_edit_reminder"/>
<activity android:name=".LicencesActivity"
android:label="@string/title_activity_licenses"/>
<receiver android:name=".AlarmReceiver"/>
<receiver android:name=".BootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter>
</receiver>
</application>
</manifest>
/*
* Copyright 2015 Blanyal D'Souza.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.blanyal.remindme;
import android.app.AlarmManager;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.BitmapFactory;
import android.media.RingtoneManager;
import android.os.SystemClock;
import androidx.core.app.NotificationCompat;
import java.util.Calendar;
public class AlarmReceiver extends BroadcastReceiver {
AlarmManager mAlarmManager;
PendingIntent mPendingIntent;
@Override
public void onReceive(Context context, Intent intent) {
int mReceivedID = Integer.parseInt(intent.getStringExtra(ReminderEditActivity.EXTRA_REMINDER_ID));
// Get notification title from Reminder Database
ReminderDatabase rb = new ReminderDatabase(context);
Reminder reminder = rb.getReminder(mReceivedID);
String mTitle = reminder.getTitle();
// Create intent to open ReminderEditActivity on notification click
Intent editIntent = new Intent(context, ReminderEditActivity.class);
editIntent.putExtra(ReminderEditActivity.EXTRA_REMINDER_ID, Integer.toString(mReceivedID));
PendingIntent mClick = PendingIntent.getActivity(context, mReceivedID, editIntent, PendingIntent.FLAG_UPDATE_CURRENT);
// Create Notification
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context)
.setLargeIcon(BitmapFactory.decodeResource(context.getResources(), R.mipmap.ic_launcher))
.setSmallIcon(R.drawable.ic_alarm_on_white_24dp)
.setContentTitle(context.getResources().getString(R.string.app_name))
.setTicker(mTitle)
.setContentText(mTitle)
.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION))
.setContentIntent(mClick)
.setAutoCancel(true)
.setOnlyAlertOnce(true);
NotificationManager nManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
nManager.notify(mReceivedID, mBuilder.build());
}
public void setAlarm(Context context, Calendar calendar, int ID) {
mAlarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
// Put Reminder ID in Intent Extra
Intent intent = new Intent(context, AlarmReceiver.class);
intent.putExtra(ReminderEditActivity.EXTRA_REMINDER_ID, Integer.toString(ID));
mPendingIntent = PendingIntent.getBroadcast(context, ID, intent, PendingIntent.FLAG_CANCEL_CURRENT);
// Calculate notification time
Calendar c = Calendar.getInstance();
long currentTime = c.getTimeInMillis();
long diffTime = calendar.getTimeInMillis() - currentTime;
// Start alarm using notification time
mAlarmManager.set(AlarmManager.ELAPSED_REALTIME,
SystemClock.elapsedRealtime() + diffTime,
mPendingIntent);
// Restart alarm if device is rebooted
ComponentName receiver = new ComponentName(context, BootReceiver.class);
PackageManager pm = context.getPackageManager();
pm.setComponentEnabledSetting(receiver,
PackageManager.COMPONENT_ENABLED_STATE_ENABLED,
PackageManager.DONT_KILL_APP);
}
public void setRepeatAlarm(Context context, Calendar calendar, int ID, long RepeatTime) {
mAlarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
// Put Reminder ID in Intent Extra
Intent intent = new Intent(context, AlarmReceiver.class);
intent.putExtra(ReminderEditActivity.EXTRA_REMINDER_ID, Integer.toString(ID));
mPendingIntent = PendingIntent.getBroadcast(context, ID, intent, PendingIntent.FLAG_CANCEL_CURRENT);
// Calculate notification timein
Calendar c = Calendar.getInstance();
long currentTime = c.getTimeInMillis();
long diffTime = calendar.getTimeInMillis() - currentTime;
// Start alarm using initial notification time and repeat interval time
mAlarmManager.setRepeating(AlarmManager.ELAPSED_REALTIME,
SystemClock.elapsedRealtime() + diffTime,
RepeatTime , mPendingIntent);
// Restart alarm if device is rebooted
ComponentName receiver = new ComponentName(context, BootReceiver.class);
PackageManager pm = context.getPackageManager();
pm.setComponentEnabledSetting(receiver,
PackageManager.COMPONENT_ENABLED_STATE_ENABLED,
PackageManager.DONT_KILL_APP);
}
public void cancelAlarm(Context context, int ID) {
mAlarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
// Cancel Alarm using Reminder ID
mPendingIntent = PendingIntent.getBroadcast(context, ID, new Intent(context, AlarmReceiver.class), 0);
mAlarmManager.cancel(mPendingIntent);
// Disable alarm
ComponentName receiver = new ComponentName(context, BootReceiver.class);
PackageManager pm = context.getPackageManager();
pm.setComponentEnabledSetting(receiver,
PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
PackageManager.DONT_KILL_APP);
}
}
\ No newline at end of file
/*
* Copyright 2015 Blanyal D'Souza.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.blanyal.remindme;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import java.util.Calendar;
import java.util.List;
public class BootReceiver extends BroadcastReceiver {
private String mTitle;
private String mTime;
private String mDate;
private String mRepeatNo;
private String mRepeatType;
private String mActive;
private String mRepeat;
private String[] mDateSplit;
private String[] mTimeSplit;
private int mYear, mMonth, mHour, mMinute, mDay, mReceivedID;
private long mRepeatTime;
private Calendar mCalendar;
private AlarmReceiver mAlarmReceiver;
// Constant values in milliseconds
private static final long milMinute = 60000L;
private static final long milHour = 3600000L;
private static final long milDay = 86400000L;
private static final long milWeek = 604800000L;
private static final long milMonth = 2592000000L;
@Override
public void onReceive(Context context, Intent intent) {
if (intent.getAction().equals("android.intent.action.BOOT_COMPLETED")) {
ReminderDatabase rb = new ReminderDatabase(context);
mCalendar = Calendar.getInstance();
mAlarmReceiver = new AlarmReceiver();
List<Reminder> reminders = rb.getAllReminders();
for (Reminder rm : reminders) {
mReceivedID = rm.getID();
mRepeat = rm.getRepeat();
mRepeatNo = rm.getRepeatNo();
mRepeatType = rm.getRepeatType();
mActive = rm.getActive();
mDate = rm.getDate();
mTime = rm.getTime();
mDateSplit = mDate.split("/");
mTimeSplit = mTime.split(":");
mDay = Integer.parseInt(mDateSplit[0]);
mMonth = Integer.parseInt(mDateSplit[1]);
mYear = Integer.parseInt(mDateSplit[2]);
mHour = Integer.parseInt(mTimeSplit[0]);
mMinute = Integer.parseInt(mTimeSplit[1]);
mCalendar.set(Calendar.MONTH, --mMonth);
mCalendar.set(Calendar.YEAR, mYear);
mCalendar.set(Calendar.DAY_OF_MONTH, mDay);
mCalendar.set(Calendar.HOUR_OF_DAY, mHour);
mCalendar.set(Calendar.MINUTE, mMinute);
mCalendar.set(Calendar.SECOND, 0);
// Cancel existing notification of the reminder by using its ID
// mAlarmReceiver.cancelAlarm(context, mReceivedID);
// Check repeat type
if (mRepeatType.equals("Minute")) {
mRepeatTime = Integer.parseInt(mRepeatNo) * milMinute;
} else if (mRepeatType.equals("Hour")) {
mRepeatTime = Integer.parseInt(mRepeatNo) * milHour;
} else if (mRepeatType.equals("Day")) {
mRepeatTime = Integer.parseInt(mRepeatNo) * milDay;
} else if (mRepeatType.equals("Week")) {
mRepeatTime = Integer.parseInt(mRepeatNo) * milWeek;
} else if (mRepeatType.equals("Month")) {
mRepeatTime = Integer.parseInt(mRepeatNo) * milMonth;
}
// Create a new notification
if (mActive.equals("true")) {
if (mRepeat.equals("true")) {
mAlarmReceiver.setRepeatAlarm(context, mCalendar, mReceivedID, mRepeatTime);
} else if (mRepeat.equals("false")) {
mAlarmReceiver.setAlarm(context, mCalendar, mReceivedID);
}
}
}
}
}
}
\ No newline at end of file
/*
* Copyright 2015 Blanyal D'Souza.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.blanyal.remindme;
// Class to create DateTime objects for easy sorting
public class DateTimeSorter {
public int mIndex;
public String mDateTime;
public DateTimeSorter(int index, String DateTime){
mIndex = index;
mDateTime = DateTime;
}
public DateTimeSorter(){}
public int getIndex() {
return mIndex;
}
public void setIndex(int index) {
mIndex = index;
}
public String getDateTime() {
return mDateTime;
}
public void setDateTime(String dateTime) {
mDateTime = dateTime;
}
}
/*
* Copyright 2015 Blanyal D'Souza.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.blanyal.remindme;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
public class LicencesActivity extends AppCompatActivity {
private Toolbar mToolbar;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.licenses);
// Setup Toolbar
mToolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(mToolbar);
getSupportActionBar().setTitle(R.string.title_activity_licenses);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true);
// Return to the previous activity on back press
mToolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
onBackPressed();
}
});
}
// To prevent crashes due to pressing physical menu buttons
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if ( keyCode == KeyEvent.KEYCODE_MENU ) {
// return true to prevent further propagation of the key event
return true;
}
return super.onKeyDown(keyCode, event);
}
// On clicking the back button
@Override
public void onBackPressed() {
super.onBackPressed();
}
}
\ No newline at end of file
/*
* Copyright 2015 Blanyal D'Souza.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.blanyal.remindme;
import android.content.Intent;
import android.os.Bundle;
import android.view.ContextMenu;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.view.ActionMode;
import androidx.appcompat.widget.Toolbar;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.amulyakhare.textdrawable.TextDrawable;
import com.amulyakhare.textdrawable.util.ColorGenerator;
import com.bignerdranch.android.multiselector.ModalMultiSelectorCallback;
import com.bignerdranch.android.multiselector.MultiSelector;
import com.bignerdranch.android.multiselector.SwappingHolder;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.bignerdranch.android.multiselector.ModalMultiSelectorCallback;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.LinkedHashMap;
import java.util.List;
public class MainActivity extends AppCompatActivity {
private RecyclerView mList;
private SimpleAdapter mAdapter;
private Toolbar mToolbar;
private TextView mNoReminderView;
private FloatingActionButton mAddReminderButton;
private int mTempPost;
private LinkedHashMap<Integer, Integer> IDmap = new LinkedHashMap<>();
private ReminderDatabase rb;
private MultiSelector mMultiSelector = new MultiSelector();
private AlarmReceiver mAlarmReceiver;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// Initialize reminder database
rb = new ReminderDatabase(getApplicationContext());
// Initialize views
mToolbar = (Toolbar) findViewById(R.id.toolbar);
mAddReminderButton = (FloatingActionButton) findViewById(R.id.add_reminder);
mList = (RecyclerView) findViewById(R.id.reminder_list);
mNoReminderView = (TextView) findViewById(R.id.no_reminder_text);
// To check is there are saved reminders
// If there are no reminders display a message asking the user to create reminders
List<Reminder> mTest = rb.getAllReminders();
if (mTest.isEmpty()) {
mNoReminderView.setVisibility(View.VISIBLE);
}
// Create recycler view
mList.setLayoutManager(getLayoutManager());
registerForContextMenu(mList);
mAdapter = new SimpleAdapter();
mAdapter.setItemCount(getDefaultItemCount());
mList.setAdapter(mAdapter);
// Setup toolbar
setSupportActionBar(mToolbar);
mToolbar.setTitle(R.string.app_name);
// On clicking the floating action button
mAddReminderButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(v.getContext(), ReminderAddActivity.class);
startActivity(intent);
}
});
// Initialize alarm
mAlarmReceiver = new AlarmReceiver();
}
// Create context menu for long press actions
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
getMenuInflater().inflate(R.menu.menu_add_reminder, menu);
}
// Multi select items in recycler view
private ModalMultiSelectorCallback mDeleteMode = new ModalMultiSelectorCallback(mMultiSelector) {
@Override
public boolean onCreateActionMode(ActionMode actionMode, Menu menu) {
getMenuInflater().inflate(R.menu.menu_add_reminder, menu);
return true;
}
@Override
public boolean onActionItemClicked(ActionMode actionMode, MenuItem menuItem) {
switch (menuItem.getItemId()) {
// On clicking discard reminders
case R.id.discard_reminder:
// Close the context menu
actionMode.finish();
// Get the reminder id associated with the recycler view item
for (int i = IDmap.size(); i >= 0; i--) {
if (mMultiSelector.isSelected(i, 0)) {
int id = IDmap.get(i);
// Get reminder from reminder database using id
Reminder temp = rb.getReminder(id);
// Delete reminder
rb.deleteReminder(temp);
// Remove reminder from recycler view
mAdapter.removeItemSelected(i);
// Delete reminder alarm
mAlarmReceiver.cancelAlarm(getApplicationContext(), id);
}
}
// Clear selected items in recycler view
mMultiSelector.clearSelections();
// Recreate the recycler items
// This is done to remap the item and reminder ids
mAdapter.onDeleteItem(getDefaultItemCount());
// Display toast to confirm delete
Toast.makeText(getApplicationContext(),
"Deleted",
Toast.LENGTH_SHORT).show();
// To check is there are saved reminders
// If there are no reminders display a message asking the user to create reminders
List<Reminder> mTest = rb.getAllReminders();
if (mTest.isEmpty()) {
mNoReminderView.setVisibility(View.VISIBLE);
} else {
mNoReminderView.setVisibility(View.GONE);
}
return true;
// On clicking save reminders
case R.id.save_reminder:
// Close the context menu
actionMode.finish();
// Clear selected items in recycler view
mMultiSelector.clearSelections();
return true;
default:
break;
}
return false;
}
};
// On clicking a reminder item
private void selectReminder(int mClickID) {
String mStringClickID = Integer.toString(mClickID);
// Create intent to edit the reminder
// Put reminder id as extra
Intent i = new Intent(this, ReminderEditActivity.class);
i.putExtra(ReminderEditActivity.EXTRA_REMINDER_ID, mStringClickID);
startActivityForResult(i, 1);
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
mAdapter.setItemCount(getDefaultItemCount());
}
// Recreate recycler view
// This is done so that newly created reminders are displayed
@Override
public void onResume(){
super.onResume();
// To check is there are saved reminders
// If there are no reminders display a message asking the user to create reminders
List<Reminder> mTest = rb.getAllReminders();
if (mTest.isEmpty()) {
mNoReminderView.setVisibility(View.VISIBLE);
} else {
mNoReminderView.setVisibility(View.GONE);
}
mAdapter.setItemCount(getDefaultItemCount());
}
// Layout manager for recycler view
protected RecyclerView.LayoutManager getLayoutManager() {
return new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false);
}
protected int getDefaultItemCount() {
return 100;
}
// Create menu
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.main_menu, menu);
return true;
}
// Setup menu
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
// start licenses activity
case R.id.action_licenses:
Intent intent = new Intent(this, LicencesActivity.class);
startActivity(intent);
return true;
default:
return super.onOptionsItemSelected(item);
}
}
// Adapter class for recycler view
public class SimpleAdapter extends RecyclerView.Adapter<SimpleAdapter.VerticalItemHolder> {
private ArrayList<ReminderItem> mItems;
public SimpleAdapter() {
mItems = new ArrayList<>();
}
public void setItemCount(int count) {
mItems.clear();
mItems.addAll(generateData(count));
notifyDataSetChanged();
}
public void onDeleteItem(int count) {
mItems.clear();
mItems.addAll(generateData(count));
}
public void removeItemSelected(int selected) {
if (mItems.isEmpty()) return;
mItems.remove(selected);
notifyItemRemoved(selected);
}
// View holder for recycler view items
@Override
public VerticalItemHolder onCreateViewHolder(ViewGroup container, int viewType) {
LayoutInflater inflater = LayoutInflater.from(container.getContext());
View root = inflater.inflate(R.layout.recycle_items, container, false);
return new VerticalItemHolder(root, this);
}
@Override
public void onBindViewHolder(VerticalItemHolder itemHolder, int position) {
ReminderItem item = mItems.get(position);
itemHolder.setReminderTitle(item.mTitle);
itemHolder.setReminderDateTime(item.mDateTime);
itemHolder.setReminderRepeatInfo(item.mRepeat, item.mRepeatNo, item.mRepeatType);
itemHolder.setActiveImage(item.mActive);
}
@Override
public int getItemCount() {
return mItems.size();
}
// Class for recycler view items
public class ReminderItem {
public String mTitle;
public String mDateTime;
public String mRepeat;
public String mRepeatNo;
public String mRepeatType;
public String mActive;
public ReminderItem(String Title, String DateTime, String Repeat, String RepeatNo, String RepeatType, String Active) {
this.mTitle = Title;
this.mDateTime = DateTime;
this.mRepeat = Repeat;
this.mRepeatNo = RepeatNo;
this.mRepeatType = RepeatType;
this.mActive = Active;
}
}
// Class to compare date and time so that items are sorted in ascending order
public class DateTimeComparator implements Comparator {
DateFormat f = new SimpleDateFormat("dd/mm/yyyy hh:mm");
public int compare(Object a, Object b) {
String o1 = ((DateTimeSorter)a).getDateTime();
String o2 = ((DateTimeSorter)b).getDateTime();
try {
return f.parse(o1).compareTo(f.parse(o2));
} catch (ParseException e) {
throw new IllegalArgumentException(e);
}
}
}
// UI and data class for recycler view items
public class VerticalItemHolder extends SwappingHolder
implements View.OnClickListener, View.OnLongClickListener {
private TextView mTitleText, mDateAndTimeText, mRepeatInfoText;
private ImageView mActiveImage , mThumbnailImage;
private ColorGenerator mColorGenerator = ColorGenerator.DEFAULT;
private TextDrawable mDrawableBuilder;
private SimpleAdapter mAdapter;
public VerticalItemHolder(View itemView, SimpleAdapter adapter) {
super(itemView, mMultiSelector);
itemView.setOnClickListener(this);
itemView.setOnLongClickListener(this);
itemView.setLongClickable(true);
// Initialize adapter for the items
mAdapter = adapter;
// Initialize views
mTitleText = (TextView) itemView.findViewById(R.id.recycle_title);
mDateAndTimeText = (TextView) itemView.findViewById(R.id.recycle_date_time);
mRepeatInfoText = (TextView) itemView.findViewById(R.id.recycle_repeat_info);
mActiveImage = (ImageView) itemView.findViewById(R.id.active_image);
mThumbnailImage = (ImageView) itemView.findViewById(R.id.thumbnail_image);
}
// On clicking a reminder item
@Override
public void onClick(View v) {
if (!mMultiSelector.tapSelection(this)) {
mTempPost = mList.getChildAdapterPosition(v);
int mReminderClickID = IDmap.get(mTempPost);
selectReminder(mReminderClickID);
} else if(mMultiSelector.getSelectedPositions().isEmpty()){
mAdapter.setItemCount(getDefaultItemCount());
}
}
// On long press enter action mode with context menu
@Override
public boolean onLongClick(View v) {
AppCompatActivity activity = MainActivity.this;
activity.startSupportActionMode(mDeleteMode);
mMultiSelector.setSelected(this, true);
return true;
}
// Set reminder title view
public void setReminderTitle(String title) {
mTitleText.setText(title);
String letter = "A";
if(title != null && !title.isEmpty()) {
letter = title.substring(0, 1);
}
int color = mColorGenerator.getRandomColor();
// Create a circular icon consisting of a random background colour and first letter of title
mDrawableBuilder = TextDrawable.builder()
.buildRound(letter, color);
mThumbnailImage.setImageDrawable(mDrawableBuilder);
}
// Set date and time views
public void setReminderDateTime(String datetime) {
mDateAndTimeText.setText(datetime);
}
// Set repeat views
public void setReminderRepeatInfo(String repeat, String repeatNo, String repeatType) {
if(repeat.equals("true")){
mRepeatInfoText.setText("Every " + repeatNo + " " + repeatType + "(s)");
}else if (repeat.equals("false")) {
mRepeatInfoText.setText("Repeat Off");
}
}
// Set active image as on or off
public void setActiveImage(String active){
if(active.equals("true")){
mActiveImage.setImageResource(R.drawable.ic_notifications_on_white_24dp);
}else if (active.equals("false")) {
mActiveImage.setImageResource(R.drawable.ic_notifications_off_grey600_24dp);
}
}
}
// Generate random test data
public ReminderItem generateDummyData() {
return new ReminderItem("1", "2", "3", "4", "5", "6");
}
// Generate real data for each item
public List<ReminderItem> generateData(int count) {
ArrayList<SimpleAdapter.ReminderItem> items = new ArrayList<>();
// Get all reminders from the database
List<Reminder> reminders = rb.getAllReminders();
// Initialize lists
List<String> Titles = new ArrayList<>();
List<String> Repeats = new ArrayList<>();
List<String> RepeatNos = new ArrayList<>();
List<String> RepeatTypes = new ArrayList<>();
List<String> Actives = new ArrayList<>();
List<String> DateAndTime = new ArrayList<>();
List<Integer> IDList= new ArrayList<>();
List<DateTimeSorter> DateTimeSortList = new ArrayList<>();
// Add details of all reminders in their respective lists
for (Reminder r : reminders) {
Titles.add(r.getTitle());
DateAndTime.add(r.getDate() + " " + r.getTime());
Repeats.add(r.getRepeat());
RepeatNos.add(r.getRepeatNo());
RepeatTypes.add(r.getRepeatType());
Actives.add(r.getActive());
IDList.add(r.getID());
}
int key = 0;
// Add date and time as DateTimeSorter objects
for(int k = 0; k<Titles.size(); k++){
DateTimeSortList.add(new DateTimeSorter(key, DateAndTime.get(k)));
key++;
}
// Sort items according to date and time in ascending order
Collections.sort(DateTimeSortList, new DateTimeComparator());
int k = 0;
// Add data to each recycler view item
for (DateTimeSorter item:DateTimeSortList) {
int i = item.getIndex();
items.add(new SimpleAdapter.ReminderItem(Titles.get(i), DateAndTime.get(i), Repeats.get(i),
RepeatNos.get(i), RepeatTypes.get(i), Actives.get(i)));
IDmap.put(k, IDList.get(i));
k++;
}
return items;
}
}
}
/*
* Copyright 2015 Blanyal D'Souza.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.blanyal.remindme;
// Reminder class
public class Reminder {
private int mID;
private String mTitle;
private String mDate;
private String mTime;
private String mRepeat;
private String mRepeatNo;
private String mRepeatType;
private String mActive;
public Reminder(int ID, String Title, String Date, String Time, String Repeat, String RepeatNo, String RepeatType, String Active){
mID = ID;
mTitle = Title;
mDate = Date;
mTime = Time;
mRepeat = Repeat;
mRepeatNo = RepeatNo;
mRepeatType = RepeatType;
mActive = Active;
}
public Reminder(String Title, String Date, String Time, String Repeat, String RepeatNo, String RepeatType, String Active){
mTitle = Title;
mDate = Date;
mTime = Time;
mRepeat = Repeat;
mRepeatNo = RepeatNo;
mRepeatType = RepeatType;
mActive = Active;
}
public Reminder(){}
public int getID() {
return mID;
}
public void setID(int ID) {
mID = ID;
}
public String getTitle() {
return mTitle;
}
public void setTitle(String title) {
mTitle = title;
}
public String getDate() {
return mDate;
}
public void setDate(String date) {
mDate = date;
}
public String getTime() {
return mTime;
}
public void setTime(String time) {
mTime = time;
}
public String getRepeatType() {
return mRepeatType;
}
public void setRepeatType(String repeatType) {
mRepeatType = repeatType;
}
public String getRepeatNo() {
return mRepeatNo;
}
public void setRepeatNo(String repeatNo) {
mRepeatNo = repeatNo;
}
public String getRepeat() {
return mRepeat;
}
public void setRepeat(String repeat) {
mRepeat = repeat;
}
public String getActive() {
return mActive;
}
public void setActive(String active) {
mActive = active;
}
}
/*
* Copyright 2015 Blanyal D'Souza.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.blanyal.remindme;
import android.app.AlertDialog;
import android.app.DatePickerDialog;
import android.app.TimePickerDialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.text.Editable;
import android.text.InputType;
import android.text.TextWatcher;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.Switch;
import android.widget.TextView;
import android.widget.TimePicker;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import java.util.Calendar;
public class ReminderAddActivity extends AppCompatActivity {
private Toolbar mToolbar;
private EditText mTitleText;
private TextView mDateText, mTimeText, mRepeatText, mRepeatNoText, mRepeatTypeText;
private FloatingActionButton mFAB1;
private FloatingActionButton mFAB2;
private Calendar mCalendar;
private int mYear, mMonth, mHour, mMinute, mDay;
private long mRepeatTime;
private String mTitle;
private String mTime;
private String mDate;
private String mRepeat;
private String mRepeatNo;
private String mRepeatType;
private String mActive;
// Values for orientation change
private static final String KEY_TITLE = "title_key";
private static final String KEY_TIME = "time_key";
private static final String KEY_DATE = "date_key";
private static final String KEY_REPEAT = "repeat_key";
private static final String KEY_REPEAT_NO = "repeat_no_key";
private static final String KEY_REPEAT_TYPE = "repeat_type_key";
private static final String KEY_ACTIVE = "active_key";
// Constant values in milliseconds
private static final long milMinute = 60000L;
private static final long milHour = 3600000L;
private static final long milDay = 86400000L;
private static final long milWeek = 604800000L;
private static final long milMonth = 2592000000L;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_add_reminder);
// Initialize Views
mToolbar = (Toolbar) findViewById(R.id.toolbar);
mTitleText = (EditText) findViewById(R.id.reminder_title);
mDateText = (TextView) findViewById(R.id.set_date);
mTimeText = (TextView) findViewById(R.id.set_time);
mRepeatText = (TextView) findViewById(R.id.set_repeat);
mRepeatNoText = (TextView) findViewById(R.id.set_repeat_no);
mRepeatTypeText = (TextView) findViewById(R.id.set_repeat_type);
mFAB1 = (FloatingActionButton) findViewById(R.id.starred1);
mFAB2 = (FloatingActionButton) findViewById(R.id.starred2);
// Setup Toolbar
setSupportActionBar(mToolbar);
getSupportActionBar().setTitle(R.string.title_activity_add_reminder);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true);
// Initialize default values
mActive = "true";
mRepeat = "true";
mRepeatNo = Integer.toString(1);
mRepeatType = "Hour";
mCalendar = Calendar.getInstance();
mHour = mCalendar.get(Calendar.HOUR_OF_DAY);
mMinute = mCalendar.get(Calendar.MINUTE);
mYear = mCalendar.get(Calendar.YEAR);
mMonth = mCalendar.get(Calendar.MONTH) + 1;
mDay = mCalendar.get(Calendar.DATE);
mDate = mDay + "/" + mMonth + "/" + mYear;
mTime = mHour + ":" + mMinute;
// Setup Reminder Title EditText
mTitleText.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
mTitle = s.toString().trim();
mTitleText.setError(null);
}
@Override
public void afterTextChanged(Editable s) {}
});
// Setup TextViews using reminder values
mDateText.setText(mDate);
mTimeText.setText(mTime);
mRepeatNoText.setText(mRepeatNo);
mRepeatTypeText.setText(mRepeatType);
mRepeatText.setText("Every " + mRepeatNo + " " + mRepeatType + "(s)");
// To save state on device rotation
if (savedInstanceState != null) {
String savedTitle = savedInstanceState.getString(KEY_TITLE);
mTitleText.setText(savedTitle);
mTitle = savedTitle;
String savedTime = savedInstanceState.getString(KEY_TIME);
mTimeText.setText(savedTime);
mTime = savedTime;
String savedDate = savedInstanceState.getString(KEY_DATE);
mDateText.setText(savedDate);
mDate = savedDate;
String saveRepeat = savedInstanceState.getString(KEY_REPEAT);
mRepeatText.setText(saveRepeat);
mRepeat = saveRepeat;
String savedRepeatNo = savedInstanceState.getString(KEY_REPEAT_NO);
mRepeatNoText.setText(savedRepeatNo);
mRepeatNo = savedRepeatNo;
String savedRepeatType = savedInstanceState.getString(KEY_REPEAT_TYPE);
mRepeatTypeText.setText(savedRepeatType);
mRepeatType = savedRepeatType;
mActive = savedInstanceState.getString(KEY_ACTIVE);
}
// Setup up active buttons
if (mActive.equals("false")) {
mFAB1.show();
mFAB2.hide();
} else if (mActive.equals("true")) {
mFAB1.hide();
mFAB2.show();
}
}
// To save state on device rotation
@Override
protected void onSaveInstanceState (Bundle outState) {
super.onSaveInstanceState(outState);
outState.putCharSequence(KEY_TITLE, mTitleText.getText());
outState.putCharSequence(KEY_TIME, mTimeText.getText());
outState.putCharSequence(KEY_DATE, mDateText.getText());
outState.putCharSequence(KEY_REPEAT, mRepeatText.getText());
outState.putCharSequence(KEY_REPEAT_NO, mRepeatNoText.getText());
outState.putCharSequence(KEY_REPEAT_TYPE, mRepeatTypeText.getText());
outState.putCharSequence(KEY_ACTIVE, mActive);
}
// On clicking Time picker
public void setTime(View v){
Calendar now = Calendar.getInstance();
TimePickerDialog timePickerDialog = new TimePickerDialog(this,
new TimePickerDialog.OnTimeSetListener() {
@Override
public void onTimeSet(TimePicker timePicker, int hourOfDay,
int minute) {
mHour = hourOfDay;
mMinute = minute;
if (minute < 10) {
mTime = hourOfDay + ":" + "0" + minute;
} else {
mTime = hourOfDay + ":" + minute;
}
mTimeText.setText(mTime);
}
}, mHour, mMinute, false);
timePickerDialog.show();
}
// On clicking Date picker
public void setDate(View v){
Calendar now = Calendar.getInstance();
DatePickerDialog datePickerDialog = new DatePickerDialog(this,
new DatePickerDialog.OnDateSetListener() {
@Override
public void onDateSet(DatePicker datePicker, int year,
int monthOfYear, int dayOfMonth) {
mDay = dayOfMonth;
mMonth = monthOfYear+1;
mYear = year;
mDate = mDay + "/" + mMonth + "/" + mYear;
mDateText.setText(mDate);
}
}, mYear, mMonth, mDay);
datePickerDialog.show();
}
// Obtain time from time picker
// @Override
// public void onTimeSet(TimePicker timePicker, int hourOfDay, int minute) {
// mHour = hourOfDay;
// mMinute = minute;
// if (minute < 10) {
// mTime = hourOfDay + ":" + "0" + minute;
// } else {
// mTime = hourOfDay + ":" + minute;
// }
// mTimeText.setText(mTime);
// }
// Obtain date from date picker
// @Override
// public void onDateSet(DatePicker datePicker, int year, int monthOfYear, int dayOfMonth) {
// monthOfYear ++;
// mDay = dayOfMonth;
// mMonth = monthOfYear;
// mYear = year;
// mDate = dayOfMonth + "/" + monthOfYear + "/" + year;
// mDateText.setText(mDate);
// }
// On clicking the active button
public void selectFab1(View v) {
mFAB1 = (FloatingActionButton) findViewById(R.id.starred1);
mFAB1.hide();
mFAB2 = (FloatingActionButton) findViewById(R.id.starred2);
mFAB2.show();
mActive = "true";
}
// On clicking the inactive button
public void selectFab2(View v) {
mFAB2 = (FloatingActionButton) findViewById(R.id.starred2);
mFAB2.hide();
mFAB1 = (FloatingActionButton) findViewById(R.id.starred1);
mFAB1.show();
mActive = "false";
}
// On clicking the repeat switch
public void onSwitchRepeat(View view) {
boolean on = ((Switch) view).isChecked();
if (on) {
mRepeat = "true";
mRepeatText.setText("Every " + mRepeatNo + " " + mRepeatType + "(s)");
} else {
mRepeat = "false";
mRepeatText.setText(R.string.repeat_off);
}
}
// On clicking repeat type button
public void selectRepeatType(View v){
final String[] items = new String[5];
items[0] = "Minute";
items[1] = "Hour";
items[2] = "Day";
items[3] = "Week";
items[4] = "Month";
// Create List Dialog
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("Select Type");
builder.setItems(items, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int item) {
mRepeatType = items[item];
mRepeatTypeText.setText(mRepeatType);
mRepeatText.setText("Every " + mRepeatNo + " " + mRepeatType + "(s)");
}
});
AlertDialog alert = builder.create();
alert.show();
}
// On clicking repeat interval button
public void setRepeatNo(View v){
AlertDialog.Builder alert = new AlertDialog.Builder(this);
alert.setTitle("Enter Number");
// Create EditText box to input repeat number
final EditText input = new EditText(this);
input.setInputType(InputType.TYPE_CLASS_NUMBER);
alert.setView(input);
alert.setPositiveButton("Ok",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
if (input.getText().toString().length() == 0) {
mRepeatNo = Integer.toString(1);
mRepeatNoText.setText(mRepeatNo);
mRepeatText.setText("Every " + mRepeatNo + " " + mRepeatType + "(s)");
}
else {
mRepeatNo = input.getText().toString().trim();
mRepeatNoText.setText(mRepeatNo);
mRepeatText.setText("Every " + mRepeatNo + " " + mRepeatType + "(s)");
}
}
});
alert.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
// do nothing
}
});
alert.show();
}
// On clicking the save button
public void saveReminder(){
ReminderDatabase rb = new ReminderDatabase(this);
// Creating Reminder
int ID = rb.addReminder(new Reminder(mTitle, mDate, mTime, mRepeat, mRepeatNo, mRepeatType, mActive));
// Set up calender for creating the notification
mCalendar.set(Calendar.MONTH, --mMonth);
mCalendar.set(Calendar.YEAR, mYear);
mCalendar.set(Calendar.DAY_OF_MONTH, mDay);
mCalendar.set(Calendar.HOUR_OF_DAY, mHour);
mCalendar.set(Calendar.MINUTE, mMinute);
mCalendar.set(Calendar.SECOND, 0);
// Check repeat type
if (mRepeatType.equals("Minute")) {
mRepeatTime = Integer.parseInt(mRepeatNo) * milMinute;
} else if (mRepeatType.equals("Hour")) {
mRepeatTime = Integer.parseInt(mRepeatNo) * milHour;
} else if (mRepeatType.equals("Day")) {
mRepeatTime = Integer.parseInt(mRepeatNo) * milDay;
} else if (mRepeatType.equals("Week")) {
mRepeatTime = Integer.parseInt(mRepeatNo) * milWeek;
} else if (mRepeatType.equals("Month")) {
mRepeatTime = Integer.parseInt(mRepeatNo) * milMonth;
}
// Create a new notification
if (mActive.equals("true")) {
if (mRepeat.equals("true")) {
new AlarmReceiver().setRepeatAlarm(getApplicationContext(), mCalendar, ID, mRepeatTime);
} else if (mRepeat.equals("false")) {
new AlarmReceiver().setAlarm(getApplicationContext(), mCalendar, ID);
}
}
// Create toast to confirm new reminder
Toast.makeText(getApplicationContext(), "Saved",
Toast.LENGTH_SHORT).show();
onBackPressed();
}
// On pressing the back button
@Override
public void onBackPressed() {
super.onBackPressed();
}
// Creating the menu
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_add_reminder, menu);
return true;
}
// On clicking menu buttons
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
// On clicking the back arrow
// Discard any changes
case android.R.id.home:
onBackPressed();
return true;
// On clicking save reminder button
// Update reminder
case R.id.save_reminder:
mTitleText.setText(mTitle);
if (mTitleText.getText().toString().length() == 0)
mTitleText.setError("Reminder Title cannot be blank!");
else {
saveReminder();
}
return true;
// On clicking discard reminder button
// Discard any changes
case R.id.discard_reminder:
Toast.makeText(getApplicationContext(), "Discarded",
Toast.LENGTH_SHORT).show();
onBackPressed();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
}
\ No newline at end of file
/*
* Copyright 2015 Blanyal D'Souza.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.blanyal.remindme;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import java.util.ArrayList;
import java.util.List;
public class ReminderDatabase extends SQLiteOpenHelper {
// Database Version
private static final int DATABASE_VERSION = 1;
// Database Name
private static final String DATABASE_NAME = "ReminderDatabase";
// Table name
private static final String TABLE_REMINDERS = "ReminderTable";
// Table Columns names
private static final String KEY_ID = "id";
private static final String KEY_TITLE = "title";
private static final String KEY_DATE = "date";
private static final String KEY_TIME = "time";
private static final String KEY_REPEAT = "repeat";
private static final String KEY_REPEAT_NO = "repeat_no";
private static final String KEY_REPEAT_TYPE = "repeat_type";
private static final String KEY_ACTIVE = "active";
public ReminderDatabase(Context context) {
super(context, DATABASE_NAME, null, DATABASE_VERSION);
}
// Creating Tables
@Override
public void onCreate(SQLiteDatabase db) {
String CREATE_REMINDERS_TABLE = "CREATE TABLE " + TABLE_REMINDERS +
"("
+ KEY_ID + " INTEGER PRIMARY KEY,"
+ KEY_TITLE + " TEXT,"
+ KEY_DATE + " TEXT,"
+ KEY_TIME + " INTEGER,"
+ KEY_REPEAT + " BOOLEAN,"
+ KEY_REPEAT_NO + " INTEGER,"
+ KEY_REPEAT_TYPE + " TEXT,"
+ KEY_ACTIVE + " BOOLEAN" + ")";
db.execSQL(CREATE_REMINDERS_TABLE);
}
// Upgrading database
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
// Drop older table if existed
if (oldVersion >= newVersion)
return;
db.execSQL("DROP TABLE IF EXISTS " + TABLE_REMINDERS);
// Create tables again
onCreate(db);
}
// Adding new Reminder
public int addReminder(Reminder reminder){
SQLiteDatabase db = this.getWritableDatabase();
ContentValues values = new ContentValues();
values.put(KEY_TITLE , reminder.getTitle());
values.put(KEY_DATE , reminder.getDate());
values.put(KEY_TIME , reminder.getTime());
values.put(KEY_REPEAT , reminder.getRepeat());
values.put(KEY_REPEAT_NO , reminder.getRepeatNo());
values.put(KEY_REPEAT_TYPE, reminder.getRepeatType());
values.put(KEY_ACTIVE, reminder.getActive());
// Inserting Row
long ID = db.insert(TABLE_REMINDERS, null, values);
db.close();
return (int) ID;
}
// Getting single Reminder
public Reminder getReminder(int id){
SQLiteDatabase db = this.getReadableDatabase();
Cursor cursor = db.query(TABLE_REMINDERS, new String[]
{
KEY_ID,
KEY_TITLE,
KEY_DATE,
KEY_TIME,
KEY_REPEAT,
KEY_REPEAT_NO,
KEY_REPEAT_TYPE,
KEY_ACTIVE
}, KEY_ID + "=?",
new String[] {String.valueOf(id)}, null, null, null, null);
if (cursor != null)
cursor.moveToFirst();
Reminder reminder = new Reminder(Integer.parseInt(cursor.getString(0)), cursor.getString(1),
cursor.getString(2), cursor.getString(3), cursor.getString(4),
cursor.getString(5), cursor.getString(6), cursor.getString(7));
return reminder;
}
// Getting all Reminders
public List<Reminder> getAllReminders(){
List<Reminder> reminderList = new ArrayList<>();
// Select all Query
String selectQuery = "SELECT * FROM " + TABLE_REMINDERS;
SQLiteDatabase db = this.getWritableDatabase();
Cursor cursor = db.rawQuery(selectQuery, null);
// Looping through all rows and adding to list
if(cursor.moveToFirst()){
do{
Reminder reminder = new Reminder();
reminder.setID(Integer.parseInt(cursor.getString(0)));
reminder.setTitle(cursor.getString(1));
reminder.setDate(cursor.getString(2));
reminder.setTime(cursor.getString(3));
reminder.setRepeat(cursor.getString(4));
reminder.setRepeatNo(cursor.getString(5));
reminder.setRepeatType(cursor.getString(6));
reminder.setActive(cursor.getString(7));
// Adding Reminders to list
reminderList.add(reminder);
} while (cursor.moveToNext());
}
return reminderList;
}
// Getting Reminders Count
public int getRemindersCount(){
String countQuery = "SELECT * FROM " + TABLE_REMINDERS;
SQLiteDatabase db = this.getReadableDatabase();
Cursor cursor = db.rawQuery(countQuery,null);
cursor.close();
return cursor.getCount();
}
// Updating single Reminder
public int updateReminder(Reminder reminder){
SQLiteDatabase db = this.getWritableDatabase();
ContentValues values = new ContentValues();
values.put(KEY_TITLE , reminder.getTitle());
values.put(KEY_DATE , reminder.getDate());
values.put(KEY_TIME , reminder.getTime());
values.put(KEY_REPEAT , reminder.getRepeat());
values.put(KEY_REPEAT_NO , reminder.getRepeatNo());
values.put(KEY_REPEAT_TYPE, reminder.getRepeatType());
values.put(KEY_ACTIVE, reminder.getActive());
// Updating row
return db.update(TABLE_REMINDERS, values, KEY_ID + "=?",
new String[]{String.valueOf(reminder.getID())});
}
// Deleting single Reminder
public void deleteReminder(Reminder reminder){
SQLiteDatabase db = this.getWritableDatabase();
db.delete(TABLE_REMINDERS, KEY_ID + "=?",
new String[]{String.valueOf(reminder.getID())});
db.close();
}
}
/*
* Copyright 2015 Blanyal D'Souza.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.blanyal.remindme;
import android.app.AlertDialog;
import android.app.DatePickerDialog;
import android.app.TimePickerDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.text.Editable;
import android.text.InputType;
import android.text.TextWatcher;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.Switch;
import android.widget.TextView;
import android.widget.TimePicker;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import java.util.Calendar;
public class ReminderEditActivity extends AppCompatActivity {
private Toolbar mToolbar;
private EditText mTitleText;
private TextView mDateText, mTimeText, mRepeatText, mRepeatNoText, mRepeatTypeText;
private FloatingActionButton mFAB1;
private FloatingActionButton mFAB2;
private Switch mRepeatSwitch;
private String mTitle;
private String mTime;
private String mDate;
private String mRepeatNo;
private String mRepeatType;
private String mActive;
private String mRepeat;
private String[] mDateSplit;
private String[] mTimeSplit;
private int mReceivedID;
private int mYear, mMonth, mHour, mMinute, mDay;
private long mRepeatTime;
private Calendar mCalendar;
private Reminder mReceivedReminder;
private ReminderDatabase rb;
private AlarmReceiver mAlarmReceiver;
// Constant Intent String
public static final String EXTRA_REMINDER_ID = "Reminder_ID";
// Values for orientation change
private static final String KEY_TITLE = "title_key";
private static final String KEY_TIME = "time_key";
private static final String KEY_DATE = "date_key";
private static final String KEY_REPEAT = "repeat_key";
private static final String KEY_REPEAT_NO = "repeat_no_key";
private static final String KEY_REPEAT_TYPE = "repeat_type_key";
private static final String KEY_ACTIVE = "active_key";
// Constant values in milliseconds
private static final long milMinute = 60000L;
private static final long milHour = 3600000L;
private static final long milDay = 86400000L;
private static final long milWeek = 604800000L;
private static final long milMonth = 2592000000L;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_add_reminder);
// Initialize Views
mToolbar = (Toolbar) findViewById(R.id.toolbar);
mTitleText = (EditText) findViewById(R.id.reminder_title);
mDateText = (TextView) findViewById(R.id.set_date);
mTimeText = (TextView) findViewById(R.id.set_time);
mRepeatText = (TextView) findViewById(R.id.set_repeat);
mRepeatNoText = (TextView) findViewById(R.id.set_repeat_no);
mRepeatTypeText = (TextView) findViewById(R.id.set_repeat_type);
mFAB1 = (FloatingActionButton) findViewById(R.id.starred1);
mFAB2 = (FloatingActionButton) findViewById(R.id.starred2);
mRepeatSwitch = (Switch) findViewById(R.id.repeat_switch);
// Setup Toolbar
setSupportActionBar(mToolbar);
getSupportActionBar().setTitle(R.string.title_activity_edit_reminder);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true);
// Setup Reminder Title EditText
mTitleText.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
mTitle = s.toString().trim();
mTitleText.setError(null);
}
@Override
public void afterTextChanged(Editable s) {}
});
// Get reminder id from intent
mReceivedID = Integer.parseInt(getIntent().getStringExtra(EXTRA_REMINDER_ID));
// Get reminder using reminder id
rb = new ReminderDatabase(this);
mReceivedReminder = rb.getReminder(mReceivedID);
// Get values from reminder
mTitle = mReceivedReminder.getTitle();
mDate = mReceivedReminder.getDate();
mTime = mReceivedReminder.getTime();
mRepeat = mReceivedReminder.getRepeat();
mRepeatNo = mReceivedReminder.getRepeatNo();
mRepeatType = mReceivedReminder.getRepeatType();
mActive = mReceivedReminder.getActive();
// Setup TextViews using reminder values
mTitleText.setText(mTitle);
mDateText.setText(mDate);
mTimeText.setText(mTime);
mRepeatNoText.setText(mRepeatNo);
mRepeatTypeText.setText(mRepeatType);
mRepeatText.setText("Every " + mRepeatNo + " " + mRepeatType + "(s)");
// To save state on device rotation
if (savedInstanceState != null) {
String savedTitle = savedInstanceState.getString(KEY_TITLE);
mTitleText.setText(savedTitle);
mTitle = savedTitle;
String savedTime = savedInstanceState.getString(KEY_TIME);
mTimeText.setText(savedTime);
mTime = savedTime;
String savedDate = savedInstanceState.getString(KEY_DATE);
mDateText.setText(savedDate);
mDate = savedDate;
String saveRepeat = savedInstanceState.getString(KEY_REPEAT);
mRepeatText.setText(saveRepeat);
mRepeat = saveRepeat;
String savedRepeatNo = savedInstanceState.getString(KEY_REPEAT_NO);
mRepeatNoText.setText(savedRepeatNo);
mRepeatNo = savedRepeatNo;
String savedRepeatType = savedInstanceState.getString(KEY_REPEAT_TYPE);
mRepeatTypeText.setText(savedRepeatType);
mRepeatType = savedRepeatType;
mActive = savedInstanceState.getString(KEY_ACTIVE);
}
// Setup up active buttons
if (mActive.equals("false")) {
mFAB1.show();
mFAB2.hide();
} else if (mActive.equals("true")) {
mFAB1.hide();
mFAB2.show();
}
// Setup repeat switch
if (mRepeat.equals("false")) {
mRepeatSwitch.setChecked(false);
mRepeatText.setText(R.string.repeat_off);
} else if (mRepeat.equals("true")) {
mRepeatSwitch.setChecked(true);
}
// Obtain Date and Time details
mCalendar = Calendar.getInstance();
mAlarmReceiver = new AlarmReceiver();
mDateSplit = mDate.split("/");
mTimeSplit = mTime.split(":");
mDay = Integer.parseInt(mDateSplit[0]);
mMonth = Integer.parseInt(mDateSplit[1]);
mYear = Integer.parseInt(mDateSplit[2]);
mHour = Integer.parseInt(mTimeSplit[0]);
mMinute = Integer.parseInt(mTimeSplit[1]);
}
// To save state on device rotation
@Override
protected void onSaveInstanceState (Bundle outState) {
super.onSaveInstanceState(outState);
outState.putCharSequence(KEY_TITLE, mTitleText.getText());
outState.putCharSequence(KEY_TIME, mTimeText.getText());
outState.putCharSequence(KEY_DATE, mDateText.getText());
outState.putCharSequence(KEY_REPEAT, mRepeatText.getText());
outState.putCharSequence(KEY_REPEAT_NO, mRepeatNoText.getText());
outState.putCharSequence(KEY_REPEAT_TYPE, mRepeatTypeText.getText());
outState.putCharSequence(KEY_ACTIVE, mActive);
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
}
// On clicking Time picker
public void setTime(View v){
Calendar now = Calendar.getInstance();
TimePickerDialog timePickerDialog = new TimePickerDialog(this,
new TimePickerDialog.OnTimeSetListener() {
@Override
public void onTimeSet(TimePicker view, int hourOfDay,
int minute) {
mHour = hourOfDay;
mMinute = minute;
if (minute < 10) {
mTime = hourOfDay + ":" + "0" + minute;
} else {
mTime = hourOfDay + ":" + minute;
}
mTimeText.setText(mTime);
}
}, mHour, mMinute, false);
timePickerDialog.show();
}
// On clicking Date picker
public void setDate(View v){
Calendar now = Calendar.getInstance();
DatePickerDialog datePickerDialog = new DatePickerDialog(this,
new DatePickerDialog.OnDateSetListener() {
@Override
public void onDateSet(DatePicker view, int year,
int monthOfYear, int dayOfMonth) {
mDay = dayOfMonth;
mMonth = monthOfYear+1;
mYear = year;
mDate = mDay + "/" + mMonth + "/" + mYear;
mDateText.setText(mDate);;
}
}, mYear, mMonth, mDay);
datePickerDialog.show();
}
// Obtain time from time picker
// @Override
// public void onTimeSet(TimePicker timePicker, int hourOfDay, int minute) {
// mHour = hourOfDay;
// mMinute = minute;
// if (minute < 10) {
// mTime = hourOfDay + ":" + "0" + minute;
// } else {
// mTime = hourOfDay + ":" + minute;
// }
// mTimeText.setText(mTime);
// }
//
// // Obtain date from date picker
// @Override
// public void onDateSet(DatePicker datePicker, int year, int monthOfYear, int dayOfMonth) {
// monthOfYear ++;
// mDay = dayOfMonth;
// mMonth = monthOfYear;
// mYear = year;
// mDate = dayOfMonth + "/" + monthOfYear + "/" + year;
// mDateText.setText(mDate);
// }
// On clicking the active button
public void selectFab1(View v) {
mFAB1 = (FloatingActionButton) findViewById(R.id.starred1);
mFAB1.hide();
mFAB2 = (FloatingActionButton) findViewById(R.id.starred2);
mFAB2.show();
mActive = "true";
}
// On clicking the inactive button
public void selectFab2(View v) {
mFAB2 = (FloatingActionButton) findViewById(R.id.starred2);
mFAB2.hide();
mFAB1 = (FloatingActionButton) findViewById(R.id.starred1);
mFAB1.show();
mActive = "false";
}
// On clicking the repeat switch
public void onSwitchRepeat(View view) {
boolean on = ((Switch) view).isChecked();
if (on) {
mRepeat = "true";
mRepeatText.setText("Every " + mRepeatNo + " " + mRepeatType + "(s)");
} else {
mRepeat = "false";
mRepeatText.setText(R.string.repeat_off);
}
}
// On clicking repeat type button
public void selectRepeatType(View v){
final String[] items = new String[5];
items[0] = "Minute";
items[1] = "Hour";
items[2] = "Day";
items[3] = "Week";
items[4] = "Month";
// Create List Dialog
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("Select Type");
builder.setItems(items, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int item) {
mRepeatType = items[item];
mRepeatTypeText.setText(mRepeatType);
mRepeatText.setText("Every " + mRepeatNo + " " + mRepeatType + "(s)");
}
});
AlertDialog alert = builder.create();
alert.show();
}
// On clicking repeat interval button
public void setRepeatNo(View v){
AlertDialog.Builder alert = new AlertDialog.Builder(this);
alert.setTitle("Enter Number");
// Create EditText box to input repeat number
final EditText input = new EditText(this);
input.setInputType(InputType.TYPE_CLASS_NUMBER);
alert.setView(input);
alert.setPositiveButton("Ok",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
if (input.getText().toString().length() == 0) {
mRepeatNo = Integer.toString(1);
mRepeatNoText.setText(mRepeatNo);
mRepeatText.setText("Every " + mRepeatNo + " " + mRepeatType + "(s)");
}
else {
mRepeatNo = input.getText().toString().trim();
mRepeatNoText.setText(mRepeatNo);
mRepeatText.setText("Every " + mRepeatNo + " " + mRepeatType + "(s)");
}
}
});
alert.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
// Do nothing
}
});
alert.show();
}
// On clicking the update button
public void updateReminder(){
// Set new values in the reminder
mReceivedReminder.setTitle(mTitle);
mReceivedReminder.setDate(mDate);
mReceivedReminder.setTime(mTime);
mReceivedReminder.setRepeat(mRepeat);
mReceivedReminder.setRepeatNo(mRepeatNo);
mReceivedReminder.setRepeatType(mRepeatType);
mReceivedReminder.setActive(mActive);
// Update reminder
rb.updateReminder(mReceivedReminder);
// Set up calender for creating the notification
mCalendar.set(Calendar.MONTH, --mMonth);
mCalendar.set(Calendar.YEAR, mYear);
mCalendar.set(Calendar.DAY_OF_MONTH, mDay);
mCalendar.set(Calendar.HOUR_OF_DAY, mHour);
mCalendar.set(Calendar.MINUTE, mMinute);
mCalendar.set(Calendar.SECOND, 0);
// Cancel existing notification of the reminder by using its ID
mAlarmReceiver.cancelAlarm(getApplicationContext(), mReceivedID);
// Check repeat type
if (mRepeatType.equals("Minute")) {
mRepeatTime = Integer.parseInt(mRepeatNo) * milMinute;
} else if (mRepeatType.equals("Hour")) {
mRepeatTime = Integer.parseInt(mRepeatNo) * milHour;
} else if (mRepeatType.equals("Day")) {
mRepeatTime = Integer.parseInt(mRepeatNo) * milDay;
} else if (mRepeatType.equals("Week")) {
mRepeatTime = Integer.parseInt(mRepeatNo) * milWeek;
} else if (mRepeatType.equals("Month")) {
mRepeatTime = Integer.parseInt(mRepeatNo) * milMonth;
}
// Create a new notification
if (mActive.equals("true")) {
if (mRepeat.equals("true")) {
mAlarmReceiver.setRepeatAlarm(getApplicationContext(), mCalendar, mReceivedID, mRepeatTime);
} else if (mRepeat.equals("false")) {
mAlarmReceiver.setAlarm(getApplicationContext(), mCalendar, mReceivedID);
}
}
// Create toast to confirm update
Toast.makeText(getApplicationContext(), "Edited",
Toast.LENGTH_SHORT).show();
onBackPressed();
}
// On pressing the back button
@Override
public void onBackPressed() {
super.onBackPressed();
}
// Creating the menu
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_add_reminder, menu);
return true;
}
// On clicking menu buttons
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
// On clicking the back arrow
// Discard any changes
case android.R.id.home:
onBackPressed();
return true;
// On clicking save reminder button
// Update reminder
case R.id.save_reminder:
mTitleText.setText(mTitle);
if (mTitleText.getText().toString().length() == 0)
mTitleText.setError("Reminder Title cannot be blank!");
else {
updateReminder();
}
return true;
// On clicking discard reminder button
// Discard any changes
case R.id.discard_reminder:
Toast.makeText(getApplicationContext(), "Changes Discarded",
Toast.LENGTH_SHORT).show();
onBackPressed();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
}
\ No newline at end of file
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/>
</vector>
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M2.01,21L23,12 2.01,3 2,10l15,2 -15,2z"/>
</vector>
<!--
Copyright 2015 Blanyal D'Souza.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:startColor="@android:color/transparent"
android:endColor="#88333333"
android:angle="90"/>
</shape>
\ No newline at end of file
<!--
Copyright 2015 Blanyal D'Souza.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:fab="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:minHeight="?attr/actionBarSize"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:contentInsetLeft="0dp"
app:contentInsetStart="16dp"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
android:background="?attr/colorPrimary" />
<LinearLayout
android:layout_width="match_parent"
android:layout_below="@+id/toolbar"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
android:id="@+id/add_reminder_layout_top"
android:background="@color/primary"
android:orientation="vertical"
android:layout_height="148dp">
<EditText
android:layout_width="match_parent"
android:id="@+id/reminder_title"
android:layout_marginLeft="72dp"
android:hint="@string/add_reminder"
android:textSize="25dp"
android:lines="4"
android:minLines="4"
android:gravity="top|left"
android:textColor="@android:color/white"
android:scrollHorizontally="false"
android:textColorHint="@color/primary_text_disabled_material_dark"
android:inputType="textCapWords|textMultiLine"
android:layout_marginRight="16dp"
android:layout_height="140dp"/>
</LinearLayout>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_below="@id/add_reminder_layout_top"
android:layout_height="fill_parent">
<LinearLayout
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="wrap_content">
<TextView
android:layout_width="match_parent"
android:layout_marginTop="8dp"
android:text="@string/details"
android:id="@+id/details"
android:textSize="15dp"
android:gravity="center_vertical"
android:layout_marginLeft="72dp"
android:textColor="@color/abc_secondary_text_material_dark"
android:layout_height="72dp"/>
<RelativeLayout
android:layout_width="match_parent"
android:clickable="true"
android:onClick="setDate"
android:id="@+id/date"
android:background="?android:attr/selectableItemBackground"
android:layout_height="72dp">
<ImageView
android:id="@+id/date_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="16dp"
android:layout_marginRight="32dp"
android:src="@drawable/ic_view_day_grey600_24dp"
android:layout_centerVertical="true" />
<LinearLayout
android:layout_width="wrap_content"
android:orientation="vertical"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/date_icon"
android:layout_height="wrap_content">
<TextView
android:id="@+id/date_text"
android:textColor="@color/abc_primary_text_material_dark"
android:layout_width="wrap_content"
android:textSize="15dp"
android:layout_height="wrap_content"
android:text="@string/date" />
<TextView
android:layout_width="wrap_content"
android:id="@+id/set_date"
android:textSize="15dp"
android:textColor="@color/abc_secondary_text_material_dark"
android:layout_height="wrap_content"/>
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:clickable="true"
android:onClick="setTime"
android:id="@+id/time"
android:background="?android:attr/selectableItemBackground"
android:layout_height="72dp">
<ImageView
android:id="@+id/time_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="16dp"
android:layout_marginRight="32dp"
android:src="@drawable/ic_access_time_grey600_24dp"
android:layout_centerVertical="true" />
<LinearLayout
android:layout_width="wrap_content"
android:orientation="vertical"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/time_icon"
android:layout_height="wrap_content">
<TextView
android:id="@+id/time_text"
android:textColor="@color/abc_primary_text_material_dark"
android:layout_width="wrap_content"
android:textSize="15dp"
android:layout_height="wrap_content"
android:text="@string/time" />
<TextView
android:layout_width="wrap_content"
android:id="@+id/set_time"
android:textSize="15dp"
android:textColor="@color/abc_secondary_text_material_dark"
android:layout_height="wrap_content"/>
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:id="@+id/repeat"
android:layout_height="72dp">
<ImageView
android:id="@+id/repeat_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="16dp"
android:layout_marginRight="32dp"
android:src="@drawable/ic_sync_grey600_24dp"
android:layout_centerVertical="true" />
<LinearLayout
android:layout_width="wrap_content"
android:orientation="vertical"
android:id="@+id/repeat_ll"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/repeat_icon"
android:layout_height="wrap_content">
<TextView
android:id="@+id/repeat_text"
android:textColor="@color/abc_primary_text_material_dark"
android:layout_width="wrap_content"
android:textSize="15dp"
android:layout_height="wrap_content"
android:text="@string/repeat" />
<TextView
android:layout_width="wrap_content"
android:id="@+id/set_repeat"
android:textSize="15dp"
android:textColor="@color/abc_secondary_text_material_dark"
android:layout_height="wrap_content"/>
</LinearLayout>
<Switch
android:id="@+id/repeat_switch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:layout_marginRight="16dp"
android:layout_marginLeft="8dp"
android:onClick="onSwitchRepeat"
android:checked="true"
android:textOn="On"
android:textOff="Off"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:id="@+id/RepeatNo"
android:clickable="true"
android:onClick="setRepeatNo"
android:background="?android:attr/selectableItemBackground"
android:layout_height="72dp">
<ImageView
android:id="@+id/repeat_no_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="16dp"
android:layout_marginRight="32dp"
android:src="@drawable/ic_unfold_more_grey600_24dp"
android:layout_centerVertical="true" />
<LinearLayout
android:layout_width="wrap_content"
android:orientation="vertical"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/repeat_no_icon"
android:layout_height="wrap_content">
<TextView
android:id="@+id/repeat_no_text"
android:textColor="@color/abc_primary_text_material_dark"
android:layout_width="wrap_content"
android:textSize="15dp"
android:layout_height="wrap_content"
android:text="@string/repeat_no" />
<TextView
android:layout_width="wrap_content"
android:id="@+id/set_repeat_no"
android:textSize="15dp"
android:textColor="@color/abc_secondary_text_material_dark"
android:layout_height="wrap_content"/>
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:id="@+id/RepeatType"
android:clickable="true"
android:onClick="selectRepeatType"
android:background="?android:attr/selectableItemBackground"
android:layout_height="72dp">
<ImageView
android:id="@+id/repeat_type_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="16dp"
android:layout_marginRight="32dp"
android:src="@drawable/ic_subject_grey600_24dp"
android:layout_centerVertical="true" />
<LinearLayout
android:layout_width="wrap_content"
android:orientation="vertical"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/repeat_type_icon"
android:layout_height="wrap_content">
<TextView
android:id="@+id/repeat_type_text"
android:textColor="@color/abc_primary_text_material_dark"
android:layout_width="wrap_content"
android:textSize="15dp"
android:layout_height="wrap_content"
android:text="@string/repeat_type" />
<TextView
android:layout_width="wrap_content"
android:id="@+id/set_repeat_type"
android:textSize="15dp"
android:textColor="@color/abc_secondary_text_material_dark"
android:layout_height="wrap_content"/>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
</ScrollView>
<View
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_below="@+id/add_reminder_layout_top"
android:background="@drawable/toolbar_dropshadow" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/starred1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:onClick="selectFab1"
android:icon="@drawable/ic_notifications_off_grey600_24dp"
android:layout_alignParentLeft="true"
android:layout_marginTop="168dp"
android:layout_centerHorizontal="true"
android:layout_marginLeft="8dp"/>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/starred2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:onClick="selectFab2"
android:icon="@drawable/ic_notifications_on_white_24dp"
android:layout_alignParentLeft="true"
android:layout_marginTop="168dp"
android:layout_centerHorizontal="true"
android:layout_marginLeft="8dp"/>
</RelativeLayout>
<!--
Copyright 2015 Blanyal D'Souza.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:fab="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:minHeight="?attr/actionBarSize"
app:contentInsetLeft="0dp"
app:contentInsetStart="16dp"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
android:background="?attr/colorPrimary" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/reminder_list"
android:layout_below="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<TextView
android:id="@+id/no_reminder_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:padding="16dp"
android:gravity="center"
android:visibility="gone"
android:text="@string/no_reminders"/>
<View
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_below="@+id/toolbar"
android:background="@drawable/toolbar_dropshadow" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/add_reminder"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:clickable="true"
android:layout_alignParentRight="true"
android:layout_marginBottom="16dp"
android:layout_marginRight="16dp"
android:src="@drawable/ic_add"/>
</RelativeLayout>
<!--
Copyright 2015 Blanyal D'Souza.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:id="@+id/scroll_view"
android:layout_below="@id/toolbar"
android:layout_height="fill_parent">
<TextView
android:id="@+id/licenses_text_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:text="@string/licenses"/>
</ScrollView>
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:minHeight="?attr/actionBarSize"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:contentInsetLeft="0dp"
app:contentInsetStart="16dp"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
android:background="?attr/colorPrimary" />
<View
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_below="@+id/toolbar"
android:background="@drawable/toolbar_dropshadow" />
</RelativeLayout>
\ No newline at end of file
<!--
Copyright 2015 Blanyal D'Souza.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:background="?android:attr/selectableItemBackground"
android:layout_height="86dp">
<ImageView android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_centerVertical="true"
android:id="@+id/thumbnail_image"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginTop="4dp"
android:layout_marginBottom="4dp"
android:layout_toRightOf="@id/thumbnail_image"
android:layout_toLeftOf="@+id/active_image"
android:orientation="vertical">
<TextView
android:id="@+id/recycle_title"
android:layout_width="match_parent"
android:ellipsize="end"
android:maxLines="2"
android:layout_height="wrap_content"
android:textColor="@color/abc_primary_text_material_dark"
tools:text="Title"
android:textSize="16dp"/>
<TextView
android:id="@+id/recycle_date_time"
android:layout_width="match_parent"
android:ellipsize="marquee"
android:singleLine="true"
android:layout_height="wrap_content"
android:textSize="13dp"
android:textColor="@color/abc_secondary_text_material_dark"
tools:text="Date and Time"/>
<TextView
android:id="@+id/recycle_repeat_info"
android:layout_width="match_parent"
android:ellipsize="marquee"
android:singleLine="true"
android:layout_height="wrap_content"
android:textSize="13dp"
android:textColor="@color/abc_secondary_text_material_dark"
tools:text="Repeat No and Type"/>
</LinearLayout>
<ImageView android:layout_width="wrap_content"
android:layout_alignParentRight="true"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:src="@drawable/ic_notifications_off_grey600_24dp"
android:layout_centerVertical="true"
android:id="@+id/active_image"/>
</RelativeLayout>
\ No newline at end of file
<!--
Copyright 2015 Blanyal D'Souza.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context="com.blanyal.remindme.MainActivity">
<item android:id="@+id/action_licenses"
android:title="@string/title_activity_licenses"
app:showAsAction="never"/>
</menu>
\ No newline at end of file
<!--
Copyright 2015 Blanyal D'Souza.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item android:id="@+id/discard_reminder"
android:icon="@drawable/ic_delete_white_24dp"
android:title="@string/action_discard_reminder"
app:showAsAction="ifRoom" />
<item android:id="@+id/save_reminder"
android:icon="@drawable/ic_check_white_24dp"
android:title="@string/action_save_reminder"
app:showAsAction="ifRoom" />
</menu>
<!--
Copyright 2015 Blanyal D'Souza.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources>
<style name="AppTheme" parent="AppTheme.Base">
<item name="windowActionModeOverlay">true</item>
<item name="android:actionModeBackground">@color/primary</item>
</style>
</resources>
<!--
Copyright 2015 Blanyal D'Souza.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources>
<style name="AppTheme" parent="AppTheme.Base">
<item name="android:windowContentTransitions">true</item>
<item name="android:windowAllowEnterTransitionOverlap">true</item>
<item name="android:windowAllowReturnTransitionOverlap">true</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:statusBarColor">@color/primary_dark</item>
<item name="android:actionBarPopupTheme">@style/ThemeOverlay.AppCompat</item>
<item name="android:windowSharedElementEnterTransition">@android:transition/move</item>
<item name="android:windowSharedElementExitTransition">@android:transition/move</item>
<item name="windowActionModeOverlay">true</item>
<item name="android:actionModeBackground">@color/primary</item>
</style>
</resources>
<!--
Copyright 2015 Blanyal D'Souza.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources>
<color name="toolbar_title">#ffffff</color>
<color name="primary">#37474f</color>
<color name="primary_dark">#263238</color>
<color name="accent">#78909c</color>
<color name="control_normal">#888888</color>
<color name="fab_pressed">#546e7a</color>
</resources>
\ No newline at end of file
<!--
Copyright 2015 Blanyal D'Souza.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources>
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
</resources>
<!--
Copyright 2015 Blanyal D'Souza.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources>
<string name="app_name">Remindly</string>
<string name="title_activity_add_reminder">Add Reminder</string>
<string name="title_activity_edit_reminder">Edit Reminder</string>
<string name="title_activity_licenses">Licenses</string>
<string name="add_reminder">Reminder</string>
<string name="details">Details</string>
<string name="date">Date</string>
<string name="time">Time</string>
<string name="repeat">Repeat</string>
<string name="repeat_off">Off</string>
<string name="repeat_no">Repetition Interval </string>
<string name="repeat_type">Type of Repetitions</string>
<string name="action_discard_reminder">Discard Reminder</string>
<string name="action_save_reminder">Save Reminder</string>
<string name="no_reminders">Click on the plus button below to begin creating your reminders!</string>
<string name="licenses"><BIG><b>NOTICES FOR LIBRARIES:</b></BIG> \n\n <b> 1) MaterialDateTimePicker
</b> \n\n<TT>Copyright (c) 2015 Wouter Dullaert\n\n
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at\n\n
http://www.apache.org/licenses/LICENSE-2.0\n\n
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.</TT>\n\n\n
<BIG><b>NOTICES FOR LIBRARIES:</b></BIG> \n\n <b> 2) FloatingActionButton</b> \n\n<TT>Copyright (C) 2014 Jerzy Chalupski\n\n
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at\n\n
http://www.apache.org/licenses/LICENSE-2.0\n\n
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.</TT>\n\n\n
<BIG><b>NOTICES FOR LIBRARIES:</b></BIG> \n\n <b> 3) RecyclerView Multiselect</b> \n\n<TT>The MIT License (MIT)\n\n
Copyright (c) 2014 Big Nerd Ranch\n\n
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.</TT>\n\n\n
<BIG><b>NOTICES FOR LIBRARIES:</b></BIG> \n\n <b> 4) TextDrawable</b> \n\n<TT>The MIT License (MIT)\n\n
Copyright (c) 2014 Amulya Khare\n\n
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.</TT>\n\n\n
<BIG><b>NOTICES FOR LIBRARIES:</b></BIG> \n\n <b> 5) material-design-icons</b> \n\n<TT>Attribution 4.0 International\n\n
=======================================================================\n\n
Creative Commons Corporation ("Creative Commons") is not a law firm and
does not provide legal services or legal advice. Distribution of
Creative Commons public licenses does not create a lawyer-client or
other relationship. Creative Commons makes its licenses and related
information available on an "as-is" basis. Creative Commons gives no
warranties regarding its licenses, any material licensed under their
terms and conditions, or any related information. Creative Commons
disclaims all liability for damages resulting from their use to the
fullest extent possible.\n\n
Using Creative Commons Public Licenses\n\n
Creative Commons public licenses provide a standard set of terms and
conditions that creators and other rights holders may use to share
original works of authorship and other material subject to copyright
and certain other rights specified in the public license below. The
following considerations are for informational purposes only, are not
exhaustive, and do not form part of our licenses.\n\n
Considerations for licensors: Our public licenses are
intended for use by those authorized to give the public
permission to use material in ways otherwise restricted by
copyright and certain other rights. Our licenses are
irrevocable. Licensors should read and understand the terms
and conditions of the license they choose before applying it.
Licensors should also secure all rights necessary before
applying our licenses so that the public can reuse the
material as expected. Licensors should clearly mark any
material not subject to the license. This includes other CC-
licensed material, or material used under an exception or
limitation to copyright. More considerations for licensors:
wiki.creativecommons.org/Considerations_for_licensors\n\n
Considerations for the public: By using one of our public
licenses, a licensor grants the public permission to use the
licensed material under specified terms and conditions. If
the licensor\'s permission is not necessary for any reason--for
example, because of any applicable exception or limitation to
copyright--then that use is not regulated by the license. Our
licenses grant only permissions under copyright and certain
other rights that a licensor has authority to grant. Use of
the licensed material may still be restricted for other
reasons, including because others have copyright or other
rights in the material. A licensor may make special requests,
such as asking that all changes be marked or described.
Although not required by our licenses, you are encouraged to
respect those requests where reasonable. More_considerations
for the public:\n
wiki.creativecommons.org/Considerations_for_licensees\n\n
=======================================================================\n\n
Creative Commons Attribution 4.0 International Public License\n\n
By exercising the Licensed Rights (defined below), You accept and agree
to be bound by the terms and conditions of this Creative Commons
Attribution 4.0 International Public License ("Public License"). To the
extent this Public License may be interpreted as a contract, You are
granted the Licensed Rights in consideration of Your acceptance of
these terms and conditions, and the Licensor grants You such rights in
consideration of benefits the Licensor receives from making the
Licensed Material available under these terms and conditions.\n\n
Section 1 -- Definitions.\n\n
a. Adapted Material means material subject to Copyright and Similar
Rights that is derived from or based upon the Licensed Material
and in which the Licensed Material is translated, altered,
arranged, transformed, or otherwise modified in a manner requiring
permission under the Copyright and Similar Rights held by the
Licensor. For purposes of this Public License, where the Licensed
Material is a musical work, performance, or sound recording,
Adapted Material is always produced where the Licensed Material is
synched in timed relation with a moving image.\n\n
b. Adapter\'s License means the license You apply to Your Copyright
and Similar Rights in Your contributions to Adapted Material in
accordance with the terms and conditions of this Public License.\n\n
c. Copyright and Similar Rights means copyright and/or similar rights
closely related to copyright including, without limitation,
performance, broadcast, sound recording, and Sui Generis Database
Rights, without regard to how the rights are labeled or
categorized. For purposes of this Public License, the rights
specified in Section 2(b)(1)-(2) are not Copyright and Similar
Rights.\n\n
d. Effective Technological Measures means those measures that, in the
absence of proper authority, may not be circumvented under laws
fulfilling obligations under Article 11 of the WIPO Copyright
Treaty adopted on December 20, 1996, and/or similar international
agreements.\n\n
e. Exceptions and Limitations means fair use, fair dealing, and/or
any other exception or limitation to Copyright and Similar Rights
that applies to Your use of the Licensed Material.\n\n
f. Licensed Material means the artistic or literary work, database,
or other material to which the Licensor applied this Public
License.\n\n
g. Licensed Rights means the rights granted to You subject to the
terms and conditions of this Public License, which are limited to
all Copyright and Similar Rights that apply to Your use of the
Licensed Material and that the Licensor has authority to license.\n\n
h. Licensor means the individual(s) or entity(ies) granting rights
under this Public License.\n\n
i. Share means to provide material to the public by any means or
process that requires permission under the Licensed Rights, such
as reproduction, public display, public performance, distribution,
dissemination, communication, or importation, and to make material
available to the public including in ways that members of the
public may access the material from a place and at a time
individually chosen by them.\n\n
j. Sui Generis Database Rights means rights other than copyright
resulting from Directive 96/9/EC of the European Parliament and of
the Council of 11 March 1996 on the legal protection of databases,
as amended and/or succeeded, as well as other essentially
equivalent rights anywhere in the world.\n\n
k. You means the individual or entity exercising the Licensed Rights
under this Public License. Your has a corresponding meaning.\n\n
Section 2 -- Scope.\n\n
a. License grant.\n\n
1. Subject to the terms and conditions of this Public License,
the Licensor hereby grants You a worldwide, royalty-free,
non-sublicensable, non-exclusive, irrevocable license to
exercise the Licensed Rights in the Licensed Material to:\n\n
a. reproduce and Share the Licensed Material, in whole or
in part; and\n\n
b. produce, reproduce, and Share Adapted Material.\n\n
2. Exceptions and Limitations. For the avoidance of doubt, where
Exceptions and Limitations apply to Your use, this Public
License does not apply, and You do not need to comply with
its terms and conditions.\n\n
3. Term. The term of this Public License is specified in Section
6(a).\n\n
4. Media and formats; technical modifications allowed. The
Licensor authorizes You to exercise the Licensed Rights in
all media and formats whether now known or hereafter created,
and to make technical modifications necessary to do so. The
Licensor waives and/or agrees not to assert any right or
authority to forbid You from making technical modifications
necessary to exercise the Licensed Rights, including
technical modifications necessary to circumvent Effective
Technological Measures. For purposes of this Public License,
simply making modifications authorized by this Section 2(a)
(4) never produces Adapted Material.\n\n
5. Downstream recipients.\n\n
a. Offer from the Licensor -- Licensed Material. Every
recipient of the Licensed Material automatically
receives an offer from the Licensor to exercise the
Licensed Rights under the terms and conditions of this
Public License.\n\n
b. No downstream restrictions. You may not offer or impose
any additional or different terms or conditions on, or
apply any Effective Technological Measures to, the
Licensed Material if doing so restricts exercise of the
Licensed Rights by any recipient of the Licensed
Material.\n\n
6. No endorsement. Nothing in this Public License constitutes or
may be construed as permission to assert or imply that You
are, or that Your use of the Licensed Material is, connected
with, or sponsored, endorsed, or granted official status by,
the Licensor or others designated to receive attribution as
provided in Section 3(a)(1)(A)(i).\n\n
b. Other rights.\n\n
1. Moral rights, such as the right of integrity, are not
licensed under this Public License, nor are publicity,
privacy, and/or other similar personality rights; however, to
the extent possible, the Licensor waives and/or agrees not to
assert any such rights held by the Licensor to the limited
extent necessary to allow You to exercise the Licensed
Rights, but not otherwise.\n\n
2. Patent and trademark rights are not licensed under this
Public License.\n\n
3. To the extent possible, the Licensor waives any right to
collect royalties from You for the exercise of the Licensed
Rights, whether directly or through a collecting society
under any voluntary or waivable statutory or compulsory
licensing scheme. In all other cases the Licensor expressly
reserves any right to collect such royalties.\n\n
Section 3 -- License Conditions.\n\n
Your exercise of the Licensed Rights is expressly made subject to the
following conditions.\n\n
a. Attribution.\n\n
1. If You Share the Licensed Material (including in modified
form), You must:\n\n
a. retain the following if it is supplied by the Licensor
with the Licensed Material:\n\n
i. identification of the creator(s) of the Licensed
Material and any others designated to receive
attribution, in any reasonable manner requested by
the Licensor (including by pseudonym if
designated);\n\n
ii. a copyright notice;\n\n
iii. a notice that refers to this Public License;\n\n
iv. a notice that refers to the disclaimer of
warranties;\n\n
v. a URI or hyperlink to the Licensed Material to the
extent reasonably practicable;\n\n
b. indicate if You modified the Licensed Material and
retain an indication of any previous modifications; and\n\n
c. indicate the Licensed Material is licensed under this
Public License, and include the text of, or the URI or
hyperlink to, this Public License.\n\n
2. You may satisfy the conditions in Section 3(a)(1) in any
reasonable manner based on the medium, means, and context in
which You Share the Licensed Material. For example, it may be
reasonable to satisfy the conditions by providing a URI or
hyperlink to a resource that includes the required
information.\n\n
3. If requested by the Licensor, You must remove any of the
information required by Section 3(a)(1)(A) to the extent
reasonably practicable.\n\n
4. If You Share Adapted Material You produce, the Adapter\'s
License You apply must not prevent recipients of the Adapted
Material from complying with this Public License.\n\n
Section 4 -- Sui Generis Database Rights.\n\n
Where the Licensed Rights include Sui Generis Database Rights that
apply to Your use of the Licensed Material:\n\n
a. for the avoidance of doubt, Section 2(a)(1) grants You the right
to extract, reuse, reproduce, and Share all or a substantial
portion of the contents of the database;\n\n
b. if You include all or a substantial portion of the database
contents in a database in which You have Sui Generis Database
Rights, then the database in which You have Sui Generis Database
Rights (but not its individual contents) is Adapted Material; and\n\n
c. You must comply with the conditions in Section 3(a) if You Share
all or a substantial portion of the contents of the database.\n\n
For the avoidance of doubt, this Section 4 supplements and does not
replace Your obligations under this Public License where the Licensed
Rights include other Copyright and Similar Rights.\n\n
Section 5 -- Disclaimer of Warranties and Limitation of Liability.\n\n
a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.\n\n
b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.\n\n
c. The disclaimer of warranties and limitation of liability provided
above shall be interpreted in a manner that, to the extent
possible, most closely approximates an absolute disclaimer and
waiver of all liability.\n\n
Section 6 -- Term and Termination.\n\n
a. This Public License applies for the term of the Copyright and
Similar Rights licensed here. However, if You fail to comply with
this Public License, then Your rights under this Public License
terminate automatically.\n\n
b. Where Your right to use the Licensed Material has terminated under
Section 6(a), it reinstates:\n\n
1. automatically as of the date the violation is cured, provided
it is cured within 30 days of Your discovery of the
violation; or\n\n
2. upon express reinstatement by the Licensor.\n\n
For the avoidance of doubt, this Section 6(b) does not affect any
right the Licensor may have to seek remedies for Your violations
of this Public License.\n\n
c. For the avoidance of doubt, the Licensor may also offer the
Licensed Material under separate terms or conditions or stop
distributing the Licensed Material at any time; however, doing so
will not terminate this Public License.\n\n
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
License.\n\n
Section 7 -- Other Terms and Conditions.\n\n
a. The Licensor shall not be bound by any additional or different
terms or conditions communicated by You unless expressly agreed.\n\n
b. Any arrangements, understandings, or agreements regarding the
Licensed Material not stated herein are separate from and
independent of the terms and conditions of this Public License.\n\n
Section 8 -- Interpretation.\n\n
a. For the avoidance of doubt, this Public License does not, and
shall not be interpreted to, reduce, limit, restrict, or impose
conditions on any use of the Licensed Material that could lawfully
be made without permission under this Public License.\n\n
b. To the extent possible, if any provision of this Public License is
deemed unenforceable, it shall be automatically reformed to the
minimum extent necessary to make it enforceable. If the provision
cannot be reformed, it shall be severed from this Public License
without affecting the enforceability of the remaining terms and
conditions.\n\n
c. No term or condition of this Public License will be waived and no
failure to comply consented to unless expressly agreed to by the
Licensor.\n\n
d. Nothing in this Public License constitutes or may be interpreted
as a limitation upon, or waiver of, any privileges and immunities
that apply to the Licensor or You, including from the legal
processes of any jurisdiction or authority.\n\n\n
=======================================================================\n\n
Creative Commons is not a party to its public licenses.
Notwithstanding, Creative Commons may elect to apply one of its public
licenses to material it publishes and in those instances will be
considered the "Licensor." Except for the limited purpose of indicating
that material is shared under a Creative Commons public license or as
otherwise permitted by the Creative Commons policies published at
creativecommons.org/policies, Creative Commons does not authorize the
use of the trademark "Creative Commons" or any other trademark or logo
of Creative Commons without its prior written consent including,
without limitation, in connection with any unauthorized modifications
to any of its public licenses or any other arrangements,
understandings, or agreements concerning use of licensed material. For
the avoidance of doubt, this paragraph does not form part of the public
licenses.\n\n
Creative Commons may be contacted at creativecommons.org.</TT>\n\n\n
<BIG><b>END OF LICENSES</b></BIG>
</string>
</resources>
<!--
Copyright 2015 Blanyal D'Souza.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="AppTheme.Base"/>
<style name="AppTheme.Base" parent="Theme.AppCompat.NoActionBar">
<item name="colorPrimary">@color/primary</item>
<item name="colorPrimaryDark">@color/primary_dark</item>
<item name="colorAccent">@color/accent</item>
<item name="actionModeBackground">@color/primary</item>
<item name="actionBarPopupTheme">@style/ThemeOverlay.AppCompat</item>
<item name="android:windowNoTitle">true</item>
<item name="windowActionModeOverlay">true</item>
</style>
</resources>
/*
* Copyright 2015 Blanyal D'Souza.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
buildscript {
repositories {
google() // Google's Maven repository
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.1'
classpath 'com.google.gms:google-services:4.3.2'
}
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
}
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
\ No newline at end of file
#Wed Oct 30 09:48:14 IST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
#!/usr/bin/env bash
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
esac
# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&-
APP_HOME="`pwd -P`"
cd "$SAVED" >&-
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
include ':app'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment