Search in sources :

Example 6 with Cookie

use of de.baumann.browser.Browser.Cookie in project browser by scoute-dich.

the class Whitelist_Cookie method onOptionsItemSelected.

@Override
public boolean onOptionsItemSelected(MenuItem menuItem) {
    switch(menuItem.getItemId()) {
        case android.R.id.home:
            finish();
            break;
        case R.id.whitelist_menu_clear:
            final BottomSheetDialog dialog = new BottomSheetDialog(Whitelist_Cookie.this);
            View dialogView = View.inflate(Whitelist_Cookie.this, R.layout.dialog_action, null);
            TextView textView = dialogView.findViewById(R.id.dialog_text);
            textView.setText(R.string.toast_clear);
            Button action_ok = dialogView.findViewById(R.id.action_ok);
            action_ok.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View view) {
                    Cookie cookie = new Cookie(Whitelist_Cookie.this);
                    cookie.clearDomains();
                    list.clear();
                    adapter.notifyDataSetChanged();
                    dialog.cancel();
                }
            });
            Button action_cancel = dialogView.findViewById(R.id.action_cancel);
            action_cancel.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View view) {
                    dialog.cancel();
                }
            });
            dialog.setContentView(dialogView);
            dialog.show();
            break;
        default:
            break;
    }
    return true;
}
Also used : Adapter_Cookie(de.baumann.browser.View.Adapter_Cookie) Cookie(de.baumann.browser.Browser.Cookie) BottomSheetDialog(android.support.design.widget.BottomSheetDialog) Button(android.widget.Button) TextView(android.widget.TextView) TextView(android.widget.TextView) View(android.view.View) ListView(android.widget.ListView)

Aggregations

Cookie (de.baumann.browser.Browser.Cookie)6 View (android.view.View)5 TextView (android.widget.TextView)5 ListView (android.widget.ListView)4 BottomSheetDialog (android.support.design.widget.BottomSheetDialog)3 Button (android.widget.Button)3 WebView (android.webkit.WebView)2 AdapterView (android.widget.AdapterView)2 AutoCompleteTextView (android.widget.AutoCompleteTextView)2 HorizontalScrollView (android.widget.HorizontalScrollView)2 ImageButton (android.widget.ImageButton)2 ImageView (android.widget.ImageView)2 VideoView (android.widget.VideoView)2 AdBlock (de.baumann.browser.Browser.AdBlock)2 Javascript (de.baumann.browser.Browser.Javascript)2 RecordAction (de.baumann.browser.Database.RecordAction)2 Adapter_Cookie (de.baumann.browser.View.Adapter_Cookie)2 NinjaWebView (de.baumann.browser.View.NinjaWebView)2 DynamicGridView (org.askerov.dynamicgrid.DynamicGridView)2 PendingIntent (android.app.PendingIntent)1