Skip to content

Commit

Permalink
Merge pull request #7 from iBurnApp/2018-updates
Browse files Browse the repository at this point in the history
2018 updates
  • Loading branch information
OnlyInAmerica committed Jul 25, 2018
2 parents f9a5662 + 291b7fc commit 3c782c9
Show file tree
Hide file tree
Showing 24 changed files with 432 additions and 136 deletions.
7 changes: 4 additions & 3 deletions build.gradle
@@ -1,14 +1,15 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.1.4-2'
ext.kotlin_version = '1.2.51'
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-beta2'
classpath 'com.android.tools.build:gradle:3.2.0-beta04'
classpath 'com.jakewharton.sdkmanager:gradle-plugin:0.12.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
Expand All @@ -21,4 +22,4 @@ allprojects {
url "https://maven.google.com"
}
}
}
}
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
#Thu Aug 03 08:37:19 PDT 2017
#Thu Apr 05 19:25:29 PDT 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-rc-1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
100 changes: 48 additions & 52 deletions iBurn/build.gradle
Expand Up @@ -8,6 +8,7 @@ buildscript {

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'

repositories {
mavenCentral()
Expand All @@ -17,14 +18,14 @@ repositories {
}

android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
compileSdkVersion 27
buildToolsVersion "27.0.3"

defaultConfig {
minSdkVersion 16
targetSdkVersion 26
versionCode 28
versionName "2017.0.1.2"
targetSdkVersion 27
versionCode 29
versionName "2018.0.0.1"

applicationId "com.iburnapp.iburn"

Expand All @@ -37,12 +38,6 @@ android {
"$projectDir/schemas".toString()]
}
}

// J2V8 lacks arm 64 libraries, so we must limit the whole project
// currently because other libraries like mapbox include them. https://github.com/eclipsesource/J2V8/issues/174
ndk {
abiFilters "armeabi-v7a", "x86"
}
}

