Bohirjon Akhmedov
08/11/2022, 5:44 AMRohan Maity
08/11/2022, 7:39 AMnavOptions{}
builder does not seem to work for me when using Navigation Kotlin DSL
I am using it like this
fragment<F>(navRouteInfo.getRoute()) {
with(navRouteInfo) {
destinationLabelId?.let { label = context.getString(it) }
Log.d("CHUI", "route options ${navOptions}")
navOptions?.let {
navOptions {
it.popUpToRoute?.let { route ->
Log.d("CHUI", "popup route $route, inclusive ${it.isPopUpToInclusive()}")
popUpTo(route) {
inclusive = it.isPopUpToInclusive()
}
}
}
}
}
But this does not work but when I try to pass NavOptions
in navigate()
like this it works
navController.navigate("${HomeFragment.NAV_ROUTE_INFO.baseRoute}/false", HomeFragment.NAV_ROUTE_INFO.navOptions)
HomeFragment.NAV_ROUTE_INFO.navOptions is NavOptions only
Any other faced similar problem with Navigation Kotlin DSLTepes Lucian Victor
08/11/2022, 8:24 AMbundle.getParcelable
and bundle.getSerializable
were deprecated and i can’t seem to find any core compat method to replace them withSlackbot
08/11/2022, 9:38 AMAlina Dolgikh [JB]
08/11/2022, 3:42 PMSlackbot
08/11/2022, 5:36 PMSlackbot
08/13/2022, 6:39 AMErfannj En
08/13/2022, 10:31 AMRajput Art Studio
08/13/2022, 6:15 PMRohan Maity
08/14/2022, 4:26 AMMohamed Ibrahim
08/14/2022, 8:34 AMstates.accept()
and states is a BehaviorRelay
, in all classes that extends BaseViewModel
, how can I achieve something like this.
I’ve written a the check using visitMethodCall
but this only can check the function name and if it’s member of BehaviorRelay
, the missing part is how to check if this function is being called in children’s of BaseViewModel
Slackbot
08/15/2022, 10:51 PMdarkmatter exe
08/17/2022, 6:49 AMSahel Mulagund
08/17/2022, 12:02 PMMahmoud Ahmed
08/17/2022, 2:26 PMMahmoud Ahmed
08/17/2022, 2:26 PMMahmoud Ahmed
08/17/2022, 3:24 PMYasser AKBBACH
08/18/2022, 2:45 PMJavier
08/19/2022, 11:13 AMCiaran Sloan
08/19/2022, 11:29 AMBen Edwards
08/20/2022, 3:24 PMalthaf
08/21/2022, 4:32 AMyunus emre Çiftçi
08/21/2022, 7:06 PMSangeeth Amirthanathan
08/22/2022, 2:48 AMSangeeth Amirthanathan
08/22/2022, 2:48 AMSangeeth Amirthanathan
08/22/2022, 2:49 AMSangeeth Amirthanathan
08/22/2022, 2:50 AMpackage com.zasa.newcaloriy
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import androidx.recyclerview.widget.LinearLayoutManager
import kotlinx.android.synthetic.main.activity_main.*
import retrofit2.Call
import retrofit2.Callback
import retrofit2.Response
import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory
private const val BASE_URL = "<https://api.spoonacular.com/>"
private const val TAG = "MainActivity"
private const val API_KEY = "5daeba7d6f3045b3affa64e67a2329c3"
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
val meals = mutableListOf<Meal>()
val mealAdapter = MealsAdapter(this, meals)
val retrofit =
Retrofit.Builder().baseUrl(BASE_URL).addConverterFactory(GsonConverterFactory.create())
.build()
val spoonacularService = retrofit.create(SpoonacularService::class.java)
val targetCalories = intent.getStringExtra("targetCalories")
spoonacularService.getMeals("$API_KEY", "day", "$targetCalories")
.enqueue(object : Callback<SpoonacularData> {
override fun onResponse(
call: Call<SpoonacularData>,
response: Response<SpoonacularData>
) {
val body = response.body()
if (body == null) {
Log.w(TAG, "failed to fetch data..")
return
}
Log.i(TAG, "$response")
rvMeals.apply {
meals.addAll(body.meals)
layoutManager = LinearLayoutManager(this@MainActivity)
adapter = mealAdapter
mealAdapter.notifyDataSetChanged()
}
}
override fun onFailure(call: Call<SpoonacularData>, t: Throwable) {
Log.i(TAG, "$t")
}
})
}
}
class MealsAdapter(val context: Context, private val meals : List<Meal>) : RecyclerView.Adapter<MealsAdapter.ViewHolder>() {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
return ViewHolder(LayoutInflater.from(context).inflate(R.layout.item_meal, parent,false))
}
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
val meal =meals[position]
holder.bindMeal(meal)
}
override fun getItemCount() = meals.size
inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView){
fun bindMeal(meal: Meal) {
itemView.findViewById<TextView>(R.id.tvMealTitle).text = meal.title
itemView.findViewById<Button>(R.id.btnGetLink).isClickable = true
itemView.findViewById<TextView>(R.id.tvReadyInMinutes).text = "Ready in Minutes : ${meal.readyInMinutes}"
itemView.findViewById<TextView>(R.id.tvServings).text = "Servings can be ${meal.servings} Members"
}
}
}
Vivek Sharma
08/22/2022, 9:09 AMDeferred Deep Linking
? I searched it can be done using Branch, Adjust, Manually also
So is there any sample or something which can be of help?gts13
08/22/2022, 10:11 AMalthaf
08/22/2022, 11:16 AMauthRepository.logout().catch {
fc.emit(Result.failure(LoginSessionExpiredException()))
}.collect {
fc.emit(Result.failure(LoginSessionExpiredException()))
}
althaf
08/22/2022, 11:16 AMauthRepository.logout().catch {
fc.emit(Result.failure(LoginSessionExpiredException()))
}.collect {
fc.emit(Result.failure(LoginSessionExpiredException()))
}
ephemient
08/22/2022, 11:21 AM.catch { /* ignore */ }.onCompletion {
fc.emit(Result.failure(LoginSessionExpiredException()))
}