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 #99 from alexstyl/develop
Release 8.0
- Loading branch information
Showing
142 changed files
with
1,829 additions
and
571 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
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.alexstyl.android; | ||
|
||
import android.os.Build; | ||
|
||
/** | ||
* This class contains static utility methods. | ||
*/ | ||
public final class Version { | ||
|
||
// Prevents instantiation. | ||
private Version() { | ||
} | ||
|
||
public static boolean hasJellyBean() { | ||
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN; | ||
} | ||
|
||
/** | ||
* Emulate the as operator of C#. If the object can be cast to type it will | ||
* be casted. If not this returns null. | ||
*/ | ||
public static <T> T as(Class<T> type, Object o) { | ||
if (type.isInstance(o)) { | ||
return type.cast(o); | ||
} | ||
return null; | ||
} | ||
|
||
public static boolean hasKitKat() { | ||
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT; | ||
} | ||
|
||
/** | ||
* Uses static final constants to detect if the device's platform version is | ||
* Lollipop or later. | ||
*/ | ||
public static boolean hasLollipop() { | ||
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP; | ||
} | ||
|
||
} |
File renamed without changes.
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
11 changes: 11 additions & 0 deletions
11
common/src/main/java/com/alexstyl/android/widget/AppWidgetId.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,11 @@ | ||
package com.alexstyl.android.widget; | ||
|
||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
|
||
/** | ||
* A id of a Widget | ||
*/ | ||
@Retention(RetentionPolicy.SOURCE) | ||
public @interface AppWidgetId { | ||
} |
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
2 changes: 2 additions & 0 deletions
2
common/src/main/java/com/alexstyl/resources/DimensionResources.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 |
---|---|---|
@@ -1,7 +1,9 @@ | ||
package com.alexstyl.resources; | ||
|
||
import android.support.annotation.DimenRes; | ||
import android.support.annotation.Px; | ||
|
||
public interface DimensionResources { | ||
@Px | ||
int getPixelSize(@DimenRes int id); | ||
} |
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
16 changes: 16 additions & 0 deletions
16
common/src/main/java/com/alexstyl/specialdates/analytics/Widget.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,16 @@ | ||
package com.alexstyl.specialdates.analytics; | ||
|
||
public enum Widget { | ||
UPCOMING_EVENTS_SCROLLING("upcoming_events_scrolling"), | ||
UPCOMING_EVENTS_SIMPLE("upcoming_events_simple"); | ||
|
||
private final String widgetName; | ||
|
||
Widget(String widgetName) { | ||
this.widgetName = widgetName; | ||
} | ||
|
||
public String getWidgetName() { | ||
return widgetName; | ||
} | ||
} |
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,13 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<declare-styleable name="ForegroundLinearLayout"> | ||
<attr name="android:foreground" /> | ||
<attr name="android:foregroundInsidePadding" /> | ||
<attr name="android:foregroundGravity" /> | ||
</declare-styleable> | ||
|
||
<declare-styleable name="ForegroundImageView"> | ||
<attr name="android:foreground" /> | ||
</declare-styleable> | ||
|
||
</resources> |
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,5 +1,10 @@ | ||
ext { | ||
android_support_version = '25.1.1' | ||
android_support_version = '25.3.1' | ||
play_services_version = '10.0.1' | ||
|
||
androidCompileSdkVersion = 25 | ||
androidBuildToolsVersion = '25.0.2' | ||
androidVersionCode = 70 | ||
androidVersionName = '8.0' | ||
} | ||
|
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
4 changes: 4 additions & 0 deletions
4
mobile/src/main/java/com/alexstyl/android/preferences/PreferenceKeyId.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,4 @@ | ||
package com.alexstyl.android.preferences; | ||
|
||
public @interface PreferenceKeyId { | ||
} |
25 changes: 25 additions & 0 deletions
25
mobile/src/main/java/com/alexstyl/specialdates/DeviceConfigurationUpdatedReceiver.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,25 @@ | ||
package com.alexstyl.specialdates; | ||
|
||
import android.content.BroadcastReceiver; | ||
import android.content.Context; | ||
import android.content.Intent; | ||
|
||
/** | ||
* A {@linkplain BroadcastReceiver} that keeps track whether the user has updated some option on their device external to Memento which can affect the app. | ||
*/ | ||
public class DeviceConfigurationUpdatedReceiver extends BroadcastReceiver { | ||
|
||
@Override | ||
public void onReceive(Context context, Intent intent) { | ||
ExternalWidgetRefresher externalWidgetRefresher = ExternalWidgetRefresher.get(context.getApplicationContext()); | ||
|
||
String action = intent.getAction(); | ||
if (Intent.ACTION_LOCALE_CHANGED.equals(action)) { | ||
ErrorTracker.updateLocaleUsed(); | ||
externalWidgetRefresher.refreshAllWidgets(); | ||
} else if (Intent.ACTION_DATE_CHANGED.equals(action)) { | ||
externalWidgetRefresher.refreshAllWidgets(); | ||
} | ||
} | ||
|
||
} |
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
Oops, something went wrong.