X-Git-Url: https://gitweb.stoutner.com/?p=PrivacyBrowserAndroid.git;a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fcom%2Fstoutner%2Fprivacybrowser%2Factivities%2FMainWebViewActivity.java;h=1ec5a020037e08504db735b8d43fc6ecd1c00184;hp=a174230d851af1cd9444184b5769d182a51f81ca;hb=16ccee9956383ad3a38b09f7a4f7e9aeee92cd42;hpb=84989e138cb593d5a2f70be848db4889aaa8da88 diff --git a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java index a174230d..1ec5a020 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java +++ b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java @@ -707,8 +707,11 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook // Get the current WebView fragment. Instantiate item returns the current item if it already exists. Fragment webViewFragment = (Fragment) webViewPagerAdapter.instantiateItem(webViewPager, position); + // Remove the lint error below that the WebView fragment might be null. + assert webViewFragment.getView() != null; + // Store the current WebView. - currentWebView = (NestedScrollWebView) webViewFragment.getView(); + currentWebView = webViewFragment.getView().findViewById(R.id.nestedscroll_webview); // Select the corresponding tab if it does not match the currently selected page. This will happen if the page was scrolled via swiping in the view pager. if (tabLayout.getSelectedTabPosition() != position) { @@ -835,10 +838,10 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook // Set the swipe to refresh color according to the theme. if (darkTheme) { - swipeRefreshLayout.setColorSchemeResources(R.color.blue_600); + swipeRefreshLayout.setColorSchemeResources(R.color.blue_800); swipeRefreshLayout.setProgressBackgroundColorSchemeResource(R.color.gray_850); } else { - swipeRefreshLayout.setColorSchemeResources(R.color.blue_700); + swipeRefreshLayout.setColorSchemeResources(R.color.blue_500); } // `DrawerTitle` identifies the `DrawerLayouts` in accessibility mode. @@ -4444,7 +4447,7 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook } @Override - public void initializeWebView(NestedScrollWebView nestedScrollWebView, int tabNumber) { + public void initializeWebView(int tabNumber, ProgressBar progressBar, NestedScrollWebView nestedScrollWebView) { // Get handles for the activity views. final FrameLayout rootFrameLayout = findViewById(R.id.root_framelayout); final DrawerLayout drawerLayout = findViewById(R.id.drawerlayout); @@ -4487,10 +4490,6 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook ImageView tabFavoriteIconImageView = currentTabView.findViewById(R.id.favorite_icon_imageview); TextView tabTitleTextView = currentTabView.findViewById(R.id.title_textview); - - //TODO - final ProgressBar progressBar = findViewById(R.id.progress_bar); - // Get a handle for the shared preferences. SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);