Java Code Examples for net.gsantner.opoc.util.ContextUtils#shouldColorOnTopBeLight()

The following examples show how to use net.gsantner.opoc.util.ContextUtils#shouldColorOnTopBeLight() . 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: GsPreferenceFragmentCompat.java    From memetastic with GNU General Public License v3.0 6 votes vote down vote up
@Override
@Deprecated
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
    Activity activity = getActivity();
    _appSettings = getAppSettings(activity);
    _cu = new ContextUtils(activity);
    getPreferenceManager().setSharedPreferencesName(getSharedPreferencesName());
    addPreferencesFromResource(getPreferenceResourceForInflation());


    if (activity != null && activity.getTheme() != null) {
        TypedArray array = activity.getTheme().obtainStyledAttributes(new int[]{android.R.attr.colorBackground});
        int bgcolor = array.getColor(0, 0xFFFFFFFF);
        _defaultIconTintColor = _cu.shouldColorOnTopBeLight(bgcolor) ? Color.WHITE : Color.BLACK;
    }

    // on bottom
    afterOnCreate(savedInstanceState, activity);
}
 
Example 2
Source File: GsPreferenceFragmentCompat.java    From openlauncher with Apache License 2.0 6 votes vote down vote up
@Override
@Deprecated
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
    Activity activity = getActivity();
    _appSettings = getAppSettings(activity);
    _cu = new ContextUtils(activity);
    getPreferenceManager().setSharedPreferencesName(getSharedPreferencesName());
    addPreferencesFromResource(getPreferenceResourceForInflation());


    if (activity != null && activity.getTheme() != null) {
        TypedArray array = activity.getTheme().obtainStyledAttributes(new int[]{android.R.attr.colorBackground});
        int bgcolor = array.getColor(0, 0xFFFFFFFF);
        _defaultIconTintColor = _cu.shouldColorOnTopBeLight(bgcolor) ? Color.WHITE : Color.BLACK;
    }

    // on bottom
    afterOnCreate(savedInstanceState, activity);
}
 
Example 3
Source File: GsPreferenceFragmentCompat.java    From Stringlate with MIT License 6 votes vote down vote up
@Override
@Deprecated
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
    Activity activity = getActivity();
    _appSettings = getAppSettings(activity);
    _cu = new ContextUtils(activity);
    getPreferenceManager().setSharedPreferencesName(getSharedPreferencesName());
    addPreferencesFromResource(getPreferenceResourceForInflation());


    if (activity != null && activity.getTheme() != null) {
        TypedArray array = activity.getTheme().obtainStyledAttributes(new int[]{android.R.attr.colorBackground});
        int bgcolor = array.getColor(0, 0xFFFFFFFF);
        _defaultIconTintColor = _cu.shouldColorOnTopBeLight(bgcolor) ? Color.WHITE : Color.BLACK;
    }

    // on bottom
    afterOnCreate(savedInstanceState, activity);
}
 
Example 4
Source File: GsPreferenceFragmentCompat.java    From kimai-android with MIT License 6 votes vote down vote up
@Override
@Deprecated
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
    Activity activity = getActivity();
    _appSettings = getAppSettings(activity);
    _cu = new ContextUtils(activity);
    getPreferenceManager().setSharedPreferencesName(getSharedPreferencesName());
    addPreferencesFromResource(getPreferenceResourceForInflation());


    if (activity != null && activity.getTheme() != null) {
        TypedArray array = activity.getTheme().obtainStyledAttributes(new int[]{android.R.attr.colorBackground});
        int bgcolor = array.getColor(0, 0xFFFFFFFF);
        _defaultIconTintColor = _cu.shouldColorOnTopBeLight(bgcolor) ? Color.WHITE : Color.BLACK;
    }

    // on bottom
    afterOnCreate(savedInstanceState, activity);
}