]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/commitdiff
Add a flow layout to the Headers SSL buttons.
authorSoren Stoutner <soren@stoutner.com>
Mon, 6 Nov 2023 21:41:56 +0000 (14:41 -0700)
committerSoren Stoutner <soren@stoutner.com>
Mon, 6 Nov 2023 21:41:56 +0000 (14:41 -0700)
app/src/main/java/com/stoutner/privacybrowser/activities/ViewHeadersActivity.kt
app/src/main/res/layout/view_headers_bottom_appbar.xml
app/src/main/res/layout/view_headers_top_appbar.xml
app/src/main/res/values-de/strings.xml
app/src/main/res/values-es/strings.xml
app/src/main/res/values-fr/strings.xml
app/src/main/res/values-it/strings.xml
app/src/main/res/values-ru/strings.xml

index ce86183b021b79f83053a1f276a759ba59cb6390..3b6bb26f8d8de2d2dab1f8bdc5a5e1e1bd5cece1 100644 (file)
@@ -37,7 +37,6 @@ import android.view.View
 import android.view.View.OnFocusChangeListener
 import android.view.WindowManager
 import android.view.inputmethod.InputMethodManager
-import android.widget.Button
 import android.widget.EditText
 import android.widget.ProgressBar
 import android.widget.TextView
@@ -46,6 +45,7 @@ import androidx.activity.result.contract.ActivityResultContracts
 import androidx.appcompat.app.ActionBar
 import androidx.appcompat.app.AppCompatActivity
 import androidx.appcompat.widget.Toolbar
+import androidx.constraintlayout.widget.ConstraintLayout
 import androidx.core.app.NavUtils
 import androidx.lifecycle.ViewModelProvider
 import androidx.preference.PreferenceManager
@@ -90,8 +90,7 @@ class ViewHeadersActivity: AppCompatActivity(), UntrustedSslCertificateListener
     private lateinit var urlEditText: EditText
     private lateinit var sslInformationTitleTextView: TextView
     private lateinit var sslInformationTextView: TextView
-    private lateinit var ciphersButton: Button
-    private lateinit var certificateButton: Button
+    private lateinit var sslButtonsConstraintLayout: ConstraintLayout
     private lateinit var requestHeadersTitleTextView: TextView
     private lateinit var requestHeadersTextView: TextView
     private lateinit var responseMessageTitleTextView: TextView
@@ -201,8 +200,7 @@ class ViewHeadersActivity: AppCompatActivity(), UntrustedSslCertificateListener
         val swipeRefreshLayout = findViewById<SwipeRefreshLayout>(R.id.swiperefreshlayout)
         sslInformationTitleTextView = findViewById(R.id.ssl_information_title_textview)
         sslInformationTextView = findViewById(R.id.ssl_information_textview)
-        ciphersButton = findViewById(R.id.ciphers_button)
-        certificateButton = findViewById(R.id.certificate_button)
+        sslButtonsConstraintLayout = findViewById(R.id.ssl_buttons_constraintlayout)
         requestHeadersTitleTextView = findViewById(R.id.request_headers_title_textview)
         requestHeadersTextView = findViewById(R.id.request_headers_textview)
         responseMessageTitleTextView = findViewById(R.id.response_message_title_textview)
@@ -452,7 +450,7 @@ class ViewHeadersActivity: AppCompatActivity(), UntrustedSslCertificateListener
 
                 // Display a snackbar if the API <= 32 (Android 12L).  Beginning in Android 13 the OS displays a notification that covers up the snackbar.
                 if (Build.VERSION.SDK_INT <= 32)
-                    Snackbar.make(urlEditText, R.string.version_info_copied, Snackbar.LENGTH_SHORT).show()
+                    Snackbar.make(urlEditText, R.string.headers_copied, Snackbar.LENGTH_SHORT).show()
 
                 // Consume the event.
                 return true
@@ -595,8 +593,7 @@ class ViewHeadersActivity: AppCompatActivity(), UntrustedSslCertificateListener
             // Hide the unused views.
             sslInformationTitleTextView.visibility = View.GONE
             sslInformationTextView.visibility = View.GONE
-            ciphersButton.visibility = View.GONE
-            certificateButton.visibility = View.GONE
+            sslButtonsConstraintLayout.visibility = View.GONE
             requestHeadersTitleTextView.visibility = View.GONE
             requestHeadersTextView.visibility = View.GONE
             responseMessageTitleTextView.visibility = View.GONE
