Skip to content

Commit

Permalink
start with routing implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
LukaKordic committed Jul 23, 2019
1 parent 0c1287c commit 50a041c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
14 changes: 14 additions & 0 deletions app/src/main/java/com/cobeisfresh/template/routing/AppNavigator.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.cobeisfresh.template.routing

import android.content.Intent
import com.cobeisfresh.template.ui.weather.base.BaseActivity
import com.cobeisfresh.template.ui.weather.view.WeatherActivity

class AppNavigator(private val activity: BaseActivity) : Navigator {

override fun showWeather() = navigateTo(getIntent<WeatherActivity>())

private fun navigateTo(intent: Intent) = activity.startActivity(intent)

private inline fun <reified T : BaseActivity> getIntent() = Intent(activity, T::class.java)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.cobeisfresh.template.routing

interface Navigator {

fun showWeather()
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.example.data.networking.base

import com.example.domain.model.HttpError
import com.example.domain.model.Result
import retrofit2.Response

abstract class NetworkResult<out T : Any> : Mapper<T>
Expand Down

0 comments on commit 50a041c

Please sign in to comment.