import android.content.ClipboardManager;
import android.content.Context;
import android.content.Intent;
+import android.content.SharedPreferences;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
+import android.preference.PreferenceManager;
import android.support.v4.app.DialogFragment;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.app.AppCompatDialogFragment;
+import android.support.v7.widget.Toolbar;
import android.util.Patterns;
import android.view.KeyEvent;
import android.view.Menu;
import java.net.URL;
import java.net.URLEncoder;
+// We need to use AppCompatActivity from android.support.v7.app.AppCompatActivity to have access to the SupportActionBar until the minimum API is >= 21.
public class MainWebView extends AppCompatActivity implements CreateHomeScreenShortcut.CreateHomeScreenSchortcutListener {
// favoriteIcon is public static so it can be accessed from CreateHomeScreenShortcut.
public static Bitmap favoriteIcon;
- // mainWebView is public static so it can be accessed from AboutDialog. It is also used in onCreate and onOptionsItemSelected.
+ // mainWebView is public static so it can be accessed from AboutDialog. It is also used in onCreate(), onOptionsItemSelected(), and loadUrlFromTextBox().
public static WebView mainWebView;
- // formattedUrlString is used in onCreate, onOptionsItemSelected, onCreateHomeScreenShortcutCreate, and loadUrlFromTextBox.
+ // mainMenu is used in onCreateOptionsMenu() and onOptionsItemSelected().
+ private Menu mainMenu;
+ // formattedUrlString is used in onCreate(), onOptionsItemSelected(), onCreateHomeScreenShortcutCreate(), and loadUrlFromTextBox().
private String formattedUrlString;
- // homepage is used in onCreate and onOptionsItemSelected.
- private String homepage = "https://www.duckduckgo.com/";
- // enableJavaScript is used in onCreate, onCreateOptionsMenu, and onOptionsItemSelected.
- private boolean enableJavaScript;
- // enableDomStorage is used in onCreate, onCreateOptionsMenu, and onOptionsItemSelected.
- private boolean enableDomStorage;
-
- /* enableSaveFormData does nothing until database storage is implemented.
- // enableSaveFormData is used in onCreate, onCreateOptionsMenu, and onOptionsItemSelected.
- private boolean enableSaveFormData;
+ // homepage is used in onCreate() and onOptionsItemSelected().
+ private String homepage;
+ // javaScriptEnabled is used in onCreate(), onCreateOptionsMenu(), onOptionsItemSelected(), and loadUrlFromTextBox().
+ private boolean javaScriptEnabled;
+ // domStorageEnabled is used in onCreate(), onCreateOptionsMenu(), and onOptionsItemSelected().
+ private boolean domStorageEnabled;
+
+ /* saveFormDataEnabled does nothing until database storage is implemented.
+ // saveFormDataEnabled is used in onCreate(), onCreateOptionsMenu(), and onOptionsItemSelected().
+ private boolean saveFormDataEnabled;
*/
- // cookieManager is used in onCreate and onOptionsItemSelected.
+ // cookieManager is used in onCreate() and onOptionsItemSelected().
private CookieManager cookieManager;
- // enableCookies is used in onCreate, onCreateOptionsMenu, and onOptionsItemSelected.
- private boolean enableCookies;
+ // cookiesEnabled is used in onCreate(), onCreateOptionsMenu(), and onOptionsItemSelected().
+ private boolean cookiesEnabled;
- // actionBar is used in onCreate and onOptionsItemSelected.
- private ActionBar actionBar;
+ // urlTextBox is used in onCreate(), onOptionsItemSelected(), and loadUrlFromTextBox().
+ private EditText urlTextBox;
@Override
// Remove Android Studio's warning about the dangers of using SetJavaScriptEnabled.
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_webview);
+ Toolbar toolbar = (Toolbar) findViewById(R.id.appBar);
+ setSupportActionBar(toolbar);
final FrameLayout fullScreenVideoFrameLayout = (FrameLayout) findViewById(R.id.fullScreenVideoFrameLayout);
final Activity mainWebViewActivity = this;
+ // We need to use the SupportActionBar from android.support.v7.app.ActionBar until the minimum API is >= 21.
+ final ActionBar appBar = getSupportActionBar();
mainWebView = (WebView) findViewById(R.id.mainWebView);
- actionBar = getSupportActionBar();
- if (actionBar != null) {
- // Remove the title from the action bar.
- actionBar.setDisplayShowTitleEnabled(false);
+ if (appBar != null) {
+ // Remove the title from the app bar.
+ appBar.setDisplayShowTitleEnabled(false);
- // Add the custom app_bar layout, which shows the favoriteIcon, urlTextBar, and progressBar.
- actionBar.setCustomView(R.layout.app_bar);
- actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
+ // Add the custom url_bar layout, which shows the favoriteIcon, urlTextBar, and progressBar.
+ appBar.setCustomView(R.layout.url_bar);
+ appBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
// Set the "go" button on the keyboard to load the URL in urlTextBox.
- EditText urlTextBox = (EditText) actionBar.getCustomView().findViewById(R.id.urlTextBox);
+ urlTextBox = (EditText) appBar.getCustomView().findViewById(R.id.urlTextBox);
urlTextBox.setOnKeyListener(new View.OnKeyListener() {
public boolean onKey(View v, int keyCode, KeyEvent event) {
// If the event is a key-down event on the "enter" button, load the URL.
// Update the URL in urlTextBox when the page starts to load.
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
- if (actionBar != null) {
- EditText urlTextBox = (EditText) actionBar.getCustomView().findViewById(R.id.urlTextBox);
- urlTextBox.setText(url);
- }
+ urlTextBox.setText(url);
}
// Update formattedUrlString and urlTextBox. It is necessary to do this after the page finishes loading because the final URL can change during load.
@Override
public void onPageFinished(WebView view, String url) {
formattedUrlString = url;
-
- if (actionBar != null) {
- EditText urlTextBox = (EditText) actionBar.getCustomView().findViewById(R.id.urlTextBox);
- urlTextBox.setText(formattedUrlString);
- }
+ urlTextBox.setText(formattedUrlString);
}
});
// Update the progress bar when a page is loading.
@Override
public void onProgressChanged(WebView view, int progress) {
- // Make sure that actionBar is not null.
- if (actionBar != null) {
- ProgressBar progressBar = (ProgressBar) actionBar.getCustomView().findViewById(R.id.progressBar);
+ // Make sure that appBar is not null.
+ if (appBar != null) {
+ ProgressBar progressBar = (ProgressBar) appBar.getCustomView().findViewById(R.id.progressBar);
progressBar.setProgress(progress);
if (progress < 100) {
progressBar.setVisibility(View.VISIBLE);
// Save a copy of the favorite icon for use if a shortcut is added to the home screen.
favoriteIcon = icon;
- // Place the favorite icon in the actionBar if it is not null.
- if (actionBar != null) {
- ImageView imageViewFavoriteIcon = (ImageView) actionBar.getCustomView().findViewById(R.id.favoriteIcon);
+ // Place the favorite icon in the appBar if it is not null.
+ if (appBar != null) {
+ ImageView imageViewFavoriteIcon = (ImageView) appBar.getCustomView().findViewById(R.id.favoriteIcon);
imageViewFavoriteIcon.setImageBitmap(Bitmap.createScaledBitmap(icon, 64, 64, true));
}
}
// Enter full screen video
@Override
public void onShowCustomView(View view, CustomViewCallback callback) {
- if (getSupportActionBar() != null) {
- getSupportActionBar().hide();
+ if (appBar != null) {
+ appBar.hide();
}
fullScreenVideoFrameLayout.addView(view);
// Exit full screen video
public void onHideCustomView() {
- if (getSupportActionBar() != null) {
- getSupportActionBar().show();
+ if (appBar != null) {
+ appBar.show();
}
mainWebView.setVisibility(View.VISIBLE);
mainWebView.getSettings().setDisplayZoomControls(false);
}
+ // Initialize the default preference values the first time the program is run.
+ PreferenceManager.setDefaultValues(this, R.xml.preferences, false);
+
+ // Get the shared preference values.
+ SharedPreferences savedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
+
// Set JavaScript initial status.
- enableJavaScript = false;
- mainWebView.getSettings().setJavaScriptEnabled(enableJavaScript);
+ javaScriptEnabled = savedPreferences.getBoolean("javascript_enabled", false);
+ mainWebView.getSettings().setJavaScriptEnabled(javaScriptEnabled);
- // Set DOM Storage initial status.
- enableDomStorage = false;
- mainWebView.getSettings().setDomStorageEnabled(enableDomStorage);
+ // Set DOM storage initial status.
+ domStorageEnabled = savedPreferences.getBoolean("dom_storage_enabled", false);
+ mainWebView.getSettings().setDomStorageEnabled(domStorageEnabled);
/* Save Form Data does nothing until database storage is implemented.
// Set Save Form Data initial status.
- enableSaveFormData = true;
- mainWebView.getSettings().setSaveFormData(enableSaveFormData);
+ saveFormDataEnabled = true;
+ mainWebView.getSettings().setSaveFormData(saveFormDataEnabled);
*/
- // Set Cookies initial status.
- enableCookies = false;
+ // Set cookies initial status.
+ cookiesEnabled = savedPreferences.getBoolean("cookies_enabled", false);
cookieManager = CookieManager.getInstance();
- cookieManager.setAcceptCookie(enableCookies);
+ cookieManager.setAcceptCookie(cookiesEnabled);
+
+ // Set hompage initial status.
+ homepage = savedPreferences.getString("homepage", "https://www.duckduckgo.com");
// Get the intent information that started the app.
final Intent intent = getIntent();
@Override
protected void onNewIntent(Intent intent) {
- // Sets the new intent as the activity intent, so that any future getIntent() picks up this one.
+ // Sets the new intent as the activity intent, so that any future getIntent()s pick up this one instead of creating a new activity.
setIntent(intent);
if (intent.getData() != null) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_webview, menu);
+ // Set mainMenu so it can be used by onOptionsItemSelected.
+ mainMenu = menu;
+
// Get MenuItems for checkable menu items.
MenuItem toggleJavaScript = menu.findItem(R.id.toggleJavaScript);
MenuItem toggleDomStorage = menu.findItem(R.id.toggleDomStorage);
MenuItem toggleCookies = menu.findItem(R.id.toggleCookies);
// Set the initial icon for toggleJavaScript
- if (enableJavaScript) {
- toggleJavaScript.setIcon(R.drawable.javascript_on);
+ if (javaScriptEnabled) {
+ toggleJavaScript.setIcon(R.drawable.javascript_enabled);
} else {
- toggleJavaScript.setIcon(R.drawable.javascript_off);
+ if (domStorageEnabled || cookiesEnabled) {
+ toggleJavaScript.setIcon(R.drawable.warning);
+ } else {
+ toggleJavaScript.setIcon(R.drawable.privacy_mode);
+ }
}
// Set the initial status of the menu item checkboxes.
- toggleDomStorage.setChecked(enableDomStorage);
+ toggleDomStorage.setChecked(domStorageEnabled);
/* toggleSaveFormData does nothing until database storage is implemented.
- toggleSaveFormData.setChecked(enableSaveFormData);
+ toggleSaveFormData.setChecked(saveFormDataEnabled);
*/
- toggleCookies.setChecked(enableCookies);
+ toggleCookies.setChecked(cookiesEnabled);
return true;
}
@SuppressWarnings("deprecation")
public boolean onOptionsItemSelected(MenuItem menuItem) {
int menuItemId = menuItem.getItemId();
+
+ // Some options need to access the clipboard.
ClipboardManager clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
+ // Some options need to update the drawable for toggleJavaScript.
+ MenuItem toggleJavaScript = mainMenu.findItem(R.id.toggleJavaScript);
+
// Sets the commands that relate to the menu entries.
switch (menuItemId) {
case R.id.toggleJavaScript:
- if (enableJavaScript) {
- enableJavaScript = false;
- menuItem.setIcon(R.drawable.javascript_off);
+ if (javaScriptEnabled) {
+ javaScriptEnabled = false;
mainWebView.getSettings().setJavaScriptEnabled(false);
mainWebView.reload();
- Toast.makeText(getApplicationContext(), "JavaScript Disabled", Toast.LENGTH_SHORT).show();
+
+ // Update the toggleJavaScript icon and display a toast message.
+ if (domStorageEnabled || cookiesEnabled) {
+ menuItem.setIcon(R.drawable.warning);
+ if (domStorageEnabled && cookiesEnabled) {
+ Toast.makeText(getApplicationContext(), "JavaScript disabled, DOM Storage and Cookies still enabled", Toast.LENGTH_SHORT).show();
+ } else {
+ if (domStorageEnabled) {
+ Toast.makeText(getApplicationContext(), "JavaScript disabled, DOM Storage still enabled", Toast.LENGTH_SHORT).show();
+ } else {
+ Toast.makeText(getApplicationContext(), "JavaScript disabled, Cookies still enabled", Toast.LENGTH_SHORT).show();
+ }
+ }
+ } else {
+ menuItem.setIcon(R.drawable.privacy_mode);
+ Toast.makeText(getApplicationContext(), "Privacy Mode", Toast.LENGTH_SHORT).show();
+ }
} else {
- enableJavaScript = true;
- menuItem.setIcon(R.drawable.javascript_on);
+ javaScriptEnabled = true;
+ menuItem.setIcon(R.drawable.javascript_enabled);
mainWebView.getSettings().setJavaScriptEnabled(true);
mainWebView.reload();
- Toast.makeText(getApplicationContext(), "JavaScript Enabled", Toast.LENGTH_SHORT).show();
+ Toast.makeText(getApplicationContext(), "JavaScript enabled", Toast.LENGTH_SHORT).show();
}
return true;
case R.id.toggleDomStorage:
- if (enableDomStorage) {
- enableDomStorage = false;
+ if (domStorageEnabled) {
+ domStorageEnabled = false;
menuItem.setChecked(false);
mainWebView.getSettings().setDomStorageEnabled(false);
mainWebView.reload();
+
+ // Update the toggleJavaScript icon and display a toast message if appropriate.
+ if (!javaScriptEnabled && !cookiesEnabled) {
+ toggleJavaScript.setIcon(R.drawable.privacy_mode);
+ Toast.makeText(getApplicationContext(), "Privacy Mode", Toast.LENGTH_SHORT).show();
+ } else {
+ if (cookiesEnabled) {
+ toggleJavaScript.setIcon(R.drawable.warning);
+ Toast.makeText(getApplicationContext(), "Cookies still enabled", Toast.LENGTH_SHORT).show();
+ } // Else Do nothing because JavaScript is enabled.
+ }
} else {
- enableDomStorage = true;
+ domStorageEnabled = true;
menuItem.setChecked(true);
mainWebView.getSettings().setDomStorageEnabled(true);
mainWebView.reload();
+
+ // Update the toggleJavaScript icon if appropriate.
+ if (!javaScriptEnabled) {
+ toggleJavaScript.setIcon(R.drawable.warning);
+ } // Else Do nothing because JavaScript is enabled.
+
+ Toast.makeText(getApplicationContext(), "DOM Storage enabled", Toast.LENGTH_SHORT).show();
}
return true;
/* toggleSaveFormData does nothing until database storage is implemented.
case R.id.toggleSaveFormData:
- if (enableSaveFormData) {
- enableSaveFormData = false;
+ if (saveFormDataEnabled) {
+ saveFormDataEnabled = false;
menuItem.setChecked(false);
mainWebView.getSettings().setSaveFormData(false);
mainWebView.reload();
} else {
- enableSaveFormData = true;
+ saveFormDataEnabled = true;
menuItem.setChecked(true);
mainWebView.getSettings().setSaveFormData(true);
mainWebView.reload();
*/
case R.id.toggleCookies:
- if (enableCookies) {
- enableCookies = false;
+ if (cookiesEnabled) {
+ cookiesEnabled = false;
menuItem.setChecked(false);
cookieManager.setAcceptCookie(false);
mainWebView.reload();
+
+ // Update the toggleJavaScript icon and display a toast message if appropriate.
+ if (!javaScriptEnabled && !domStorageEnabled) {
+ toggleJavaScript.setIcon(R.drawable.privacy_mode);
+ Toast.makeText(getApplicationContext(), "Privacy Mode", Toast.LENGTH_SHORT).show();
+ } else {
+ if (domStorageEnabled) {
+ toggleJavaScript.setIcon(R.drawable.warning);
+ Toast.makeText(getApplicationContext(), "DOM Storage still enabled", Toast.LENGTH_SHORT).show();
+ } // Else Do nothing because JavaScript is enabled.
+ }
} else {
- enableCookies = true;
+ cookiesEnabled = true;
menuItem.setChecked(true);
cookieManager.setAcceptCookie(true);
mainWebView.reload();
+
+ // Update the toggleJavaScript icon if appropriate.
+ if (!javaScriptEnabled) {
+ toggleJavaScript.setIcon(R.drawable.warning);
+ } // Else Do nothing because JavaScript is enabled.
+
+ Toast.makeText(getApplicationContext(), "Cookies enabled", Toast.LENGTH_SHORT).show();
}
return true;
return true;
case R.id.copyURL:
- // Make sure that actionBar is not null.
- if (actionBar != null) {
- EditText urlTextBox = (EditText) actionBar.getCustomView().findViewById(R.id.urlTextBox);
- clipboard.setPrimaryClip(ClipData.newPlainText("URL", urlTextBox.getText()));
- }
+ clipboard.setPrimaryClip(ClipData.newPlainText("URL", urlTextBox.getText()));
return true;
case R.id.pasteURL:
- // Make sure that actionBar is not null.
- if (actionBar != null) {
- ClipData.Item clipboardData = clipboard.getPrimaryClip().getItemAt(0);
- EditText urlTextBox = (EditText) actionBar.getCustomView().findViewById(R.id.urlTextBox);
- urlTextBox.setText(clipboardData.coerceToText(this));
+ ClipData.Item clipboardData = clipboard.getPrimaryClip().getItemAt(0);
+ urlTextBox.setText(clipboardData.coerceToText(this));
try {
loadUrlFromTextBox();
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
- }
return true;
case R.id.shareURL:
- // Make sure that actionBar is not null.
- if (actionBar != null) {
- EditText urlTextBox = (EditText) actionBar.getCustomView().findViewById(R.id.urlTextBox);
- Intent shareIntent = new Intent();
- shareIntent.setAction(Intent.ACTION_SEND);
- shareIntent.putExtra(Intent.EXTRA_TEXT, urlTextBox.getText().toString());
- shareIntent.setType("text/plain");
- startActivity(Intent.createChooser(shareIntent, "Share URL"));
- }
+ Intent shareIntent = new Intent();
+ shareIntent.setAction(Intent.ACTION_SEND);
+ shareIntent.putExtra(Intent.EXTRA_TEXT, urlTextBox.getText().toString());
+ shareIntent.setType("text/plain");
+ startActivity(Intent.createChooser(shareIntent, "Share URL"));
return true;
case R.id.addToHomescreen:
startActivity(downloadManangerIntent);
return true;
+ case R.id.settings:
+ // Start the Settings activity.
+ Intent intent = new Intent(this, Settings.class);
+ startActivity(intent);
+ return true;
+
case R.id.about:
// Show the AboutDialog AlertDialog and name this instance aboutDialog.
AppCompatDialogFragment aboutDialog = new AboutDialog();
}
public void loadUrlFromTextBox() throws UnsupportedEncodingException {
- // Make sure that actionBar is not null.
- ActionBar actionBar = getSupportActionBar();
- if (actionBar != null) {
- final WebView mainWebView = (WebView) findViewById(R.id.mainWebView);
- EditText urlTextBox = (EditText) actionBar.getCustomView().findViewById(R.id.urlTextBox);
-
- // Get the text from urlTextInput and convert it to a string.
- String unformattedUrlString = urlTextBox.getText().toString();
- URL unformattedUrl = null;
- Uri.Builder formattedUri = new Uri.Builder();
-
- // Check to see if unformattedUrlString is a valid URL. Otherwise, convert it into a Duck Duck Go search.
- if (Patterns.WEB_URL.matcher(unformattedUrlString).matches()) {
-
- // Add http:// at the beginning if it is missing. Otherwise the app will segfault.
- if (!unformattedUrlString.startsWith("http")) {
- unformattedUrlString = "http://" + unformattedUrlString;
- }
+ // Get the text from urlTextBox and convert it to a string.
+ String unformattedUrlString = urlTextBox.getText().toString();
+ URL unformattedUrl = null;
+ Uri.Builder formattedUri = new Uri.Builder();
+
+ // Check to see if unformattedUrlString is a valid URL. Otherwise, convert it into a Duck Duck Go search.
+ if (Patterns.WEB_URL.matcher(unformattedUrlString).matches()) {
+ // Add http:// at the beginning if it is missing. Otherwise the app will segfault.
+ if (!unformattedUrlString.startsWith("http")) {
+ unformattedUrlString = "http://" + unformattedUrlString;
+ }
- // Convert unformattedUrlString to a URL, then to a URI, and then back to a string, which sanitizes the input and adds in any missing components.
- try {
- unformattedUrl = new URL(unformattedUrlString);
- } catch (MalformedURLException e) {
- e.printStackTrace();
- }
+ // Convert unformattedUrlString to a URL, then to a URI, and then back to a string, which sanitizes the input and adds in any missing components.
+ try {
+ unformattedUrl = new URL(unformattedUrlString);
+ } catch (MalformedURLException e) {
+ e.printStackTrace();
+ }
- // The ternary operator (? :) makes sure that a null pointer exception is not thrown, which would happen if .get was called on a null value.
- final String scheme = unformattedUrl != null ? unformattedUrl.getProtocol() : null;
- final String authority = unformattedUrl != null ? unformattedUrl.getAuthority() : null;
- final String path = unformattedUrl != null ? unformattedUrl.getPath() : null;
- final String query = unformattedUrl != null ? unformattedUrl.getQuery() : null;
- final String fragment = unformattedUrl != null ? unformattedUrl.getRef() : null;
+ // The ternary operator (? :) makes sure that a null pointer exception is not thrown, which would happen if .get was called on a null value.
+ final String scheme = unformattedUrl != null ? unformattedUrl.getProtocol() : null;
+ final String authority = unformattedUrl != null ? unformattedUrl.getAuthority() : null;
+ final String path = unformattedUrl != null ? unformattedUrl.getPath() : null;
+ final String query = unformattedUrl != null ? unformattedUrl.getQuery() : null;
+ final String fragment = unformattedUrl != null ? unformattedUrl.getRef() : null;
- formattedUri.scheme(scheme).authority(authority).path(path).query(query).fragment(fragment);
- formattedUrlString = formattedUri.build().toString();
+ formattedUri.scheme(scheme).authority(authority).path(path).query(query).fragment(fragment);
+ formattedUrlString = formattedUri.build().toString();
+ } else {
+ // Sanitize the search input and convert it to a DuckDuckGo search.
+ final String encodedUrlString = URLEncoder.encode(unformattedUrlString, "UTF-8");
- } else {
- // Sanitize the search input and convert it to a DuckDuckGo search.
- final String encodedUrlString = URLEncoder.encode(unformattedUrlString, "UTF-8");
+ // Use the correct search URL based on javaScriptEnabled.
+ if (javaScriptEnabled) {
formattedUrlString = "https://duckduckgo.com/?q=" + encodedUrlString;
+ } else {
+ formattedUrlString = "https://duckduckgo.com/html/?q=" + encodedUrlString;
}
+ }
- mainWebView.loadUrl(formattedUrlString);
+ mainWebView.loadUrl(formattedUrlString);
- // Hides the keyboard so we can see the webpage.
- InputMethodManager inputMethodManager = (InputMethodManager) getSystemService(Activity.INPUT_METHOD_SERVICE);
- inputMethodManager.hideSoftInputFromWindow(mainWebView.getWindowToken(), 0);
- }
+ // Hides the keyboard so we can see the webpage.
+ InputMethodManager inputMethodManager = (InputMethodManager) getSystemService(Activity.INPUT_METHOD_SERVICE);
+ inputMethodManager.hideSoftInputFromWindow(mainWebView.getWindowToken(), 0);
}
-}
\ No newline at end of file
+}