@@ -611,14 +608,12 @@ class ViewHeadersActivity: AppCompatActivity(), UntrustedSslCertificateListener
                 // Hide the SSL information views.
                 sslInformationTitleTextView.visibility = View.GONE
                 sslInformationTextView.visibility = View.GONE
-                ciphersButton.visibility = View.GONE
-                certificateButton.visibility = View.GONE
+                sslButtonsConstraintLayout.visibility = View.GONE
             } else {  // This is not an HTTP URL.
                 // Show the SSL information views.
                 sslInformationTitleTextView.visibility = View.VISIBLE
                 sslInformationTextView.visibility = View.VISIBLE
-                ciphersButton.visibility = View.VISIBLE
-                certificateButton.visibility = View.VISIBLE
+                sslButtonsConstraintLayout.visibility = View.VISIBLE
             }
 
             // Show the other views.
index 287b982d56953774cafe7fcefcb5b325a0bbfd07..eddf4477d3250013fdafab27bfcff44b903d527d 100644 (file)
                         android:textIsSelectable="true"
                         android:layout_marginBottom="8dp" />
 
-                    <!-- Button row. -->
-                    <LinearLayout
+                    <!-- SSL Buttons. -->
+                    <androidx.constraintlayout.widget.ConstraintLayout
+                        android:id="@+id/ssl_buttons_constraintlayout"
                         android:layout_height="wrap_content"
-                        android:layout_width="wrap_content"
-                        android:orientation="horizontal"
-                        android:layout_gravity="center_horizontal" >
-
-                            <Button
-                                android:id="@+id/ciphers_button"
-                                android:layout_height="wrap_content"
-                                android:layout_width="wrap_content"
-                                android:text="@string/ciphers"
-                                android:layout_gravity="center_horizontal"
-                                android:layout_marginEnd="10dp"
-                                android:layout_marginBottom="16dp"
-                                android:onClick="showCiphers"
-                                app:backgroundTint="@color/button_background_selector"
-                                android:textColor="@color/button_text_selector"
-                                tools:ignore="ButtonStyle" />
-
-                            <Button
-                                android:id="@+id/certificate_button"
-                                android:layout_height="wrap_content"
-                                android:layout_width="wrap_content"
-                                android:text="@string/certificate"
-                                android:onClick="showCertificate"
-                                app:backgroundTint="@color/button_background_selector"
-                                android:textColor="@color/button_text_selector"
-                                tools:ignore="ButtonStyle" />
-                    </LinearLayout>
+                        android:layout_width="match_parent"
+                        android:layout_marginBottom="16dp"
+                        tools:ignore="MissingConstraints" >
+
+                        <androidx.constraintlayout.helper.widget.Flow
+                            android:layout_height="wrap_content"
+                            android:layout_width="match_parent"
+                            app:constraint_referenced_ids="ciphers_button,certificate_button"
+                            app:flow_wrapMode="chain"
+                            app:flow_firstHorizontalStyle="packed"
+                            app:flow_horizontalGap="15dp" />
+
+                        <androidx.appcompat.widget.AppCompatButton
+                            android:id="@+id/ciphers_button"
+                            android:layout_height="wrap_content"
+                            android:layout_width="wrap_content"
+                            android:text="@string/ciphers"
+                            android:onClick="showCiphers"
+                            app:backgroundTint="@color/button_background_selector"
+                            android:textColor="@color/button_text_selector"
+                            tools:ignore="ButtonStyle" />
+
+                        <androidx.appcompat.widget.AppCompatButton
+                            android:id="@+id/certificate_button"
+                            android:layout_height="wrap_content"
+                            android:layout_width="wrap_content"
+                            android:text="@string/certificate"
+                            android:onClick="showCertificate"
+                            app:backgroundTint="@color/button_background_selector"
+                            android:textColor="@color/button_text_selector"
+                            tools:ignore="ButtonStyle" />
+                    </androidx.constraintlayout.widget.ConstraintLayout>
 
                     <!-- Request headers. -->
                     <TextView
index bd6e6ff00b770254fbdc2c6f4ed4026cb1ed8f5b..0358048cd1ed5e2ec34ad25d93dd9660c942e1e3 100644 (file)
                         android:textIsSelectable="true"
                         android:layout_marginBottom="8dp" />
 
-                    <!-- Button row. -->
-                    <LinearLayout
+                    <!-- SSL Buttons. -->
+                    <androidx.constraintlayout.widget.ConstraintLayout
+                        android:id="@+id/ssl_buttons_constraintlayout"
                         android:layout_height="wrap_content"
