Commit 32ca20d4 authored by PANKAJ KUMAR's avatar PANKAJ KUMAR

Alarm on-off option is working at the time of adding new reminder. During...

Alarm on-off option is working at the time of adding new reminder. During editing reminder this option causes app to crash.
parent 167e7542
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<activity <activity
android:name="com.sudogeeks.talking_reminder.ReminderAddActivity" android:name="com.sudogeeks.talking_reminder.ReminderAddActivity"
android:label="@string/activity_add_reminder_label"> android:label="@string/add_reminder_label">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
</intent-filter> </intent-filter>
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
<activity <activity
android:name="com.sudogeeks.talking_reminder.ReminderEditActivity" android:name="com.sudogeeks.talking_reminder.ReminderEditActivity"
android:label="@string/activity_edit_reminder_label" /> android:label="@string/edit_reminder_label" />
<receiver android:name="com.sudogeeks.talking_reminder.AlarmReceiver"/> <receiver android:name="com.sudogeeks.talking_reminder.AlarmReceiver"/>
......
...@@ -145,9 +145,11 @@ public class MainActivity extends AppCompatActivity { ...@@ -145,9 +145,11 @@ public class MainActivity extends AppCompatActivity {
} }
}; };
/**onCreate() implementation /**
* onCreate() implementation
* Overridden method. In this method initial life cycle of the app is implemented. * Overridden method. In this method initial life cycle of the app is implemented.
* If user is not authenticated then user is sent for login/signup, else database instance and main view is initialized * If user is not authenticated then user is sent for login/signup, else database instance and main view is initialized
*
* @param savedInstanceState * @param savedInstanceState
*/ */
@Override @Override
...@@ -168,7 +170,7 @@ public class MainActivity extends AppCompatActivity { ...@@ -168,7 +170,7 @@ public class MainActivity extends AppCompatActivity {
if (user != null) { if (user != null) {
//User is signed in //User is signed in
reminderDatabaseReference = firebaseDatabase.getReference().child("reminders").child(user.getUid()); reminderDatabaseReference = firebaseDatabase.getReference().child("reminders").child(user.getUid());
Toast.makeText(MainActivity.this, "You're now signed in.\nWelcome to Talking ReminderDO!", Toast.LENGTH_SHORT).show(); //Toast.makeText(MainActivity.this, "You're now signed in.\nWelcome to Talking ReminderDO!", Toast.LENGTH_SHORT).show();
attachDatabaseReadListener(); attachDatabaseReadListener();
} else { } else {
//User is signed out //User is signed out
...@@ -271,7 +273,8 @@ public class MainActivity extends AppCompatActivity { ...@@ -271,7 +273,8 @@ public class MainActivity extends AppCompatActivity {
} }
} }
/**Define what happens when user closes the app /**
* Define what happens when user closes the app
* Overridden method * Overridden method
*/ */
@Override @Override
...@@ -284,7 +287,8 @@ public class MainActivity extends AppCompatActivity { ...@@ -284,7 +287,8 @@ public class MainActivity extends AppCompatActivity {
//reminderAdapter.clear(); //reminderAdapter.clear();
} }
/** Create context menu for long press actions /**
* Create context menu for long press actions
* *
* @param menu * @param menu
* @param view * @param view
...@@ -308,7 +312,8 @@ public class MainActivity extends AppCompatActivity { ...@@ -308,7 +312,8 @@ public class MainActivity extends AppCompatActivity {
startActivityForResult(i, 1); startActivityForResult(i, 1);
} }
/** Standard method for handling the outcome of an activity. /**
* Standard method for handling the outcome of an activity.
* If user signs in is successful then only take the user to main page. Else force the user to login in first * If user signs in is successful then only take the user to main page. Else force the user to login in first
* *
* @param requestCode * @param requestCode
...@@ -332,9 +337,9 @@ public class MainActivity extends AppCompatActivity { ...@@ -332,9 +337,9 @@ public class MainActivity extends AppCompatActivity {
} }
} }
/** Define the behaviour of the app in case user comes back after suspending the app. /**
* Define the behaviour of the app in case user comes back after suspending the app.
* -Recreate recycler view : This is done so that newly created reminders are also displayed * -Recreate recycler view : This is done so that newly created reminders are also displayed
*/ */
@Override @Override
public void onResume() { public void onResume() {
...@@ -352,7 +357,8 @@ public class MainActivity extends AppCompatActivity { ...@@ -352,7 +357,8 @@ public class MainActivity extends AppCompatActivity {
mAdapter.setItemCount(getDefaultItemCount()); mAdapter.setItemCount(getDefaultItemCount());
} }
/** Layout manager for recycler view /**
* Layout manager for recycler view
* *
* @return LinearLayoutManager instance * @return LinearLayoutManager instance
*/ */
...@@ -360,7 +366,8 @@ public class MainActivity extends AppCompatActivity { ...@@ -360,7 +366,8 @@ public class MainActivity extends AppCompatActivity {
return new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false); return new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false);
} }
/** Helper method /**
* Helper method
* *
* @return integer 100 * @return integer 100
*/ */
...@@ -371,7 +378,7 @@ public class MainActivity extends AppCompatActivity { ...@@ -371,7 +378,7 @@ public class MainActivity extends AppCompatActivity {
/** /**
* Creating main menu * Creating main menu
* *
* @param Menu object * @param menu object
* @return boolean * @return boolean
*/ */
@Override @Override
...@@ -380,7 +387,8 @@ public class MainActivity extends AppCompatActivity { ...@@ -380,7 +387,8 @@ public class MainActivity extends AppCompatActivity {
return true; return true;
} }
/**Defines behaviours for the menu items. /**
* Defines behaviours for the menu items.
* *
* @param item * @param item
* @return Boolean * @return Boolean
...@@ -398,8 +406,9 @@ public class MainActivity extends AppCompatActivity { ...@@ -398,8 +406,9 @@ public class MainActivity extends AppCompatActivity {
} }
/**\brief Adapter class (Inner Class) for implementing recycler view /**
* * \brief Adapter class (Inner Class) for implementing recycler view
* <p>
* This class will handle how to display the reminder data on the main page. * This class will handle how to display the reminder data on the main page.
*/ */
public class SimpleAdapter extends RecyclerView.Adapter<SimpleAdapter.VerticalItemHolder> { public class SimpleAdapter extends RecyclerView.Adapter<SimpleAdapter.VerticalItemHolder> {
...@@ -420,7 +429,8 @@ public class MainActivity extends AppCompatActivity { ...@@ -420,7 +429,8 @@ public class MainActivity extends AppCompatActivity {
notifyItemRemoved(selected); notifyItemRemoved(selected);
} }
/** View holder for recycler view items /**
* View holder for recycler view items
* Overridden method * Overridden method
* *
* @param container * @param container
...@@ -435,7 +445,8 @@ public class MainActivity extends AppCompatActivity { ...@@ -435,7 +445,8 @@ public class MainActivity extends AppCompatActivity {
return new VerticalItemHolder(root, this); return new VerticalItemHolder(root, this);
} }
/**Bind a reminder item to a position in the main view /**
* Bind a reminder item to a position in the main view
* Overridden method * Overridden method
* *
* @param itemHolder * @param itemHolder
...@@ -450,7 +461,8 @@ public class MainActivity extends AppCompatActivity { ...@@ -450,7 +461,8 @@ public class MainActivity extends AppCompatActivity {
itemHolder.setActiveImage(item.mActive); itemHolder.setActiveImage(item.mActive);
} }
/**Retuns the number of reminders in the database /**
* Retuns the number of reminders in the database
* *
* @return * @return
*/ */
...@@ -466,8 +478,9 @@ public class MainActivity extends AppCompatActivity { ...@@ -466,8 +478,9 @@ public class MainActivity extends AppCompatActivity {
notifyDataSetChanged(); notifyDataSetChanged();
} }
/** Prepare data for each reminder item to facilitate proper displaying in the view. /**
* this Helper method required because all the data in database are not directly representable. * Prepare data for each reminder item to facilitate proper displaying in the view.
* this Helper method required because all the data in database are not directly representable.
* *
* @param count * @param count
* @return * @return
...@@ -524,8 +537,9 @@ public class MainActivity extends AppCompatActivity { ...@@ -524,8 +537,9 @@ public class MainActivity extends AppCompatActivity {
return items; return items;
} }
/** Data-Object class for recycler view items /**
* This class is slightly different form ReminderDO class. Very specific to the requirement of the recyler view * Data-Object class for recycler view items
* This class is slightly different form ReminderDO class. Very specific to the requirement of the recyler view
*/ */
public class ReminderItem { public class ReminderItem {
public String mTitle; public String mTitle;
...@@ -535,12 +549,13 @@ public class MainActivity extends AppCompatActivity { ...@@ -535,12 +549,13 @@ public class MainActivity extends AppCompatActivity {
public String mRepeatType; public String mRepeatType;
public String mActive; public String mActive;
/**Constructor /**
* Constructor
* *
* @param Title * @param Title
* @param DateTime * @param DateTime
* @param Repeat * @param Repeat
* @param RepeatNo number of repeatition * @param RepeatNo number of repeatition
* @param RepeatType * @param RepeatType
* @param Active * @param Active
*/ */
...@@ -554,8 +569,8 @@ public class MainActivity extends AppCompatActivity { ...@@ -554,8 +569,8 @@ public class MainActivity extends AppCompatActivity {
} }
} }
/** Inner class to compare date and time so that items can be sorted in ascending/decending order of date and time /**
* * Inner class to compare date and time so that items can be sorted in ascending/decending order of date and time
*/ */
public class DateTimeComparator implements Comparator { public class DateTimeComparator implements Comparator {
DateFormat f = new SimpleDateFormat("dd/mm/yyyy hh:mm"); DateFormat f = new SimpleDateFormat("dd/mm/yyyy hh:mm");
...@@ -572,8 +587,8 @@ public class MainActivity extends AppCompatActivity { ...@@ -572,8 +587,8 @@ public class MainActivity extends AppCompatActivity {
} }
} }
/** UI and data class (Adapter) for recycler view items /**
* * UI and data class (Adapter) for recycler view items
*/ */
public class VerticalItemHolder extends SwappingHolder public class VerticalItemHolder extends SwappingHolder
implements View.OnClickListener, View.OnLongClickListener { implements View.OnClickListener, View.OnLongClickListener {
...@@ -607,7 +622,8 @@ public class MainActivity extends AppCompatActivity { ...@@ -607,7 +622,8 @@ public class MainActivity extends AppCompatActivity {
mThumbnailImage = itemView.findViewById(R.id.thumbnail_image); mThumbnailImage = itemView.findViewById(R.id.thumbnail_image);
} }
/** On clicking a reminder item /**
* On clicking a reminder item
* *
* @param view * @param view
*/ */
...@@ -624,7 +640,8 @@ public class MainActivity extends AppCompatActivity { ...@@ -624,7 +640,8 @@ public class MainActivity extends AppCompatActivity {
} }
} }
/** On long press enter action mode with context menu /**
* On long press enter action mode with context menu
* *
* @param view * @param view
* @return * @return
...@@ -637,7 +654,8 @@ public class MainActivity extends AppCompatActivity { ...@@ -637,7 +654,8 @@ public class MainActivity extends AppCompatActivity {
return true; return true;
} }
/** Set reminder title view /**
* Set reminder title view
* *
* @param reminderTitle * @param reminderTitle
*/ */
...@@ -657,7 +675,8 @@ public class MainActivity extends AppCompatActivity { ...@@ -657,7 +675,8 @@ public class MainActivity extends AppCompatActivity {
mThumbnailImage.setImageDrawable(mDrawableBuilder); mThumbnailImage.setImageDrawable(mDrawableBuilder);
} }
/** Set date and time views /**
* Set date and time views
* *
* @param datetime * @param datetime
*/ */
...@@ -665,7 +684,8 @@ public class MainActivity extends AppCompatActivity { ...@@ -665,7 +684,8 @@ public class MainActivity extends AppCompatActivity {
mDateAndTimeText.setText(datetime); mDateAndTimeText.setText(datetime);
} }
/** Set repeat views /**
* Set repeat views
* *
* @param repeat * @param repeat
* @param repeatNo * @param repeatNo
...@@ -679,13 +699,15 @@ public class MainActivity extends AppCompatActivity { ...@@ -679,13 +699,15 @@ public class MainActivity extends AppCompatActivity {
} }
} }
/** Set active image as on or off /**
* Set active image as on or off
* This method is apparently not consistent because on/off behaviour doesn't always work * This method is apparently not consistent because on/off behaviour doesn't always work
*
* @param active * @param active
*/ */
public void setActiveImage(String active) { public void setActiveImage(String active) {
if (active.equals("true")) { if (active.equals("true")) {
mActiveImage.setImageResource(R.drawable.ic_notifications_active); mActiveImage.setImageResource(R.drawable.ic_notifications_on);
} else if (active.equals("false")) { } else if (active.equals("false")) {
mActiveImage.setImageResource(R.drawable.ic_notifications_off); mActiveImage.setImageResource(R.drawable.ic_notifications_off);
} }
......
...@@ -92,18 +92,16 @@ public class ReminderAddActivity extends AppCompatActivity { ...@@ -92,18 +92,16 @@ public class ReminderAddActivity extends AppCompatActivity {
mRepeatText = findViewById(R.id.set_repeat); mRepeatText = findViewById(R.id.set_repeat);
mRepeatNoText = findViewById(R.id.set_repeat_no); mRepeatNoText = findViewById(R.id.set_repeat_no);
mRepeatTypeText = findViewById(R.id.set_repeat_type); mRepeatTypeText = findViewById(R.id.set_repeat_type);
mFAB1 = findViewById(R.id.starred1);
mFAB2 = findViewById(R.id.starred2);
// Setup Toolbar // Setup Toolbar
setSupportActionBar(mToolbar); setSupportActionBar(mToolbar);
getSupportActionBar().setTitle(R.string.activity_add_reminder_label); getSupportActionBar().setTitle(R.string.add_reminder_label);
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true); getSupportActionBar().setHomeButtonEnabled(true);
// Initialize default values // Initialize default values
mActive = "true"; mActive = "true";
mRepeat = "true"; mRepeat = "false";
mRepeatNo = Integer.toString(1); mRepeatNo = Integer.toString(1);
mRepeatType = "Hour"; mRepeatType = "Hour";
...@@ -170,16 +168,6 @@ public class ReminderAddActivity extends AppCompatActivity { ...@@ -170,16 +168,6 @@ public class ReminderAddActivity extends AppCompatActivity {
mActive = savedInstanceState.getString(KEY_ACTIVE); 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 // To save state on device rotation
...@@ -240,47 +228,6 @@ public class ReminderAddActivity extends AppCompatActivity { ...@@ -240,47 +228,6 @@ public class ReminderAddActivity extends AppCompatActivity {
datePickerDialog.show(); 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 = findViewById(R.id.starred1);
mFAB1.hide();
mFAB2 = findViewById(R.id.starred2);
mFAB2.show();
mActive = "true";
}
// On clicking the inactive button
public void selectFab2(View v) {
mFAB2 = findViewById(R.id.starred2);
mFAB2.hide();
mFAB1 = findViewById(R.id.starred1);
mFAB1.show();
mActive = "false";
}
// On clicking the repeat switch // On clicking the repeat switch
public void onSwitchRepeat(View view) { public void onSwitchRepeat(View view) {
...@@ -294,6 +241,10 @@ public class ReminderAddActivity extends AppCompatActivity { ...@@ -294,6 +241,10 @@ public class ReminderAddActivity extends AppCompatActivity {
} }
} }
public void onSwitchRing(View view) {
mActive = Boolean.toString(((Switch) view).isChecked());
}
// On clicking repeat type button // On clicking repeat type button
public void selectRepeatType(View v) { public void selectRepeatType(View v) {
final String[] items = new String[5]; final String[] items = new String[5];
......
...@@ -87,7 +87,7 @@ public class ReminderEditActivity extends AppCompatActivity { ...@@ -87,7 +87,7 @@ public class ReminderEditActivity extends AppCompatActivity {
// Setup Toolbar // Setup Toolbar
setSupportActionBar(mToolbar); setSupportActionBar(mToolbar);
getSupportActionBar().setTitle(R.string.activity_edit_reminder_label); getSupportActionBar().setTitle(R.string.edit_reminder_label);
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true); getSupportActionBar().setHomeButtonEnabled(true);
......
...@@ -53,7 +53,7 @@ public class ReminderReceiveActivity extends AppCompatActivity { ...@@ -53,7 +53,7 @@ public class ReminderReceiveActivity extends AppCompatActivity {
// Setup Toolbar // Setup Toolbar
mToolbar = findViewById(R.id.toolbar); mToolbar = findViewById(R.id.toolbar);
setSupportActionBar(mToolbar); setSupportActionBar(mToolbar);
getSupportActionBar().setTitle(R.string.activity_add_reminder_label); getSupportActionBar().setTitle(R.string.add_reminder_label);
//Get the file from intent //Get the file from intent
Intent intent = getIntent(); Intent intent = getIntent();
......
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M7.58,4.08L6.15,2.65C3.75,4.48 2.17,7.3 2.03,10.5h2c0.15,-2.65 1.51,-4.97 3.55,-6.42zM19.97,10.5h2c-0.15,-3.2 -1.73,-6.02 -4.12,-7.85l-1.42,1.43c2.02,1.45 3.39,3.77 3.54,6.42zM18,11c0,-3.07 -1.64,-5.64 -4.5,-6.32L13.5,4c0,-0.83 -0.67,-1.5 -1.5,-1.5s-1.5,0.67 -1.5,1.5v0.68C7.63,5.36 6,7.92 6,11v5l-2,2v1h16v-1l-2,-2v-5zM12,22c0.14,0 0.27,-0.01 0.4,-0.04 0.65,-0.14 1.18,-0.58 1.44,-1.18 0.1,-0.24 0.15,-0.5 0.15,-0.78h-4c0.01,1.1 0.9,2 2.01,2z"/>
</vector>
<vector android:height="24dp" android:tint="#00D5DA"
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="M12,22c1.1,0 2,-0.9 2,-2h-4c0,1.1 0.89,2 2,2zM18,16v-5c0,-3.07 -1.64,-5.64 -4.5,-6.32L13.5,4c0,-0.83 -0.67,-1.5 -1.5,-1.5s-1.5,0.67 -1.5,1.5v0.68C7.63,5.36 6,7.92 6,11v5l-2,2v1h16v-1l-2,-2z"/>
</vector>
<vector android:height="24dp" android:tint="#646464"
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="M9,9m-4,0a4,4 0,1 1,8 0a4,4 0,1 1,-8 0"/>
<path android:fillColor="#FF000000" android:pathData="M9,15c-2.67,0 -8,1.34 -8,4v2h16v-2c0,-2.66 -5.33,-4 -8,-4zM16.76,5.36l-1.68,1.69c0.84,1.18 0.84,2.71 0,3.89l1.68,1.69c2.02,-2.02 2.02,-5.07 0,-7.27zM20.07,2l-1.63,1.63c2.77,3.02 2.77,7.56 0,10.74L20.07,16c3.9,-3.89 3.91,-9.95 0,-14z"/>
</vector>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
...@@ -10,14 +11,12 @@ ...@@ -10,14 +11,12 @@
android:background="?attr/colorPrimary" android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize" android:minHeight="?attr/actionBarSize"
app:contentInsetLeft="0dp" app:contentInsetLeft="0dp"
app:contentInsetStart="16dp" app:contentInsetStart="16dp" />
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" />
<LinearLayout <LinearLayout
android:id="@+id/add_reminder_layout_top" android:id="@+id/add_reminder_layout_top"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="148dp" android:layout_height="86dp"
android:layout_below="@+id/toolbar" android:layout_below="@+id/toolbar"
android:background="@color/primary" android:background="@color/primary"
android:orientation="vertical" android:orientation="vertical"
...@@ -26,8 +25,8 @@ ...@@ -26,8 +25,8 @@
<EditText <EditText
android:id="@+id/reminder_title" android:id="@+id/reminder_title"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="140dp" android:layout_height="84dp"
android:layout_marginLeft="72dp" android:layout_marginLeft="36dp"
android:layout_marginRight="16dp" android:layout_marginRight="16dp"
android:gravity="top|left" android:gravity="top|left"
android:hint="@string/add_reminder" android:hint="@string/add_reminder"
...@@ -44,23 +43,63 @@ ...@@ -44,23 +43,63 @@
<ScrollView <ScrollView
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:layout_height="fill_parent"
android:layout_below="@id/add_reminder_layout_top"> android:layout_below="@id/add_reminder_layout_top"
android:background="#FFFFFF">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
<TextView <RelativeLayout
android:id="@+id/details" android:id="@+id/ring"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="72dp" android:layout_height="72dp"
android:layout_marginLeft="72dp" android:clickable="true">
android:layout_marginTop="8dp"
android:gravity="center_vertical" <ImageView
android:text="@string/details" android:id="@+id/ring_icon"
android:textColor="@color/abc_secondary_text_material_dark" android:layout_width="wrap_content"
android:textSize="15dp" /> android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="16dp"
android:layout_marginRight="32dp"
android:src="@drawable/ic_voice" />
<LinearLayout
android:id="@+id/ring_ll"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/ring_icon"
android:orientation="vertical">
<TextView
android:id="@+id/ring_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Ring"
android:textColor="@color/textbody"
android:textSize="15dp" />
</LinearLayout>
<Switch
android:id="@+id/ring_switch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginLeft="8dp"
android:layout_marginRight="16dp"
android:background="@color/fui_transparent"
android:checked="true"
android:onClick="onSwitchRing"
android:textOff="Off"
android:textOn="On" />
</RelativeLayout>
<RelativeLayout <RelativeLayout
android:id="@+id/date" android:id="@+id/date"
...@@ -68,7 +107,9 @@ ...@@ -68,7 +107,9 @@
android:layout_height="72dp" android:layout_height="72dp"
android:background="?android:attr/selectableItemBackground" android:background="?android:attr/selectableItemBackground"
android:clickable="true" android:clickable="true"
android:onClick="setDate"> android:onClick="setDate"
android:visibility="visible"
tools:visibility="visible">
<ImageView <ImageView
android:id="@+id/date_icon" android:id="@+id/date_icon"
...@@ -92,14 +133,14 @@ ...@@ -92,14 +133,14 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/date" android:text="@string/date"
android:textColor="@color/abc_primary_text_material_dark" android:textColor="@color/textbody"
android:textSize="15dp" /> android:textSize="15dp" />
<TextView <TextView
android:id="@+id/set_date" android:id="@+id/set_date"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="@color/abc_secondary_text_material_dark" android:textColor="@color/primary"
android:textSize="15dp" /> android:textSize="15dp" />
</LinearLayout> </LinearLayout>
...@@ -136,14 +177,14 @@ ...@@ -136,14 +177,14 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/time" android:text="@string/time"
android:textColor="@color/abc_primary_text_material_dark" android:textColor="@color/textbody"
android:textSize="15dp" /> android:textSize="15dp" />
<TextView <TextView
android:id="@+id/set_time" android:id="@+id/set_time"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="@color/abc_secondary_text_material_dark" android:textColor="@color/primary"
android:textSize="15dp" /> android:textSize="15dp" />
</LinearLayout> </LinearLayout>
...@@ -153,7 +194,8 @@ ...@@ -153,7 +194,8 @@
<RelativeLayout <RelativeLayout
android:id="@+id/repeat" android:id="@+id/repeat"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="72dp"> android:layout_height="72dp"
android:clickable="true">
<ImageView <ImageView
android:id="@+id/repeat_icon" android:id="@+id/repeat_icon"
...@@ -178,14 +220,14 @@ ...@@ -178,14 +220,14 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/repeat" android:text="@string/repeat"
android:textColor="@color/abc_primary_text_material_dark" android:textColor="@color/textbody"
android:textSize="15dp" /> android:textSize="15dp" />
<TextView <TextView
android:id="@+id/set_repeat" android:id="@+id/set_repeat"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="@color/abc_secondary_text_material_dark" android:textColor="@color/primary"
android:textSize="15dp" /> android:textSize="15dp" />
</LinearLayout> </LinearLayout>
...@@ -198,10 +240,14 @@ ...@@ -198,10 +240,14 @@
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginLeft="8dp" android:layout_marginLeft="8dp"
android:layout_marginRight="16dp" android:layout_marginRight="16dp"
android:background="@color/fui_transparent"
android:checked="false" android:checked="false"
android:onClick="onSwitchRepeat" android:onClick="onSwitchRepeat"
android:shadowColor="#C1EFFD"
android:textOff="Off" android:textOff="Off"
android:textOn="On" /> android:textOn="On"
android:visibility="visible"
tools:visibility="visible" />
</RelativeLayout> </RelativeLayout>
...@@ -235,14 +281,14 @@ ...@@ -235,14 +281,14 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/repeat_no" android:text="@string/repeat_no"
android:textColor="@color/abc_primary_text_material_dark" android:textColor="@color/textbody"
android:textSize="15dp" /> android:textSize="15dp" />
<TextView <TextView
android:id="@+id/set_repeat_no" android:id="@+id/set_repeat_no"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="@color/abc_secondary_text_material_dark" android:textColor="@color/primary"
android:textSize="15dp" /> android:textSize="15dp" />
</LinearLayout> </LinearLayout>
...@@ -279,14 +325,14 @@ ...@@ -279,14 +325,14 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/repeat_type" android:text="@string/repeat_type"
android:textColor="@color/abc_primary_text_material_dark" android:textColor="@color/textbody"
android:textSize="15dp" /> android:textSize="15dp" />
<TextView <TextView
android:id="@+id/set_repeat_type" android:id="@+id/set_repeat_type"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="@color/abc_secondary_text_material_dark" android:textColor="@color/primary"
android:textSize="15dp" /> android:textSize="15dp" />
</LinearLayout> </LinearLayout>
...@@ -297,34 +343,4 @@ ...@@ -297,34 +343,4 @@
</ScrollView> </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:layout_alignParentLeft="true"
android:layout_centerHorizontal="true"
android:layout_marginLeft="8dp"
android:layout_marginTop="168dp"
android:clickable="true"
android:icon="@drawable/ic_notifications_off"
android:onClick="selectFab1" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/starred2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerHorizontal="true"
android:layout_marginLeft="8dp"
android:layout_marginTop="168dp"
android:clickable="true"
android:icon="@drawable/ic_notifications_active"
android:onClick="selectFab2" />
</RelativeLayout> </RelativeLayout>
...@@ -19,10 +19,12 @@ ...@@ -19,10 +19,12 @@
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/reminder_list" android:id="@+id/reminder_list"
android:layout_below="@+id/toolbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" /> android:layout_height="match_parent"
android:layout_below="@+id/toolbar"
android:layout_marginTop="0dp"
android:background="#FFFFFF" />
<TextView <TextView
android:id="@+id/no_reminder_text" android:id="@+id/no_reminder_text"
android:layout_width="match_parent" android:layout_width="match_parent"
......
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:background="?android:attr/selectableItemBackground" android:layout_height="86dp"
android:layout_height="86dp"> android:background="@color/fui_transparent">
<ImageView android:layout_width="40dp" <ImageView
android:layout_height="40dp" android:id="@+id/thumbnail_image"
android:layout_marginLeft="16dp" android:layout_width="40dp"
android:layout_marginRight="16dp" android:layout_height="40dp"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:id="@+id/thumbnail_image"/> android:layout_marginLeft="16dp"
android:layout_marginRight="16dp" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -19,49 +18,50 @@ ...@@ -19,49 +18,50 @@
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginTop="4dp" android:layout_marginTop="4dp"
android:layout_marginBottom="4dp" android:layout_marginBottom="4dp"
android:layout_toRightOf="@id/thumbnail_image"
android:layout_toLeftOf="@+id/active_image" android:layout_toLeftOf="@+id/active_image"
android:layout_toRightOf="@id/thumbnail_image"
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
android:id="@+id/recycle_title" android:id="@+id/recycle_title"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end" android:ellipsize="end"
android:maxLines="2" android:maxLines="2"
android:layout_height="wrap_content" android:textColor="@color/textbody"
android:textColor="@color/abc_primary_text_material_dark" android:textSize="16dp"
tools:text="Title" tools:text="Title" />
android:textSize="16dp"/>
<TextView <TextView
android:id="@+id/recycle_date_time" android:id="@+id/recycle_date_time"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="marquee" android:ellipsize="marquee"
android:singleLine="true" android:singleLine="true"
android:layout_height="wrap_content" android:textColor="@color/primary"
android:textSize="13dp" android:textSize="13dp"
android:textColor="@color/abc_secondary_text_material_dark" tools:text="Date and Time" />
tools:text="Date and Time"/>
<TextView <TextView
android:id="@+id/recycle_repeat_info" android:id="@+id/recycle_repeat_info"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="marquee" android:ellipsize="marquee"
android:singleLine="true" android:singleLine="true"
android:layout_height="wrap_content" android:textColor="@color/primary"
android:textSize="13dp" android:textSize="13dp"
android:textColor="@color/abc_secondary_text_material_dark" tools:text="Repeat No and Type" />
tools:text="Repeat No and Type"/>
</LinearLayout> </LinearLayout>
<ImageView android:layout_width="wrap_content" <ImageView
android:layout_alignParentRight="true" android:id="@+id/active_image"
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:layout_marginLeft="16dp" android:layout_height="wrap_content"
android:layout_marginRight="16dp" android:layout_alignParentRight="true"
android:src="@drawable/ic_notifications_off" android:layout_centerVertical="true"
android:layout_centerVertical="true" android:layout_marginLeft="16dp"
android:id="@+id/active_image"/> android:layout_marginRight="16dp"
android:src="@drawable/ic_notifications_off" />
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
...@@ -6,16 +6,16 @@ ...@@ -6,16 +6,16 @@
<item android:id="@+id/discard_reminder" <item android:id="@+id/discard_reminder"
android:icon="@drawable/ic_delete_white" android:icon="@drawable/ic_delete_white"
android:title="@string/action_discard_reminder" android:title="@string/discard_reminder"
app:showAsAction="ifRoom" /> app:showAsAction="ifRoom" />
<item android:id="@+id/send_reminder" <item android:id="@+id/send_reminder"
android:icon="@drawable/ic_send" android:icon="@drawable/ic_send"
android:title="@string/action_discard_reminder" android:title="@string/send_reminder"
app:showAsAction="ifRoom" /> app:showAsAction="always" />
<item android:id="@+id/save_reminder" <item android:id="@+id/save_reminder"
android:icon="@drawable/ic_save_white" android:icon="@drawable/ic_save_white"
android:title="@string/action_save_reminder" android:title="@string/save_reminder"
app:showAsAction="ifRoom" /> app:showAsAction="always" />
</menu> </menu>
...@@ -3,6 +3,6 @@ ...@@ -3,6 +3,6 @@
<item android:id="@+id/save_reminder" <item android:id="@+id/save_reminder"
android:icon="@drawable/ic_save_white" android:icon="@drawable/ic_save_white"
android:title="@string/action_save_reminder" android:title="@string/save_reminder"
app:showAsAction="ifRoom" /> app:showAsAction="ifRoom" />
</menu> </menu>
\ No newline at end of file
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
<resources> <resources>
<string name="app_name">Talking Reminder</string> <string name="app_name">Talking Reminder</string>
<string name="activity_add_reminder_label">Add Reminder</string> <string name="add_reminder_label">Add Reminder</string>
<string name="activity_edit_reminder_label">Edit Reminder</string> <string name="edit_reminder_label">Edit Reminder</string>
<string name="add_reminder">Reminder</string> <string name="add_reminder">Reminder</string>
<string name="details">Details</string> <string name="details">Details</string>
<string name="date">Date</string> <string name="date">Date</string>
...@@ -13,10 +13,11 @@ ...@@ -13,10 +13,11 @@
<string name="repeat_no">Repetition Interval </string> <string name="repeat_no">Repetition Interval </string>
<string name="repeat_type">Type of Repetitions</string> <string name="repeat_type">Type of Repetitions</string>
<string name="action_discard_reminder">Discard Reminder</string> <string name="discard_reminder">Discard Reminder</string>
<string name="action_save_reminder">Save Reminder</string> <string name="save_reminder">Save Reminder</string>
<string name="no_reminders">Click on the plus button below to begin creating your reminderDOS!</string> <string name="no_reminders">Click on the plus button below to begin creating your reminderDOS!</string>
<string name="sign_out">sign_out</string> <string name="sign_out">Sign out</string>
<string name="send_reminder">Send Reminder</string>
</resources> </resources>
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