-
-
Notifications
You must be signed in to change notification settings - Fork 292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated context for Nougat and newer devices #197
Conversation
I'll look at this PR shortly. I'm rather busy at the moment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not quite sure why this is needed. I'm running this library on multiple N devices and I'm having no errors / issues.
I ran it on Samsung galaxy S7 and it was returning DecorContext. I think I still need to figure out why did that happen. |
@rubengees did this in #97 and AFAIR he took that method from the support library. Would be interesting to see whether they changed their implementation too or whether it's still the same. |
Any news? |
I tested on a couple of Nougat devices and most of them are returning |
Their code is still the same. |
So I guess we should leave it too? |
Can you test it on any device - say google nexus 6p - v7.1.2 in genymotion and see as it returns |
I guess it is not safe to assume an context(esp. from rootView) would always return an Activity. We can simply keep this |
I'll test it out tomorrow-ish, do I need to use the multi screen feature? |
okay, no prob! No just make sure to debug the context while testing on genymotion on Nougat devices. |
Will this also occur on normal devices or just when used together with Genymotion? |
It occurs on Nougat and above - be it genymotion or hardware devices and I have seen that. My app was causing anr's on multiple devices due to the while check. Shall I send you a screenshot of the DecorContext while debugging ? |
I ran Emoji on the normal AVD simulator image with API 25 and had no problems :/ Could it be that the layout is somehow different? |
Which device image did you test on ? Was it a generic or ones from the genymotion ? I guess so and I mentioned earlier that some of the devices didn't show that behaviour |
Device: 2.7 QVGA Api 25 Which one are you using? I'm still not that convinced that we need this change especially if the support lib still has the same code as we do plus. |
Can you download and test on this image in genymotion - google nexus 6p - v7.1.2 for once. If it doesn't occur then this merge shouldn't be necessary. |
I don't have genymotion installed anymore. Also it's not the official simulator. The google ones have become pretty good these days and if on those devices you can find the same behavior feel free to reopen this one. Otherwise I'll close this. Also I've always had a few problems with the keyboard on Genymotion and decided to not use it for developing this, instead you can just use a normal android smartphone. |
Okay will reopen this in case I face it on any other device:) |
Hi, I'm new to github as a developer, so maybe I'll need some assistance to fix things.. |
Okay, just saw the debugger screenshot. I'll try to see what's hapenning inside for me and update |
I guess that's what is caused due to the multi window mode |
Gosh, so then I think I'll have to update it :) guys I'll ask your help.
Haven't committed a single line in here
…On Oct 22, 2017 19:55, "Debdeep Ganguly" ***@***.***> wrote:
I guess that's what is caused due to the multi window mode
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#197 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AHyHYqZFZVO_3XAXfz9qYepDTzywKmLPks5su3OXgaJpZM4PHwtu>
.
|
Got it. Here is it: I am passing an actual activity and here if this is an activity, id doesn't even enter the while loop. Gotta try it, but maybe am I wrong? Anyone?
Get Outlook for Android<https://aka.ms/ghei36>
…________________________________
From: Debdeep Ganguly <notifications@github.com>
Sent: Sunday, October 22, 2017 7:55:51 PM
To: vanniktech/Emoji
Cc: VitaliPom; Comment
Subject: Re: [vanniktech/Emoji] Updated context for Nougat and newer devices (#197)
I guess that's what is caused due to the multi window mode
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#197 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AHyHYqZFZVO_3XAXfz9qYepDTzywKmLPks5su3OXgaJpZM4PHwtu>.
|
Changed the argument of
asActivity
inside theEmojiPopup
constructor to pass the root view.Changed the parameter of
asActivity()
in theUtils
class to accept view instead of context.Added code for Nougat and later for getting context.
For Nougat and later,
rootView.getContext()
returns an instance ofDecorContext
and not anActivity
, so now the execution will not stop inside the while loop causing an anr.