X-Git-Url: https://gitweb.stoutner.com/?p=PrivacyBrowserAndroid.git;a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fcom%2Fstoutner%2Fprivacybrowser%2Ffragments%2FAboutWebViewFragment.kt;h=2d450bc863c3074cc0921ee174c17b86a079be04;hp=054d200e0236e2320aa43f8ac87d57f868a4bcbf;hb=725e4a525bed43f46e24ecc97eafcc339a48939c;hpb=031def95c6d9bfc14113fe86b4a5690233d93ce2 diff --git a/app/src/main/java/com/stoutner/privacybrowser/fragments/AboutWebViewFragment.kt b/app/src/main/java/com/stoutner/privacybrowser/fragments/AboutWebViewFragment.kt index 054d200e..2d450bc8 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/fragments/AboutWebViewFragment.kt +++ b/app/src/main/java/com/stoutner/privacybrowser/fragments/AboutWebViewFragment.kt @@ -40,6 +40,8 @@ import com.stoutner.privacybrowser.R // Define the class constants. private const val TAB_NUMBER = "tab_number" +private const val SCROLL_X = "scroll_x" +private const val SCROLL_Y = "scroll_y" class AboutWebViewFragment : Fragment() { // Define the class variables. @@ -128,8 +130,8 @@ class AboutWebViewFragment : Fragment() { // Scroll the tab if the saved instance state is not null. if (savedInstanceState != null) { tabWebView.post { - tabWebView.scrollX = savedInstanceState.getInt("scroll_x") - tabWebView.scrollY = savedInstanceState.getInt("scroll_y") + tabWebView.scrollX = savedInstanceState.getInt(SCROLL_X) + tabWebView.scrollY = savedInstanceState.getInt(SCROLL_Y) } } @@ -146,8 +148,8 @@ class AboutWebViewFragment : Fragment() { // Save the scroll positions if the layout is not null, which can happen if a tab is not currently selected. if (tabWebView != null) { - savedInstanceState.putInt("scroll_x", tabWebView.scrollX) - savedInstanceState.putInt("scroll_y", tabWebView.scrollY) + savedInstanceState.putInt(SCROLL_X, tabWebView.scrollX) + savedInstanceState.putInt(SCROLL_Y, tabWebView.scrollY) } } } \ No newline at end of file