How does the Gmail Android app do the webview-header-overlay magic for the mail-conversation view?

后端 未结 1 432
时光说笑
时光说笑 2021-02-06 17:15

Using hierarchyviewer on the Gmail conversation view shows an interesting and unusual layout hierarchy:

  • All messages in a single conversation are
相关标签:
1条回答
  • 2021-02-06 18:08

    Incidentally, the only approach I can think of is javascript-based - use javascript in the WebView to gather the header coordinates, and then use WebView.addJavascriptInterface() to pass those coordinates on to Java and the HybridConversationScrollContainer. I haven't tried doing this myself though so I'm not sure if it could actually work.

    There is a short post on the android Developer blog talking about the addJavascriptInterface() method:

    http://android-developers.blogspot.com/2008/09/using-webviews.html

    It would be wonderful if MessageHeaderScrollView could be released as an open-source library - I'd use it! - but seeing as the Gmail app is closed, it doesn't seem immediately likely.

    0 讨论(0)
提交回复
热议问题