]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blobdiff - app/src/main/java/com/stoutner/privacybrowser/activities/ViewSourceActivity.java
Add a logcat activity. https://redmine.stoutner.com/issues/264
[PrivacyBrowserAndroid.git] / app / src / main / java / com / stoutner / privacybrowser / activities / ViewSourceActivity.java
index db9bf7974f6a52aa58d0256c2d407cc8d0aa6042..62c704de7728db11a0d78f9a4a2b13a61b94fc24 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2017-2018 Soren Stoutner <soren@stoutner.com>.
+ * Copyright © 2017-2019 Soren Stoutner <soren@stoutner.com>.
  *
  * This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
  *
@@ -181,7 +181,7 @@ public class ViewSourceActivity extends AppCompatActivity {
             // Get the URL.
             String url = urlEditText.getText().toString();
 
-            // Get new source data for the URL if it begins with `http`/
+            // Get new source data for the URL if it begins with `http`.
             if (url.startsWith("http")) {
                 new GetSource(this).execute(url);
             } else {
@@ -206,7 +206,7 @@ public class ViewSourceActivity extends AppCompatActivity {
 
     @Override
     public boolean onCreateOptionsMenu(Menu menu) {
-        // Inflate the menu; this adds items to the action bar if it is present.
+        // Inflate the menu.  This adds items to the action bar if it is present.
         getMenuInflater().inflate(R.menu.view_source_options_menu, menu);
 
         // Display the menu.
@@ -291,7 +291,7 @@ public class ViewSourceActivity extends AppCompatActivity {
         }
     }
 
-    // `String` declares the parameters.  `Void` does not declare progress units.  `String[]` contains the results.
+    // `String` declares the parameters.  `Void` does not declare progress units.  `SpannableStringBuilder[]` contains the results.
     private static class GetSource extends AsyncTask<String, Void, SpannableStringBuilder[]> {
         // Create a weak reference to the calling activity.
         private WeakReference<Activity> activityWeakReference;
@@ -308,7 +308,7 @@ public class ViewSourceActivity extends AppCompatActivity {
             Activity viewSourceActivity = activityWeakReference.get();
 
             // Abort if the activity is gone.
-            if ((viewSourceActivity == null) || (viewSourceActivity.isFinishing())) {
+            if ((viewSourceActivity == null) || viewSourceActivity.isFinishing()) {
                 return;
             }
 
@@ -334,7 +334,7 @@ public class ViewSourceActivity extends AppCompatActivity {
             Activity activity = activityWeakReference.get();
 
             // Abort if the activity is gone.
-            if ((activity == null) || (activity.isFinishing())) {
+            if ((activity == null) || activity.isFinishing()) {
                 return new SpannableStringBuilder[] {requestHeadersBuilder, responseMessageBuilder, responseHeadersBuilder, responseBodyBuilder};
             }
 
@@ -663,11 +663,11 @@ public class ViewSourceActivity extends AppCompatActivity {
         // `onPostExecute()` operates on the UI thread.
         @Override
         protected void onPostExecute(SpannableStringBuilder[] viewSourceStringArray){
-            // Get a handle the activity.
+            // Get a handle for the activity.
             Activity activity = activityWeakReference.get();
 
             // Abort if the activity is gone.
-            if ((activity == null) || (activity.isFinishing())) {
+            if ((activity == null) || activity.isFinishing()) {
                 return;
             }