You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2022/07/11 17:11:48 UTC

[GitHub] [cordova-android] SachinGhagare opened a new issue, #1459: After accepting the permission on Android, The start page (/www/index.html) is painted with a opaque view.

SachinGhagare opened a new issue, #1459:
URL: https://github.com/apache/cordova-android/issues/1459

   # Bug Report
   The start page (/www/index.html) is having a opaque view. 
   
   ## Problem
   The start page (/www/index.html) is painted with a opaque view [grayed colored mask]. This happens only after accepting the android permission and calling `loadurl()`.
   
   ### What is expected to happen?
   Should paint the defined color in the css. In the attached screen shot, the background color is defined with `#222222`  /www/css/index.css. Same color should be painted on the launch of start page.
   
   
   ### What does actually happen?
   It is painted with layer of grayed colored on top of the start page.
   
   
   ## Information
   Created a [sample application](https://cordova.apache.org/docs/en/latest/guide/cli/index.html). Added the request permission functionality using`setContentView` with a layout resource defined in the res/layout/layout.xml.  Once Permission is enabled calling the `loadUrl()`. 
   On start page could see, the  gray colored layer.
   However on swipe kill/Force Stop the issue is not observed. The start page is loaded properly with defined color in the css file.
   
   Before Swipe kill or Force Stop.
   <img src="https://user-images.githubusercontent.com/33626630/178317275-8e747fb8-a10f-47cf-969e-248d98890959.png" width="250" height="400">
   
   After Swipe kill or Force Stop.
   <img src="https://user-images.githubusercontent.com/33626630/178317085-d44d16c3-d652-401c-9bd0-7ca2f0d36448.png" width="250" height="400">
   
   Video:
   https://user-images.githubusercontent.com/33626630/178315761-ffda3196-59e3-4a37-8321-d3f04e09bf7e.mp4
   
   
   ### Command or Code
   Sample Application can be refered at:  https://github.com/SachinGhagare/cordovaSampleApp.git
   
   
   
   ### Environment, Platform, Device
   In Android device issue is observed. Checked on few Devices on all devices issue is observed. [Android 9 and Android 10 version]
   
   
   ### Version information
   `cordova platform ls`
   Installed platforms:
   android 10.1.2
   
   Operating System : Windows. [Not sure on Xcode is observred. I have tried on Windows]
   Android Studio : Chipmunk 
   
   
   ## Checklist
   
   - [x] I searched for existing GitHub issues
   - [x] I updated all Cordova tooling to most recent version
   - [x] I included all the necessary information above, Sample application git repo link, Screen Shot and Video
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] breautek commented on issue #1459: After accepting the permission on Android, The start page (/www/index.html) is painted with a opaque view.

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #1459:
URL: https://github.com/apache/cordova-android/issues/1459#issuecomment-1186081268

   > @breautek I didn't get you, custom Android version? Can you please elaborate,.!
   
   Going by memory now... but
   
   `git diff` command shows that the native cordova sources outside of the template files have differences compared to cordova-android@10.1.2 official release. If I recall correctly, it was a onPermission handler method that has differences.
   
   I believe the app layout was also modified if I recall correctly.
   
   Making changes to the native sources is fine under the Apache license, but attempting to provide support to custom versions is a nightmare. Realistically bug reports should only be raised against official versions of cordova-android.
   
   Like I said before, if you're attempting to extend the platform by creating a plugin, or something to that effect, a better place to ask questions is our [Slack Community](https://join.slack.com/t/cordova/shared_invite/zt-z70vy6tx-7VNulesO0Qz0Od9QV4tc1Q)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] SachinGhagare commented on issue #1459: After accepting the permission on Android, The start page (/www/index.html) is painted with a opaque view.

