Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Christian Vivas Santiago
    @christian130
    this
    ```
     @Override
                public synchronized void onNext(Task task) {
                    //progressBar.setProgress(progress);
                    int n = counter.incrementAndGet();
                    float g = (((float) n / 5) * 100);
    
    
                    Log.d("OnNext", "called from OnNext()" + Thread.currentThread().getName());
                    Log.d("Counting", "this is what i've counted" + Integer.toString(n));
                    Log.d("percentage", "this is the percentage" + Integer.toString((int) g));
                    progressBar.setProgress((int) g);
                    textView.setText("" + (int) g + "%");
    
    
                    Log.d("OnNext: ", "called from OnNext() with a POJO Task named task" + task.getDescription());
    
    
                }
    in the last item is never called
    i mean is called the Logger... but the components textView and progressBar are not called
    are not changed... for that last item in particular...
    Christian Vivas Santiago
    @christian130
    the list is simple as List<Task> mylist= new ArrayList<Task>();
    something like that...
    Ignacio Baca Moreno-Torres
    @ibaca
    if the logger is called, then this is not a Rx problem
    Christian Vivas Santiago
    @christian130
    @ibaca the logger is calling... but the textView and the progressBar controllers does not change
    you call pull the entirely project in my github
    the last one
    i've just uploaded it...
    you can git clone that
    and then open it with android studio
    but you can surf the entire project
    Ignacio Baca Moreno-Torres
    @ibaca
    but you have rx or android doubts? bc this is a rx group :grimacing:
    if your are learing rx, just create a simple test case or a main
    Christian Vivas Santiago
    @christian130
    @ibaca i'm just doing the codingwithmitch course... and i just mixed what i know with the actual Rx
    Ignacio Baca Moreno-Torres
    @ibaca
    so you say that Log.d("Counting", "this is what i've counted" + Integer.toString(n)); gets executed correctly?
    but progressBar.setProgress((int) g); doesn’t update the progressBar?
    Christian Vivas Santiago
    @christian130
    @ibaca yes
    the progressBar does not update in the last item
    of the simple list
    the list is a simple generic list containg a POJO
    with the name of Task
    and implements an ArrayList normal... simple...
    but i cannot figure out why in the last item it passes from onNext directly to onComplete without making the change in the UI for 60 percentage
    so you say that Log.d("Counting", "this is what i've counted" + Integer.toString(n)); gets executed correctly? @ibaca yes
    but progressBar.setProgress((int) g); doesn’t update the progressBar? @ibaca yes
    Ignacio Baca Moreno-Torres
    @ibaca
    what do you see in the textView?
    Christian Vivas Santiago
    @christian130
    @ibaca i see the percentage
    Ignacio Baca Moreno-Torres
    @ibaca
    what percentage?
    Christian Vivas Santiago
    @christian130
    @ibaca for building the progress bar
    in order to setProgress
    Ignacio Baca Moreno-Torres
    @ibaca
    the number, what number do you see at the end?
    Christian Vivas Santiago
    @christian130
    progressBar.setProgress()
    in this case i see in the logcat 60 percentage
    which is good
    Ignacio Baca Moreno-Torres
    @ibaca
    uhm, no idea, it really looks like everithing works as expected… if you really think progressBar is not updating then you better ask in a android group :wink:
    Christian Vivas Santiago
    @christian130
    it calculates given five items... and then it converts it to percentage due to the division of that number... all depends on if i give it isComplete true or false... but is always gives you the division by 5 because there are five items... if i go to DataSource file and then i changed to true the isComplete constructor... then it should be 20,40,60,80,100 and so on...
    @ibaca no.. but i've just changed the size of the list to two... and the last one is not updating...
    i think it have to be something with the Rx implementation
    and i'm sure of it..
    i think i'll have to skip this issue until i figure this out in the future... Rx is a total unknown universe and pretty they are
    but i dont know why it shows in the logger and not updating the UI
    and i forces it to run in the ui by RunUiThread
    but is already running in the ui thread
    this
    .observeOn(AndroidSchedulers.mainThread());
    it's executing the subscriber in the main
    Christian Vivas Santiago
    @christian130
    I figured out to use Rx and also the ProgressBar across with the textView using an iteration technique with the manual create "Observable"... in this https://github.com/christian130/ReactProgramming/tree/lesson03