Search in sources :

Example 11 with LayoutPreference

use of com.android.settingslib.widget.LayoutPreference in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class RemoveAccountPreferenceController method displayPreference.

@Override
public void displayPreference(PreferenceScreen screen) {
    super.displayPreference(screen);
    final LayoutPreference removeAccountPreference = screen.findPreference(KEY_REMOVE_ACCOUNT);
    Button removeAccountButton = (Button) removeAccountPreference.findViewById(R.id.button);
    removeAccountButton.setOnClickListener(this);
}
Also used : LayoutPreference(com.android.settingslib.widget.LayoutPreference) Button(android.widget.Button)

Example 12 with LayoutPreference

use of com.android.settingslib.widget.LayoutPreference in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class UsbDetailsHeaderController method displayPreference.

@Override
public void displayPreference(PreferenceScreen screen) {
    super.displayPreference(screen);
    final LayoutPreference headerPreference = screen.findPreference(KEY_DEVICE_HEADER);
    mHeaderController = EntityHeaderController.newInstance(mFragment.getActivity(), mFragment, headerPreference.findViewById(R.id.entity_header));
}
Also used : LayoutPreference(com.android.settingslib.widget.LayoutPreference)

Example 13 with LayoutPreference

use of com.android.settingslib.widget.LayoutPreference in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class StartNowPreferenceController method displayPreference.

@Override
public void displayPreference(PreferenceScreen screen) {
    super.displayPreference(screen);
    LayoutPreference pref = screen.findPreference(getPreferenceKey());
    Button startButton = pref.findViewById(R.id.dream_start_now_button);
    startButton.setOnClickListener(v -> mBackend.startDreaming());
}
Also used : LayoutPreference(com.android.settingslib.widget.LayoutPreference) Button(android.widget.Button)

Example 14 with LayoutPreference

use of com.android.settingslib.widget.LayoutPreference in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class StartNowPreferenceController method updateState.

@Override
public void updateState(Preference preference) {
    super.updateState(preference);
    Button startButton = ((LayoutPreference) preference).findViewById(R.id.dream_start_now_button);
    startButton.setEnabled(mBackend.getWhenToDreamSetting() != DreamBackend.NEVER);
}
Also used : LayoutPreference(com.android.settingslib.widget.LayoutPreference) Button(android.widget.Button)

Example 15 with LayoutPreference

use of com.android.settingslib.widget.LayoutPreference in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class ZenAutomaticRuleHeaderPreferenceController method updateState.

public void updateState(Preference preference) {
    if (mRule == null) {
        return;
    }
    if (mFragment != null) {
        LayoutPreference pref = (LayoutPreference) preference;
        if (mController == null) {
            mController = EntityHeaderController.newInstance(mFragment.getActivity(), mFragment, pref.findViewById(R.id.entity_header));
        }
        pref = mController.setIcon(getIcon()).setLabel(mRule.getName()).setPackageName(mRule.getOwner().getPackageName()).setUid(mContext.getUserId()).setHasAppInfoLink(false).setButtonActions(EntityHeaderController.ActionType.ACTION_EDIT_PREFERENCE, EntityHeaderController.ActionType.ACTION_NONE).done(mFragment.getActivity(), mContext);
        pref.findViewById(R.id.entity_header).setVisibility(View.VISIBLE);
    }
}
Also used : LayoutPreference(com.android.settingslib.widget.LayoutPreference)

Aggregations

LayoutPreference (com.android.settingslib.widget.LayoutPreference)61 Before (org.junit.Before)10 Preference (androidx.preference.Preference)8 Activity (android.app.Activity)5 View (android.view.View)5 Button (android.widget.Button)5 Lifecycle (com.android.settingslib.core.lifecycle.Lifecycle)5 Test (org.junit.Test)5 ImageView (android.widget.ImageView)3 PreferenceManager (androidx.preference.PreferenceManager)3 PreferenceScreen (androidx.preference.PreferenceScreen)3 Intent (android.content.Intent)2 UserInfo (android.content.pm.UserInfo)2 Resources (android.content.res.Resources)2 Bundle (android.os.Bundle)2 RemoteException (android.os.RemoteException)2 UserManager (android.os.UserManager)2 TextView (android.widget.TextView)2 PreferenceFragmentCompat (androidx.preference.PreferenceFragmentCompat)2 WifiDataUsageSummaryPreferenceController (com.android.settings.datausage.WifiDataUsageSummaryPreferenceController)2