diff --git a/src/android/webkit/WebViewClassic.java b/src/android/webkit/WebViewClassic.java deleted file mode 100644 index e315beeab..000000000 --- a/src/android/webkit/WebViewClassic.java +++ /dev/null @@ -1,14 +0,0 @@ -package android.webkit; - -import android.view.View; - -/** - * Trojan class for getting access to a hidden API level 16 interface - */ -public class WebViewClassic { - public interface TitleBarDelegate { - int getTitleHeight(); - - public void onSetEmbeddedTitleBar(final View title); - } -} diff --git a/src/com/nobu_games/android/view/web/JBTitleBarWebView.java b/src/com/nobu_games/android/view/web/JBTitleBarWebView.java deleted file mode 100644 index b0908cdf8..000000000 --- a/src/com/nobu_games/android/view/web/JBTitleBarWebView.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.nobu_games.android.view.web; - -import android.content.Context; -import android.util.AttributeSet; -import android.view.MotionEvent; -import android.view.View; -import android.webkit.WebViewClassic.TitleBarDelegate; - -public class JBTitleBarWebView extends TitleBarWebView implements - TitleBarDelegate { - - public JBTitleBarWebView(Context context) { - super(context); - } - - public JBTitleBarWebView(Context context, AttributeSet attrs) { - super(context, attrs); - } - - public JBTitleBarWebView(Context context, AttributeSet attrs, int defStyle) { - super(context, attrs, defStyle); - } - - /** - * Makes sure that the title bar view gets touch events - *

- * {@inheritDoc} - */ - @Override - public boolean dispatchTouchEvent(MotionEvent event) { - if(mTitleBar != null) { - final int sy = getScrollY(); - final int visTitleHeight = getVisibleTitleHeightCompat(); - final float x = event.getX(); - float y = event.getY(); - - switch(event.getActionMasked()) { - case MotionEvent.ACTION_DOWN: - if(y <= visTitleHeight) { - mTouchInTitleBar = true; - } - break; - - case MotionEvent.ACTION_MOVE: - mTouchMove = true; - break; - - case MotionEvent.ACTION_UP: - case MotionEvent.ACTION_CANCEL: - mTouchMove = false; - break; - - default: - } - - if(mTouchInTitleBar) { - y += sy; - event.setLocation(x, y); - - return mTitleBar.dispatchTouchEvent(event); - } - } - - return super.dispatchTouchEvent(event); - } - - @Override - public int getTitleHeight() { - if(mTitleBar != null) return mTitleBar.getHeight(); - return 0; - } - - @Override - public void onSetEmbeddedTitleBar(View title) { - } - -} diff --git a/src/com/nobu_games/android/view/web/TitleBarWebView.java b/src/com/nobu_games/android/view/web/TitleBarWebView.java index a82bec341..510605e49 100644 --- a/src/com/nobu_games/android/view/web/TitleBarWebView.java +++ b/src/com/nobu_games/android/view/web/TitleBarWebView.java @@ -3,6 +3,7 @@ package com.nobu_games.android.view.web; /* * Copyright (C) 2012 Thomas Werner * Portions Copyright (C) 2006 The Android Open Source Project + * Portions Copyright (C) 2012 The K-9 Dog Walkers * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -96,20 +97,6 @@ public class TitleBarWebView extends WebView { init(); } - /** - * Gets the correct TitleBarWebView instance for the current API level. - * - * @param context - * @return - */ - public static TitleBarWebView getInstance(Context context) { - if(Build.VERSION.SDK_INT >= 16) { - return new JBTitleBarWebView(context); - } else { - return new TitleBarWebView(context); - } - } - /** * Corrects the visual displacement caused by the title bar view. *