Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 17a6f793 authored by Jesse Vincent's avatar Jesse Vincent
Browse files

Better solution coming up!

Revert "Added fallback for when WebView.setEmbeddedTitleBar() is not available"

This reverts commit 6073b9d3.
parent 91d40435
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -164,9 +164,15 @@ public class MessageWebView extends WebView {
        }
    }

    public void wrapSetTitleBar(final View title) throws Exception {
    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);
        }
    }
}
+1 −13
Original line number Diff line number Diff line
@@ -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;
            }
        }

        mShowHiddenAttachments.setOnClickListener(this);