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
*url*: https://polar-bastion-91741.herokuapp.com/images | |
`GET /images?user_id={user_id}` | |
returns all uploaded images for the user | |
response: `[{"url": String, "created_at": timestamp}]` | |
`$ curl 'https://polar-bastion-91741.herokuapp.com/images?user_id=100'` | |
`POST /images/{user_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
object MatchesDependencies { | |
internal lateinit var matchMakingService: MatchMakingService | |
private set | |
fun init(networkingModule: NetworkingModule) { | |
matchMakingService = | |
networkingModule.createSecureServiceEndpoint(MatchMakingService::class.java) | |
} | |
internal lateinit var matchesBehavior: MatchesBehavior |
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
@Test | |
internal fun presenceService_askedForFrequency() { | |
val heartbeat = PublishSubject.create<Presence>() | |
val mockPresenceService = mock<PresenceService> { | |
on { sendHeartbeat() } doReturn heartbeat | |
} | |
val mockNetworkingModule = mock<NetworkingModule> { | |
on { createSecureServiceEndpoint(PresenceService::class.java) } | |
.doReturn(mockPresenceService) | |
} |
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
@Provides | |
@Singleton | |
open fun providePresenceMaintainer(networkingModule: NetworkingModule) = PresenceMaintainer(networkingModule) |
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
open class PresenceMaintainer( | |
networkingModule: NetworkingModule, | |
) : Application.ActivityLifecycleCallbacks { | |
internal val presenceService = | |
networkingModule.createSecureServiceEndpoint(PresenceService::class.java) | |
private val foregroundSubject = PublishSubject.create<Boolean>() | |
private val polling = presenceService.sendHeartbeat() | |
.subscribeOn(Schedulers.io()) | |
private var connected by Delegates.observable(false) { … } |
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
package com.runup.myapplication2.app; | |
import android.content.Context; | |
import android.content.res.Resources; | |
import android.util.AttributeSet; | |
import android.widget.NumberPicker; | |
import java.lang.reflect.Field; | |
/** |
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
package com.runup.myapplication2.app; | |
import android.content.Context; | |
import android.graphics.Bitmap; | |
import android.graphics.Canvas; | |
import android.graphics.Color; | |
import android.graphics.Paint; | |
import android.graphics.PorterDuff; | |
import android.graphics.PorterDuffXfermode; | |
import android.graphics.drawable.BitmapDrawable; |
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
/** | |
* Manages dimensions (px) via etalon (STANDARD is for Nexus7). | |
* Use for texts, not for pictures | |
* (as this one has two scale coefficients: one for width and one for height). | |
*/ | |
@SuppressLint("UseValueOf") | |
public class DimenManager { | |
private static final Point STANDARD = new Point(1200, 1776); |