Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adssched2019 #333

Merged
merged 123 commits into from Nov 11, 2019
Merged
Changes from 1 commit
Commits
Show all changes
123 commits
Select commit Hold shift + click to select a range
2398a50
Prepares adssched for 2019 development
JoseAlcerreca Jul 31, 2019
4f41cfe
ADS Year 2018->2019
JoseAlcerreca Jul 31, 2019
cfffb2b
Renames adssched -> iosched
JoseAlcerreca Aug 2, 2019
f02d7a3
Use Room for search
tiembo Mar 27, 2019
5f5115e
Adds coroutines to Use Case
manuelvicnt Aug 6, 2019
83dbcaa
Make event filter objects immutable
jdkoren Aug 12, 2019
af37afc
Enable Spotless + Ktlint code linting
chrisbanes Aug 21, 2019
3504dcb
Adds Navigation Component
JoseAlcerreca Aug 14, 2019
e4244c2
Fix clearFilters test
jdkoren Aug 22, 2019
7623117
More adssched -> iosched renames
jdkoren Aug 22, 2019
6637cf0
Merge "More adssched -> iosched renames" into adssched
jdkoren Aug 23, 2019
643e531
Adds Flow to replace MediatorUseCase and one shot operations that use…
manuelvicnt Aug 7, 2019
cc025d4
Dialog updates
jdkoren Aug 22, 2019
64ae2a9
Fixes pressing back from schedule
JoseAlcerreca Aug 27, 2019
38fe60a
Merge "Dialog updates" into adssched
jdkoren Aug 27, 2019
c349614
Small updates to instrumented tests
jdkoren Jan 31, 2019
7a9cf45
Refreshes schedule and details when user changes timezone setting
JoseAlcerreca Aug 27, 2019
28f4b4f
Replace hardcoded texts with values from Remote Config
thagikura Aug 22, 2019
08caeca
Merge "Refreshes schedule and details when user changes timezone sett…
JoseAlcerreca Aug 30, 2019
b288692
Merge "Small updates to instrumented tests" into adssched
jdkoren Aug 30, 2019
ca2df89
Merge "Replace hardcoded texts with values from Remote Config" into a…
thagikura Sep 3, 2019
63548db
Update codestyle
jdkoren Sep 3, 2019
a3452e3
Initial implementation of dark mode
chrisbanes Jan 31, 2019
ccd39fa
Styling fixes for Dark Mode
chrisbanes Feb 11, 2019
af54fc5
Update Theme setting to show three options
chrisbanes Mar 7, 2019
d3d82b4
More dark theme updates
jdkoren Aug 31, 2019
42f9606
Support battery saver night theme on pre-Q devices
jdkoren Aug 31, 2019
886ef3b
Use WorkManager to handle fcm that triggers event data sync
pfmaggi Aug 29, 2019
c1ac267
Merge "Update codestyle" into adssched
JoseAlcerreca Sep 9, 2019
7988aba
Adds "User is attendee" feature
JoseAlcerreca Aug 27, 2019
c7f664a
Merge "Adds "User is attendee" feature" into adssched
JoseAlcerreca Sep 9, 2019
74c6b69
Merge "Use WorkManager to handle fcm that triggers event data sync" i…
pfmaggi Sep 9, 2019
b2476d2
Scopes user attendee preference to a year
JoseAlcerreca Sep 9, 2019
1ad2fb6
Fixes hidden NPE crash from gson
JoseAlcerreca Sep 9, 2019
b18b266
Adapts colors to new branding guidelines
JoseAlcerreca Sep 9, 2019
75c80a0
Replace match_parent in ConstraintLayout
jdkoren Sep 10, 2019
de32ee2
Fixes crash in SignInDialogFragment
JoseAlcerreca Sep 10, 2019
72472a6
Merge "Replace match_parent in ConstraintLayout" into adssched
jdkoren Sep 11, 2019
f61eb19
Supports incremental annotation processing
manuelvicnt Sep 11, 2019
8195c7a
Fixes Agenda data in staging
JoseAlcerreca Sep 11, 2019
2979372
Merge "Supports incremental annotation processing" into adssched
JoseAlcerreca Sep 13, 2019
fee092b
Merge "Fixes Agenda data in staging" into adssched
JoseAlcerreca Sep 13, 2019
ad0340d
Corrected comment from JobScheduler to WorkManager.
pfmaggi Sep 13, 2019
acc4d91
Fix system default theme not showing on Android Q
chrisbanes Sep 16, 2019
eb00dc1
Replaces coroutine Dispatchers in instrumentation tests
manuelvicnt Sep 17, 2019
775d059
Merge "Fix system default theme not showing on Android Q" into adssched
chrisbanes Sep 18, 2019
5ec50a8
Include instrumented tests as part of CI
thagikura May 15, 2019
33f707a
New onboarding screen and launcher icon
JoseAlcerreca Sep 17, 2019
c1a6f4f
Merge "New onboarding screen and launcher icon" into adssched
JoseAlcerreca Sep 19, 2019
b012a6d
Adds 2019 headers
JoseAlcerreca Sep 20, 2019
82116b1
Fixes schedule not being updated when changing user attendee setting …
JoseAlcerreca Sep 19, 2019
8c952a4
Merge "Fixes schedule not being updated when changing user attendee s…
JoseAlcerreca Sep 20, 2019
ead7722
Removes instant flavor as Play now supports instant apps in main track
JoseAlcerreca Sep 20, 2019
f912569
Mitigate the crash in session detail
JoseAlcerreca Sep 20, 2019
2ba1ba7
Adds new conference data and colors
JoseAlcerreca Sep 19, 2019
84706dc
Merge "Mitigate the crash in session detail" into adssched
JoseAlcerreca Sep 20, 2019
9da57d1
Merge "Adds new conference data and colors" into adssched
JoseAlcerreca Sep 20, 2019
aa694a3
Merge "Adds 2019 headers" into adssched
JoseAlcerreca Sep 20, 2019
327777e
Merge "Removes instant flavor as Play now supports instant apps in ma…
JoseAlcerreca Sep 20, 2019
93bc7fc
Fix colorControlLight in light theme
jdkoren Sep 20, 2019
64e9de8
Remove deprecated FirebaseInstanceIdService
jdkoren Sep 20, 2019
075f25b
Increase schedule filter chips touch area
jdkoren Sep 20, 2019
fbf4996
Don't shrink toolbar titles in landscape
jdkoren Apr 3, 2019
9f5e64a
Temporarily moves the instant app URL to firebase, for testing
JoseAlcerreca Sep 20, 2019
48223f8
Reverting some changes in the build script to avoid making signing ch…
JoseAlcerreca Sep 20, 2019
a7891e4
Merge "Don't shrink toolbar titles in landscape" into adssched
jdkoren Sep 20, 2019
493f8d9
Merge "Fix colorControlLight in light theme" into adssched
jdkoren Sep 20, 2019
ecf07a1
Merge "Temporarily moves the instant app URL to firebase, for testing…
JoseAlcerreca Sep 20, 2019
47686c5
Removes activity-alias and bumps version
JoseAlcerreca Sep 20, 2019
23be70f
New filter colors
JoseAlcerreca Sep 24, 2019
358f445
Merge "Increase schedule filter chips touch area" into adssched
JoseAlcerreca Sep 25, 2019
dbe8528
Fix basic fragment transitions
chrisbanes Sep 26, 2019
f590802
Merge "Remove deprecated FirebaseInstanceIdService" into adssched
JoseAlcerreca Sep 26, 2019
55877d6
Merge "Fix basic fragment transitions" into adssched
chrisbanes Sep 26, 2019
80925a1
Make Adssched go edge-to-edge
chrisbanes Sep 17, 2019
efffa29
Fixes crash in (unused) related sessions
JoseAlcerreca Sep 25, 2019
483f327
Updates FAQ content for 2019 and makes text selectable
JoseAlcerreca Sep 27, 2019
dbfe14c
Merge "Make Adssched go edge-to-edge" into adssched
chrisbanes Sep 28, 2019
cf9180a
Fixes detail screen showing old data on loading
JoseAlcerreca Oct 1, 2019
ed210da
Fix Speaker/Session detail Toolbar when scrolling
chrisbanes Oct 1, 2019
e2b15d5
Bumps version, adds production URL for AIA, adds 2019 conference data
JoseAlcerreca Oct 1, 2019
82014ad
Merge "Bumps version, adds production URL for AIA, adds 2019 conferen…
JoseAlcerreca Oct 1, 2019
b550b64
Fix UI elements being displayed under nav bar in landscape
chrisbanes Oct 1, 2019
82fe2f3
Merge "Fix UI elements being displayed under nav bar in landscape" in…
JoseAlcerreca Oct 1, 2019
3d7cdf5
Merge "Fixes detail screen showing old data on loading" into adssched
JoseAlcerreca Oct 1, 2019
540f3ea
Scope ViewModels to fragments where possible
jdkoren Sep 10, 2019
26a144d
Fixes search touch target
JoseAlcerreca Oct 1, 2019
66bdf05
Merge "Fixes search touch target" into adssched
JoseAlcerreca Oct 1, 2019
e34d581
Minor tweaks to event info text
dturner Oct 2, 2019
57df9e7
Replaces old IO asset in search screen
JoseAlcerreca Oct 2, 2019
76b4587
Merge "Replaces old IO asset in search screen" into adssched
JoseAlcerreca Oct 2, 2019
44a504b
Opaque status bar.
nickbutcher Oct 2, 2019
4de7bb8
Align speaker session list.
nickbutcher Oct 2, 2019
6762620
Fix speaker bio padding.
nickbutcher Oct 2, 2019
d5b3732
Merge "Opaque status bar." into adssched
JoseAlcerreca Oct 2, 2019
745cc36
Merge "Align speaker session list." into adssched
JoseAlcerreca Oct 2, 2019
a32764a
Fix navigation transitions using default anims
chrisbanes Oct 3, 2019
d167ff0
Re-land transparent status/nav bars
chrisbanes Oct 3, 2019
8316203
Merge "Re-land transparent status/nav bars" into adssched
nickbutcher Oct 3, 2019
40ecb63
Prevents wrong timezone in speaker screen
JoseAlcerreca Oct 3, 2019
3426a0a
Version 2.0.3 and conference data update 3 Oct
JoseAlcerreca Oct 2, 2019
007f9d1
Merge "Version 2.0.3 and conference data update 3 Oct" into adssched
JoseAlcerreca Oct 4, 2019
74b7a4e
FTS with multiple tokens
yenerm Sep 18, 2019
f353a50
Decreases alpha of color used in headers
JoseAlcerreca Oct 7, 2019
eeb5cd2
Merge "Decreases alpha of color used in headers" into adssched
JoseAlcerreca Oct 8, 2019
eb913c0
Adds top margin to detail/speaker header images
JoseAlcerreca Oct 8, 2019
6264576
version bump and conference data update Oct 8
JoseAlcerreca Oct 8, 2019
ca8ec80
Merge "FTS with multiple tokens b/138927344" into adssched
yenerm Oct 8, 2019
27464e9
Merge "version bump and conference data update Oct 8" into adssched
JoseAlcerreca Oct 9, 2019
078a7f1
Fixes negative button in instant app -> full app dialog
JoseAlcerreca Oct 11, 2019
07e62ab
Changes Pacific Time Zone to UTC-7
JoseAlcerreca Oct 14, 2019
ba584e4
Conference schedule update 14 Oct
JoseAlcerreca Oct 14, 2019
7566d9a
Merge "Changes Pacific Time Zone to UTC-7" into adssched
JoseAlcerreca Oct 14, 2019
532d838
Merge "Adds top margin to detail/speaker header images" into adssched
JoseAlcerreca Oct 14, 2019
4a60b07
Agenda and info updates
JoseAlcerreca Oct 14, 2019
a839ed9
Merge "Agenda and info updates" into adssched
JoseAlcerreca Oct 14, 2019
a1fe667
Conference data update 19 Oct
JoseAlcerreca Oct 16, 2019
76e6cd2
Version bump and small info fixes
JoseAlcerreca Oct 19, 2019
ff00797
Disables scroll-to-present feature for bugfix release
JoseAlcerreca Oct 22, 2019
ffbcea6
Conference data update 21 Oct
JoseAlcerreca Oct 21, 2019
55d7632
Fixes schedule screen being reloaded after starring a session
JoseAlcerreca Oct 22, 2019
6d73af2
Prepares project for open source
JoseAlcerreca Nov 11, 2019
1262792
CircleCI: Limits Xmx to 1024m
JoseAlcerreca Nov 11, 2019
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

