Giter Site home page Giter Site logo

Comments (5)

adhiamboperes avatar adhiamboperes commented on August 16, 2024

This is caused by ImeOptions. We don't have many screens that implement that, but the focus should be on the ones that set IME_ACTION_NEXT(pin creation) because they likely try to automove to next edittext, while the softkeyboard is still showing.

See https://stackoverflow.com/a/47991577/11396524

from oppia-android.

elin4046 avatar elin4046 commented on August 16, 2024

I'm having some trouble reproducing this bug, can anyone assist? This is what I've investigated so far:

My understanding of how the bug can be reproduced is as follows:

Given a TextInputEditText with imeOptions set to actionNext
Given another view below it that is not focusable, not visible, or disabled
When a user focuses on TextInputEditText, bringing up the soft keyboard, and presses the '|->' action button in the bottom right corner of the keyboard
Then the exception is thrown since the system attempts to jump to the other view which cannot be focused

Based on a code search query android:imeOptions="actionNext", I've identified 4 potential activities where this bug can take place:
Screenshot 2024-07-11 at 10 52 52 AM

  • I didn't find anything suspect in the profile reset PIN and admin PIN activities, and they seem configured properly (each screen has two TextInputEditTexts; the one on top of the other has the "actionNext" attribute, and the one directly below it has "actionDone"). There also doesn't seem to be a way to make a view unfocusable on these activities.

  • I suspected Add profile activity would be the culprit because there's a checkbox that sets the visibility of two TextInputEditText fields, but I wasn't able to reproduce the error with these steps (on Android 14 emulator):

    add_profile

  • The enter PIN password activity seems to be misconfigured as the screen contains a single TextInputEditText view, but the imeOption is still set to "actionNext." However, there doesn't seem to be any side effect of this either, and I can't reproduce the bug here.
    Screenshot 2024-07-11 at 1 22 57 PM

Any next steps from here? I'm new to Android development, so I'm not sure what else I should be looking for to get a reproduction.

from oppia-android.

adhiamboperes avatar adhiamboperes commented on August 16, 2024

@elin4046, thanks for looking into this. Some reasons why a view may not be focussable are:
Non-focusable Views: The view you are trying to focus on is not focusable. This can happen if the view’s focusable attribute is set to false or if the view is not focusable in touch mode.

  • View is Invisible or Gone: If the view is not currently visible (View.GONE or View.INVISIBLE), it cannot receive focus.
  • View is Disabled: A view that is disabled (View.setEnabled(false)) cannot receive focus.
  • View Not in Focusable Layout: The view is not within a focusable layout, or the layout itself is not focusable.
  • Parent View Issues: The parent view of the view you are trying to focus on is not focusable, or there is an issue with the focus properties of the parent view.
  • Focus Order Issues: There might be a problem with the focus order, especially if you are dynamically adding views to the layout and setting focus.
  • Race Conditions: If you are trying to set focus before the view hierarchy is fully laid out, it can cause this exception. This can often be resolved by ensuring that focus is set at an appropriate time, such as after the layout pass.

Given that you have already investigated the first 3, and I tried looking a bit into Focus Order Issues, it maybe one of the other two. But those are situational and would be really difficult to reproduce, e.g if a device is low on storage or memory, then the app might slow down/freeze.

This indicates that this issue would rarely occur, and we can put off trying to fix it for now. If however, we receive more crash reports, then we can investigate further.

Would you like to select another issue, or would you like me to assign you something else?

from oppia-android.

elin4046 avatar elin4046 commented on August 16, 2024

Hi @adhiamboperes, thanks for the info, makes sense to depriortize this effort then. You can assign this issue to me, #4312, and I'll take a stab at it

from oppia-android.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.