mirror of
https://github.com/moparisthebest/k-9
synced 2025-01-31 15:20:09 -05:00
Better solution coming up!
Revert "Added fallback for when WebView.setEmbeddedTitleBar() is not available"
This reverts commit 6073b9d3fa
.
This commit is contained in:
parent
91d404350f
commit
17a6f79365
@ -164,9 +164,15 @@ public class MessageWebView extends WebView {
|
||||
}
|
||||
}
|
||||
|
||||
public void wrapSetTitleBar(final View title) throws Exception {
|
||||
Class<?> webViewClass = Class.forName("android.webkit.WebView");
|
||||
Method setEmbeddedTitleBar = webViewClass.getMethod("setEmbeddedTitleBar", View.class);
|
||||
setEmbeddedTitleBar.invoke(this, title);
|
||||
public void wrapSetTitleBar(final View title) {
|
||||
try {
|
||||
Class<?> webViewClass = Class.forName("android.webkit.WebView");
|
||||
Method setEmbeddedTitleBar = webViewClass.getMethod("setEmbeddedTitleBar", View.class);
|
||||
setEmbeddedTitleBar.invoke(this, title);
|
||||
}
|
||||
|
||||
catch (Exception e) {
|
||||
Log.v(K9.LOG_TAG, "failed to find the setEmbeddedTitleBar method",e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -160,19 +160,7 @@ public class SingleMessageView extends LinearLayout implements OnClickListener,
|
||||
|
||||
mTitleBarHeaderContainer = new LinearLayout(activity);
|
||||
mTitleBarHeaderContainer.addView(mHeaderContainer);
|
||||
try {
|
||||
mMessageContentView.wrapSetTitleBar(mTitleBarHeaderContainer);
|
||||
} catch (Exception e) {
|
||||
// If wrapSetTitleBar() fails we put the header back. This isn't a very good
|
||||
// fall-back but better than not displaying the message header at all.
|
||||
|
||||
// FIXME: Get rid of the setEmbeddedTitleBar-method and come up with something that
|
||||
// feels just like it but doesn't use undocumented methods.
|
||||
|
||||
mTitleBarHeaderContainer.removeView(mHeaderContainer);
|
||||
mHeaderPlaceHolder.addView(mHeaderContainer);
|
||||
mTitleBarHeaderContainer = null;
|
||||
}
|
||||
mMessageContentView.wrapSetTitleBar(mTitleBarHeaderContainer);
|
||||
}
|
||||
|
||||
mShowHiddenAttachments.setOnClickListener(this);
|
||||
|
Loading…
Reference in New Issue
Block a user