mirror of https://github.com/LeOS-GSI/LeOS-Genesis
parent
aa1793fa33
commit
0df46d2642
|
@ -328,20 +328,20 @@ public class geckoClients {
|
||||||
mRuntime.getSettings().setRemoteDebuggingEnabled(true);
|
mRuntime.getSettings().setRemoteDebuggingEnabled(true);
|
||||||
installExtension();
|
installExtension();
|
||||||
}
|
}
|
||||||
initBrowserManager();
|
initBrowserManager(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initBrowserManager() {
|
public void initBrowserManager(Context pcontext) {
|
||||||
if (mIconManager == null) {
|
if (mIconManager == null) {
|
||||||
mIconManager = new BrowserIconManager();
|
mIconManager = new BrowserIconManager();
|
||||||
|
mIconManager.init(pcontext, mRuntime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void onGetFavIcon(ImageView pImageView, String pURL, AppCompatActivity pcontext) {
|
public void onGetFavIcon(ImageView pImageView, String pURL, AppCompatActivity pcontext) {
|
||||||
initBrowserManager();
|
|
||||||
pURL = helperMethod.completeURL(helperMethod.getDomainName(pURL));
|
pURL = helperMethod.completeURL(helperMethod.getDomainName(pURL));
|
||||||
mIconManager.onLoadIconIntoView(pcontext, mRuntime, pImageView, pURL);
|
mIconManager.onLoadIconIntoView(pImageView, pURL);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onLoadFavIcon(AppCompatActivity pcontext) {
|
public void onLoadFavIcon(AppCompatActivity pcontext) {
|
||||||
|
@ -374,6 +374,7 @@ public class geckoClients {
|
||||||
mRuntime.getSettings().setWebFontsEnabled(status.sShowWebFonts);
|
mRuntime.getSettings().setWebFontsEnabled(status.sShowWebFonts);
|
||||||
mRuntime.getSettings().setForceUserScalableEnabled(status.sSettingEnableZoom);
|
mRuntime.getSettings().setForceUserScalableEnabled(status.sSettingEnableZoom);
|
||||||
mIconManager = new BrowserIconManager();
|
mIconManager = new BrowserIconManager();
|
||||||
|
mIconManager.init(pcontext, mRuntime);
|
||||||
|
|
||||||
if (status.sSettingTrackingProtection == 1) {
|
if (status.sSettingTrackingProtection == 1) {
|
||||||
mRuntime.getSettings().getContentBlocking().setAntiTracking(ContentBlocking.AntiTracking.DEFAULT);
|
mRuntime.getSettings().getContentBlocking().setAntiTracking(ContentBlocking.AntiTracking.DEFAULT);
|
||||||
|
|
|
@ -11,17 +11,23 @@ import java.util.concurrent.TimeUnit
|
||||||
|
|
||||||
class BrowserIconManager {
|
class BrowserIconManager {
|
||||||
|
|
||||||
fun onLoadIconIntoView(
|
var fetchClient: GeckoViewFetchClient? = null
|
||||||
|
var mIcons: BrowserIcons? = null
|
||||||
|
|
||||||
|
fun init(
|
||||||
mContext: Context,
|
mContext: Context,
|
||||||
mRuntime: GeckoRuntime,
|
mRuntime: GeckoRuntime,
|
||||||
|
){
|
||||||
|
fetchClient = GeckoViewFetchClient(mContext, mRuntime, Pair(10L, TimeUnit.MINUTES))
|
||||||
|
mIcons = BrowserIcons(mContext, httpClient = fetchClient!!, generator = DefaultIconGenerator())
|
||||||
|
}
|
||||||
|
|
||||||
|
fun onLoadIconIntoView(
|
||||||
mView: ImageView,
|
mView: ImageView,
|
||||||
pURL: String
|
pURL: String
|
||||||
): BrowserIcons {
|
): BrowserIcons {
|
||||||
val fetchClient = GeckoViewFetchClient(mContext, mRuntime, Pair(10L, TimeUnit.MINUTES))
|
mIcons?.loadIntoView(mView, IconRequest(pURL))
|
||||||
val mIcons =
|
return mIcons!!
|
||||||
BrowserIcons(mContext, httpClient = fetchClient, generator = DefaultIconGenerator())
|
|
||||||
mIcons.loadIntoView(mView, IconRequest(pURL))
|
|
||||||
return mIcons
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun onLoadIcon(mContext: Context, mRuntime: GeckoRuntime) {
|
fun onLoadIcon(mContext: Context, mRuntime: GeckoRuntime) {
|
||||||
|
|
|
@ -220,7 +220,7 @@
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:text="@string/SETTING_ACCESSIBILITY_FONT_CUSTOM_SAMPLE"
|
android:text="@string/SETTING_ACCESSIBILITY_FONT_CUSTOM_SAMPLE"
|
||||||
android:textColor="@color/c_text_v1"
|
android:textColor="@color/c_text_v1"
|
||||||
android:textSize="15sp"
|
android:textSize="11sp"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
|
Loading…
Reference in New Issue