If you look at Jira for issue MSA-51, you will see that I added some code to allow an option to turn on the standard zoom controls for the webview so we can use them them to fast scroll a chapter. This works well on my G1 in Android 1.6, but on an HTC Hero on 1.5 it shows the button but tapping it doesn't bring up the zoom box. In an emulator running 2.1 I only get the zoom controls with no button for bringing up the zoom box. We may have to come up with a different way of allowing fast scroll that works on all versions.
Can anyone shed any more light on this for me? Any ideas?
Fast Scroll in Chapter View (MSA-51)
- jackcholt
- New Member
- Posts: 34
- Joined: Mon Nov 23, 2009 8:55 am
- Location: Fallbrook, CA, USA
-
- New Member
- Posts: 17
- Joined: Mon Apr 19, 2010 1:53 pm
- Location: Orem, UT, USA
My Nexus One behaves the same way as the emulator -- only shows -/+ zoom buttons, not a zoom box. Not sure where that went. I can't recall whether I've seen it recently in the 2.1 web browser either.jackcholt wrote:If you look at Jira for issue MSA-51, you will see that I added some code to allow an option to turn on the standard zoom controls for the webview so we can use them them to fast scroll a chapter. This works well on my G1 in Android 1.6, but on an HTC Hero on 1.5 it shows the button but tapping it doesn't bring up the zoom box. In an emulator running 2.1 I only get the zoom controls with no button for bringing up the zoom box. We may have to come up with a different way of allowing fast scroll that works on all versions.
Can anyone shed any more light on this for me? Any ideas?
- jackcholt
- New Member
- Posts: 34
- Joined: Mon Nov 23, 2009 8:55 am
- Location: Fallbrook, CA, USA
-
- New Member
- Posts: 6
- Joined: Sun Apr 18, 2010 3:49 pm
- Location: Orem, UT, USA
I got to playing with it and ended up looking at the source code for how it is done in listview. I ended up copying what they did there and creating a subclass of WebView that supports the fast scroll thumb so that it looks, feels, and behaves pretty much exactly like the ListView. Check it out and let me know what you think.
We might want to take it a little farther and show an overlay with the verse number at the top, like Contacts does with the alphabet.
Also might want to adjust how large a chapter needs to be before it really needs the thumb to display. Right now it will display when the chapter is 4x the height of the viewport or greater (same as ListView), but I think that might be a little too aggressive.
We might want to take it a little farther and show an overlay with the verse number at the top, like Contacts does with the alphabet.
Also might want to adjust how large a chapter needs to be before it really needs the thumb to display. Right now it will display when the chapter is 4x the height of the viewport or greater (same as ListView), but I think that might be a little too aggressive.
- jackcholt
- New Member
- Posts: 34
- Joined: Mon Nov 23, 2009 8:55 am
- Location: Fallbrook, CA, USA
Thank you, thank you Shon. That is exactly what I had in mind. I like it because it is consistent with the way fast scroll works in the listView. Which makes the app internally consistent. Always a plus. This should make the brethren happy. This is the kind of technology that companies usually make employees sign NDA's to protect.
-
- New Member
- Posts: 17
- Joined: Mon Apr 19, 2010 1:53 pm
- Location: Orem, UT, USA
Looks great! I think this is a very nice feature, and it basically takes the approach I was talking about (creating a transparent overlay).
I did discover an issue on the Nexus One. It turns out that the fast-scroll thumb is too small on hi-res devices, and I guess it's too big on low-res devices. We need to scale the graphics according to the device resolution. But the API's we want are in Android 1.6, not 1.5. So I made a change to WebViewFastScroller.java to use the reflection API to see if we have density information, and if so to scale on devices that don't use the default density.
This also explains what's been happening on verse positioning. See the bug I posted on JIRA for more info. We need to scale our scroll parameters according to the device display density as well. I'll see if I can find some time to figure this out more. ScriptureViewActivity and WebViewFastScroller both need some work to scale scroll positions appropriately.
I did discover an issue on the Nexus One. It turns out that the fast-scroll thumb is too small on hi-res devices, and I guess it's too big on low-res devices. We need to scale the graphics according to the device resolution. But the API's we want are in Android 1.6, not 1.5. So I made a change to WebViewFastScroller.java to use the reflection API to see if we have density information, and if so to scale on devices that don't use the default density.
This also explains what's been happening on verse positioning. See the bug I posted on JIRA for more info. We need to scale our scroll parameters according to the device display density as well. I'll see if I can find some time to figure this out more. ScriptureViewActivity and WebViewFastScroller both need some work to scale scroll positions appropriately.