This repository has been archived by the owner on Jan 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from alexstyl/develop
Release 4.0 (58)
- Loading branch information
Showing
206 changed files
with
2,412 additions
and
5,157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,23 @@ | ||
<?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.alexstyl.specialdates" | ||
android:installLocation="auto"> | ||
|
||
package="com.alexstyl.specialdates"> | ||
|
||
<application | ||
android:name="com.alexstyl.specialdates.DebugApplication" | ||
android:allowBackup="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/localised_app_name" | ||
android:theme="@style/Theme.Memento.BloodyCherry" | ||
tools:replace="android:name"> | ||
|
||
<activity | ||
android:name="com.alexstyl.specialdates.debug.DebugActivity" | ||
android:icon="@drawable/ic_heart" | ||
android:label="Memento Debug" | ||
android:taskAffinity="com.alexstyl.debug" | ||
android:theme="@style/Theme.AppCompat.Light.NoActionBar"> | ||
android:taskAffinity="com.alexstyl.debug"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
|
||
<activity android:name=".debug.MixingColorsActivity" /> | ||
</application> | ||
|
||
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
116 changes: 116 additions & 0 deletions
116
mobile/src/debug/java/com/alexstyl/specialdates/debug/DebugFragment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
package com.alexstyl.specialdates.debug; | ||
|
||
import android.app.DatePickerDialog; | ||
import android.content.ActivityNotFoundException; | ||
import android.content.ContentUris; | ||
import android.content.Context; | ||
import android.content.Intent; | ||
import android.net.Uri; | ||
import android.os.Bundle; | ||
import android.preference.Preference; | ||
import android.provider.CalendarContract; | ||
import android.widget.DatePicker; | ||
import android.widget.Toast; | ||
|
||
import com.alexstyl.specialdates.R; | ||
import com.alexstyl.specialdates.contact.actions.IntentAction; | ||
import com.alexstyl.specialdates.dailyreminder.DailyReminderDebugPreferences; | ||
import com.alexstyl.specialdates.date.DayDate; | ||
import com.alexstyl.specialdates.service.DailyReminderIntentService; | ||
import com.alexstyl.specialdates.ui.base.MementoPreferenceFragment; | ||
import com.alexstyl.specialdates.util.Utils; | ||
import com.alexstyl.specialdates.widgetprovider.TodayWidgetProvider; | ||
|
||
import java.util.Calendar; | ||
|
||
public class DebugFragment extends MementoPreferenceFragment { | ||
|
||
private DailyReminderDebugPreferences dailyReminderDebugPreferences; | ||
|
||
@Override | ||
public void onCreate(Bundle paramBundle) { | ||
super.onCreate(paramBundle); | ||
addPreferencesFromResource(R.xml.preference_debug); | ||
dailyReminderDebugPreferences = DailyReminderDebugPreferences.newInstance(getActivity()); | ||
findPreference(R.string.key_debug_refresh_widget).setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { | ||
@Override | ||
public boolean onPreferenceClick(Preference preference) { | ||
TodayWidgetProvider.updateWidgets(getActivity()); | ||
Toast.makeText(getActivity(), "Widget(s) refreshed", Toast.LENGTH_SHORT).show(); | ||
return true; | ||
} | ||
}); | ||
|
||
findPreference(R.string.key_debug_daily_reminder_date_enable) | ||
.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { | ||
@Override | ||
public boolean onPreferenceChange(Preference preference, Object newValue) { | ||
dailyReminderDebugPreferences.setEnabled((boolean) newValue); | ||
return true; | ||
} | ||
}); | ||
findPreference(R.string.key_debug_daily_reminder_date).setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { | ||
@Override | ||
public boolean onPreferenceClick(Preference preference) { | ||
DayDate today = dailyReminderDebugPreferences.getSelectedDate(); | ||
DatePickerDialog datePickerDialog = new DatePickerDialog( | ||
getActivity(), onDailyReminderDateSelectedListener, | ||
today.getYear(), today.getMonth() - 1, today.getDayOfMonth() | ||
); | ||
datePickerDialog.show(); | ||
return false; | ||
} | ||
}); | ||
|
||
findPreference(R.string.key_debug_daily_reminder).setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { | ||
@Override | ||
public boolean onPreferenceClick(Preference preference) { | ||
DailyReminderIntentService.startService(getActivity()); | ||
Toast.makeText(getActivity(), "Daily Reminder Triggered", Toast.LENGTH_SHORT).show(); | ||
return true; | ||
} | ||
}); | ||
|
||
findPreference(R.string.key_debug_start_calendar).setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { | ||
@Override | ||
public boolean onPreferenceClick(Preference preference) { | ||
startDateIntent(); | ||
return true; | ||
} | ||
|
||
}); | ||
} | ||
|
||
private void startDateIntent() { | ||
IntentAction i = new IntentAction() { | ||
@Override | ||
public void onStartAction(Context context) throws ActivityNotFoundException { | ||
Calendar cal = Calendar.getInstance(); | ||
Uri.Builder builder = CalendarContract.CONTENT_URI.buildUpon(); | ||
builder.appendPath("time"); | ||
ContentUris.appendId(builder, cal.getTimeInMillis()); | ||
Intent intent = new Intent(Intent.ACTION_VIEW) | ||
.setData(builder.build()); | ||
|
||
startActivity(intent); | ||
|
||
} | ||
|
||
@Override | ||
public String getName() { | ||
return "date debug"; | ||
} | ||
}; | ||
Utils.openIntentSafely(getActivity(), i); | ||
} | ||
|
||
private final DatePickerDialog.OnDateSetListener onDailyReminderDateSelectedListener = new DatePickerDialog.OnDateSetListener() { | ||
|
||
@Override | ||
public void onDateSet(DatePicker view, int year, int month, int dayOfMonth) { | ||
int month1 = month + 1; // dialog picker months have 0 index | ||
dailyReminderDebugPreferences.setSelectedDate(dayOfMonth, month1, year); | ||
} | ||
}; | ||
|
||
} |
24 changes: 0 additions & 24 deletions
24
mobile/src/debug/java/com/alexstyl/specialdates/debug/MixingColorsActivity.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.