org.chromium.chrome.browser.preferences.ButtonPreference Java Examples

The following examples show how to use org.chromium.chrome.browser.preferences.ButtonPreference. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PhysicalWebPreferenceFragment.java    From delion with Apache License 2.0 5 votes vote down vote up
private void initLaunchButton() {
    ButtonPreference physicalWebLaunch =
            (ButtonPreference) findPreference(PREF_PHYSICAL_WEB_LAUNCH);

    physicalWebLaunch.setOnPreferenceClickListener(new OnPreferenceClickListener() {
        @Override
        public boolean onPreferenceClick(Preference preference) {
            startActivity(createListUrlsIntent(getActivity()));
            return true;
        }
    });
}
 
Example #2
Source File: ClearBrowsingDataPreferences.java    From delion with Apache License 2.0 5 votes vote down vote up
/**
 * Disable the "Clear" button if none of the options are selected. Otherwise, enable it.
 */
private void updateButtonState() {
    ButtonPreference clearButton = (ButtonPreference) findPreference(PREF_CLEAR_BUTTON);
    if (clearButton == null) return;
    boolean isEnabled = !getSelectedOptions().isEmpty();
    clearButton.setEnabled(isEnabled);
}
 
Example #3
Source File: PhysicalWebPreferenceFragment.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
private void initLaunchButton() {
    ButtonPreference physicalWebLaunch =
            (ButtonPreference) findPreference(PREF_PHYSICAL_WEB_LAUNCH);

    physicalWebLaunch.setOnPreferenceClickListener(new OnPreferenceClickListener() {
        @Override
        public boolean onPreferenceClick(Preference preference) {
            startActivity(createListUrlsIntent(getActivity()));
            return true;
        }
    });
}
 
Example #4
Source File: ClearBrowsingDataPreferences.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
/**
 * Disable the "Clear" button if none of the options are selected. Otherwise, enable it.
 */
private void updateButtonState() {
    ButtonPreference clearButton = (ButtonPreference) findPreference(PREF_CLEAR_BUTTON);
    if (clearButton == null) return;
    boolean isEnabled = !getSelectedOptions().isEmpty();
    clearButton.setEnabled(isEnabled);
}
 
Example #5
Source File: PhysicalWebPreferenceFragment.java    From 365browser with Apache License 2.0 5 votes vote down vote up
private void initLaunchButton() {
    ButtonPreference physicalWebLaunch =
            (ButtonPreference) findPreference(PREF_PHYSICAL_WEB_LAUNCH);

    physicalWebLaunch.setOnPreferenceClickListener(new OnPreferenceClickListener() {
        @Override
        public boolean onPreferenceClick(Preference preference) {
            PhysicalWebUma.onActivityReferral(PhysicalWebUma.PREFERENCE_REFERER);
            PhysicalWeb.showUrlList();
            return true;
        }
    });
}
 
Example #6
Source File: ClearBrowsingDataPreferences.java    From 365browser with Apache License 2.0 5 votes vote down vote up
/**
 * Disable the "Clear" button if none of the options are selected. Otherwise, enable it.
 */
protected void updateButtonState() {
    ButtonPreference clearButton = (ButtonPreference) findPreference(PREF_CLEAR_BUTTON);
    if (clearButton == null) return;
    boolean isEnabled = !getSelectedOptions().isEmpty();
    clearButton.setEnabled(isEnabled);
}
 
Example #7
Source File: ClearBrowsingDataPreferences.java    From 365browser with Apache License 2.0 4 votes vote down vote up
/**
 * Initialize the ButtonPreference.
 */
protected void initClearButtonPreference() {
    ButtonPreference clearButton = (ButtonPreference) findPreference(PREF_CLEAR_BUTTON);
    clearButton.setOnPreferenceClickListener(this);
    clearButton.setShouldDisableView(true);
}