splits {
Expand Down Expand Up @@ -132,64 +127,65 @@ if (project.hasProperty('keyPassword')) {
android.signingConfigs.release.keyPassword = keyPassword
}

def SUPPORT_LIB_VERSION = "26.0.1"
def PLAY_SERVICES_VERSION = "11.2.0"
def SUPPORT_LIB_VERSION = "27.1.1"
def PLAY_SERVICES_VERSION = "12.0.1"

dependencies {

// Android Support libraries
compile "com.android.support:design:$SUPPORT_LIB_VERSION"
compile "com.android.support:support-v4:$SUPPORT_LIB_VERSION"
compile "com.android.support:appcompat-v7:$SUPPORT_LIB_VERSION"
compile "com.android.support:recyclerview-v7:$SUPPORT_LIB_VERSION"
compile "com.android.support:support-annotations:$SUPPORT_LIB_VERSION"
compile "com.android.support:support-dynamic-animation:$SUPPORT_LIB_VERSION"
implementation "com.android.support:design:$SUPPORT_LIB_VERSION"
implementation "com.android.support:support-v13:$SUPPORT_LIB_VERSION"
implementation "com.android.support:support-v4:$SUPPORT_LIB_VERSION"
implementation "com.android.support:appcompat-v7:$SUPPORT_LIB_VERSION"
implementation "com.android.support:recyclerview-v7:$SUPPORT_LIB_VERSION"
implementation "com.android.support:support-annotations:$SUPPORT_LIB_VERSION"
implementation "com.android.support:support-dynamic-animation:$SUPPORT_LIB_VERSION"

// Google Play Services
compile "com.google.android.gms:play-services-gcm:$PLAY_SERVICES_VERSION"
compile "com.google.android.gms:play-services-location:$PLAY_SERVICES_VERSION"
implementation "com.google.android.gms:play-services-gcm:$PLAY_SERVICES_VERSION"
implementation "com.google.android.gms:play-services-location:$PLAY_SERVICES_VERSION"

// 3rd Party libraries
compile 'com.google.code.gson:gson:2.8.1'
compile 'net.hockeyapp.android:HockeySDK:4.1.2'
compile 'com.jakewharton.timber:timber:4.5.1'
compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
compile 'io.reactivex.rxjava2:rxjava:2.1.0'
compile 'io.reactivex.rxjava2:rxkotlin:2.0.3'
compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
compile 'com.squareup.retrofit2:converter-gson:2.3.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.8.0'
compile 'com.squareup.okhttp3:okhttp:3.8.0'
compile 'com.patloew.rxlocation:rxlocation:1.0.3'
compile 'com.tonicartos:superslim:0.4.13'
compile 'xyz.danoz:recyclerviewfastscroller:0.1.3'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.eclipsesource.j2v8:j2v8:4.7.1@aar'
compile('com.mapbox.mapboxsdk:mapbox-android-sdk:5.1.3@aar') {
implementation 'com.google.code.gson:gson:2.8.1'
implementation 'net.hockeyapp.android:HockeySDK:4.1.2'
implementation 'com.jakewharton.timber:timber:4.5.1'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
implementation 'io.reactivex.rxjava2:rxjava:2.1.0'
implementation 'io.reactivex.rxjava2:rxkotlin:2.0.3'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.8.0'
implementation 'com.squareup.okhttp3:okhttp:3.8.0'
implementation 'com.patloew.rxlocation:rxlocation:1.0.3'
implementation 'com.tonicartos:superslim:0.4.13'
implementation 'xyz.danoz:recyclerviewfastscroller:0.1.3'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.eclipsesource.j2v8:j2v8:4.7.1@aar'
implementation('com.mapbox.mapboxsdk:mapbox-android-sdk:5.1.3@aar') {
transitive = true
}
compile 'com.roughike:bottom-bar:2.3.1'
compile 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.roughike:bottom-bar:2.3.1'
implementation 'com.squareup.picasso:picasso:2.5.2'

compile 'com.github.hotchemi:permissionsdispatcher:2.4.0'
implementation 'com.github.hotchemi:permissionsdispatcher:2.4.0'
kapt 'com.github.hotchemi:permissionsdispatcher-processor:2.4.0'

compile 'com.jakewharton:butterknife:8.6.0'
implementation 'com.jakewharton:butterknife:8.6.0'
kapt 'com.jakewharton:butterknife-compiler:8.6.0'

compile "android.arch.persistence.room:rxjava2:1.0.0-alpha9"
compile "android.arch.persistence.room:runtime:1.0.0-alpha9"
kapt "android.arch.persistence.room:compiler:1.0.0-alpha9"
implementation "android.arch.persistence.room:rxjava2:1.1.0-beta2"
implementation "android.arch.persistence.room:runtime:1.1.0-beta2"
kapt "android.arch.persistence.room:compiler:1.1.0-beta2"

compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"

// Test dependencies
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:1.10.19'
androidTestCompile 'com.android.support.test:runner:1.0.0'
androidTestCompile 'com.android.support.test:rules:1.0.0'
androidTestCompile 'com.android.support.test.espresso:espresso-core:3.0.0'
androidTestCompile "com.android.support:support-annotations:$SUPPORT_LIB_VERSION"
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:1.10.19'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test:rules:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
androidTestImplementation "com.android.support:support-annotations:$SUPPORT_LIB_VERSION"

}
Expand Up @@ -12,7 +12,9 @@ public class CurrentDateProvider {
/**
* Date to use as "now" for Debug builds
*/
public static Date MOCK_NOW_DATE = new GregorianCalendar(2017, Calendar.AUGUST, 28, 15, 43).getTime();
private static Date MOCK_NOW_DATE = new GregorianCalendar(
2017, Calendar.AUGUST, 31, 15, 43)
.getTime();

public static Date getCurrentDate() {
return BuildConfig.MOCK ? MOCK_NOW_DATE : new Date();
Expand Down
68 changes: 64 additions & 4 deletions iBurn/src/main/java/com/gaiagps/iburn/DateUtil.java
Expand Up @@ -7,13 +7,16 @@
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;

/**
* Created by davidbrodsky on 8/6/14.
*/
public class DateUtil {

private static SimpleDateFormat timeFormatter = new SimpleDateFormat("h:mm a", Locale.US);
public static final TimeZone PLAYA_TIME_ZONE = TimeZone.getTimeZone("America/Los_Angeles");

private static SimpleDateFormat TIME_FORMATTER = new SimpleDateFormat("h:mm a", Locale.US);

/**
* Get a human description of an event's state
Expand All @@ -27,11 +30,31 @@ public class DateUtil {
* @param prettyEndDateStr A 'prettified' end date string
*/
public static String getDateString(Context context, Date nowDate, Date startDate, String prettyStartDateStr, Date endDate, String prettyEndDateStr) {


Calendar startCal = Calendar.getInstance();
Calendar endCal = Calendar.getInstance();
startCal.setTime(startDate);
endCal.setTime(endDate);

//Show date/day only if end date is not same date as start date
final SimpleDateFormat timeFormatter = new SimpleDateFormat("h:mm a", Locale.US);
if(endCal.get(Calendar.YEAR) == startCal.get(Calendar.YEAR) &&
endCal.get(Calendar.DAY_OF_YEAR) == startCal.get(Calendar.DAY_OF_YEAR))
{
return timeFormatter.format(startDate) + "-" + timeFormatter.format(endDate);

}
else {
return timeFormatter.format(startDate) + "-" + prettyEndDateStr;
}


/*
// The date before which to use relative date descriptors. e.g: (in 2 minutes)
Calendar relativeTimeCutoff = Calendar.getInstance();
relativeTimeCutoff.setTime(nowDate);
relativeTimeCutoff.add(Calendar.HOUR, 1);

if (nowDate.before(startDate)) {
// Has not yet started
if (relativeTimeCutoff.after(startDate)) {
Expand All @@ -52,7 +75,7 @@ public static String getDateString(Context context, Date nowDate, Date startDate
return context.getString(R.string.ends) + " " + prettyEndDateStr;
}
}
}*/
}

public static String getStartDateString(Date startDate, Date nowDate) {
Expand All @@ -67,7 +90,7 @@ public static String getStartDateString(Date startDate, Date nowDate) {

String relativeSpan = null;
if (hours > 0)
relativeSpan = "at " + timeFormatter.format(startDate);
relativeSpan = "at " + TIME_FORMATTER.format(startDate);
else
relativeSpan = String.format("in %d minute%s", minutes, minutes > 1 ? 's' : "");

Expand All @@ -89,4 +112,41 @@ public static String getEndDateString(Date endDate, Date nowDate) {
return (endDate.before(nowDate) ? "Ended " : "Ends ") + relativeSpan;
}
}

public static Date getAllDayStartDateTime(String day){
/***
* This gets the start time
* we will assume is the datetime for events that are
* actually all day events
**/
Date now = CurrentDateProvider.getCurrentDate();
Calendar cal = Calendar.getInstance();
cal.setTime(now);
cal.set(Calendar.MONTH,Integer.valueOf(day.split("/")[0])-1);
cal.set(Calendar.DATE,Integer.valueOf(day.split("/")[1]));
cal.set(Calendar.HOUR_OF_DAY,10);
cal.set(Calendar.MINUTE,0);
cal.set(Calendar.SECOND,0);
cal.set(Calendar.MILLISECOND,0);
return cal.getTime();
}

public static Date getAllDayEndDateTime(String day){
/***
* This gets the end time we will assume is the datetime
* for events that are
* actually all day events
**/
Date now = CurrentDateProvider.getCurrentDate();
Calendar cal = Calendar.getInstance();
cal.setTime(now);
cal.set(Calendar.MONTH,Integer.valueOf(day.split("/")[0])-1);
cal.set(Calendar.DATE,Integer.valueOf(day.split("/")[1]));
cal.set(Calendar.HOUR_OF_DAY,20);
cal.set(Calendar.MINUTE,0);
cal.set(Calendar.SECOND,0);
cal.set(Calendar.MILLISECOND,0);
Date newTime = cal.getTime();
return newTime;
}
}

0 comments on commit 3c782c9

Please sign in to comment.