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