Skip to content

Commit 4a9e6a0

Browse files
committed
universal links
1 parent 6b78849 commit 4a9e6a0

File tree

5 files changed

+10
-6
lines changed

5 files changed

+10
-6
lines changed

app/src/main/AndroidManifest.xml

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
<action android:name="android.intent.action.MAIN" />
2121
<category android:name="android.intent.category.LAUNCHER" />
2222
</intent-filter>
23+
24+
<nav-graph android:value="@navigation/nav_graph" />
2325
</activity>
2426

2527
</application>

app/src/main/java/com/arctouch/codechallenge/feature/details/DetailsFragment.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ class DetailsFragment : Fragment() {
4242
private fun getMovieByArguments() {
4343
arguments?.let {
4444
val safeArgs = DetailsFragmentArgs.fromBundle(it)
45-
setActionBarTitle(safeArgs.movie.title)
46-
mViewModel.getMovie(safeArgs.movie.id.toLong())
45+
// setActionBarTitle(safeArgs.movie.title)
46+
mViewModel.getMovie(safeArgs.movieId)
4747
}
4848
}
4949

app/src/main/java/com/arctouch/codechallenge/feature/home/HomeFragment.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class HomeFragment : Fragment(), MenuProvider {
8181
}
8282

8383
private fun openDetails(movie: Movie) {
84-
val direction = HomeFragmentDirections.actionHomePagedFragmentToDetailsFragment(movie)
84+
val direction = HomeFragmentDirections.actionHomePagedFragmentToDetailsFragment(movie.id)
8585
view?.let {
8686
Navigation.findNavController(it).navigate(direction)
8787
}

app/src/main/java/com/arctouch/codechallenge/model/Models.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ data class UpcomingMoviesResponse(
1818

1919
@Parcelize
2020
data class Movie(
21-
val id: Int,
21+
val id: Long,
2222
val title: String,
2323
val overview: String?,
2424
val genres: List<Genre>?,

app/src/main/res/navigation/nav_graph.xml

+4-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@
1010
android:name="com.arctouch.codechallenge.feature.details.DetailsFragment"
1111
android:label="@string/movie_detais"
1212
tools:layout="@layout/fragment_details">
13+
14+
<deepLink app:uri="https://sample.com/movie/{movieId}"/>
1315
<argument
14-
android:name="movie"
15-
app:argType="com.arctouch.codechallenge.model.Movie" />
16+
android:name="movieId"
17+
app:argType="long" />
1618
</fragment>
1719
<fragment
1820
android:id="@+id/homePagedFragment"

0 commit comments

Comments
 (0)