mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-13 09:26:52 -04:00
+ Code which should help to fix text-autorisizing issue on KitKat
This commit is contained in:
parent
82419359dc
commit
08fa116ffd
@ -24,7 +24,8 @@ import android.util.AttributeSet;
|
||||
import android.view.MotionEvent;
|
||||
import android.webkit.WebView;
|
||||
import android.widget.ZoomButtonsController;
|
||||
|
||||
import android.webkit.WebSettings.LayoutAlgorithm;
|
||||
import android.os.Build;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import static org.kiwix.kiwixmobile.BackwardsCompatibilityTools.newApi;
|
||||
@ -41,14 +42,25 @@ public class KiwixWebView extends WebView {
|
||||
|
||||
public KiwixWebView(Context context) {
|
||||
super(context);
|
||||
init();
|
||||
}
|
||||
|
||||
public KiwixWebView(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
init();
|
||||
}
|
||||
|
||||
public KiwixWebView(Context context, AttributeSet attrs, int defStyle) {
|
||||
super(context, attrs, defStyle);
|
||||
init();
|
||||
}
|
||||
|
||||
private void init() {
|
||||
getSettings().setSupportMultipleWindows(true);
|
||||
getSettings().setSupportZoom(true);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
getSettings().setLayoutAlgorithm(LayoutAlgorithm.TEXT_AUTOSIZING);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user