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

Commit

Permalink
Merge branch 'develop' into fix_debug
Browse files Browse the repository at this point in the history
* develop: (39 commits)
  Use same version of Android in number picker module
  Include oraclejdk8
  Block transition if already transitioning
  Move analytics initialization before usage
  Introduce SearchTransitioner to handle the transition to Search
  Ensure we are using namedays before using it
  Create separate hint for namedays or just contacts
  Play Transitions from KitKat onward
  Remove unused methods and class
  Set the view of the search activity after the initialization of the theme
  Use Support library transitions
  Fix animation stuck
  Fade content out and in while transition
  Finish Search when the back key is pressed with no search Query
  Remove comments
  Create copy of drawable instead of changing the resource one
  Update targetSDK and libraries
  Add missing stylings from toolbar
  Add transition between activities
  Create animation on the MainActivity
  ...
  • Loading branch information
alexstyl committed Sep 14, 2016
2 parents 3864fac + 0fbc63f commit 2a68111
Show file tree
Hide file tree
Showing 104 changed files with 1,253 additions and 1,136 deletions.
2 changes: 1 addition & 1 deletion .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 Down
16 changes: 9 additions & 7 deletions mobile/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ 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 ->
Expand All @@ -28,7 +28,7 @@ android {
defaultConfig {
applicationId 'com.alexstyl.specialdates'
minSdkVersion 16
targetSdkVersion 22
targetSdkVersion 24
versionCode 57
versionName '3.8'

Expand Down Expand Up @@ -67,12 +67,14 @@ 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 Down
2 changes: 2 additions & 0 deletions mobile/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<!-- Activities -->
<activity
android:name="com.alexstyl.specialdates.ui.activity.MainActivity"
android:windowSoftInputMode="adjustPan"
android:exported="true"
android:launchMode="singleTop">

Expand Down Expand Up @@ -67,6 +68,7 @@
<activity
android:name="com.alexstyl.specialdates.search.SearchActivity"
android:exported="false"
android:theme="@style/Search.Theme"
android:parentActivityName="com.alexstyl.specialdates.ui.activity.MainActivity"
android:windowSoftInputMode="stateVisible|adjustResize">
<meta-data
Expand Down
39 changes: 38 additions & 1 deletion mobile/src/main/java/com/alexstyl/specialdates/Navigator.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,26 @@
import android.net.Uri;
import android.support.annotation.NonNull;

import com.alexstyl.specialdates.about.AboutActivity;
import com.alexstyl.specialdates.addevent.AddBirthdayActivity;
import com.alexstyl.specialdates.analytics.Analytics;
import com.alexstyl.specialdates.analytics.Screen;
import com.alexstyl.specialdates.contact.actions.IntentAction;
import com.alexstyl.specialdates.search.SearchActivity;
import com.alexstyl.specialdates.settings.MainPreferenceActivity;
import com.alexstyl.specialdates.support.SupportDonateDialog;
import com.alexstyl.specialdates.util.Utils;

public class Navigator {

public static final Uri GOOGLE_PLUS_COMMUNITY = Uri.parse("https://plus.google.com/u/0/communities/112144353599130693487");

private final Context context;
private final Analytics analytics;

public Navigator(Context context) {
public Navigator(Context context, Analytics analytics) {
this.context = context;
this.analytics = analytics;
}

public boolean canGoToPlayStore() {
Expand Down Expand Up @@ -83,4 +92,32 @@ public String getName() {
}
});
}

public void toAddBirthday() {
Intent intent = new Intent(context, AddBirthdayActivity.class);
context.startActivity(intent);
}

public void toSearch() {
Intent intent = new Intent(context, SearchActivity.class);
context.startActivity(intent);
}

public void toAbout() {
Intent intent = new Intent(context, AboutActivity.class);
context.startActivity(intent);
analytics.trackScreen(Screen.ABOUT);
}

public void toDonateDialog() {
Intent intent = new Intent(context, SupportDonateDialog.class);
context.startActivity(intent);
analytics.trackScreen(Screen.DONATE);
}

public void toSettings() {
Intent intent = new Intent(context, MainPreferenceActivity.class);
context.startActivity(intent);
analytics.trackScreen(Screen.SETTINGS);
}
}
9 changes: 0 additions & 9 deletions mobile/src/main/java/com/alexstyl/specialdates/PayPal.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

import com.alexstyl.specialdates.Navigator;
import com.alexstyl.specialdates.R;
import com.alexstyl.specialdates.analytics.Firebase;
import com.alexstyl.specialdates.theming.AttributeExtractor;
import com.alexstyl.specialdates.ui.CheatsSheat;
import com.alexstyl.specialdates.ui.activity.MainActivity;
Expand Down Expand Up @@ -41,7 +42,7 @@ protected void onCreate(Bundle savedInstanceState) {

SimpleChromeCustomTabs.initialize(this);

navigator = new Navigator(this);
navigator = new Navigator(this, Firebase.get(this));
MementoToolbar toolbar = Views.findById(this, R.id.memento_toolbar);

setSupportActionBar(toolbar);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@
import com.alexstyl.specialdates.addevent.ui.ContactHeroView;
import com.alexstyl.specialdates.addevent.ui.ContactsAutoCompleteView;
import com.alexstyl.specialdates.analytics.Action;
import com.alexstyl.specialdates.analytics.Analytics;
import com.alexstyl.specialdates.analytics.ActionWithParameters;
import com.alexstyl.specialdates.analytics.Analytics;
import com.alexstyl.specialdates.analytics.Firebase;
import com.alexstyl.specialdates.analytics.Screen;
import com.alexstyl.specialdates.contact.Birthday;
import com.alexstyl.specialdates.contact.Contact;
import com.alexstyl.specialdates.theming.MementoTheme;
Expand All @@ -36,8 +35,7 @@ public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

analytics = Firebase.get(this);
analytics.trackScreen(Screen.ADD_BIRTHDAY);
MementoTheme theme = Themer.get().getCurrentTheme();
MementoTheme theme = Themer.get(this).getCurrentTheme();
setContentView(R.layout.activity_add_birthday, theme);

contactHeroView = Views.findById(this, R.id.addbirthday_hero);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import com.alexstyl.specialdates.date.DateParseException;
import com.alexstyl.specialdates.date.DayDate;
import com.alexstyl.specialdates.util.DateParser;
import com.alexstyl.specialdates.util.Utils;
import com.novoda.notils.exception.DeveloperError;

public class BirthdayQuery {
Expand Down Expand Up @@ -127,8 +126,7 @@ public static Cursor query(ContentResolver cr) {
}

private static final Uri CONTENT_URI = ContactsContract.Data.CONTENT_URI;
private static final String COL_DISPLAY_NAME = Utils.hasHoneycomb() ? ContactsContract.Contacts.DISPLAY_NAME_PRIMARY
: ContactsContract.Contacts.DISPLAY_NAME;
private static final String COL_DISPLAY_NAME = ContactsContract.Contacts.DISPLAY_NAME_PRIMARY;

public static final String WHERE =
"(" + ContactsContract.Data.MIMETYPE + " = ? AND " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,16 @@
import android.os.Build;
import android.provider.ContactsContract;

import com.alexstyl.specialdates.util.Utils;

@TargetApi(Build.VERSION_CODES.HONEYCOMB)
class ContactsQuery {
public final static Uri CONTENT_URI = ContactsContract.Data.CONTENT_URI;

public static String COL_DISPLAY_NAME = Utils.hasHoneycomb() ? ContactsContract.Contacts.DISPLAY_NAME_PRIMARY //3
: ContactsContract.Contacts.DISPLAY_NAME;
public static String COL_DISPLAY_NAME = ContactsContract.Contacts.DISPLAY_NAME_PRIMARY;

public static String COL_LOOKUP = ContactsContract.Contacts.LOOKUP_KEY;

@SuppressLint("InlinedApi")
public final static String SORT_ORDER = Utils.hasHoneycomb() ?
ContactsContract.Contacts.DISPLAY_NAME_PRIMARY : ContactsContract.Contacts.DISPLAY_NAME;
public final static String SORT_ORDER = ContactsContract.Contacts.DISPLAY_NAME_PRIMARY;

@SuppressLint("InlinedApi")
public static final String[] PROJECTION = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public void onActivityCreated(Bundle savedInstanceState) {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
navigator = new Navigator(getActivity());
navigator = new Navigator(getActivity(), analytics);
analytics = Firebase.get(getActivity());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import com.alexstyl.specialdates.date.DayDate;
import com.alexstyl.specialdates.events.database.EventSQLiteOpenHelper;
import com.alexstyl.specialdates.util.DateParser;
import com.alexstyl.specialdates.util.Utils;

import java.util.ArrayList;
import java.util.Collections;
Expand Down Expand Up @@ -120,8 +119,7 @@ public static Cursor query(ContentResolver cr) {
}

private static final Uri CONTENT_URI = ContactsContract.Data.CONTENT_URI;
private static final String COL_DISPLAY_NAME = Utils.hasHoneycomb() ? ContactsContract.Contacts.DISPLAY_NAME_PRIMARY
: ContactsContract.Contacts.DISPLAY_NAME;
private static final String COL_DISPLAY_NAME = ContactsContract.Contacts.DISPLAY_NAME_PRIMARY;

public static final String WHERE =
"(" + ContactsContract.Data.MIMETYPE + " = ? AND " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import com.alexstyl.specialdates.events.database.EventSQLiteOpenHelper;
import com.alexstyl.specialdates.events.namedays.calendar.NamedayCalendar;
import com.alexstyl.specialdates.events.namedays.calendar.NamedayCalendarProvider;
import com.alexstyl.specialdates.util.Utils;

import java.util.ArrayList;
import java.util.Collections;
Expand Down Expand Up @@ -230,14 +229,12 @@ private static class DeviceContactsQuery {
};

@SuppressLint("InlinedApi")
public final static String SORT_ORDER =
Utils.hasHoneycomb() ? ContactsContract.Contacts.DISPLAY_NAME_PRIMARY
: ContactsContract.Contacts.DISPLAY_NAME;
public final static String SORT_ORDER = ContactsContract.Contacts.DISPLAY_NAME_PRIMARY;

@SuppressLint("InlinedApi")
public static final String[] PROJECTION = {
ContactsContract.Data.CONTACT_ID,
Utils.hasHoneycomb() ? ContactsContract.Contacts.DISPLAY_NAME_PRIMARY : ContactsContract.Contacts.DISPLAY_NAME,
ContactsContract.Contacts.DISPLAY_NAME_PRIMARY
};

public static final int ID = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import android.os.Build;
import android.provider.ContactsContract;

import com.alexstyl.specialdates.util.Utils;
import com.nostra13.universalimageloader.core.download.BaseImageDownloader;

import java.io.FileNotFoundException;
Expand All @@ -33,11 +32,7 @@ protected InputStream getStreamFromContent(String imageUri, Object extra) throws
Uri uri = Uri.parse(imageUri);

if (imageUri.startsWith("content://com.android.contacts/")) {
if (Utils.hasICS()) {
return ContactsContract.Contacts.openContactPhotoInputStream(res, uri, true);
} else {
return ContactsContract.Contacts.openContactPhotoInputStream(res, uri);
}
return ContactsContract.Contacts.openContactPhotoInputStream(res, uri, true);
}

return res.openInputStream(uri);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.alexstyl.specialdates.search;

import android.content.Context;
import android.util.AttributeSet;
import android.view.KeyEvent;
import android.widget.EditText;

public class BackKeyEditText extends EditText {
public BackKeyEditText(Context context, AttributeSet attrs) {
super(context, attrs);
}

private OnBackKeyPressedListener listener;

public void setOnBackKeyPressedListener(OnBackKeyPressedListener listener) {
this.listener = listener;
}

@Override
public boolean onKeyPreIme(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK && listener.onBackButtonPressed()) {
return true;
}
return super.onKeyPreIme(keyCode, event);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import android.os.Handler;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;

public class DelayedTextWatcher implements TextWatcher {
Expand All @@ -23,13 +22,13 @@ public DelayedTextWatcher(TextUpdatedCallback textWatchTextUpdatedCallback, Hand
this.handler = handler;
}

private Runnable timeEndRunnable = new Runnable() {
private final Runnable timeEndRunnable = new Runnable() {
@Override
public void run() {
if (TextUtils.isEmpty(text)) {
textWatchTextUpdatedCallback.onEmptyTextEntered();
} else {
if (text.length() > 0) {
textWatchTextUpdatedCallback.onTextConfirmed(text);
} else {
textWatchTextUpdatedCallback.onEmptyTextConfirmed();
}
}
};
Expand All @@ -55,7 +54,7 @@ public void afterTextChanged(Editable s) {
public interface TextUpdatedCallback {
void onTextChanged(String text);

void onEmptyTextEntered();
void onEmptyTextConfirmed();

void onTextConfirmed(String text);
}
Expand Down
Loading

0 comments on commit 2a68111

Please sign in to comment.