Skip to content
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

Support for small screen sizes needed (task #467316) #36

Closed
dephan opened this issue Jun 18, 2010 · 20 comments
Closed

Support for small screen sizes needed (task #467316) #36

dephan opened this issue Jun 18, 2010 · 20 comments

Comments

@dephan
Copy link

dephan commented Jun 18, 2010

If you have a smaller screen the login dialog will not display all the information. Try using 240x320 pixels for example. The login button is outside the screen!

IOP testing?
http://en.wikipedia.org/wiki/Interoperability

@soneff
Copy link

soneff commented Jun 18, 2010

Ya, this is a known issue -- I've asked our designer for another version of the dialogs that will work on small screens (and to simplify the existing dialogs), but there is no ETA.

@skreeky
Copy link

skreeky commented Jun 19, 2010

Hi, I got the same problem trying to login from an HTC Tattoo. The screen is too small. Is this an issue with the web page coming from Facebook? I tried changing the portrait size in the SDK code and/or setting display=wap instead. Nothing helped to fully fix the problem. display=wap made the buttons visible but the login was run in the web browser...

@dephan
Copy link
Author

dephan commented Jun 21, 2010

The issue is actually that the javascript run in the webview asks the phone browser for screen dimensions. The phone browser reports its actual size (full size including the status bar) and then the javascript sizes itself accordingly.

It's not a problem for larger screens as there is slack enough for the items to fit anyway. Thus, the hardcoded values in the dialog have zero effect on the size on screen.

@skreeky
Copy link

skreeky commented Jun 22, 2010

After some testing I ended up commenting out the line setLayoutParams(FILL) call in setUpWebView(). Now the buttons are shown on an HTC Tattoo with small screen. It is not nice, but it works for now. Time to release our app :-)

@lshepard
Copy link

If you migrate your app to the new data permissions, then you should find a much nicer login flow that works on a smaller screen.

@skreeky
Copy link

skreeky commented Jun 27, 2010

What is involved in migrating to the new data permissions? Can you provide a link or an example?

@dephan
Copy link
Author

dephan commented Jun 28, 2010

No, that does not help. I'm using the new data permissions already.

@dephan
Copy link
Author

dephan commented Jun 28, 2010

This issue is solved after the server-side update.

@skreeky
Copy link

skreeky commented Jun 28, 2010

Server-side update = changes on the facebook.com side?

@SteveMil
Copy link

It is still an issue for us. We are getting reports from customers on phones like the Tattoo and X10 mini. The issue for us is not the sign-in dialog (which now looks really ugly), but the permissions dialog.

We are using the new permissions and are asking for "publish_stream" and "offline_access". The permissions dialog doesn't have enough room to show the "Don't Allow" and "Allow" buttons.

I've tried scrolling down, but scrolling is not supported with the current SDK code and permissions page. I've tried using the keyboard to get to the off-screen "Accept" button, but Android doesn't allow the user to click on off-screen buttons/links. On other devices where I can see the "Allow" button, I can DOWN arrow to the bottom, press RIGHT once, then press ENTER. Doesn't work on the LDPI screens where the button is not visible. I've tried flipping between landscape and portrait as well, but can never get to the "Accept" button.

At this point, we have nothing helpful to tell customers. We'll probably have to make a code change to work around the issue and do another release.

@dephan
Copy link
Author

dephan commented Jul 14, 2010

skreeky: Yes, they (facebook.com) changed the layout of the login java script we are accessing.
SteveMil: I did a workaround locally for the problem that worked. The problem is tied to the fact that the webview the sdk is using is connected to the browser in the phone (or its user_agent). When the java script runs in the webview and queries for screen size it gets the full pixel size of the screen (and not the size of the webview window). This means that you end up with a javascript that assumes it has the whole screen while it actually doesn't. We have status bar and a frame around the view and so on..

The workaround is to change the dialog into a separate activity instead of extending Dialog. In you manifest.xml you can set this activity to have fullscreen mode (no status bar), and thus the correct size is given to the script and everything will fit on the screen.

@SteveMil
Copy link

Thanks for the tip dephan. I'll look into making the change (I'd still prefer to keep it as a dialog and have Facebook do the work-around on their side :). I need to make a code change anyway since I just realized the Facebook client crashes on OS 1.5, and the only fix to that is a code change.

@badmetacoder
Copy link

Skip and Publish buttons do not appear on the bottom of the stream.publish dialog. on small screens (QVGA).

@ghost
Copy link

ghost commented Sep 30, 2010

When is support for small screens coming?

@ChrisDavis8
Copy link

I detected that the screen was small and set the dimensions to 240x320 in fbdialog.java
When the permission page was displayed it was not perfect but the buttons were visible and I could scroll the page, cant work out what it is that allows the scroll though; maybe the page width??

@ghost
Copy link

ghost commented Oct 12, 2010

I found that the web view didnt have any focus which prevented the scrolling.
mWebView.requestFocus(); in the setupWebView method seemed to help

@SteveMil
Copy link

Thanks people. There was enough info in this thread for me to fix the issue on my side. Like others have eluded to, the problem is that the SDK has two hard-coded sizes for the content view of the dialog. If the view is larger than the max dialog size (always true on LDPI), then the browser control just gets clipped by the dialog. The reason you cannot scroll is that the web control doesn't think it needs to scroll since it is physically large enough to hold the entire website (even though it is clipped by the dialog).

The quick fix for me was to just change the math for how they compute the size in FbDialog.onCreate(). I'm passing this to the LayoutParams constructor...

display.getWidth() - (int)((float)26 * scale),
display.getHeight() - (int)((float)51 * scale)

Those values generate the largest possible view that a dialog can contain on LDPI, MDPI, and HDPI (both 800 and 854 high screens) for both portrait and landscape modes.

The only other issue I had was screen rotation (my AndroidManifest.xml allows this without a dialog restart). So, whenever I detect the screen rotated, I just call setLayoutParams on the content view again and that fixes the dialog up.

@ghost
Copy link

ghost commented Oct 15, 2010

When publishing a wall post does the image associated with the wall post get up-scaled if its too small as that's what appears to happen in my tests.
I generally have an image that is 128x128 for the larger screens and that appears OK on MDPI and HDPI screens but on LDPI that dialog data appeared mangled and when I tried smaller images they appeared much larger than they should be for such a small screen which made me think Facebook might be stretching the images to make them larger.

@jimbru
Copy link
Contributor

jimbru commented Mar 17, 2011

This issue should be resolved with my latest commit: 5d44d0c

Hopefully this will be a useful fix. If the issue persists for anyone, feel free to comment here.

@skreeky
Copy link

skreeky commented Mar 17, 2011

Hi!

Thank you for emailing info@skreeky.com.
We will have a look at your email and get back to you when possible.

Regards,
The Skreeky Team

rotorgames pushed a commit to rotorgames/facebook-android-sdk that referenced this issue Aug 2, 2022
[android] Update to use v4.22.0 of the SDK
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants