uber / uber/RIBs

Cannot push events to the callbacksRelay from child class

Open Beginner friendly
#437 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Android
Dominant language
Kotlin
Stars
7.9k
Forks
914
PR merge metrics
No merged PRs in 30d

Description

Expected Behavior

We should be able to send events to the the callbacksRelay in RibActivity from the child classes that inherit from RibActivity

Current Behavior

Interaction to callbacksRelay is only one way (can listen to it) using the public Observable<ActivityCallbackEvent> callbacks() function but since the Relay is hidden we aren't able to send events to it.

Possible Solution

Create a protected function <function name>(ActivityCallbackEvent event) in RibActivity through which child Activities can send ActivityCallbackEvent

Context (Environment)

In case we have a logical way of sending an ActivityCallbackEvent through any of the system overriden methods lets say onActivityResult then we have to create a local instance of callbacksRelay and override the callbacks() function to return our local instance. In this case we need to re-implement all the other system notifications as well like onTrimMemory, onLowMemory. It's not very obvious and can be future error prone

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with RibActivity and inspect the callbacks() method and its callbacksRelay visibility. Trace how child Activities inherit the class and verify that they can emit ActivityCallbackEvent values without replacing callbacks() or reimplementing system notifications such as onActivityResult, onTrimMemory, and onLowMemory.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.