Skip to content
This repository has been archived by the owner on Jan 11, 2021. It is now read-only.

Commit

Permalink
Merge pull request #46 from alexstyl/develop
Browse files Browse the repository at this point in the history
Release 4.0 (58)
  • Loading branch information
alexstyl authored Sep 18, 2016
2 parents a4d2a5e + 4107c20 commit 481d055
Show file tree
Hide file tree
Showing 206 changed files with 2,412 additions and 5,157 deletions.
12 changes: 6 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: android
jdk: oraclejdk7
jdk: oraclejdk8
sudo: false
cache:
directories:
Expand All @@ -12,19 +12,19 @@ cache:
android:
components:
- tools
- build-tools-23.0.2
- android-23
- build-tools-24.0.2
- android-24
- platform-tools
- extra-google-google_play_services
- extra-android-support
- extra-android-m2repository
- extra-google-m2repository
- addon-google_apis-google-23
- addon-google_apis-google-24

licenses:
- 'android-sdk-preview-license-52d11cd2'
- 'android-sdk-license-c81a61d9'
- 'android-sdk-license-.+'
- 'google-gdk-license-.+'


script:
- ./gradlew build
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ buildscript {
apply from: 'secret.gradle'
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.3'
classpath 'com.google.gms:google-services:3.0.0'
classpath 'io.fabric.tools:gradle:1.21.5'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down
38 changes: 16 additions & 22 deletions mobile/build.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}

dependencies {
classpath 'io.fabric.tools:gradle:1.21.5'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'com.google.gms.google-services'

android {
compileSdkVersion 23
buildToolsVersion '23.0.2'

compileSdkVersion 24
buildToolsVersion '24.0.2'

applicationVariants.all { variant ->
variant.outputs.each { output ->
Expand All @@ -28,12 +18,13 @@ android {
defaultConfig {
applicationId 'com.alexstyl.specialdates'
minSdkVersion 16
targetSdkVersion 22
versionCode 57
versionName '3.8'
targetSdkVersion 24
versionCode 58
versionName '4.0'

manifestPlaceholders = [crashlyticsApiKey: crashlyticsKey]
buildConfigField 'String', 'API_KEY_VENDING', '\"' + androidVendingKey + "\""
buildConfigField 'String', 'MIXPANEL_TOKEN', '\"' + mixpanelKey + "\""
}

buildTypes {
Expand All @@ -54,6 +45,10 @@ android {
abortOnError false
}

testOptions {
unitTests.returnDefaultValues = true
}

}

repositories {
Expand All @@ -66,13 +61,12 @@ repositories {
}

dependencies {

compile fileTree(dir: 'libs', exclude: 'android-support-v4.jar', include: ['*.jar'])
compile project(':numberpicker')
compile 'com.android.support:support-annotations:23.3.0'
compile 'com.android.support:design:23.3.0'
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.android.support:recyclerview-v7:23.3.0'
compile 'com.android.support:support-annotations:24.2.0'
compile 'com.android.support:design:24.2.0'
compile 'com.android.support:appcompat-v7:24.2.0'
compile 'com.android.support:recyclerview-v7:24.2.0'
compile 'com.android.support:transition:24.2.0'
compile 'net.danlew:android.joda:2.8.0'
compile('de.psdev.licensesdialog:licensesdialog:1.5.0') {
exclude module: 'support-v4'
Expand All @@ -83,7 +77,7 @@ dependencies {
compile('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') {
transitive = true;
}
compile 'com.google.firebase:firebase-core:9.4.0'
compile 'com.mixpanel.android:mixpanel-android:4.9.2'


debugCompile 'com.squareup.leakcanary:leakcanary-android:1.3.1'
Expand Down
13 changes: 3 additions & 10 deletions mobile/src/debug/AndroidManifest.xml
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>
Original file line number Diff line number Diff line change
@@ -1,26 +1,9 @@
package com.alexstyl.specialdates.debug;

import android.annotation.TargetApi;
import android.content.ActivityNotFoundException;
import android.content.ContentUris;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.preference.Preference;
import android.provider.CalendarContract;
import android.widget.Toast;

import com.alexstyl.specialdates.R;
import com.alexstyl.specialdates.contact.actions.IntentAction;
import com.alexstyl.specialdates.service.DailyReminderIntentService;
import com.alexstyl.specialdates.ui.base.MementoPreferenceActivity;
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 DebugActivity extends MementoPreferenceActivity {
@Override
Expand All @@ -29,70 +12,4 @@ public void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.fragment_debug);
}

public static class DebugFragment extends MementoPreferenceFragment {

@Override
public void onCreate(Bundle paramBundle) {
super.onCreate(paramBundle);
addPreferencesFromResource(R.xml.preference_debug);

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).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() {
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
@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);
}
}

}
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);
}
};

}

This file was deleted.

Loading

0 comments on commit 481d055

Please sign in to comment.