Commit 79cc996e authored by DEEPAK VERMA's avatar DEEPAK VERMA

Code cleanup

parent 65475998
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.blanyal.remindme">
package="com.sudogeeks.talking_reminder">
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
......@@ -12,9 +12,9 @@
android:label="@string/app_name"
android:theme="@style/AppTheme"
tools:replace="android:icon,android:theme">
<activity android:name=".ReadTheMessage"></activity>
<activity android:name="com.sudogeeks.talking_reminder.ReadTheMessage"></activity>
<activity android:name=".ReminderReceiveActivity">
<activity android:name="com.sudogeeks.talking_reminder.ReminderReceiveActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
......@@ -26,7 +26,7 @@
</activity>
<activity
android:name=".MainActivity"
android:name="com.sudogeeks.talking_reminder.MainActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
......@@ -35,7 +35,7 @@
</activity>
<activity
android:name=".ReminderAddActivity"
android:name="com.sudogeeks.talking_reminder.ReminderAddActivity"
android:label="@string/activity_add_reminder_label">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
......@@ -43,12 +43,12 @@
</activity>
<activity
android:name=".ReminderEditActivity"
android:name="com.sudogeeks.talking_reminder.ReminderEditActivity"
android:label="@string/activity_edit_reminder_label" />
<receiver android:name=".AlarmReceiver"/>
<receiver android:name="com.sudogeeks.talking_reminder.AlarmReceiver"/>
<receiver android:name=".BootReceiver">
<receiver android:name="com.sudogeeks.talking_reminder.BootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter>
......@@ -56,7 +56,7 @@
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="com.blanyal.remindme.fileprovider"
android:authorities="com.sudogeeks.talking_reminder.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<!-- ressource file to create -->
......@@ -67,7 +67,7 @@
</provider>
<service
android:name=".ReadTheMessage"
android:name="com.sudogeeks.talking_reminder.ReadTheMessage"
android:enabled="true" />
</application>
......
/*
* 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().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;
package com.sudogeeks.talking_reminder;
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;
......@@ -44,11 +25,7 @@ public class AlarmReceiver extends BroadcastReceiver {
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);
......@@ -63,20 +40,20 @@ public class AlarmReceiver extends BroadcastReceiver {
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,"MyChannelId_01")
// .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());
// // Create Notification
// NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context,"MyChannelId_01")
// .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());
NotificationHelper notificationHelper = new NotificationHelper(context,intent);
NotificationCompat.Builder nb = notificationHelper.getChannelNotification();
......@@ -103,17 +80,17 @@ public class AlarmReceiver extends BroadcastReceiver {
// Intent speechIntent = new Intent();
// speechIntent.setClass(context, ReadTheMessage.class);
// speechIntent.putExtra("MESSAGE",mTitle );
// speechIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
// context.startActivity(speechIntent);
////
// Intent speechIntent = new Intent();
// speechIntent.setClass(context, ReadTheMessage.class);
// speechIntent.putExtra("MESSAGE",mTitle );
// speechIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
// context.startActivity(speechIntent);
////
// Intent speechIntent = new Intent();
// speechIntent.putExtra("MESSAGE", "Bluetooth is on.");
// ReadTheMessage.enqueueWork(context, speechIntent);
//
// Intent speechIntent = new Intent();
// speechIntent.putExtra("MESSAGE", "Bluetooth is on.");
// ReadTheMessage.enqueueWork(context, speechIntent);
//
}
......
/*
* 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;
package com.sudogeeks.talking_reminder;
import android.content.BroadcastReceiver;
import android.content.Context;
......
package com.blanyal.remindme;
package com.sudogeeks.talking_reminder;
// Class to create DateTime objects for easy sorting
public class DateTimeSorter {
......
/*
* 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;
package com.sudogeeks.talking_reminder;
import android.content.Intent;
import android.os.Bundle;
......
package com.blanyal.remindme;
package com.sudogeeks.talking_reminder;
//package com.example.application.alarmmanagerproject;
import androidx.core.app.NotificationCompat;
......@@ -7,20 +7,13 @@ import android.annotation.TargetApi;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.ContentResolver;
import android.content.Context;
import android.content.ContextWrapper;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.graphics.BitmapFactory;
import android.media.RingtoneManager;
import android.speech.tts.TextToSpeech;
import java.io.File;
import java.util.HashMap;
import java.util.Locale;
public class NotificationHelper extends ContextWrapper {
public static final String channelID = "channelID";
......@@ -85,7 +78,7 @@ public class NotificationHelper extends ContextWrapper {
//.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_ALARM))
// .setSound(Uri.fromFile(new File("SDCARD/s1.mp3")))
//.setSound(null)
.setPriority(NotificationManager.IMPORTANCE_LOW)
.setPriority(NotificationManager.IMPORTANCE_HIGH)
.setContentIntent(mClick)
.setAutoCancel(true)
.setOnlyAlertOnce(true);
......
package com.blanyal.remindme;
package com.sudogeeks.talking_reminder;
import android.app.Activity;
import android.app.Service;
import android.os.Bundle;
import android.os.IBinder;
import android.speech.tts.TextToSpeech;
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 java.util.Locale;
......
/*
* 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;
package com.sudogeeks.talking_reminder;
// Reminder class
public class Reminder {
......
package com.blanyal.remindme;
package com.sudogeeks.talking_reminder;
import android.Manifest;
import android.app.AlertDialog;
......@@ -17,7 +17,6 @@ import android.text.TextWatcher;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.Switch;
......@@ -36,7 +35,6 @@ import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.util.Calendar;
......@@ -522,7 +520,7 @@ public class ReminderAddActivity extends AppCompatActivity {
File filePath = context.getFilesDir();
File fileToSend = new File(filePath, filename);
Uri fileUri = FileProvider.getUriForFile(context,
"com.blanyal.remindme.fileprovider", fileToSend);
"com.sudogeeks.talking_reminder.fileprovider", fileToSend); //TODO remove hardcoded dependencies
Intent share = new Intent();
share.setAction(Intent.ACTION_SEND);
share.putExtra(Intent.EXTRA_STREAM, fileUri);
......
/*
* 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;
package com.sudogeeks.talking_reminder;
import android.content.ContentValues;
import android.content.Context;
......
/*
* 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;
package com.sudogeeks.talking_reminder;
import android.app.AlertDialog;
import android.app.DatePickerDialog;
......
package com.blanyal.remindme;
package com.sudogeeks.talking_reminder;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.core.content.FileProvider;
import android.content.Context;
import android.content.Intent;
......@@ -16,8 +15,6 @@ import android.widget.Toast;
import org.json.JSONObject;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Calendar;
......@@ -44,7 +41,7 @@ public class ReminderReceiveActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_add_reminder);
setContentView(R.layout.activity_receive_reminder);
Context context = this;
mCalendar = Calendar.getInstance();
......
package com.blanyal.remindme;
package com.sudogeeks.talking_reminder;
public class Utility {
public static final String FILE_NAME_PREFIX = "Talking_Reminder";
......
......@@ -14,7 +14,7 @@
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:contentInsetLeft="0dp"
app:contentInsetStart="16dp"
app:theme="@style/ThemeOverlay.AppCompat.DayNight.ActionBar"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
android:background="?attr/colorPrimary" />
<LinearLayout
......
This diff is collapsed.
<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">
</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
......@@ -2,7 +2,7 @@
<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">
tools:context="com.blanyal.talking_reminder.MainActivity">
<!-- <item android:id="@+id/action_licenses"-->
<!-- android:title="@string/title_activity_licenses"-->
......
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