Skip to content

Commit

Permalink
Merge pull request #12 from morris-james/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
morris-j committed Aug 31, 2015
2 parents 480d4ca + 9fafd1b commit 94176ff
Show file tree
Hide file tree
Showing 47 changed files with 2,065 additions and 1,427 deletions.
1,447 changes: 725 additions & 722 deletions .idea/workspace.xml

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ repositories {
}

android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
compileSdkVersion 23
buildToolsVersion "23"

productFlavors {
googlePlay {
Expand All @@ -42,10 +42,10 @@ android {

defaultConfig {
applicationId "jamesmorrisstudios.com.randremind"
minSdkVersion 10
targetSdkVersion 22
versionCode 29
versionName "1.1.9"
minSdkVersion 14
targetSdkVersion 23
versionCode 38
versionName "1.2.0"
}

signingConfigs {
Expand Down Expand Up @@ -79,6 +79,6 @@ dependencies {
//compile 'com.jamesmorrisstudios:utilitieslibrary:1.1' //local gradle
//compile 'com.jamesmorrisstudios:appbaselibrary:1.1' //local gradle

compile 'com.github.morris-james:UtilitiesLibrary:v1.1.1' //Jitpack
compile 'com.github.morris-james:appbaselibrary:v1.1.1' //Jitpack
compile 'com.github.morris-james:UtilitiesLibrary:v1.1.2' //Jitpack
compile 'com.github.morris-james:appbaselibrary:v1.1.3' //Jitpack
}
7 changes: 6 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="jamesmorrisstudios.com.randremind">

Expand All @@ -22,6 +23,8 @@
<!-- For the broadcast receiver to schedule app wakes -->
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<!-- Needed to pick custom ringtones on some devices (mainly Sony) -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

<application
android:name=".app.App"
Expand Down Expand Up @@ -57,9 +60,11 @@
android:exported="false">
<intent-filter>
<action android:name="jamesmorrisstudios.com.randremind.NOTIFICATION_CLICKED" />
<action android:name="jamesmorrisstudios.com.randremind.NOTIFICATION_CLICKED_SILENT" />
<action android:name="jamesmorrisstudios.com.randremind.NOTIFICATION_DELETED" />
<action android:name="jamesmorrisstudios.com.randremind.NOTIFICATION_DISMISS" />
<action android:name="jamesmorrisstudios.com.randremind.NOTIFICATION_ACKNOWLEDGE" />
<action android:name="jamesmorrisstudios.com.randremind.NOTIFICATION_SNOOZE" />
</intent-filter>
</receiver>

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public EditReminderGeneral(View parent) {
}

public final void bindItem(EditReminderItem item) {
final ReminderItem reminderItem = ReminderList.getInstance().getCurrentReminder();
ReminderItem reminderItem = ReminderList.getInstance().getCurrentReminder();
if(reminderItem == null) {
return;
}
Expand All @@ -39,6 +39,10 @@ public void onTextChanged(CharSequence s, int start, int before, int count) {

@Override
public void afterTextChanged(@NonNull Editable s) {
ReminderItem reminderItem = ReminderList.getInstance().getCurrentReminder();
if(reminderItem == null) {
return;
}
if(!reminderItem.getTitle().equals(s.toString())) {
reminderItem.setTitle(s.toString());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
package jamesmorrisstudios.com.randremind.editReminder;

import android.content.DialogInterface;
import android.support.v7.widget.AppCompatSpinner;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.CompoundButton;
import android.widget.RadioButton;
import android.widget.TextView;

import com.jamesmorrisstudios.appbaselibrary.dialogHelper.EditTextListRequest;
import com.jamesmorrisstudios.appbaselibrary.dialogHelper.SingleChoiceRequest;
import com.jamesmorrisstudios.appbaselibrary.dialogs.EditTextListDialog;
import com.jamesmorrisstudios.utilitieslibrary.Bus;
import com.jamesmorrisstudios.utilitieslibrary.app.AppUtil;

import java.util.ArrayList;
import java.util.List;
Expand All @@ -23,63 +27,70 @@
* Created by James on 6/10/2015.
*/
public class EditReminderMessage {
private AppCompatSpinner numMessages;
private RadioButton inOrder, random;
private Button editMessages;
private View orderContainer, messageContainer;
private TextView order;

public EditReminderMessage(View parent) {
numMessages = (AppCompatSpinner) parent.findViewById(R.id.message_count);
inOrder = (RadioButton) parent.findViewById(R.id.radio_in_order);
random = (RadioButton) parent.findViewById(R.id.radio_random);
editMessages = (Button) parent.findViewById(R.id.btn_edit_messages);

List<String> perDayList = new ArrayList<>();
for (int i = 0; i < 100; i++) {
perDayList.add(Integer.toString(i + 1));
}
ArrayAdapter<String> spinnerArrayAdapter = new ArrayAdapter<>(parent.getContext(), R.layout.support_simple_spinner_dropdown_item, perDayList);
spinnerArrayAdapter.setDropDownViewResource(R.layout.simple_drop_down_item);
numMessages.setAdapter(spinnerArrayAdapter);
numMessages.setSelection(0);
orderContainer = parent.findViewById(R.id.orderContainer);
messageContainer = parent.findViewById(R.id.messageContainer);
order = (TextView) parent.findViewById(R.id.order);
}

public final void bindItem(EditReminderItem item) {
final ReminderItem reminderItem = ReminderList.getInstance().getCurrentReminder();
ReminderItem reminderItem = ReminderList.getInstance().getCurrentReminder();
if(reminderItem == null) {
return;
}
if(reminderItem.isMessageInOrder()) {
inOrder.setChecked(true);
random.setChecked(false);
order.setText(AppUtil.getContext().getString(R.string.in_order));
} else {
inOrder.setChecked(false);
random.setChecked(true);
order.setText(AppUtil.getContext().getString(R.string.random));
}
inOrder.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if(isChecked) {
reminderItem.setMessageInOrder(true);
reminderItem.setCurMessage(-1);
}
}
});
random.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
orderContainer.setOnClickListener(new View.OnClickListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if(isChecked) {
reminderItem.setMessageInOrder(false);
reminderItem.setCurMessage(-1);
}
public void onClick(View v) {
String title = AppUtil.getContext().getString(R.string.ordering);
String[] items = new String[]{AppUtil.getContext().getString(R.string.in_order), AppUtil.getContext().getString(R.string.random)};

Bus.postObject(new SingleChoiceRequest(title, items, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
ReminderItem reminderItem = ReminderList.getInstance().getCurrentReminder();
if (reminderItem == null) {
return;
}
if (which == 0) {
reminderItem.setMessageInOrder(true);
order.setText(AppUtil.getContext().getString(R.string.in_order));
} else {
reminderItem.setMessageInOrder(false);
order.setText(AppUtil.getContext().getString(R.string.random));
}
}
}, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
//Do nothing on negative
}
}));
}
});
editMessages.setOnClickListener(new View.OnClickListener() {
messageContainer.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ReminderItem reminderItem = ReminderList.getInstance().getCurrentReminder();
if(reminderItem == null) {
return;
}
Bus.postObject(new EditTextListRequest(reminderItem.getMessageList(), new EditTextListDialog.EditMessageListener() {
@Override
public void onPositive(ArrayList<String> messages) {
ReminderItem reminderItem = ReminderList.getInstance().getCurrentReminder();
if(reminderItem == null) {
return;
}
reminderItem.setMessageList(messages);
reminderItem.setCurMessage(-1);
}
}, new View.OnClickListener() {
@Override
Expand All @@ -89,28 +100,6 @@ public void onClick(View v) {
}));
}
});
numMessages.setSelection(reminderItem.getMessageList().size()-1);
numMessages.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
int size = position + 1;
//If we are making the list bigger
while (size > reminderItem.getMessageList().size()) {
reminderItem.updateMessageList().add("");
reminderItem.setCurMessage(-1);
}
//If we are making the list smaller
while (size < reminderItem.getMessageList().size()) {
reminderItem.updateMessageList().remove(reminderItem.getMessageList().size() - 1);
reminderItem.setCurMessage(-1);
}
}

@Override
public void onNothingSelected(AdapterView<?> parent) {

}
});
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ private void notificationListeners() {
notificationSoundContainer.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(@NonNull View v) {
final ReminderItem remind = ReminderList.getInstance().getCurrentReminder();
ReminderItem remind = ReminderList.getInstance().getCurrentReminder();
if (remind == null) {
return;
}
Expand All @@ -91,14 +91,15 @@ public void onClick(@NonNull View v) {
Bus.postObject(new RingtoneRequest(defaultUri, AppUtil.getContext().getResources().getString(R.string.select_notification), new RingtoneRequest.RingtoneRequestListener() {
@Override
public void ringtoneResponse(Uri uri, String name) {
if (uri != null) {
remind.setNotificationTone(uri.toString());
} else {
remind.setNotificationTone(null);
ReminderItem remind = ReminderList.getInstance().getCurrentReminder();
if (remind == null) {
return;
}
if (name != null) {
if (uri != null && name != null) {
remind.setNotificationTone(uri.toString());
remind.setNotificationToneName(name);
} else {
remind.setNotificationTone(null);
remind.setNotificationToneName(AppUtil.getContext().getString(R.string.none));
}
sound.setText(remind.getNotificationToneName());
Expand Down
Loading

0 comments on commit 94176ff

Please sign in to comment.