Loading core/java/android/webkit/WebSettings.java +16 −11 Original line number Diff line number Diff line Loading @@ -72,14 +72,6 @@ public abstract class WebSettings { TextSize(int size) { value = size; } /** * @hide Only for use by WebViewProvider implementations */ public int getValue() { return value; } int value; } Loading Loading @@ -442,7 +434,7 @@ public abstract class WebSettings { * Gets the text zoom of the page in percent. * * @return the text zoom of the page in percent * @see #setTextSizeZoom * @see #setTextZoom */ public synchronized int getTextZoom() { throw new MustOverrideException(); Loading @@ -455,7 +447,7 @@ public abstract class WebSettings { * @deprecated Use {@link #setTextZoom} instead. */ public synchronized void setTextSize(TextSize t) { throw new MustOverrideException(); setTextZoom(t.value); } /** Loading @@ -468,7 +460,20 @@ public abstract class WebSettings { * @deprecated Use {@link #getTextZoom} instead. */ public synchronized TextSize getTextSize() { throw new MustOverrideException(); TextSize closestSize = null; int smallestDelta = Integer.MAX_VALUE; int textSize = getTextZoom(); for (TextSize size : TextSize.values()) { int delta = Math.abs(textSize - size.value); if (delta == 0) { return size; } if (delta < smallestDelta) { smallestDelta = delta; closestSize = size; } } return closestSize != null ? closestSize : TextSize.NORMAL; } /** Loading core/java/android/webkit/WebSettingsClassic.java +0 −28 Original line number Diff line number Diff line Loading @@ -645,34 +645,6 @@ public class WebSettingsClassic extends WebSettings { return mTextSize; } /** * @see android.webkit.WebSettings#setTextSize(android.webkit.WebSettingsClassic.TextSize) */ @Override public synchronized void setTextSize(TextSize t) { setTextZoom(t.value); } /** * @see android.webkit.WebSettings#getTextSize() */ @Override public synchronized TextSize getTextSize() { TextSize closestSize = null; int smallestDelta = Integer.MAX_VALUE; for (TextSize size : TextSize.values()) { int delta = Math.abs(mTextSize - size.value); if (delta == 0) { return size; } if (delta < smallestDelta) { smallestDelta = delta; closestSize = size; } } return closestSize != null ? closestSize : TextSize.NORMAL; } /** * Set the double-tap zoom of the page in percent. Default is 100. * @param doubleTapZoom A percent value for increasing or decreasing the double-tap zoom. Loading Loading
core/java/android/webkit/WebSettings.java +16 −11 Original line number Diff line number Diff line Loading @@ -72,14 +72,6 @@ public abstract class WebSettings { TextSize(int size) { value = size; } /** * @hide Only for use by WebViewProvider implementations */ public int getValue() { return value; } int value; } Loading Loading @@ -442,7 +434,7 @@ public abstract class WebSettings { * Gets the text zoom of the page in percent. * * @return the text zoom of the page in percent * @see #setTextSizeZoom * @see #setTextZoom */ public synchronized int getTextZoom() { throw new MustOverrideException(); Loading @@ -455,7 +447,7 @@ public abstract class WebSettings { * @deprecated Use {@link #setTextZoom} instead. */ public synchronized void setTextSize(TextSize t) { throw new MustOverrideException(); setTextZoom(t.value); } /** Loading @@ -468,7 +460,20 @@ public abstract class WebSettings { * @deprecated Use {@link #getTextZoom} instead. */ public synchronized TextSize getTextSize() { throw new MustOverrideException(); TextSize closestSize = null; int smallestDelta = Integer.MAX_VALUE; int textSize = getTextZoom(); for (TextSize size : TextSize.values()) { int delta = Math.abs(textSize - size.value); if (delta == 0) { return size; } if (delta < smallestDelta) { smallestDelta = delta; closestSize = size; } } return closestSize != null ? closestSize : TextSize.NORMAL; } /** Loading
core/java/android/webkit/WebSettingsClassic.java +0 −28 Original line number Diff line number Diff line Loading @@ -645,34 +645,6 @@ public class WebSettingsClassic extends WebSettings { return mTextSize; } /** * @see android.webkit.WebSettings#setTextSize(android.webkit.WebSettingsClassic.TextSize) */ @Override public synchronized void setTextSize(TextSize t) { setTextZoom(t.value); } /** * @see android.webkit.WebSettings#getTextSize() */ @Override public synchronized TextSize getTextSize() { TextSize closestSize = null; int smallestDelta = Integer.MAX_VALUE; for (TextSize size : TextSize.values()) { int delta = Math.abs(mTextSize - size.value); if (delta == 0) { return size; } if (delta < smallestDelta) { smallestDelta = delta; closestSize = size; } } return closestSize != null ? closestSize : TextSize.NORMAL; } /** * Set the double-tap zoom of the page in percent. Default is 100. * @param doubleTapZoom A percent value for increasing or decreasing the double-tap zoom. Loading