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

View File

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

View File

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