Skip to content

Instantly share code, notes, and snippets.

View sergpetrov's full-sized avatar

Sergei Petrov sergpetrov

  • London, UK
View GitHub Profile
<fragment
android:id="@+id/subscriptions_fragment"
android:name="com.company.SubscriptionsFragment">
<deepLink app:uri="company.com/user/subscriptions" />
</fragment>
<fragment
android:id="@+id/profile_fragment"
android:name="com.company.ProfileFragment">
<deepLink app:uri="company.com/user/.*" />
...
</fragment>
<fragment
android:id="@+id/favorites_fragment"
android:name="com.company.FavoritesFragment">
<deepLink app:uri="company.com/customer/favorites" />
<deepLink app:uri="staging-company.com/customer/favorites" />
</fragment>
<fragment
android:id="@+id/favorites_fragment"
android:name="com.company.FavoritesFragment">
<deepLink app:uri="${deepLinkHost}/customer/favorites" />
</fragment>
override fun onNewIntent(intent: Intent?) {
super.onNewIntent(intent)
navController.handleDeepLink(intent)
}
staging {
manifestPlaceholders = [scheme: "https", host: "staging-company.com"]
}
prod {
manifestPlaceholders = [scheme: "https", host: "company.com"]
}
<fragment
android:id="@+id/video_fragment"
android:name="com.company.VideoFragment">
<deepLink android:autoVerify="true" app:uri="company.com/videos/{videoId}" />
<deepLink android:autoVerify="true" app:uri="company.com/.*/videos/{videoId}" />
<deepLink android:autoVerify="true" app:uri="company.com/.*/collections/videos/{videoId}" />
<deepLink android:autoVerify="true" app:uri="company.com/user/videos/{videoId}" />
<deepLink android:autoVerify="true" app:uri="staging-company.com/videos/{videoId}" />
<deepLink android:autoVerify="true" app:uri="staging-company.com/.*/videos/{videoId}" />
import android.graphics.Canvas
import android.graphics.Rect
import android.support.v7.widget.RecyclerView
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
/**
* Created with Android Studio
* User: Sergey Petrov s.a.petrov.spb@gmail.com