Posted by GitBox <gi...@apache.org>.
SachinGhagare commented on issue #1459:
URL: https://github.com/apache/cordova-android/issues/1459#issuecomment-1184785767

   @breautek 
   
   Found that removing the `this.appView.getView().requestFocusFromTouch();` is solving issue.
   
   Can you please explain, why `requestFocusTouch()` needed ?
   **Want to understand is that really needed?**
   
   `    //Suppressing warnings in AndroidStudio
       @SuppressWarnings({"deprecation", "ResourceType"})
       protected void createViews() {
           //Why are we setting a constant as the ID? This should be investigated
           appView.getView().setId(100);
           appView.getView().setLayoutParams(new FrameLayout.LayoutParams(
                   ViewGroup.LayoutParams.MATCH_PARENT,
                   ViewGroup.LayoutParams.MATCH_PARENT));
   
           setContentView(appView.getView());
   
           if (preferences.contains("BackgroundColor")) {
               try {
                   int backgroundColor = preferences.getInteger("BackgroundColor", Color.BLACK);
                   // Background of activity:
                   appView.getView().setBackgroundColor(backgroundColor);
               }
               catch (NumberFormatException e){
                   e.printStackTrace();
               }
           }
   
           appView.getView().requestFocusFromTouch();
       }`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] breautek commented on issue #1459: After accepting the permission on Android, The start page (/www/index.html) is painted with a opaque view.

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #1459:
URL: https://github.com/apache/cordova-android/issues/1459#issuecomment-1180687762

   You're using a custom/modified version of cordova-android. Apache cannot provide support or address issues against non-apache versions of cordova-android. Note that Apache uses GitHub Issues for tracking issues only.
   
   If you're attempting to create a plugin or extend the platform, community members on our [Slack](https://join.slack.com/t/cordova/shared_invite/zt-z70vy6tx-7VNulesO0Qz0Od9QV4tc1Q) may be able to help. Otherwise, general android development might be better suited on Q/A sites such as [StackOverflow](https://stackoverflow.com).
   
   Kind regards,
   Norman


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] breautek commented on issue #1459: After accepting the permission on Android, The start page (/www/index.html) is painted with a opaque view.

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #1459:
URL: https://github.com/apache/cordova-android/issues/1459#issuecomment-1186080315

   Code was added by https://github.com/apache/cordova-android/commit/d99856c52b6474d6fdef0329e38e2b4d6c55a317 8 years ago, included in cordova-android v4 release... Long before I became a contributor.
   
   Attached jira tag is ticket [CB-8510](https://issues.apache.org/jira/browse/CB-8510) which appears to be syncing code between cordova webview and an `XWalkWebview` implementation.
   
   The [Android Docs](https://developer.android.com/reference/android/view/View#requestFocusFromTouch()) states
   
   > Call this to try to give focus to a specific view or to one of its descendants. This is a special variant of [requestFocus()](https://developer.android.com/reference/android/view/View#requestFocus()) that will allow views that are not focusable in touch mode to request focus when they are touched.
   
   `appView` I believe is the view that holds the `WebView` component, I'm just taking a wild guess but probably has something to do with giving the webview focus so it will began handling native events, without an explicit touch from the user.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] SachinGhagare commented on issue #1459: After accepting the permission on Android, The start page (/www/index.html) is painted with a opaque view.

Posted by GitBox <gi...@apache.org>.
SachinGhagare commented on issue #1459:
URL: https://github.com/apache/cordova-android/issues/1459#issuecomment-1184810261

   > You're using a custom/modified version of cordova-android. Apache cannot provide support or address issues against non-apache versions of cordova-android. Note that Apache uses GitHub Issues for tracking issues only.
   > 
   > If you're attempting to create a plugin or extend the platform, community members on our [Slack](https://join.slack.com/t/cordova/shared_invite/zt-z70vy6tx-7VNulesO0Qz0Od9QV4tc1Q) may be able to help. Otherwise, general android development might be better suited on Q/A sites such as [StackOverflow](https://stackoverflow.com).
   > 
   > Kind regards, Norman
   
   
   removing the appView.getView().requestFocusFromTouch();, is solving issue.
   @breautek can you please explain why that is needed?
   
   Wanted to understand is requestFocusFromTouch really needed?
   ```
       //Suppressing warnings in AndroidStudio
       @SuppressWarnings({"deprecation", "ResourceType"})
       protected void createViews() {
           //Why are we setting a constant as the ID? This should be investigated
           appView.getView().setId(100);
           appView.getView().setLayoutParams(new FrameLayout.LayoutParams(
                   ViewGroup.LayoutParams.MATCH_PARENT,
                   ViewGroup.LayoutParams.MATCH_PARENT));
   
           setContentView(appView.getView());
   
           if (preferences.contains("BackgroundColor")) {
               try {
                   int backgroundColor = preferences.getInteger("BackgroundColor", Color.BLACK);
                   // Background of activity:
                   appView.getView().setBackgroundColor(backgroundColor);
               }
               catch (NumberFormatException e){
                   e.printStackTrace();
               }
           }
   
           appView.getView().requestFocusFromTouch();
       }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] SachinGhagare commented on issue #1459: After accepting the permission on Android, The start page (/www/index.html) is painted with a opaque view.

Posted by GitBox <gi...@apache.org>.
SachinGhagare commented on issue #1459:
URL: https://github.com/apache/cordova-android/issues/1459#issuecomment-1180767569

   @breautek 
   I didn't get you, custom Android version? 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] breautek closed issue #1459: After accepting the permission on Android, The start page (/www/index.html) is painted with a opaque view.

Posted by GitBox <gi...@apache.org>.
breautek closed issue #1459: After accepting the permission on Android, The start page (/www/index.html) is painted with a opaque view.
URL: https://github.com/apache/cordova-android/issues/1459


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org