Skip to content
This repository was archived by the owner on Feb 17, 2020. It is now read-only.

Commit e0b8032

Browse files
committed
Merge branch 'develop' into london2017
# Conflicts: # gradle.properties # team-props/static-analysis/detekt-config.yml
2 parents 380fc72 + 26ebffb commit e0b8032

51 files changed

Lines changed: 998 additions & 1135 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

app/build.gradle

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77
}
88

99
plugins {
10-
id 'io.gitlab.arturbosch.detekt' version '1.0.0.RC4-3'
10+
id 'io.gitlab.arturbosch.detekt'
1111
}
1212

1313
apply plugin: 'com.android.application'
@@ -67,7 +67,7 @@ android {
6767
resValueProperty 'deeplink_scheme', (buildProperties.application['deeplinkScheme'] | "squanchy")
6868
}
6969

70-
if (System.getenv('CI') == null) {
70+
if (isNotRunningOnCI()) {
7171
signingConfigs {
7272
config {
7373
signingConfigProperties buildProperties.releaseSigningConfig
@@ -100,19 +100,31 @@ android {
100100
}
101101
}
102102

103+
private static boolean isNotRunningOnCI() {
104+
System.getenv('CI') == null
105+
}
106+
103107
play {
104108
jsonFile = teamPropsFile('play-store-keys.json')
105109
}
106110

107111
detekt {
108-
version = '1.0.0.RC4-3'
112+
profile = 'main'
109113

110114
profile('main') {
111115
input = "$projectDir/src/main/java"
112116
config = teamPropsFile('static-analysis/detekt-config.yml')
113117
filters = '.*test.*,.*/resources/.*,.*/tmp/.*'
114118
output = "$projectDir/build/reports/detekt"
115119
}
120+
121+
idea {
122+
path = "$rootDir/.idea"
123+
codeStyleScheme = "$rootDir/.idea/codeStyleSettings.xml"
124+
inspectionsProfile = "$rootDir/.idea/inspectionProfiles/Squanchy.xml"
125+
report = "$projectDir/build/reports/detekt-idea"
126+
mask = "*.kt,"
127+
}
116128
}
117129

118130
project.afterEvaluate {

app/src/main/java/me/eugeniomarletti/renderthread/RenderThreadMethods.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
@SuppressLint("PrivateApi") // This class wraps the private APIs we rely on
2323
final class RenderThreadMethods {
2424

25-
private static final int MAX_SUPPORTED_ANDROID_VERSION = 25;
25+
private static final int MAX_SUPPORTED_ANDROID_VERSION = 27;
2626
private static final int MIN_SUPPORTED_ANDROID_VERSION = 21;
2727

2828
@NonNull

app/src/main/java/net/squanchy/home/HomeActivity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,14 @@ private void selectPageFrom(Intent intent, Optional<Bundle> savedState) {
116116
private void collectPageViewsInto(Map<BottomNavigationSection, View> pageViews) {
117117
pageViews.put(BottomNavigationSection.SCHEDULE, pageContainer.findViewById(R.id.schedule_content_root));
118118
pageViews.put(BottomNavigationSection.FAVORITES, pageContainer.findViewById(R.id.favorites_content_root));
119-
pageViews.put(BottomNavigationSection.TWEETS, pageContainer.findViewById(R.id.tweets_content_root));
119+
pageViews.put(BottomNavigationSection.TWEETS, pageContainer.findViewById(R.id.tweetsContentRoot));
120120
pageViews.put(BottomNavigationSection.VENUE_INFO, pageContainer.findViewById(R.id.venueContentRoot));
121121
}
122122

123123
private void collectLoadablesInto(List<Loadable> loadables) {
124124
loadables.add(pageContainer.findViewById(R.id.schedule_content_root));
125125
loadables.add(pageContainer.findViewById(R.id.favorites_content_root));
126-
loadables.add(pageContainer.findViewById(R.id.tweets_content_root));
126+
loadables.add(pageContainer.findViewById(R.id.tweetsContentRoot));
127127
loadables.add(pageContainer.findViewById(R.id.venueContentRoot));
128128
}
129129

app/src/main/java/net/squanchy/imageloader/SquanchyGlideAppModule.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ private class FirebaseImageLoader : ModelLoader<StorageReference, InputStream> {
8686
try {
8787
inputStream?.close()
8888
} catch (e: IOException) {
89-
Timber.w("Could not close stream", e)
89+
Timber.w(e, "Could not close stream")
9090
}
9191
}
9292
}

app/src/main/java/net/squanchy/notification/NotificationCreator.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ class NotificationCreator(private val context: Context) {
116116
val eventDetailIntent = EventDetailsActivity.createIntent(context, eventId)
117117
taskBuilder.addNextIntent(eventDetailIntent)
118118

119-
return taskBuilder.getPendingIntent(0, PendingIntent.FLAG_CANCEL_CURRENT)
119+
return taskBuilder.getPendingIntent(0, PendingIntent.FLAG_CANCEL_CURRENT)!!
120120
}
121121

122122
private fun getPlaceName(event: Event): String? {
@@ -131,7 +131,7 @@ class NotificationCreator(private val context: Context) {
131131

132132
private fun createPendingIntentForMultipleEvents(): PendingIntent {
133133
val taskBuilder = createBaseTaskStackBuilder()
134-
return taskBuilder.getPendingIntent(0, PendingIntent.FLAG_CANCEL_CURRENT)
134+
return taskBuilder.getPendingIntent(0, PendingIntent.FLAG_CANCEL_CURRENT)!!
135135
}
136136

137137
private fun createBaseTaskStackBuilder(): TaskStackBuilder {
@@ -197,9 +197,7 @@ class NotificationCreator(private val context: Context) {
197197
private val EVENTS_ABOUT_TO_START_CHANNEL_ID = "events_about_to_start"
198198

199199
// pulsate every 1 second, indicating a relatively high degree of urgency
200-
@SuppressWarnings("MagicNumber")
201200
private val NOTIFICATION_LED_ON_MS = 100
202-
@SuppressWarnings("MagicNumber")
203201
private val NOTIFICATION_LED_OFF_MS = 1000
204202
private val ARGB_TRANSPARENT = "#00000000"
205203
}

app/src/main/java/net/squanchy/notification/NotificationsIntentService.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ class NotificationsIntentService : IntentService(NotificationsIntentService::cla
8888
}
8989

9090
companion object {
91-
@SuppressWarnings("MagicNumber")
9291
private val NOTIFICATION_INTERVAL_MINUTES = 10
9392
private val SHOW_NOTIFICATIONS_DEFAULT = true
9493
}

app/src/main/java/net/squanchy/notification/Notifier.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ class Notifier(private val notificationManagerCompat: NotificationManagerCompat)
1919
}
2020

2121
companion object {
22-
@SuppressWarnings("MagicNumber")
2322
private val SINGLE_NOTIFICATION_ID = 42
2423
}
2524
}

app/src/main/java/net/squanchy/support/ContextUnwrapper.java

Lines changed: 0 additions & 25 deletions
This file was deleted.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
@file:JvmName("ContextUnwrapper")
2+
package net.squanchy.support
3+
4+
import android.content.Context
5+
import android.content.ContextWrapper
6+
import android.support.v7.app.AppCompatActivity
7+
8+
tailrec fun unwrapToActivityContext(context: Context?): AppCompatActivity =
9+
when (context) {
10+
null -> throw IllegalArgumentException("Context must not be null")
11+
is AppCompatActivity -> context
12+
is ContextWrapper -> unwrapToActivityContext(context.baseContext)
13+
else -> throw IllegalArgumentException("Context type not supported: ${context.javaClass.canonicalName}")
14+
}
15+

app/src/main/java/net/squanchy/support/graphics/CircularRevealDrawable.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public void animateToColor(@ColorInt int newColor, @IntRange(from = 0) int durat
5252
revealDuration = durationMillis;
5353
pendingTargetColor = newColor;
5454
startAnimationOnNextDraw = true;
55-
setColor(pendingTargetColor);
55+
setColor(targetColor);
5656
}
5757

5858
@Override

0 commit comments

Comments
 (0)