import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
-import android.support.annotation.NonNull;
// If we don't use android.support.v7.app.AlertDialog instead of android.app.AlertDialog then the dialog will be covered by the keyboard.
import android.support.v7.app.AlertDialog;
import android.view.KeyEvent;
}
}
- // onCreateDialog requires @NonNull.
@Override
- @NonNull
public Dialog onCreateDialog(Bundle savedInstanceState) {
// Create a drawable version of the favorite icon.
Drawable favoriteIconDrawable = new BitmapDrawable(getResources(), MainWebViewActivity.favoriteIcon);
LayoutInflater customDialogInflater = getActivity().getLayoutInflater();
// Use AlertDialog.Builder to create the AlertDialog. The style formats the color of the button text.
- AlertDialog.Builder createHomeScreenShorcutDialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowser_AlertDialog);
+ AlertDialog.Builder createHomeScreenShorcutDialogBuilder = new AlertDialog.Builder(getActivity(), R.style.LightAlertDialog);
createHomeScreenShorcutDialogBuilder.setTitle(R.string.create_shortcut);
createHomeScreenShorcutDialogBuilder.setIcon(favoriteIconDrawable);
// The parent view is "null" because it will be assigned by AlertDialog.