Skip to content

Instantly share code, notes, and snippets.

Avatar

Tomislav Smrečki tsmrecki

View GitHub Profile
View NewsPageKeyedRemoteMediator.kt
package com.bornfight.demo.repository.news
import androidx.paging.ExperimentalPagingApi
import androidx.paging.LoadType
import androidx.paging.PagingState
import androidx.paging.RemoteMediator
import androidx.room.withTransaction
import com.bornfight.common.data.database.AppDatabase
import com.bornfight.common.data.retrofit.ApiInterface
import com.bornfight.demo.model.NewsIte
View AndroidManifest.xml
<meta-data
android:name="default-url"
android:value="https://example.domain" />
@tsmrecki
tsmrecki / build.gradle
Last active Dec 20, 2017
Instant App data deep links proper definition
View build.gradle
<intent-filter android:autoVerify="true">
...
<data
android:scheme="http"
android:host="example.domain"
android:pathPrefix="/products" />
<data android:scheme="https"/>
</intent-filter>
@tsmrecki
tsmrecki / build.gradle
Created Dec 18, 2017
Instant apps module configuration
View build.gradle
apply plugin: 'com.android.instantapp'
dependencies {
implementation project(':product')
implementation project(':productlist')
implementation project(':base')
}
@tsmrecki
tsmrecki / build.gradle
Created Dec 18, 2017
Feature module dependencies example
View build.gradle
apply plugin: 'com.android.feature'
...
dependencies {
implementation project(':base')
...
}
@tsmrecki
tsmrecki / build.gradle
Last active Dec 20, 2017
Base module dependencies example
View build.gradle
apply plugin: 'com.android.feature'
android {
baseFeature true
...
}
dependencies {
api 'com.android.support:appcompat-v7:26.0.1'
api 'com.android.support.constraint:constraint-layout:1.0.2'
@tsmrecki
tsmrecki / build.gradle
Last active Dec 18, 2017
App module dependcies example
View build.gradle
apply plugin: 'com.android.application'
...
dependencies {
implementation project(':product')
implementation project(':productlist')
implementation project(':base')
}
@tsmrecki
tsmrecki / AndroidManifest.xml
Last active Dec 20, 2017
Android Instant App activity intent filter example
View AndroidManifest.xml
<activity android:name=".ProductActivity">
<intent-filter
android:autoVerify="true"
android:order="100">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
@tsmrecki
tsmrecki / assetlinks.json
Created Dec 18, 2017
Asset links configuration file example for App Links
View assetlinks.json
@tsmrecki
tsmrecki / Gameplay.cs
Created May 19, 2016
Check for input actions
View Gameplay.cs
void LateUpdate(){
if (GvrViewer.Instance.BackButtonPressed) {
Application.Quit ();
}
if (GvrViewer.Instance.Triggered) {
SomeAction ();
}
}