diff --git a/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/geckoManager/geckoClients.java b/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/geckoManager/geckoClients.java index c19bb67d..9f2768f2 100644 --- a/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/geckoManager/geckoClients.java +++ b/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/geckoManager/geckoClients.java @@ -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); diff --git a/app/src/main/java/com/hiddenservices/onionservices/appManager/kotlinHelperLibraries/BrowserIconManager.kt b/app/src/main/java/com/hiddenservices/onionservices/appManager/kotlinHelperLibraries/BrowserIconManager.kt index 14189985..ad59d01d 100644 --- a/app/src/main/java/com/hiddenservices/onionservices/appManager/kotlinHelperLibraries/BrowserIconManager.kt +++ b/app/src/main/java/com/hiddenservices/onionservices/appManager/kotlinHelperLibraries/BrowserIconManager.kt @@ -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) { diff --git a/app/src/main/res/layouts/tab/layout/tab_grid_view.xml b/app/src/main/res/layouts/tab/layout/tab_grid_view.xml index 69f0cd78..c7d74b2d 100644 --- a/app/src/main/res/layouts/tab/layout/tab_grid_view.xml +++ b/app/src/main/res/layouts/tab/layout/tab_grid_view.xml @@ -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" />