-                        android:layout_width="wrap_content"
-                        android:orientation="horizontal"
-                        android:layout_gravity="center_horizontal" >
+                        android:layout_width="match_parent"
+                        android:layout_marginBottom="16dp"
+                        tools:ignore="MissingConstraints" >
+
+                        <androidx.constraintlayout.helper.widget.Flow
+                            android:layout_height="wrap_content"
+                            android:layout_width="match_parent"
+                            app:constraint_referenced_ids="ciphers_button,certificate_button"
+                            app:flow_wrapMode="chain"
+                            app:flow_firstHorizontalStyle="packed"
+                            app:flow_horizontalGap="15dp" />
 
-                        <Button
+                        <androidx.appcompat.widget.AppCompatButton
                             android:id="@+id/ciphers_button"
                             android:layout_height="wrap_content"
                             android:layout_width="wrap_content"
                             android:text="@string/ciphers"
-                            android:layout_gravity="center_horizontal"
-                            android:layout_marginEnd="10dp"
-                            android:layout_marginBottom="16dp"
                             android:onClick="showCiphers"
                             app:backgroundTint="@color/button_background_selector"
                             android:textColor="@color/button_text_selector"
                             tools:ignore="ButtonStyle" />
 
-                        <Button
+                        <androidx.appcompat.widget.AppCompatButton
                             android:id="@+id/certificate_button"
                             android:layout_height="wrap_content"
                             android:layout_width="wrap_content"
                             app:backgroundTint="@color/button_background_selector"
                             android:textColor="@color/button_text_selector"
                             tools:ignore="ButtonStyle" />
-                    </LinearLayout>
+                    </androidx.constraintlayout.widget.ConstraintLayout>
 
                     <!-- Request headers. -->
                     <TextView
index 5abeb8eb0a3e78c5ee3c1029126c8b79ca36e8ce..283521e0a41dcfd47ed490625ddc77d516877392 100644 (file)
     <string name="open_in_new_tab">In neuem Tab öffnen</string>
     <string name="open_in_background">Im Hintergrund öffnen</string>
     <string name="open_image_in_new_tab">Grafik in neuem Tab öffnen</string>
+    <string name="share_image">Bild teilen</string>
     <string name="copy_url">URL kopieren</string>
     <string name="email_address">E-Mail-Adresse</string>
     <string name="copy_email_address">E-Mail-Adresse kopieren</string>
     <!-- View Headers. Android removes double spaces, but extra spaces can be manually specified with the Unicode `\u0020` formatting.
         The `%1$s` code inserts variables into the displayed text and should be preserved in translation.  <https://developer.android.com/reference/kotlin/java/util/Formatter> -->
     <string name="colon">: \u0020</string>
+    <string name="ssl_information">SSL-Information</string>
+    <string name="applied_cipher">Verwendetes Verschlüsselungsverfahren</string>
+    <string name="peer_principal">Zielprinzipalname</string>
+    <string name="certificate_type">Zertifikats-Typ</string>
+    <string name="certificate_hash_code">Zertifikats-Hash</string>
+    <string name="ciphers">Verschlüsselungsverfahren</string>
+    <string name="available_ciphers">Verfügbare Verschlüsselungsverfahren</string>
+    <string name="certificate">Zertifikat</string>
     <string name="request_headers">Anfragekopfzeilen</string>
     <string name="response_message">Status-Code</string>
     <string name="response_headers">Antwortkopfzeilen</string>
     <string name="about_view_headers_message">Weil Androids WebView keine Quelltext-Informationen zur Verfügung stellt, muss eine separate a separate Serveranfrage mit system tools gestellt werden,
         die hier dargestellten Daten erhält. Deshalb können Unterschiede zwischen diesen Daten und der mit WebView dargestellten Webseite auftreten.
         Es ist geplant, mit Version 4.x eine eigene Engine einzuführen, die diese Einschränkungen umgeht.</string>
+    <string name="headers_copied">Header kopiert.</string>
+    <string name="headers_txt">%1$s headers.txt</string>
 
     <!-- Create Home Screen Shortcut Alert Dialog. -->
     <string name="create_shortcut">Verknüpfung erstellen</string>
 
     <!-- Logcat.  Android removes double spaces, but extra spaces can be manually specified with the Unicode `\u0020` formatting.
         The `%1$s` code inserts variables into the displayed text and should be preserved in translation.  <https://developer.android.com/reference/kotlin/java/util/Formatter> -->
