From e834ad4e37f36e2f8bcbe9bcc9604a2090b6ec0e Mon Sep 17 00:00:00 2001 From: blanyal Date: Mon, 13 Apr 2015 22:24:28 +0530 Subject: [PATCH 1/3] Added Database --- .../java/com/blanyal/remindme/Reminder.java | 108 ++++++++++ .../blanyal/remindme/ReminderDatabase.java | 196 ++++++++++++++++++ .../main/res/layout/activity_add_reminder.xml | 4 + app/src/main/res/values/strings.xml | 1 + 4 files changed, 309 insertions(+) create mode 100644 app/src/main/java/com/blanyal/remindme/Reminder.java create mode 100644 app/src/main/java/com/blanyal/remindme/ReminderDatabase.java diff --git a/app/src/main/java/com/blanyal/remindme/Reminder.java b/app/src/main/java/com/blanyal/remindme/Reminder.java new file mode 100644 index 0000000..69d68ee --- /dev/null +++ b/app/src/main/java/com/blanyal/remindme/Reminder.java @@ -0,0 +1,108 @@ +/* + * 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; + + +public class Reminder { + + private int mID; + private String mTitle; + private String mDate; + private String mTime; + private Boolean mRepeat; + private String mRepeatNo; + private String mRepeatType; + + + public Reminder(int ID, String Title, String Date, String Time, Boolean Repeat, String RepeatNo, String RepeatType){ + mID = ID; + mTitle = Title; + mDate = Date; + mTime = Time; + mRepeat = Repeat; + mRepeatNo = RepeatNo; + mRepeatType = RepeatType; + } + + public Reminder(String Title, String Date, String Time, Boolean Repeat, String RepeatNo, String RepeatType){ + mTitle = Title; + mDate = Date; + mTime = Time; + mRepeat = Repeat; + mRepeatNo = RepeatNo; + mRepeatType = RepeatType; + } + + 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 Boolean isRepeat() { + return mRepeat; + } + + public void setRepeat(Boolean repeat) { + mRepeat = repeat; + } + + public String getRepeatType() { + return mRepeatType; + } + + public void setRepeatType(String repeatType) { + mRepeatType = repeatType; + } + + public String getRepeatNo() { + return mRepeatNo; + } + + public void setRepeatNo(String repeatNo) { + mRepeatNo = repeatNo; + } +} diff --git a/app/src/main/java/com/blanyal/remindme/ReminderDatabase.java b/app/src/main/java/com/blanyal/remindme/ReminderDatabase.java new file mode 100644 index 0000000..384d4bd --- /dev/null +++ b/app/src/main/java/com/blanyal/remindme/ReminderDatabase.java @@ -0,0 +1,196 @@ +/* + * 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 = "Reminders"; + + // Table name + private static final String TABLE_REMINDERS = "reminders"; + + // 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"; + + 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" + ")"; + 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 void 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.isRepeat()); + values.put(KEY_REPEAT_NO , reminder.getRepeatNo()); + values.put(KEY_REPEAT_TYPE, reminder.getRepeatType()); + + // Inserting Row + db.insert(TABLE_REMINDERS, null, values); + db.close(); // Closing database connection + + } + + + // 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_ID + "=?", + + new String[] {String.valueOf(id)}, null, null, null, null); + if (cursor != null) + cursor.moveToFirst(); + + Reminder reminder = new Reminder(cursor.getString(0), + cursor.getString(1),cursor.getString(2), Boolean.parseBoolean(cursor.getString(3)), + cursor.getString(4), cursor.getString(5)); + + return reminder; + } + + // Getting all Reminders + public List getAllReminders(){ + List 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(Boolean.parseBoolean(cursor.getString(4))); + reminder.setRepeatNo(cursor.getString(5)); + reminder.setRepeatType(cursor.getString(6)); + + // 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.isRepeat()); + values.put(KEY_REPEAT_NO , reminder.getRepeatNo()); + values.put(KEY_REPEAT_TYPE, reminder.getRepeatType()); + + // 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(); + } + + + +} diff --git a/app/src/main/res/layout/activity_add_reminder.xml b/app/src/main/res/layout/activity_add_reminder.xml index c8b4bff..ee9ac23 100644 --- a/app/src/main/res/layout/activity_add_reminder.xml +++ b/app/src/main/res/layout/activity_add_reminder.xml @@ -79,6 +79,7 @@ @@ -130,6 +131,7 @@ @@ -180,6 +182,7 @@ @@ -217,6 +220,7 @@ android:layout_width="wrap_content" android:id="@+id/set_repeat" android:textSize="15dp" + android:text="@string/repeat_off" android:textColor="@color/abc_secondary_text_material_light" android:layout_height="wrap_content"/> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 44a1b8b..dced08a 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -11,5 +11,6 @@ Date Time Repeat + Off From dda8b0a97eb8c41197c8dd3d8ccc334766ae1c26 Mon Sep 17 00:00:00 2001 From: blanyal Date: Tue, 14 Apr 2015 11:19:40 +0530 Subject: [PATCH 2/3] Various Changes --- app/app.iml | 1 + app/build.gradle | 2 + .../com/blanyal/remindme/AddReminder.java | 115 ++++++++++++++++-- .../java/com/blanyal/remindme/Reminder.java | 15 ++- .../blanyal/remindme/ReminderDatabase.java | 12 +- .../main/res/layout/activity_add_reminder.xml | 14 +++ app/src/main/res/menu/menu_add_reminder.xml | 19 +++ app/src/main/res/values/strings.xml | 3 + 8 files changed, 163 insertions(+), 18 deletions(-) create mode 100644 app/src/main/res/menu/menu_add_reminder.xml diff --git a/app/app.iml b/app/app.iml index a262149..e3c8e19 100644 --- a/app/app.iml +++ b/app/app.iml @@ -87,6 +87,7 @@ + diff --git a/app/build.gradle b/app/build.gradle index d97354a..cd7a62d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -24,4 +24,6 @@ dependencies { compile 'com.android.support:appcompat-v7:22.0.0' compile 'com.android.support:recyclerview-v7:22.0.0' compile 'com.getbase:floatingactionbutton:1.9.0' + compile 'com.wdullaer:materialdatetimepicker:1.2.1' + } diff --git a/app/src/main/java/com/blanyal/remindme/AddReminder.java b/app/src/main/java/com/blanyal/remindme/AddReminder.java index b5243aa..2d2f9f4 100644 --- a/app/src/main/java/com/blanyal/remindme/AddReminder.java +++ b/app/src/main/java/com/blanyal/remindme/AddReminder.java @@ -23,13 +23,32 @@ import android.os.Bundle; import android.support.v7.app.ActionBarActivity; import android.support.v7.widget.Toolbar; +import android.text.Editable; +import android.text.TextWatcher; import android.view.Menu; import android.view.MenuItem; +import android.widget.EditText; +import android.widget.TextView; +import android.widget.Toast; + +import com.getbase.floatingactionbutton.FloatingActionButton; + +import java.util.Calendar; public class AddReminder extends ActionBarActivity { private Toolbar mToolbar; + private EditText mReminderText; + private TextView mDateText, mTimeText, mRepeatText; + private FloatingActionButton mFAB1; + private FloatingActionButton mFAB2; + private Calendar mCalendar; + private int mYear, mMonth, mHour, mMinute, mDay; + private String mTitle; + private String mTime; + private String mDate; + @Override protected void onCreate(Bundle savedInstanceState) { @@ -38,29 +57,99 @@ protected void onCreate(Bundle savedInstanceState) { mToolbar = (Toolbar) findViewById(R.id.toolbar); - mToolbar.setTitle(R.string.title_activity_add_reminder); + mFAB1 = (FloatingActionButton) findViewById(R.id.starred1); + mFAB2 = (FloatingActionButton) findViewById(R.id.starred2); + mReminderText = (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); + + + setSupportActionBar(mToolbar); + getSupportActionBar().setTitle(R.string.title_activity_add_reminder); + getSupportActionBar().setDisplayHomeAsUpEnabled(true); + getSupportActionBar().setHomeButtonEnabled(true); + + + 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); + mDay = mCalendar.get(Calendar.DATE); + + + mDate = mDay + "/" + mMonth + "/" + mYear; + mTime = mHour + ":" + mMinute; + + + mReminderText.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(); + mReminderText.setError(null); + } + + @Override + public void afterTextChanged(Editable s) { + + } + }); + mDateText.setText(mDate); + mTimeText.setText(mTime); + + + } + + + @Override + public void onBackPressed() { + super.onBackPressed(); } @Override public boolean onCreateOptionsMenu(Menu menu) { - // Inflate the menu; this adds items to the action bar if it is present. - getMenuInflater().inflate(R.menu.menu_main, menu); + getMenuInflater().inflate(R.menu.menu_add_reminder, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { - // Handle action bar item clicks here. The action bar will - // automatically handle clicks on the Home/Up button, so long - // as you specify a parent activity in AndroidManifest.xml. - int id = item.getItemId(); - - //noinspection SimplifiableIfStatement - if (id == R.id.action_settings) { - return true; - } + switch (item.getItemId()) { + + case android.R.id.home: + onBackPressed(); + return true; - return super.onOptionsItemSelected(item); + case R.id.save_reminder: + mReminderText.setText(mTitle); + + if (mReminderText.getText().toString().length() == 0) + mReminderText.setError("Reminder Title cannot be blank!"); + + else { + Toast.makeText(getApplicationContext(), "Saved", + Toast.LENGTH_SHORT).show(); + onBackPressed(); + } + return true; + + 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 diff --git a/app/src/main/java/com/blanyal/remindme/Reminder.java b/app/src/main/java/com/blanyal/remindme/Reminder.java index 69d68ee..d88212d 100644 --- a/app/src/main/java/com/blanyal/remindme/Reminder.java +++ b/app/src/main/java/com/blanyal/remindme/Reminder.java @@ -27,9 +27,10 @@ public class Reminder { private Boolean mRepeat; private String mRepeatNo; private String mRepeatType; + private Boolean mActive; - public Reminder(int ID, String Title, String Date, String Time, Boolean Repeat, String RepeatNo, String RepeatType){ + public Reminder(int ID, String Title, String Date, String Time, Boolean Repeat, String RepeatNo, String RepeatType, Boolean Active){ mID = ID; mTitle = Title; mDate = Date; @@ -37,15 +38,17 @@ public Reminder(int ID, String Title, String Date, String Time, Boolean Repeat, mRepeat = Repeat; mRepeatNo = RepeatNo; mRepeatType = RepeatType; + mActive = Active; } - public Reminder(String Title, String Date, String Time, Boolean Repeat, String RepeatNo, String RepeatType){ + public Reminder(String Title, String Date, String Time, Boolean Repeat, String RepeatNo, String RepeatType, Boolean Active){ mTitle = Title; mDate = Date; mTime = Time; mRepeat = Repeat; mRepeatNo = RepeatNo; mRepeatType = RepeatType; + mActive = Active; } public Reminder(){} @@ -105,4 +108,12 @@ public String getRepeatNo() { public void setRepeatNo(String repeatNo) { mRepeatNo = repeatNo; } + + public Boolean isActive() { + return mActive; + } + + public void setActive(Boolean active) { + mActive = active; + } } diff --git a/app/src/main/java/com/blanyal/remindme/ReminderDatabase.java b/app/src/main/java/com/blanyal/remindme/ReminderDatabase.java index 384d4bd..8017f8c 100644 --- a/app/src/main/java/com/blanyal/remindme/ReminderDatabase.java +++ b/app/src/main/java/com/blanyal/remindme/ReminderDatabase.java @@ -48,6 +48,7 @@ public class ReminderDatabase extends SQLiteOpenHelper { 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); @@ -64,7 +65,8 @@ public void onCreate(SQLiteDatabase db) { + KEY_TIME + " INTEGER," + KEY_REPEAT + " BOOLEAN," + KEY_REPEAT_NO + " INTEGER," - + KEY_REPEAT_TYPE + " TEXT" + ")"; + + KEY_REPEAT_TYPE + " TEXT," + + KEY_ACTIVE + "BOOLEAN" + ")"; db.execSQL(CREATE_REMINDERS_TABLE); } @@ -92,6 +94,7 @@ public void addReminder(Reminder reminder){ values.put(KEY_REPEAT , reminder.isRepeat()); values.put(KEY_REPEAT_NO , reminder.getRepeatNo()); values.put(KEY_REPEAT_TYPE, reminder.getRepeatType()); + values.put(KEY_ACTIVE, reminder.isActive()); // Inserting Row db.insert(TABLE_REMINDERS, null, values); @@ -112,7 +115,8 @@ public Reminder getReminder(int id){ KEY_TIME, KEY_REPEAT, KEY_REPEAT_NO, - KEY_REPEAT_TYPE + KEY_REPEAT_TYPE, + KEY_ACTIVE }, KEY_ID + "=?", new String[] {String.valueOf(id)}, null, null, null, null); @@ -121,7 +125,7 @@ public Reminder getReminder(int id){ Reminder reminder = new Reminder(cursor.getString(0), cursor.getString(1),cursor.getString(2), Boolean.parseBoolean(cursor.getString(3)), - cursor.getString(4), cursor.getString(5)); + cursor.getString(4), cursor.getString(5), Boolean.parseBoolean(cursor.getString(6))); return reminder; } @@ -147,6 +151,7 @@ public List getAllReminders(){ reminder.setRepeat(Boolean.parseBoolean(cursor.getString(4))); reminder.setRepeatNo(cursor.getString(5)); reminder.setRepeatType(cursor.getString(6)); + reminder.setActive(Boolean.parseBoolean(cursor.getString(7))); // Adding Reminders to list reminderList.add(reminder); @@ -176,6 +181,7 @@ public int updateReminder(Reminder reminder){ values.put(KEY_REPEAT , reminder.isRepeat()); values.put(KEY_REPEAT_NO , reminder.getRepeatNo()); values.put(KEY_REPEAT_TYPE, reminder.getRepeatType()); + values.put(KEY_ACTIVE, reminder.isActive()); // Updating row return db.update(TABLE_REMINDERS, values, KEY_ID + "=?", diff --git a/app/src/main/res/layout/activity_add_reminder.xml b/app/src/main/res/layout/activity_add_reminder.xml index ee9ac23..23ffa97 100644 --- a/app/src/main/res/layout/activity_add_reminder.xml +++ b/app/src/main/res/layout/activity_add_reminder.xml @@ -246,6 +246,20 @@ android:background="@drawable/toolbar_dropshadow" /> + + + + + + + + + + + + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index dced08a..7dfd2c4 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -12,5 +12,8 @@ Time Repeat Off + + Discard Reminder + Save Reminder From fab3b67428a7d9a81783e239fc4eab4e71be0908 Mon Sep 17 00:00:00 2001 From: blanyal Date: Tue, 14 Apr 2015 13:14:57 +0530 Subject: [PATCH 3/3] Various Changes --- .../com/blanyal/remindme/AddReminder.java | 44 ++++++++++++++++++- .../main/res/layout/activity_add_reminder.xml | 14 +++--- app/src/main/res/values-v21/styles.xml | 2 +- app/src/main/res/values/colors.xml | 9 ++-- app/src/main/res/values/styles.xml | 4 +- 5 files changed, 58 insertions(+), 15 deletions(-) diff --git a/app/src/main/java/com/blanyal/remindme/AddReminder.java b/app/src/main/java/com/blanyal/remindme/AddReminder.java index 2d2f9f4..800af06 100644 --- a/app/src/main/java/com/blanyal/remindme/AddReminder.java +++ b/app/src/main/java/com/blanyal/remindme/AddReminder.java @@ -27,16 +27,22 @@ import android.text.TextWatcher; import android.view.Menu; import android.view.MenuItem; +import android.view.View; import android.widget.EditText; import android.widget.TextView; import android.widget.Toast; import com.getbase.floatingactionbutton.FloatingActionButton; +import com.wdullaer.materialdatetimepicker.date.DatePickerDialog; +import com.wdullaer.materialdatetimepicker.time.RadialPickerLayout; +import com.wdullaer.materialdatetimepicker.time.TimePickerDialog; import java.util.Calendar; -public class AddReminder extends ActionBarActivity { +public class AddReminder extends ActionBarActivity implements + TimePickerDialog.OnTimeSetListener, + DatePickerDialog.OnDateSetListener{ private Toolbar mToolbar; private EditText mReminderText; @@ -104,9 +110,45 @@ public void afterTextChanged(Editable s) { mDateText.setText(mDate); mTimeText.setText(mTime); + } + + + public void setTime(View v){ + Calendar now = Calendar.getInstance(); + TimePickerDialog tpd = TimePickerDialog.newInstance( + this, + now.get(Calendar.HOUR_OF_DAY), + now.get(Calendar.MINUTE), + false + ); + tpd.setThemeDark(false); + tpd.show(getFragmentManager(), "Timepickerdialog"); + } + public void setDate(View v){ + Calendar now = Calendar.getInstance(); + DatePickerDialog dpd = DatePickerDialog.newInstance( + this, + now.get(Calendar.YEAR), + now.get(Calendar.MONTH), + now.get(Calendar.DAY_OF_MONTH) + ); + dpd.show(getFragmentManager(), "Datepickerdialog"); } + @Override + public void onTimeSet(RadialPickerLayout view, int hourOfDay, int minute) { + mTime = hourOfDay + ":" + minute; + mTimeText.setText(mTime); + } + + @Override + public void onDateSet(DatePickerDialog view, int year, int monthOfYear, int dayOfMonth) { + mDate = dayOfMonth + "/" + monthOfYear + "/" + year; + mDateText.setText(mDate); + } + + @Override public void onBackPressed() { diff --git a/app/src/main/res/layout/activity_add_reminder.xml b/app/src/main/res/layout/activity_add_reminder.xml index 23ffa97..ecc394d 100644 --- a/app/src/main/res/layout/activity_add_reminder.xml +++ b/app/src/main/res/layout/activity_add_reminder.xml @@ -72,7 +72,7 @@ android:textSize="15dp" android:gravity="center_vertical" android:layout_marginLeft="72dp" - android:textColor="@color/abc_secondary_text_material_light" + android:textColor="@color/abc_secondary_text_material_dark" android:layout_height="72dp"/> @@ -107,7 +107,7 @@ @@ -159,7 +159,7 @@ @@ -210,7 +210,7 @@ diff --git a/app/src/main/res/values-v21/styles.xml b/app/src/main/res/values-v21/styles.xml index 594e88e..5ac269b 100644 --- a/app/src/main/res/values-v21/styles.xml +++ b/app/src/main/res/values-v21/styles.xml @@ -8,7 +8,7 @@ true @color/primary_dark - @style/ThemeOverlay.AppCompat.Light + @style/ThemeOverlay.AppCompat @android:transition/move @android:transition/move diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 7f30902..9b5ae76 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -2,10 +2,11 @@ #ffffff - #f44336 - #d32f2f - #536dfe + #009688 + #00796b + #3f51b5 #888888 - #3d5afe + #3949ab + \ No newline at end of file diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 4fbd204..9c4e2bc 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -3,13 +3,13 @@