public class MainWebViewActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener, CreateHomeScreenShortcutDialog.CreateHomeScreenSchortcutListener,
SslCertificateErrorDialog.SslCertificateErrorListener, DownloadFileDialog.DownloadFileListener, DownloadImageDialog.DownloadImageListener, UrlHistoryDialog.UrlHistoryListener {
- // `darkTheme` is public static so it can be accessed from `AboutActivity` and `GuideActivity`. It is also used in `onCreate()`, `applyAppSettings()`, and `applyDomainSettings()`.
+ // `darkTheme` is public static so it can be accessed from `AboutActivity`, `GuideActivity`, `AddDomainDialog`, `CreateBookmarkDialog`, `CreateBookmarkFolderDialog`, `DownloadFileDialog`, `DownloadImageDialog`, `EditBookmarkDialog`,
+ // `EditBookmarkFolderDialog`, `MoveToFolderDialog`, `SslCertificateErrorDialog`, `UrlHistoryDialog`, `ViewSslCertificateDialog`, `CreateHomeScreenShortcutDialog`, and `OrbotProxyHelper`.
+ // It is also used in `onCreate()`, `applyAppSettings()`, and `applyDomainSettings()`.
public static boolean darkTheme;
// `favoriteIconBitmap` is public static so it can be accessed from `CreateHomeScreenShortcutDialog`, `BookmarksActivity`, `CreateBookmarkDialog`, `CreateBookmarkFolderDialog`, `EditBookmarkDialog`, `EditBookmarkFolderDialog`, `ViewSslCertificateDialog`.
@Override
@NonNull
public Dialog onCreateDialog(Bundle savedInstanceState) {
- // Use `AlertDialog.Builder` to create the `AlertDialog`. The style formats the color of the button text.
- AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.LightAlertDialog);
+ // Use `AlertDialog.Builder` to create the `AlertDialog`.
+ AlertDialog.Builder dialogBuilder;
+
+ // Set the style according to the theme.
+ if (MainWebViewActivity.darkTheme) {
+ dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogDark);
+ } else {
+ dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogLight);
+ }
+
+ // Set the title.
dialogBuilder.setTitle(R.string.add_domain);
- // The parent view is `null` because it will be assigned by the `AlertDialog`.
+
+ // Set the view. The parent view is `null` because it will be assigned by the `AlertDialog`.
dialogBuilder.setView(getActivity().getLayoutInflater().inflate(R.layout.add_domain_dialog, null));
// Set an `onClick()` listener for the negative button.
// Create a drawable version of the favorite icon.
Drawable favoriteIconDrawable = new BitmapDrawable(getResources(), MainWebViewActivity.favoriteIconBitmap);
- // Use `AlertDialog.Builder` to create the `AlertDialog`. The style formats the color of the button text.
- AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.LightAlertDialog);
+ // Use `AlertDialog.Builder` to create the `AlertDialog`.
+ AlertDialog.Builder dialogBuilder;
+
+ // Set the style according to the theme.
+ if (MainWebViewActivity.darkTheme) {
+ dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogDark);
+ } else {
+ dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogLight);
+ }
+
+ // Set the title and icon.
dialogBuilder.setTitle(R.string.create_bookmark);
dialogBuilder.setIcon(favoriteIconDrawable);
- // The parent view is `null` because it will be assigned by the `AlertDialog`.
+
+ // Set the view. The parent view is `null` because it will be assigned by the `AlertDialog`.
dialogBuilder.setView(getActivity().getLayoutInflater().inflate(R.layout.create_bookmark_dialog, null));
// Set an `onClick()` listener for the negative button.
@Override
@NonNull
public Dialog onCreateDialog(Bundle savedInstanceState) {
- // Use `AlertDialog.Builder` to create the `AlertDialog`. The style formats the color of the button text.
- final AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.LightAlertDialog);
+ // Use `AlertDialog.Builder` to create the `AlertDialog`.
+ AlertDialog.Builder dialogBuilder;
+
+ // Set the style according to the theme.
+ if (MainWebViewActivity.darkTheme) {
+ dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogDark);
+ } else {
+ dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogLight);
+ }
+
+ // Set the title.
dialogBuilder.setTitle(R.string.create_folder);
- // The parent view is `null` because it will be assigned by the `AlertDialog`.
+
+ // Set the view. The parent view is `null` because it will be assigned by the `AlertDialog`.
dialogBuilder.setView(getActivity().getLayoutInflater().inflate(R.layout.create_bookmark_folder_dialog, null));
// Set an `onClick()` listener for the negative button.
// Create a drawable version of the favorite icon.
Drawable favoriteIconDrawable = new BitmapDrawable(getResources(), MainWebViewActivity.favoriteIconBitmap);
- // Use `AlertDialog.Builder` to create the `AlertDialog`. `R.style.LightAlertDialog` formats the color of the button text.
- AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.LightAlertDialog);
+ // Use `AlertDialog.Builder` to create the `AlertDialog`.
+ AlertDialog.Builder dialogBuilder;
+
+ // Set the style according to the theme.
+ if (MainWebViewActivity.darkTheme) {
+ dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogDark);
+ } else {
+ dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogLight);
+ }
+
+ // Set the title and icon.
dialogBuilder.setTitle(R.string.create_shortcut);
dialogBuilder.setIcon(favoriteIconDrawable);
- // The parent view is `null` because it will be assigned by `AlertDialog`.
+
+ // Set the view. The parent view is `null` because it will be assigned by `AlertDialog`.
dialogBuilder.setView(layoutInflater.inflate(R.layout.create_home_screen_shortcut_dialog, null));
// Set an `onClick` listener on the negative button.
import android.widget.TextView;
import com.stoutner.privacybrowser.R;
+import com.stoutner.privacybrowser.activities.MainWebViewActivity;
import java.util.Locale;
// Get the activity's layout inflater.
LayoutInflater layoutInflater = getActivity().getLayoutInflater();
- // Use `AlertDialog.Builder` to create the `AlertDialog`. `R.style.lightAlertDialog` formats the color of the button text.
- AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.LightAlertDialog);
+ // Use `AlertDialog.Builder` to create the `AlertDialog`.
+ AlertDialog.Builder dialogBuilder;
+
+ // Set the style according to the theme.
+ if (MainWebViewActivity.darkTheme) {
+ dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogDark);
+ } else {
+ dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogLight);
+ }
// Set the title.
dialogBuilder.setTitle(R.string.save_as);
import android.widget.EditText;
import com.stoutner.privacybrowser.R;
+import com.stoutner.privacybrowser.activities.MainWebViewActivity;
// `android.support.v7.app.AlertDialog` uses more of the horizontal screen real estate versus `android.app.AlertDialog's` smaller width.
// We have to use `AppCompatDialogFragment` instead of `DialogFragment` or an error is produced on API <=22.
// Get the activity's layout inflater.
LayoutInflater layoutInflater = getActivity().getLayoutInflater();
- // Use `AlertDialog.Builder` to create the `AlertDialog`. `R.style.lightAlertDialog` formats the color of the button text.
- AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.LightAlertDialog);
+ // Use `AlertDialog.Builder` to create the `AlertDialog`.
+ AlertDialog.Builder dialogBuilder;
+
+ // Set the style according to the theme.
+ if (MainWebViewActivity.darkTheme) {
+ dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogDark);
+ } else {
+ dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogLight);
+ }
+
+ // Set the title.
dialogBuilder.setTitle(R.string.save_image_as);
- // The parent view is `null` because it will be assigned by `AlertDialog`.
+
+ // Set the view. The parent view is `null` because it will be assigned by `AlertDialog`.
dialogBuilder.setView(layoutInflater.inflate(R.layout.download_image_dialog, null));
// Set an `onClick()` listener on the negative button.
Cursor bookmarkCursor = BookmarksActivity.bookmarksDatabaseHelper.getBookmarkCursor(selectedBookmarkDatabaseId);
bookmarkCursor.moveToFirst();
- // Use `AlertDialog.Builder` to create the `AlertDialog`. The style formats the color of the button text.
- AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.LightAlertDialog);
+ // Use `AlertDialog.Builder` to create the `AlertDialog`.
+ AlertDialog.Builder dialogBuilder;
+
+ // Set the style according to the theme.
+ if (MainWebViewActivity.darkTheme) {
+ dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogDark);
+ } else {
+ dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogLight);
+ }
+
+ // Set the title.
dialogBuilder.setTitle(R.string.edit_bookmark);
- // The parent view is `null` because it will be assigned by `AlertDialog`.
+
+ // Set the view. The parent view is `null` because it will be assigned by `AlertDialog`.
dialogBuilder.setView(getActivity().getLayoutInflater().inflate(R.layout.edit_bookmark_dialog, null));
// Set an `onClick()` listener for the negative button.
Cursor bookmarkCursor = BookmarksActivity.bookmarksDatabaseHelper.getBookmarkCursor(selectedBookmarkDatabaseId);
bookmarkCursor.moveToFirst();
- // Use `AlertDialog.Builder` to create the `AlertDialog`. The style formats the color of the button text.
- AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.LightAlertDialog);
+ // Use `AlertDialog.Builder` to create the `AlertDialog`.
+ AlertDialog.Builder dialogBuilder;
+
+ // Set the style according to the theme.
+ if (MainWebViewActivity.darkTheme) {
+ dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogDark);
+ } else {
+ dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogLight);
+ }
+
+ // Set the title.
dialogBuilder.setTitle(R.string.edit_folder);
- // The parent view is `null` because it will be assigned by `AlertDialog`.
+
+ // Set the view. The parent view is `null` because it will be assigned by `AlertDialog`.
dialogBuilder.setView(getActivity().getLayoutInflater().inflate(R.layout.edit_bookmark_folder_dialog, null));
// Set an `onClick()` listener for the negative button.
import com.stoutner.privacybrowser.R;
import com.stoutner.privacybrowser.activities.BookmarksActivity;
+import com.stoutner.privacybrowser.activities.MainWebViewActivity;
import com.stoutner.privacybrowser.helpers.BookmarksDatabaseHelper;
import java.io.ByteArrayOutputStream;
@Override
@NonNull
public Dialog onCreateDialog(Bundle savedInstanceState) {
- // Use `AlertDialog.Builder` to create the `AlertDialog`. The style formats the color of the button text.
- AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.LightAlertDialog);
+ // Use `AlertDialog.Builder` to create the `AlertDialog`.
+ AlertDialog.Builder dialogBuilder;
+
+ // Set the style according to the theme.
+ if (MainWebViewActivity.darkTheme) {
+ dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogDark);
+ } else {
+ dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogLight);
+ }
+
+ // Set the title.
dialogBuilder.setTitle(R.string.move_to_folder);
- // The parent view is `null` because it will be assigned by `AlertDialog`.
+
+ // Set the view. The parent view is `null` because it will be assigned by `AlertDialog`.
dialogBuilder.setView(getActivity().getLayoutInflater().inflate(R.layout.move_to_folder_dialog, null));
// Set an `onClick()` listener for the negative button.
import android.widget.TextView;
import com.stoutner.privacybrowser.R;
+import com.stoutner.privacybrowser.activities.MainWebViewActivity;
import java.text.DateFormat;
import java.util.Date;
// Get the activity's layout inflater.
LayoutInflater layoutInflater = getActivity().getLayoutInflater();
- // Use `AlertDialog.Builder` to create the `AlertDialog`. `R.style.LightAlertDialog` formats the color of the button text.
- AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.LightAlertDialog);
+ // Use `AlertDialog.Builder` to create the `AlertDialog`.
+ AlertDialog.Builder dialogBuilder;
+
+ // Set the style according to the theme.
+ if (MainWebViewActivity.darkTheme) {
+ dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogDark);
+ } else {
+ dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogLight);
+ }
+
+ // Set the title.
dialogBuilder.setTitle(R.string.ssl_certificate_error);
- // The parent view is `null` because it will be assigned by `AlertDialog`.
+
+ // Set the view. The parent view is `null` because it will be assigned by `AlertDialog`.
dialogBuilder.setView(layoutInflater.inflate(R.layout.ssl_certificate_error, null));
// Set an `onClick` listener on the negative button. `null` doesn't do anything extra when the button is pressed. The `Dialog` will automatically close.
SpannableStringBuilder startDateStringBuilder = new SpannableStringBuilder(startDateLabel + startDate);
SpannableStringBuilder endDateStringBuilder = new SpannableStringBuilder((endDateLabel + endDate));
- // Create the `ForegroundColorSpan`. We have to use the deprecated `getColor` until API >= 23.
- ForegroundColorSpan blueColorSpan = new ForegroundColorSpan(getResources().getColor(R.color.blue_700));
- ForegroundColorSpan redColorSpan = new ForegroundColorSpan(getResources().getColor(R.color.red_a700));
+ // Create a red `ForegroundColorSpan`. We have to use the deprecated `getColor` until API >= 23.
+ @SuppressWarnings("deprecation") ForegroundColorSpan redColorSpan = new ForegroundColorSpan(getResources().getColor(R.color.red_a700));
+
+ // Create a blue `ForegroundColorSpan`.
+ ForegroundColorSpan blueColorSpan;
+
+ // Set `blueColorSpan` according to the theme. We have to use the deprecated `getColor()` until API >= 23.
+ if (MainWebViewActivity.darkTheme) {
+ //noinspection deprecation
+ blueColorSpan = new ForegroundColorSpan(getResources().getColor(R.color.blue_400));
+ } else {
+ //noinspection deprecation
+ blueColorSpan = new ForegroundColorSpan(getResources().getColor(R.color.blue_700));
+ }
// Setup the spans to display the certificate information in blue. `SPAN_INCLUSIVE_INCLUSIVE` allows the span to grow in either direction.
urlStringBuilder.setSpan(blueColorSpan, urlLabel.length(), urlStringBuilder.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
import android.widget.ListView;
import com.stoutner.privacybrowser.R;
+import com.stoutner.privacybrowser.activities.MainWebViewActivity;
import com.stoutner.privacybrowser.adapters.HistoryArrayAdapter;
import com.stoutner.privacybrowser.definitions.History;
// Get the activity's layout inflater.
LayoutInflater layoutInflater = getActivity().getLayoutInflater();
- // Use `AlertDialog.Builder` to create the `AlertDialog`. `R.style.lightAlertDialog` formats the color of the button text.
- AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.LightAlertDialog);
+ // Use `AlertDialog.Builder` to create the `AlertDialog`.
+ AlertDialog.Builder dialogBuilder;
+
+ // Set the style according to the theme.
+ if (MainWebViewActivity.darkTheme) {
+ dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogDark);
+ } else {
+ dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogLight);
+ }
// Set the title.
dialogBuilder.setTitle(R.string.history);
// Create a drawable version of the favorite icon.
Drawable favoriteIconDrawable = new BitmapDrawable(getResources(), MainWebViewActivity.favoriteIconBitmap);
- // Use `AlertDialog.Builder` to create the `AlertDialog`. `R.style.LightAlertDialog` formats the color of the button text.
- AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.LightAlertDialog);
+ // Use `AlertDialog.Builder` to create the `AlertDialog`.
+ AlertDialog.Builder dialogBuilder;
+
+ // Set the style according to the theme.
+ if (MainWebViewActivity.darkTheme) {
+ dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogDark);
+ } else {
+ dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogLight);
+ }
+
+ // Set the icon.
dialogBuilder.setIcon(favoriteIconDrawable);
// Set an `onClick` listener on the negative button. Using `null` closes the dialog without doing anything else.
SpannableStringBuilder startDateStringBuilder = new SpannableStringBuilder(startDateLabel + DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.LONG).format(startDate));
SpannableStringBuilder endDateStringBuilder = new SpannableStringBuilder(endDateLabel + DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.LONG).format(endDate));
- // Create a blue `ForegroundColorSpan`. We have to use the deprecated `getColor` until API >= 23.
- @SuppressWarnings("deprecation") ForegroundColorSpan blueColorSpan = new ForegroundColorSpan(getResources().getColor(R.color.blue_700));
+ // Create a red `ForegroundColorSpan`. We have to use the deprecated `getColor` until API >= 23.
@SuppressWarnings("deprecation") ForegroundColorSpan redColorSpan = new ForegroundColorSpan(getResources().getColor(R.color.red_a700));
+ // Create a blue `ForegroundColorSpan`.
+ ForegroundColorSpan blueColorSpan;
+
+ // Set `blueColorSpan` according to the theme. We have to use the deprecated `getColor()` until API >= 23.
+ if (MainWebViewActivity.darkTheme) {
+ //noinspection deprecation
+ blueColorSpan = new ForegroundColorSpan(getResources().getColor(R.color.blue_400));
+ } else {
+ //noinspection deprecation
+ blueColorSpan = new ForegroundColorSpan(getResources().getColor(R.color.blue_700));
+ }
+
// Setup the spans to display the certificate information in blue. `SPAN_INCLUSIVE_INCLUSIVE` allows the span to grow in either direction.
issuedToCNameStringBuilder.setSpan(blueColorSpan, cNameLabel.length(), issuedToCNameStringBuilder.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
issuedToONameStringBuilder.setSpan(blueColorSpan, oNameLabel.length(), issuedToONameStringBuilder.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
privacyBrowserContext.sendBroadcast(orbotIntent);
}
} catch (PackageManager.NameNotFoundException exception){ // If an exception is thrown, Orbot is not installed.
- // Build an `AlertDialog`. `R.style.LightAlertDialog` formats the color of the button text.
- AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(parentActivity, R.style.LightAlertDialog);
+ // Use `AlertDialog.Builder` to create the `AlertDialog`.
+ AlertDialog.Builder dialogBuilder;
+
+ // Set the style according to the theme.
+ if (MainWebViewActivity.darkTheme) {
+ dialogBuilder = new AlertDialog.Builder(parentActivity, R.style.PrivacyBrowserAlertDialogDark);
+ } else {
+ dialogBuilder = new AlertDialog.Builder(parentActivity, R.style.PrivacyBrowserAlertDialogLight);
+ }
+
+ // Set the message.
dialogBuilder.setMessage(R.string.orbot_proxy_not_installed);
+
+ // Set the positive button.
dialogBuilder.setPositiveButton(R.string.close, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
});
- // Convert `dialogBuilder` to `alertDialog` and display it on the screen.
+ // Convert `dialogBuilder` to `alertDialog`.
AlertDialog alertDialog = dialogBuilder.create();
+
+ // Make it so.
alertDialog.show();
}
}
android:layout_marginEnd="4dp" >
<!-- `android:imeOptions="actionGo"` sets the keyboard to have a `go` key instead of a `new line` key.
- `android:inputType="textUri"` disables spell check in the `EditText`. -->
+ `android:inputType="textUri"` disables spell check in the `EditText`. -->
<android.support.design.widget.TextInputEditText
android:id="@+id/shortcut_name_edittext"
android:layout_width="match_parent"
You should have received a copy of the GNU General Public License
along with Privacy Browser. If not, see <http://www.gnu.org/licenses/>. -->
-<LinearLayout
+<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical">
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent" >
- <!-- The icon selection rows. -->
<LinearLayout
+ xmlns:tools="http://schemas.android.com/tools"
android:layout_height="wrap_content"
android:layout_width="match_parent"
- android:orientation="horizontal">
+ android:orientation="vertical" >
- <!-- The column displaying the icons. -->
+ <!-- The icon selection rows. -->
<LinearLayout
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:layout_marginStart="16dp"
- android:layout_marginEnd="10dp"
- android:orientation="vertical" >
-
- <ImageView
- android:id="@+id/edit_bookmark_current_icon"
- android:layout_width="30dp"
- android:layout_height="30dp"
- android:layout_marginTop="12dp"
- android:layout_marginBottom="6dp"
- android:layout_gravity="center_vertical"
- tools:ignore="ContentDescription" />
-
- <ImageView
- android:id="@+id/edit_bookmark_web_page_favorite_icon"
- android:layout_width="30dp"
- android:layout_height="30dp"
- android:layout_marginTop="6dp"
- android:layout_marginBottom="6dp"
- tools:ignore="ContentDescription" />
- </LinearLayout>
-
- <!-- The column with the `RadioGroup`. -->
- <RadioGroup
android:layout_height="wrap_content"
android:layout_width="match_parent"
- android:checkedButton="@+id/edit_bookmark_current_icon_radiobutton" >
+ android:orientation="horizontal" >
- <RadioButton
- android:id="@id/edit_bookmark_current_icon_radiobutton"
+ <!-- The column displaying the icons. -->
+ <LinearLayout
android:layout_height="wrap_content"
android:layout_width="wrap_content"
- android:layout_marginTop="12dp"
- android:layout_marginBottom="4dp"
- android:text="@string/current_bookmark_icon"
- android:textSize="18sp" />
-
- <RadioButton
- android:id="@+id/edit_bookmark_web_page_favorite_icon_radiobutton"
+ android:layout_marginStart="16dp"
+ android:layout_marginEnd="10dp"
+ android:orientation="vertical" >
+
+ <ImageView
+ android:id="@+id/edit_bookmark_current_icon"
+ android:layout_width="30dp"
+ android:layout_height="30dp"
+ android:layout_marginTop="12dp"
+ android:layout_marginBottom="6dp"
+ android:layout_gravity="center_vertical"
+ tools:ignore="ContentDescription" />
+
+ <ImageView
+ android:id="@+id/edit_bookmark_web_page_favorite_icon"
+ android:layout_width="30dp"
+ android:layout_height="30dp"
+ android:layout_marginTop="6dp"
+ android:layout_marginBottom="6dp"
+ tools:ignore="ContentDescription" />
+ </LinearLayout>
+
+ <!-- The column with the `RadioGroup`. -->
+ <RadioGroup
android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:layout_marginTop="5dp"
- android:text="@string/web_page_favorite_icon"
- android:textSize="18sp" />
- </RadioGroup>
- </LinearLayout>
+ android:layout_width="match_parent"
+ android:checkedButton="@+id/edit_bookmark_current_icon_radiobutton" >
+
+ <RadioButton
+ android:id="@id/edit_bookmark_current_icon_radiobutton"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_marginTop="12dp"
+ android:layout_marginBottom="4dp"
+ android:text="@string/current_bookmark_icon"
+ android:textSize="18sp" />
+
+ <RadioButton
+ android:id="@+id/edit_bookmark_web_page_favorite_icon_radiobutton"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_marginTop="5dp"
+ android:text="@string/web_page_favorite_icon"
+ android:textSize="18sp" />
+ </RadioGroup>
+ </LinearLayout>
- <!-- `android.support.design.widget.TextInputLayout` makes the `android:hint` float above the `EditText`. -->
- <android.support.design.widget.TextInputLayout
- android:layout_height="wrap_content"
- android:layout_width="match_parent"
- android:layout_marginTop="12dp"
- android:layout_marginBottom="6dp"
- android:layout_marginStart="4dp"
- android:layout_marginEnd="4dp" >
-
- <!-- `android:imeOptions="actionGo"` sets the keyboard to have a `go` key instead of a `new line` key.
- `android:inputType="textUri"` disables spell check in the `EditText`. -->
- <android.support.design.widget.TextInputEditText
- android:id="@+id/edit_bookmark_name_edittext"
+ <!-- `android.support.design.widget.TextInputLayout` makes the `android:hint` float above the `EditText`. -->
+ <android.support.design.widget.TextInputLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
- android:hint="@string/bookmark_name"
- android:imeOptions="actionGo"
- android:inputType="textUri" />
- </android.support.design.widget.TextInputLayout>
-
- <!-- `android.support.design.widget.TextInputLayout` makes the `android:hint` float above the `EditText`. -->
- <android.support.design.widget.TextInputLayout
- android:layout_height="wrap_content"
- android:layout_width="match_parent"
- android:layout_marginTop="6dp"
- android:layout_marginBottom="12dp"
- android:layout_marginStart="4dp"
- android:layout_marginEnd="4dp" >
-
- <!-- `android:imeOptions="actionGo"` sets the keyboard to have a "go" key instead of a "new line" key.
- `android:inputType="textUri"` disables spell check in the EditText.
- `android:singleLine="true"` is not needed in a Dialog.-->
- <EditText
- android:id="@+id/edit_bookmark_url_edittext"
+ android:layout_marginTop="12dp"
+ android:layout_marginBottom="6dp"
+ android:layout_marginStart="4dp"
+ android:layout_marginEnd="4dp" >
+
+ <!-- `android:imeOptions="actionGo"` sets the keyboard to have a `go` key instead of a `new line` key.
+ `android:inputType="textUri"` disables spell check in the `EditText`. -->
+ <android.support.design.widget.TextInputEditText
+ android:id="@+id/edit_bookmark_name_edittext"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:hint="@string/bookmark_name"
+ android:imeOptions="actionGo"
+ android:inputType="textUri" />
+ </android.support.design.widget.TextInputLayout>
+
+ <!-- `android.support.design.widget.TextInputLayout` makes the `android:hint` float above the `EditText`. -->
+ <android.support.design.widget.TextInputLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
- android:hint="@string/bookmark_url"
- android:imeOptions="actionGo"
- android:inputType="textUri" />
- </android.support.design.widget.TextInputLayout>
-</LinearLayout>
\ No newline at end of file
+ android:layout_marginTop="6dp"
+ android:layout_marginBottom="12dp"
+ android:layout_marginStart="4dp"
+ android:layout_marginEnd="4dp" >
+
+ <!-- `android:imeOptions="actionGo"` sets the keyboard to have a "go" key instead of a "new line" key.
+ `android:inputType="textUri"` disables spell check in the EditText.
+ `android:singleLine="true"` is not needed in a Dialog.-->
+ <EditText
+ android:id="@+id/edit_bookmark_url_edittext"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:hint="@string/bookmark_url"
+ android:imeOptions="actionGo"
+ android:inputType="textUri" />
+ </android.support.design.widget.TextInputLayout>
+ </LinearLayout>
+</ScrollView>
\ No newline at end of file
You should have received a copy of the GNU General Public License
along with Privacy Browser. If not, see <http://www.gnu.org/licenses/>. -->
-<LinearLayout
+<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
android:layout_height="wrap_content"
- android:layout_width="match_parent"
- android:orientation="vertical" >
+ android:layout_width="match_parent" >
- <!-- The icon selection rows. -->
<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
android:layout_height="wrap_content"
android:layout_width="match_parent"
- android:orientation="horizontal">
+ android:orientation="vertical" >
- <!-- The column displaying the icons. -->
+ <!-- The icon selection rows. -->
<LinearLayout
android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:orientation="vertical"
- android:layout_marginStart="16dp"
- android:layout_marginEnd="10dp" >
-
- <ImageView
- android:id="@+id/edit_folder_current_icon"
- android:layout_height="30dp"
- android:layout_width="30dp"
- android:layout_marginTop="12dp"
- android:layout_marginBottom="6dp"
- android:layout_gravity="center_vertical"
- tools:ignore="ContentDescription" />
-
- <ImageView
- android:id="@+id/edit_folder_default_icon"
- android:layout_height="30dp"
- android:layout_width="30dp"
- android:layout_marginTop="6dp"
- android:layout_marginBottom="6dp"
- android:layout_gravity="center_vertical"
- android:src="@drawable/folder_blue_bitmap"
- tools:ignore="ContentDescription" />
-
- <ImageView
- android:id="@+id/edit_folder_web_page_favorite_icon"
- android:layout_height="30dp"
- android:layout_width="30dp"
- android:layout_marginTop="6dp"
- android:layout_marginBottom="12dp"
- android:layout_gravity="center_vertical"
- tools:ignore="ContentDescription" />
- </LinearLayout>
-
- <!-- The column with the `RadioGroup`. -->
- <RadioGroup
android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:checkedButton="@+id/edit_folder_current_icon_radiobutton">
+ android:orientation="horizontal">
- <RadioButton
- android:id="@id/edit_folder_current_icon_radiobutton"
+ <!-- The column displaying the icons. -->
+ <LinearLayout
android:layout_height="wrap_content"
android:layout_width="wrap_content"
- android:layout_marginTop="12dp"
- android:layout_marginBottom="4dp"
- android:text="@string/current_folder_icon"
- android:textSize="18sp"/>
-
- <RadioButton
- android:id="@+id/edit_folder_default_icon_radiobutton"
- android:layout_width="wrap_content"
+ android:orientation="vertical"
+ android:layout_marginStart="16dp"
+ android:layout_marginEnd="10dp" >
+
+ <ImageView
+ android:id="@+id/edit_folder_current_icon"
+ android:layout_height="30dp"
+ android:layout_width="30dp"
+ android:layout_marginTop="12dp"
+ android:layout_marginBottom="6dp"
+ android:layout_gravity="center_vertical"
+ tools:ignore="ContentDescription" />
+
+ <ImageView
+ android:id="@+id/edit_folder_default_icon"
+ android:layout_height="30dp"
+ android:layout_width="30dp"
+ android:layout_marginTop="6dp"
+ android:layout_marginBottom="6dp"
+ android:layout_gravity="center_vertical"
+ android:src="@drawable/folder_blue_bitmap"
+ tools:ignore="ContentDescription" />
+
+ <ImageView
+ android:id="@+id/edit_folder_web_page_favorite_icon"
+ android:layout_height="30dp"
+ android:layout_width="30dp"
+ android:layout_marginTop="6dp"
+ android:layout_marginBottom="12dp"
+ android:layout_gravity="center_vertical"
+ tools:ignore="ContentDescription" />
+ </LinearLayout>
+
+ <!-- The column with the `RadioGroup`. -->
+ <RadioGroup
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginTop="5dp"
- android:layout_marginBottom="4dp"
- android:text="@string/default_folder_icon"
- android:textSize="18sp" />
+ android:checkedButton="@+id/edit_folder_current_icon_radiobutton">
+
+ <RadioButton
+ android:id="@id/edit_folder_current_icon_radiobutton"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_marginTop="12dp"
+ android:layout_marginBottom="4dp"
+ android:text="@string/current_folder_icon"
+ android:textSize="18sp"/>
+
+ <RadioButton
+ android:id="@+id/edit_folder_default_icon_radiobutton"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="5dp"
+ android:layout_marginBottom="4dp"
+ android:text="@string/default_folder_icon"
+ android:textSize="18sp" />
+
+ <RadioButton
+ android:id="@+id/edit_folder_web_page_icon_radiobutton"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="5dp"
+ android:text="@string/web_page_favorite_icon"
+ android:textSize="18sp" />
+ </RadioGroup>
+ </LinearLayout>
- <RadioButton
- android:id="@+id/edit_folder_web_page_icon_radiobutton"
- android:layout_width="wrap_content"
+ <!-- `android.support.design.widget.TextInputLayout` makes the `android:hint` float above the `EditText`. -->
+ <android.support.design.widget.TextInputLayout
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:layout_marginTop="6dp"
+ android:layout_marginBottom="12dp"
+ android:layout_marginStart="4dp"
+ android:layout_marginEnd="4dp" >
+
+ <!-- `android:imeOptions="actionGo"` sets the keyboard to have a "go" key instead of a "new line" key.
+ `android:inputType="textUri"` disables spell check in the EditText. -->
+ <android.support.design.widget.TextInputEditText
+ android:id="@+id/edit_folder_name_edittext"
android:layout_height="wrap_content"
- android:layout_marginTop="5dp"
- android:text="@string/web_page_favorite_icon"
- android:textSize="18sp" />
- </RadioGroup>
- </LinearLayout>
+ android:layout_width="match_parent"
+ android:hint="@string/folder_name"
+ android:imeOptions="actionGo"
+ android:inputType="textUri" />
+ </android.support.design.widget.TextInputLayout>
- <!-- `android.support.design.widget.TextInputLayout` makes the `android:hint` float above the `EditText`. -->
- <android.support.design.widget.TextInputLayout
- android:layout_height="wrap_content"
- android:layout_width="match_parent"
- android:layout_marginTop="6dp"
- android:layout_marginBottom="12dp"
- android:layout_marginStart="4dp"
- android:layout_marginEnd="4dp" >
-
- <!-- `android:imeOptions="actionGo"` sets the keyboard to have a "go" key instead of a "new line" key.
- `android:inputType="textUri"` disables spell check in the EditText. -->
- <android.support.design.widget.TextInputEditText
- android:id="@+id/edit_folder_name_edittext"
+ <TextView
android:layout_height="wrap_content"
android:layout_width="match_parent"
- android:hint="@string/folder_name"
- android:imeOptions="actionGo"
- android:inputType="textUri" />
- </android.support.design.widget.TextInputLayout>
-
- <TextView
- android:layout_height="wrap_content"
- android:layout_width="match_parent"
- android:gravity="center_horizontal"
- android:text="@string/folder_names_must_be_unique" />
-</LinearLayout>
\ No newline at end of file
+ android:gravity="center_horizontal"
+ android:text="@string/folder_names_must_be_unique" />
+ </LinearLayout>
+</ScrollView>
\ No newline at end of file
android:text="@string/url"
android:textAllCaps="true"
android:textStyle="bold"
- android:textColor="@color/blue_900" />
+ android:textColor="?attr/sslTitle" />
<TextView
android:id="@+id/url_error_dialog"
android:text="@string/issued_to"
android:textAllCaps="true"
android:textStyle="bold"
- android:textColor="@color/blue_900" />
+ android:textColor="?attr/sslTitle" />
<TextView
android:id="@+id/issued_to_cname_error_dialog"
android:text="@string/issued_by"
android:textAllCaps="true"
android:textStyle="bold"
- android:textColor="@color/blue_900"/>
+ android:textColor="?attr/sslTitle"/>
<TextView
android:id="@+id/issued_by_cname_error_dialog"
android:text="@string/valid_dates"
android:textAllCaps="true"
android:textStyle="bold"
- android:textColor="@color/blue_900"/>
+ android:textColor="?attr/sslTitle"/>
<TextView
android:id="@+id/start_date_error_dialog"
android:id="@+id/history_listview"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
- android:divider="@color/white"
+ android:divider="@color/transparent"
android:dividerHeight="0dp" />
\ No newline at end of file
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:orientation="horizontal"
- android:background="@drawable/listview_item_background_selector" >
+ tools:ignore="UseCompoundDrawables" >
<ImageView
android:id="@+id/history_favorite_icon_imageview"
android:id="@+id/history_url_textview"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
- android:textColor="@color/black"
+ android:textColor="?attr/urlHistoryText"
android:textSize="16sp"
android:layout_margin="10dp"
android:maxLines="1"
android:text="@string/issued_to"
android:textAllCaps="true"
android:textStyle="bold"
- android:textColor="@color/blue_900" />
+ android:textColor="?attr/sslTitle" />
<TextView
android:id="@+id/issued_to_cname"
android:text="@string/issued_by"
android:textAllCaps="true"
android:textStyle="bold"
- android:textColor="@color/blue_900"/>
+ android:textColor="?attr/sslTitle"/>
<TextView
android:id="@+id/issued_by_cname"
android:text="@string/valid_dates"
android:textAllCaps="true"
android:textStyle="bold"
- android:textColor="@color/blue_900"/>
+ android:textColor="?attr/sslTitle"/>
<TextView
android:id="@+id/start_date"
<attr name="aboutTitle" format="reference" />
<attr name="aboutText" format="reference" />
+ <attr name="sslTitle" format="reference" />
+ <attr name="urlHistoryText" format="reference" />
<attr name="navigationHeaderBackground" format="reference" />
<attr name="navigationHeaderTextColor" format="reference" />
<color name="dark_green_15">#FF163317</color>
<color name="gray_100">#FFF5F5F5</color>
+ <color name="gray_200">#FFEEEEEE</color>
<color name="gray_300">#FFE0E0E0</color>
<color name="gray_400">#FFBDBDBD</color>
<color name="gray_500">#FF9E9E9E</color>
<item name="progressTintColor">@color/blue_700</item>
<item name="navigationIconTintColor">@color/blue_800</item>
<item name="findOnPageIconTintColor">@color/blue_700</item>
+ <item name="sslTitle">@color/blue_900</item>
+ <item name="urlHistoryText">@color/black</item>
</style>
<!-- `windowActionModeOverlay` makes the contextual app bar cover the support app bar.
<item name="tabIndicatorColor">@color/white</item>
</style>
- <style name="LightAlertDialog" parent="Theme.AppCompat.Light.Dialog.Alert" >
+ <style name="PrivacyBrowserAlertDialogLight" parent="Theme.AppCompat.Light.Dialog.Alert" >
<item name="colorAccent">@color/blue_700</item>
</style>
<item name="progressTintColor">@color/blue_800</item>
<item name="navigationIconTintColor">@color/blue_900</item>
<item name="findOnPageIconTintColor">@color/blue_900</item>
+ <item name="sslTitle">@color/blue_700</item>
+ <item name="urlHistoryText">@color/gray_200</item>
</style>
<style name="PrivacyBrowserDark.SecondaryActivity" >
<item name="tabIndicatorColor">@color/gray_300</item>
</style>
+ <style name="PrivacyBrowserAlertDialogDark" parent="Theme.AppCompat.Dialog.Alert" >
+ <item name="android:windowBackground">@color/gray_900</item>
+ <item name="android:textColor">@color/gray_300</item>
+ </style>
+
<!-- `ThemeOverlay.AppCompat.Dark` makes the popups have a dark background with light text. -->
<!-- <style name="PrivacyBrowserPopupOverlayDark" parent="ThemeOverlay.AppCompat.Dark" /> -->