From: Soren Stoutner Date: Wed, 22 Mar 2017 23:39:15 +0000 (-0700) Subject: Move the progress bar to the bottom of the app bar. Implements https://redmine.stout... X-Git-Tag: v2.1~9 X-Git-Url: https://gitweb.stoutner.com/?a=commitdiff_plain;h=7f8620e81518589f44c8517edbfc8989a5f04845;p=PrivacyBrowserAndroid.git Move the progress bar to the bottom of the app bar. Implements https://redmine.stoutner.com/issues/107. --- diff --git a/.idea/dictionaries/soren.xml b/.idea/dictionaries/soren.xml index a5cc4b46..780edc6d 100644 --- a/.idea/dictionaries/soren.xml +++ b/.idea/dictionaries/soren.xml @@ -4,6 +4,7 @@ aaaa adsense adservers + adview amiunique androidversion anonymized @@ -75,6 +76,7 @@ radiogroup redmine referer + refreshlayout relativelayout requery robinlinus diff --git a/app/src/free/java/com/stoutner/privacybrowser/BannerAd.java b/app/src/free/java/com/stoutner/privacybrowser/BannerAd.java index 3f9d9a73..88e3985b 100644 --- a/app/src/free/java/com/stoutner/privacybrowser/BannerAd.java +++ b/app/src/free/java/com/stoutner/privacybrowser/BannerAd.java @@ -1,5 +1,5 @@ -/** - * Copyright 2016 Soren Stoutner . +/* + * Copyright 2016-2017 Soren Stoutner . * * This file is part of Privacy Browser . * @@ -39,24 +39,24 @@ public class BannerAd extends AppCompatActivity{ } public static void reloadAfterRotate (View view, Context applicationContext, String ad_id) { - // Cast view to an AdView. + // Cast `view` to an `AdView`. AdView adView = (AdView) view; // Save the layout parameters. RelativeLayout.LayoutParams adViewLayoutParameters = (RelativeLayout.LayoutParams) adView.getLayoutParams(); - // Remove the AdView. + // Remove the `AdView`. RelativeLayout adViewParentLayout = (RelativeLayout) adView.getParent(); adViewParentLayout.removeView(adView); - // Setup the new AdView. + // Setup the new `AdView`. adView = new AdView(applicationContext); adView.setAdSize(AdSize.SMART_BANNER); adView.setAdUnitId(ad_id); - adView.setId(R.id.adView); + adView.setId(R.id.adview); adView.setLayoutParams(adViewLayoutParameters); - // Display the new AdView. + // Display the new `AdView`. adViewParentLayout.addView(adView); // Request a new ad. @@ -65,7 +65,7 @@ public class BannerAd extends AppCompatActivity{ } public static void hideAd(View view) { - // Cast view to an AdView. + // Cast `view` to an `AdView`. AdView adView = (AdView) view; // Hide the ad. @@ -73,26 +73,26 @@ public class BannerAd extends AppCompatActivity{ } public static void showAd(View view) { - // Cast view to an AdView. + // Cast `view` to an `AdView`. AdView adView = (AdView) view; - // Hide the ad. + // Show the ad. adView.setVisibility(View.VISIBLE); } public static void pauseAd(View view) { - // Cast view to an AdView. + // Cast `view` to an `AdView`. AdView adView = (AdView) view; - // Pause the AdView. + // Pause the `AdView`. adView.pause(); } public static void resumeAd(View view) { - // Cast view to an AdView. + // Cast `view` to an `AdView`. AdView adView = (AdView) view; - // Resume the AdView. + // Resume the `AdView`. adView.resume(); } } \ No newline at end of file diff --git a/app/src/free/res/layout/main_webview.xml b/app/src/free/res/layout/main_webview.xml index 6013ae29..a6fd37b4 100644 --- a/app/src/free/res/layout/main_webview.xml +++ b/app/src/free/res/layout/main_webview.xml @@ -1,7 +1,7 @@ - + + tools:showIn="@layout/main_drawerlayout"> + android:layout_above="@id/adview"> = 21. - urlAppBarFrameLayout.setBackground(getResources().getDrawable(R.drawable.url_bar_background_green)); + urlAppBarRelativeLayout.setBackground(getResources().getDrawable(R.drawable.url_bar_background_green)); } else { // The URL we are loading does not have custom domain settings. Load the defaults. // Get the shared preference values. `this` references the current context. SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this); @@ -1978,7 +1980,7 @@ public class MainWebViewActivity extends AppCompatActivity implements Navigation } // Set a transparent background on `urlTextBox`. We have to use the deprecated `.getDrawable()` until the minimum API >= 21. - urlAppBarFrameLayout.setBackgroundDrawable(getResources().getDrawable(R.drawable.url_bar_background_transparent)); + urlAppBarRelativeLayout.setBackgroundDrawable(getResources().getDrawable(R.drawable.url_bar_background_transparent)); } // Close `domainsDatabaseHelper`. @@ -2161,7 +2163,7 @@ public class MainWebViewActivity extends AppCompatActivity implements Navigation BannerAd.reloadAfterRotate(adView, getApplicationContext(), getString(R.string.ad_id)); // Reinitialize the `adView` variable, as the `View` will have been removed and re-added by `BannerAd.reloadAfterRotate()`. - adView = findViewById(R.id.adView); + adView = findViewById(R.id.adview); } // Remove the translucent navigation bar flag if it is set. diff --git a/app/src/main/res/layout/drawerlayout.xml b/app/src/main/res/layout/drawerlayout.xml deleted file mode 100644 index ca8cffed..00000000 --- a/app/src/main/res/layout/drawerlayout.xml +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/main_drawerlayout.xml b/app/src/main/res/layout/main_drawerlayout.xml new file mode 100644 index 00000000..c616f68e --- /dev/null +++ b/app/src/main/res/layout/main_drawerlayout.xml @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/main_webview.xml b/app/src/main/res/layout/main_webview.xml index bda4ce53..d395ac59 100644 --- a/app/src/main/res/layout/main_webview.xml +++ b/app/src/main/res/layout/main_webview.xml @@ -1,7 +1,7 @@ - + + tools:showIn="@layout/main_drawerlayout" > - + \ No newline at end of file diff --git a/app/src/main/res/layout/url_app_bar.xml b/app/src/main/res/layout/url_app_bar.xml index 34d6339f..377deff4 100644 --- a/app/src/main/res/layout/url_app_bar.xml +++ b/app/src/main/res/layout/url_app_bar.xml @@ -1,7 +1,7 @@ - - + - - + + + + - - - - - - - - - - - \ No newline at end of file + android:layout_width="match_parent" + android:layout_toEndOf="@id/favorite_icon" + android:hint="@string/url_or_search_terms" + android:imeOptions="actionGo" + android:inputType="textUri" /> + \ No newline at end of file