-    <string name="copy_string">kopieren</string>
-    <string name="clear">leeren</string>
+    <string name="copy_string">Kopieren</string>
+    <string name="clear">Leeren</string>
     <string name="logcat_copied">Logcat kopiert.</string>
     <string name="privacy_browser_logcat_txt">Privacy Browser Android %1$s Logcat.txt</string>
     <string name="error_saving_logcat">Fehler beim Speichern von Logcat:\u0020 %1$s</string>
index 68f5fa210e9c0953e9617a062b667fa2ca9b98e8..092feae5f0a89ffdc8731c046f5bceecd0be2dcb 100644 (file)
     <string name="open_in_new_tab">Abrir en nueva pestaña</string>
     <string name="open_in_background">Abrir en segundo plano</string>
     <string name="open_image_in_new_tab">Abrir imagen en nueva pestaña</string>
+    <string name="share_image">Compartir imagen</string>
     <string name="copy_url">Copiar URL</string>
     <string name="email_address">Correo electrónico</string>
     <string name="copy_email_address">Copiar correo electrónico</string>
index e6cf67fad159dee6c2813be7612e94e43b3b3988..35adcaf30d4fe2bd31d84f04ff1cafd290e95e3c 100644 (file)
     <string name="open_in_new_tab">Ouvrir dans un nouvel onglet</string>
     <string name="open_in_background">Ouvrir en arrière-plan</string>
     <string name="open_image_in_new_tab">Ouvrir l\'image dans un nouvel onglet</string>
+    <string name="share_image">Partager l\'image</string>
     <string name="copy_url">Copier l\'URL</string>
     <string name="email_address">Addresse e-mail</string>
     <string name="copy_email_address">Copier l\'adresse e-mail</string>
     <!-- View Headers. Android removes initial and trailing spaces, but they can be manually specified with the Unicode `\u0020` formatting.
         The `%1$s` code inserts variables into the displayed text and should be preserved in translation.  <https://developer.android.com/reference/kotlin/java/util/Formatter> -->
     <string name="colon">\u0020:\u0020</string>
+    <string name="ssl_information">Information SSL</string>
+    <string name="applied_cipher">Chiffrement en vigueur</string>
+    <string name="peer_principal">Pair Principal</string>
+    <string name="certificate_type">Type de Certificat</string>
+    <string name="certificate_hash_code">Code de hachage du certificat</string>
+    <string name="ciphers">Chiffrements</string>
+    <string name="available_ciphers">Chiffrements disponibles</string>
+    <string name="certificate">Certificat</string>
     <string name="request_headers">En-tête de la requête</string>
     <string name="response_message">Message de la réponse</string>
     <string name="response_headers">En-tête de la réponse</string>
     <string name="about_view_headers_message">Puisqu\'Android Webview ne permet pas de révêler l\'information source,
         une requête séparée a été effectuée en utilisant les outils sytèmes afin d\'afficher ce qui est présenté à l\'écran
         Il peut donc y avoir des différences entre ces connées et celle utilisée par Webview. Cette limitation sera supprimée lors de la sortie de Privacy Webview 4.x</string>
+    <string name="headers_copied">En-têtes copiés.</string>
+    <string name="headers_txt">%1$s headers.txt</string>
 
     <!-- Create Home Screen Shortcut Alert Dialog. -->
     <string name="create_shortcut">Créer un raccourci</string>
index 05f94bc95708ff22f785d6d878bc17aa2b0bf7ab..2a105a73db85b0c7d183a0d3c35f97df0c6ba173 100644 (file)
     <string name="open_in_new_tab">Apri in una nuova Scheda</string>
     <string name="open_in_background">Apri in Background</string>
     <string name="open_image_in_new_tab">Apri l\'immagine in una nuova scheda</string>
+    <string name="share_image">Condividi Immagine</string>
     <string name="copy_url">Copia URL</string>
     <string name="email_address">Indirizzo Email</string>
     <string name="copy_email_address">Copia Indirizzo Email</string>
index 706e5454b3c7bdcb199950e4ebd0840616a492a3..092b6613c2a92085c8692cb92035dcb93b9cc0f0 100644 (file)
     <string name="open_in_new_tab">Открыть в новой вкладке</string>
     <string name="open_in_background">Открыть в фоне</string>
     <string name="open_image_in_new_tab">Открыть изображение в новой вкладке</string>
+    <string name="share_image">Поделиться изображением</string>
     <string name="copy_url">Копировать URL</string>
     <string name="email_address">Адрес email</string>
     <string name="copy_email_address">Копировать адрес email</string>