Adds Flow to replace MediatorUseCase and one shot operations that use…

…d LiveData

Change-Id: I1644c8fce181539532fc6b8aec0da9fb1a21bc93
  • Loading branch information
manuelvicnt committed Aug 7, 2019
commit 643e531d00884291d79c6742601e2bd53b9f2ee4
@@ -38,7 +38,7 @@ buildscript {
appcompatVersion = '1.0.0-beta01'
browserVersion = '1.0.0-beta01'
constraintLayoutVersion = '1.1.2'
coroutinesVersion = '1.3.0-RC'
coroutinesVersion = '1.3.0'
crashlyticsVersion = '2.9.4'
dagger = "2.16"
dataBindingCompilerVersion = '3.0.1'
@@ -61,7 +61,7 @@ buildscript {
ktlintVersion = '0.33.0'
ktxVersion = "1.0.0"
legacySupportVersion = '1.0.0-alpha1'
lifecycleVersion = '2.2.0-alpha02'
lifecycleVersion = '2.2.0-alpha03'
materialVersion = '1.0.0'
mockitoVersion = "2.8.9"
mockitoKotlinVersion = "1.5.0"
@@ -78,6 +78,9 @@ android {
option("-Xmaxerrs", 2000)
}
}
kotlinOptions {
jvmTarget = '1.8'
}

signingConfigs {
// We need to sign debug builds with a debug key to make firebase auth happy
@@ -116,10 +119,13 @@ dependencies {
implementation "com.google.android:flexbox:$rootProject.flexboxVersion"

// Architecture Components

implementation "androidx.lifecycle:lifecycle-extensions:$rootProject.lifecycleVersion"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$rootProject.lifecycleVersion"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$rootProject.lifecycleVersion"
implementation "androidx.fragment:fragment-ktx:$rootProject.fragmentVersion"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:$rootProject.lifecycleVersion"
kapt "androidx.lifecycle:lifecycle-compiler:$rootProject.lifecycleVersion"
implementation "androidx.room:room-ktx:$rootProject.roomVersion"
implementation "androidx.room:room-runtime:$rootProject.roomVersion"
kapt "androidx.room:room-compiler:$rootProject.roomVersion"
@@ -31,4 +31,9 @@
# Navigation safe-args
-keepnames class com.path.to.your.ParcelableArg
-keepnames class com.path.to.your.SerializableArg
-keepnames class com.path.to.your.EnumArg
-keepnames class com.path.to.your.EnumArg

# Coroutines
-dontwarn **$$inlined$map**
-dontwarn **$$inlined$collect**
-dontwarn **$$inlined$transform**
@@ -16,16 +16,17 @@

package com.google.samples.apps.iosched.shared.data.signin.datasources

import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import com.google.firebase.auth.FirebaseAuth
import com.google.firebase.auth.FirebaseUser
import com.google.samples.apps.iosched.shared.data.signin.AuthenticatedUserInfo
import com.google.samples.apps.iosched.shared.data.signin.FirebaseUserInfo
import com.google.samples.apps.iosched.shared.domain.internal.DefaultScheduler
import com.google.samples.apps.iosched.shared.domain.sessions.NotificationAlarmUpdater
import com.google.samples.apps.iosched.shared.fcm.FcmTokenUpdater
import com.google.samples.apps.iosched.shared.result.Result
import com.google.samples.apps.iosched.shared.result.Result.Success
import kotlinx.coroutines.channels.ConflatedBroadcastChannel
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.asFlow
import timber.log.Timber
import javax.inject.Inject

@@ -41,58 +42,57 @@ import javax.inject.Inject
class FirebaseAuthStateUserDataSource @Inject constructor(
val firebase: FirebaseAuth,
private val tokenUpdater: FcmTokenUpdater,
notificationAlarmUpdater: NotificationAlarmUpdater
private val notificationAlarmUpdater: NotificationAlarmUpdater
) : AuthStateUserDataSource {

private val currentFirebaseUserObservable =
MutableLiveData<Result<AuthenticatedUserInfo?>>()

private var isAlreadyListening = false

private var isListening = false
private var lastUid: String? = null

// Channel that keeps track of User Authentication
private val channel = ConflatedBroadcastChannel<Result<AuthenticatedUserInfo>>()

// Listener that saves the [FirebaseUser], fetches the ID token
// and updates the user ID observable.
private val authStateListener: ((FirebaseAuth) -> Unit) = { auth ->
DefaultScheduler.execute {
Timber.d("Received a FirebaseAuth update.")
// Post the current user for observers
currentFirebaseUserObservable.postValue(
Result.Success(
FirebaseUserInfo(auth.currentUser)
)
)
val listener: ((FirebaseAuth) -> Unit) = { auth ->
Timber.d("Received a FirebaseAuth update")

auth.currentUser?.let { currentUser ->
// Save the FCM ID token in firestore
tokenUpdater.updateTokenForUser(currentUser.uid)
auth.currentUser?.let { currentUser ->
// Save the FCM ID token in firestore
tokenUpdater.updateTokenForUser(currentUser.uid)

if (lastUid != auth.uid) { // Prevent duplicates
notificationAlarmUpdater.updateAll(currentUser.uid)
}
}

if (auth.currentUser == null) {
// Logout, cancel all alarms
notificationAlarmUpdater.cancelAll()
}
auth.currentUser?.let {
if (lastUid != auth.uid) { // Prevent duplicates
notificationAlarmUpdater.updateAll(it.uid)
}
}

// Save the last UID to prevent setting too many alarms.
lastUid = auth.uid
}

override fun startListening() {
if (!isAlreadyListening) {
firebase.addAuthStateListener(authStateListener)
isAlreadyListening = true
// Send the current user for observers
if (!channel.isClosedForSend) {
channel.offer(Success(FirebaseUserInfo(auth.currentUser)))
} else {
unregisterListener()
}
}

override fun getBasicUserInfo(): LiveData<Result<AuthenticatedUserInfo?>> {
return currentFirebaseUserObservable
// Synchronized method, multiple calls to this method at the same time isn't allowed since
// isListening is read and can be modified
@Synchronized
override fun getBasicUserInfo(): Flow<Result<AuthenticatedUserInfo>> {
if (!isListening) {
firebase.addAuthStateListener(listener)
isListening = true
}
return channel.asFlow()
}

override fun clearListener() {
firebase.removeAuthStateListener(authStateListener)
private fun unregisterListener() {
firebase.removeAuthStateListener(listener)
}
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.