All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.holoeverywhere.preference.PreferenceCategory Maven / Gradle / Ivy

There is a newer version: 1.6.8
Show newest version

package org.holoeverywhere.preference;

import org.holoeverywhere.R;

import android.content.Context;
import android.util.AttributeSet;

public class PreferenceCategory extends PreferenceGroup {
    private static final String TAG = "PreferenceCategory";

    public PreferenceCategory(Context context) {
        this(context, null);
    }

    public PreferenceCategory(Context context, AttributeSet attrs) {
        this(context, attrs, R.attr.preferenceCategoryStyle);
    }

    public PreferenceCategory(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }

    @Override
    public boolean isEnabled() {
        return false;
    }

    @Override
    protected boolean onPrepareAddPreference(Preference preference) {
        if (preference instanceof PreferenceCategory) {
            throw new IllegalArgumentException("Cannot add a "
                    + PreferenceCategory.TAG + " directly to a "
                    + PreferenceCategory.TAG);
        }
        return super.onPrepareAddPreference(preference);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy