X-Git-Url: https://gitweb.stoutner.com/?p=PrivacyBrowserAndroid.git;a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fcom%2Fstoutner%2Fprivacybrowser%2FCreateHomeScreenShortcut.java;h=e50f2ca44187d6a49561907e4097055e3a75e0a0;hp=2349fcdd6b662a70f7541a99fe8d6b8edc303020;hb=a7e15f550848e50703320e8811d24a7cf0d8d189;hpb=b72fd06c1e378ca01c1cccd83ed0c7ae5297b8f4 diff --git a/app/src/main/java/com/stoutner/privacybrowser/CreateHomeScreenShortcut.java b/app/src/main/java/com/stoutner/privacybrowser/CreateHomeScreenShortcut.java index 2349fcdd..e50f2ca4 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/CreateHomeScreenShortcut.java +++ b/app/src/main/java/com/stoutner/privacybrowser/CreateHomeScreenShortcut.java @@ -1,5 +1,20 @@ /** - * Copyright Soren Stoutner 2015. + * Copyright 2015 Soren Stoutner + * + * This file is part of Privacy Browser . + * + * Privacy Browser is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Privacy Browser is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Privacy Browser. If not, see . */ package com.stoutner.privacybrowser; @@ -44,13 +59,12 @@ public class CreateHomeScreenShortcut extends AppCompatDialogFragment { @Override @NonNull public Dialog onCreateDialog(Bundle savedInstanceState) { - AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(getActivity()); - LayoutInflater customDialogInflater = getActivity().getLayoutInflater(); - // Create a drawable version of the favorite icon. Drawable favoriteIconDrawable = new BitmapDrawable(getResources(), Webview.favoriteIcon); - // Setup dialogBuilder. + // Use AlertDialog.Builder to create the AlertDialog + AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(getActivity()); + LayoutInflater customDialogInflater = getActivity().getLayoutInflater(); alertDialogBuilder.setTitle(R.string.shortcut_name); alertDialogBuilder.setIcon(favoriteIconDrawable); alertDialogBuilder.setView(customDialogInflater.inflate(R.layout.create_home_screen_shortcut_dialog, null)); @@ -67,7 +81,7 @@ public class CreateHomeScreenShortcut extends AppCompatDialogFragment { } }); - // Assign the resulting built dialog to an AlertDialog. + // Assign the alertDialogBuilder to an AlertDialog. final AlertDialog alertDialog = alertDialogBuilder.create(); // Show the keyboard when the dialog is displayed on the screen.