Search in sources :

Example 16 with RecordAction

use of de.baumann.browser.Database.RecordAction in project browser by scoute-dich.

the class AdBlock method removeDomain.

public synchronized void removeDomain(String domain) {
    RecordAction action = new RecordAction(context);
    action.open(true);
    action.deleteDomain(domain);
    action.close();
    whitelist.remove(domain);
}
Also used : RecordAction(de.baumann.browser.Database.RecordAction)

Example 17 with RecordAction

use of de.baumann.browser.Database.RecordAction in project browser by scoute-dich.

the class AdBlock method loadDomains.

private static synchronized void loadDomains(Context context) {
    RecordAction action = new RecordAction(context);
    action.open(false);
    whitelist.clear();
    whitelist.addAll(action.listDomains());
    action.close();
}
Also used : RecordAction(de.baumann.browser.Database.RecordAction)

Example 18 with RecordAction

use of de.baumann.browser.Database.RecordAction in project browser by scoute-dich.

the class Cookie method removeDomain.

public synchronized void removeDomain(String domain) {
    RecordAction action = new RecordAction(context);
    action.open(true);
    action.deleteDomainCookie(domain);
    action.close();
    whitelistCookie.remove(domain);
}
Also used : RecordAction(de.baumann.browser.Database.RecordAction)

Example 19 with RecordAction

use of de.baumann.browser.Database.RecordAction in project browser by scoute-dich.

the class Cookie method addDomain.

public synchronized void addDomain(String domain) {
    RecordAction action = new RecordAction(context);
    action.open(true);
    action.addDomainCookie(domain);
    action.close();
    whitelistCookie.add(domain);
}
Also used : RecordAction(de.baumann.browser.Database.RecordAction)

Example 20 with RecordAction

use of de.baumann.browser.Database.RecordAction in project browser by scoute-dich.

the class Whitelist_Cookie method onCreate.

@SuppressWarnings("ConstantConditions")
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    helper_main.setTheme(this);
    setContentView(R.layout.whitelist);
    Toolbar toolbar = findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    RecordAction action = new RecordAction(this);
    action.open(false);
    list = action.listDomainsCookie();
    action.close();
    ListView listView = findViewById(R.id.whitelist);
    listView.setEmptyView(findViewById(R.id.whitelist_empty));
    adapter = new Adapter_Cookie(this, list);
    listView.setAdapter(adapter);
    adapter.notifyDataSetChanged();
    Button button = findViewById(R.id.whitelist_add);
    button.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            EditText editText = findViewById(R.id.whitelist_edit);
            String domain = editText.getText().toString().trim();
            if (domain.isEmpty()) {
                NinjaToast.show(Whitelist_Cookie.this, R.string.toast_input_empty);
            } else if (!BrowserUnit.isURL(domain)) {
                NinjaToast.show(Whitelist_Cookie.this, R.string.toast_invalid_domain);
            } else {
                RecordAction action = new RecordAction(Whitelist_Cookie.this);
                action.open(true);
                if (action.checkDomainCookie(domain)) {
                    NinjaToast.show(Whitelist_Cookie.this, R.string.toast_domain_already_exists);
                } else {
                    Cookie cookie = new Cookie(Whitelist_Cookie.this);
                    cookie.addDomain(domain.trim());
                    list.add(0, domain.trim());
                    adapter.notifyDataSetChanged();
                    NinjaToast.show(Whitelist_Cookie.this, R.string.toast_add_whitelist_successful);
                }
                action.close();
            }
        }
    });
}
Also used : EditText(android.widget.EditText) Adapter_Cookie(de.baumann.browser.View.Adapter_Cookie) Cookie(de.baumann.browser.Browser.Cookie) ListView(android.widget.ListView) Button(android.widget.Button) RecordAction(de.baumann.browser.Database.RecordAction) Adapter_Cookie(de.baumann.browser.View.Adapter_Cookie) TextView(android.widget.TextView) View(android.view.View) ListView(android.widget.ListView) Toolbar(android.support.v7.widget.Toolbar)

Aggregations

RecordAction (de.baumann.browser.Database.RecordAction)33 View (android.view.View)11 ListView (android.widget.ListView)11 TextView (android.widget.TextView)11 WebView (android.webkit.WebView)8 AdapterView (android.widget.AdapterView)8 AutoCompleteTextView (android.widget.AutoCompleteTextView)8 HorizontalScrollView (android.widget.HorizontalScrollView)8 ImageView (android.widget.ImageView)8 VideoView (android.widget.VideoView)8 Record (de.baumann.browser.Database.Record)8 NinjaWebView (de.baumann.browser.View.NinjaWebView)8 DynamicGridView (org.askerov.dynamicgrid.DynamicGridView)8 Paint (android.graphics.Paint)6 EditText (android.widget.EditText)6 File (java.io.File)6 UnsupportedEncodingException (java.io.UnsupportedEncodingException)6 Button (android.widget.Button)5 Adapter_Record (de.baumann.browser.View.Adapter_Record)5 BufferedReader (java.io.BufferedReader)4