Bug Fixes

Bug Fixes
master
Abdul Mannan Saeed 2022-05-14 23:31:35 +05:00
parent aa1793fa33
commit 0df46d2642
3 changed files with 18 additions and 11 deletions

View File

@ -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);

View File

@ -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) {

View File

@ -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