Android Open Source - Calma Calma Settings






From Project

Back to project page Calma.

License

The source code is released under:

Apache License

If you think the Android project Calma listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*
 * Copyright (C) 2013 Thomas Schmid//from   w w w. ja v  a 2 s.c  o m
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 * MA  02110-1301, USA.
 */

package com.scto.android.calma.preferences;

//import com.cyanogenmod.filemanager.util.FileHelper;

/**
 * The enumeration of settings of Calma application.
 */
public enum CalmaSettings {
    /**
     * Whether is the first use of the application
     * @hide
     */
    SETTINGS_FIRST_USE("calma_first_use", Boolean.TRUE),  //$NON-NLS-1$

    /**
     * The access mode to use
     * @hide
     */
    SETTINGS_ACCESS_MODE("calma_access_mode", AccessMode.SAFE), //$NON-NLS-1$

    /**
     * The initial directory to be used.
     * @hide
     */
    SETTINGS_INITIAL_DIR("calma_initial_dir", FileHelper.ROOT_DIRECTORY), //$NON-NLS-1$

    /**
     * The view mode to use (simple, details, or icons).
     * @hide
     */
    SETTINGS_LAYOUT_MODE("calma_layout_mode", NavigationLayoutMode.DETAILS), //$NON-NLS-1$
    /**
     * The sort mode to use (name or data, ascending or descending).
     * @hide
     */
    SETTINGS_SORT_MODE("calma_sort_mode", NavigationSortMode.NAME_ASC), //$NON-NLS-1$

    /**
     * When to sort the directories before the files.
     * @hide
     */
    SETTINGS_SHOW_DIRS_FIRST("calma_show_dirs_first", Boolean.TRUE), //$NON-NLS-1$
    /**
     * When to show the hidden files.
     * @hide
     */
    SETTINGS_SHOW_HIDDEN("calma_show_hidden", Boolean.TRUE), //$NON-NLS-1$
    /**
     * When to show the system files.
     * @hide
     */
    SETTINGS_SHOW_SYSTEM("calma_show_system", Boolean.TRUE), //$NON-NLS-1$
    /**
     * When to show the symlinks files.
     * @hide
     */
    SETTINGS_SHOW_SYMLINKS("calma_show_symlinks", Boolean.TRUE), //$NON-NLS-1$

    /**
     * When to use case sensitive comparison in sorting of files
     * @hide
     */
    SETTINGS_CASE_SENSITIVE_SORT("calma_case_sensitive_sort", Boolean.FALSE), //$NON-NLS-1$
    /**
     * When to display thumbs of pictures, videos, ...
     * @hide
     */
    SETTINGS_DISPLAY_THUMBS("calma_show_thumbs", Boolean.FALSE), //$NON-NLS-1$
    /**
     * Whether use flinger to remove items
     * @hide
     */
    SETTINGS_USE_FLINGER("calma_use_flinger", Boolean.FALSE),  //$NON-NLS-1$

    /**
     * When to show debug traces
     * @hide
     */
    SETTINGS_SHOW_TRACES("calma_show_debug_traces", Boolean.FALSE), //$NON-NLS-1$

    /**
     * Whether use back button up navigation
     * @hide
     */
    SETTINGS_USE_BACK_BUTTON("calma_use_back_button", Boolean.FALSE), //$NON-NLS-1$

    /**
     * The current theme to use in the app
     * @hide
     */
    SETTINGS_THEME("calma_theme", "com.scto.android.calma:light"); //$NON-NLS-1$

    /**
     * A broadcast intent that is sent when a setting was changed
     */
    public final static String INTENT_SETTING_CHANGED = "com.scto.android.calma.INTENT_SETTING_CHANGED"; //$NON-NLS-1$

    /**
     * A broadcast intent that is sent when a theme was changed
     */
    public final static String INTENT_THEME_CHANGED = "com.scto.android.calma.INTENT_THEME_CHANGED"; //$NON-NLS-1$

    /**
     * A broadcast intent that is sent when a file was changed
     */
    public final static String INTENT_FILE_CHANGED = "com.scto.android.calma.INTENT_FILE_CHANGED"; //$NON-NLS-1$

    /**
     * The extra key with the preference key that was changed
     */
    public final static String EXTRA_SETTING_CHANGED_KEY = "preference"; //$NON-NLS-1$

    /**
     * The extra key with the file key that was changed
     */
    public final static String EXTRA_FILE_CHANGED_KEY = "file"; //$NON-NLS-1$

    /**
     * The extra key with the file key that was changed
     */
    public final static String EXTRA_THEME_PACKAGE = "package"; //$NON-NLS-1$

    /**
     * The extra key with the identifier of theme that was changed
     */
    public final static String EXTRA_THEME_ID = "id"; //$NON-NLS-1$

    private final String mId;
    private final Object mDefaultValue;

    /**
     * Constructor of <code>CalmaSettings</code>.
     *
     * @param id The unique identifier of the setting
     * @param defaultValue The default value of the setting
     */
    private CalmaSettings(String id, Object defaultValue) {
        this.mId = id;
        this.mDefaultValue = defaultValue;
    }

    /**
     * Method that returns the unique identifier of the setting.
     * @return the mId
     */
    public String getId() {
        return this.mId;
    }

    /**
     * Method that returns the default value of the setting.
     *
     * @return Object The default value of the setting
     */
    public Object getDefaultValue() {
        return this.mDefaultValue;
    }

    /**
     * Method that returns an instance of {@link CalmaSettings} from its.
     * unique identifier
     *
     * @param id The unique identifier
     * @return CalmaSettings The navigation sort mode
     */
    public static CalmaSettings fromId(String id) {
        CalmaSettings[] values = values();
        int cc = values.length;
        for (int i = 0; i < cc; i++) {
            if (values[i].mId == id) {
                return values[i];
            }
        }
        return null;
    }
}




Java Source Code List

com.cyanogenmod.filemanager.activities.preferences.SettingsPreferences.java
com.espian.showcaseview.OnShowcaseEventListener.java
com.espian.showcaseview.ShowcaseViewBuilder.java
com.espian.showcaseview.ShowcaseView.java
com.espian.showcaseview.ShowcaseViews.java
com.espian.showcaseview.actionbar.ActionBarViewWrapper.java
com.espian.showcaseview.actionbar.reflection.ActionBarReflector.java
com.espian.showcaseview.actionbar.reflection.AppCompatReflector.java
com.espian.showcaseview.actionbar.reflection.BaseReflector.java
com.espian.showcaseview.actionbar.reflection.SherlockReflector.java
com.espian.showcaseview.anim.AnimationUtils.java
com.espian.showcaseview.drawing.ClingDrawerImpl.java
com.espian.showcaseview.drawing.ClingDrawer.java
com.espian.showcaseview.drawing.TextDrawerImpl.java
com.espian.showcaseview.drawing.TextDrawer.java
com.espian.showcaseview.targets.ActionItemTarget.java
com.espian.showcaseview.targets.ActionViewTarget.java
com.espian.showcaseview.targets.PointTarget.java
com.espian.showcaseview.targets.Target.java
com.espian.showcaseview.targets.ViewTarget.java
com.espian.showcaseview.utils.Calculator.java
com.espian.showcaseview.utils.PointAnimator.java
com.espian.showcaseview.utils.ShowcaseAreaCalculator.java
com.scto.android.calma.CalmaApp.java
com.scto.android.calma.activities.BaseActivity.java
com.scto.android.calma.activities.CalmaActivity.java
com.scto.android.calma.activities.SettingsActivity.java
com.scto.android.calma.activities.preferences.AboutPreferenceFragment.java
com.scto.android.calma.activities.preferences.DisplayPreferenceFragment.java
com.scto.android.calma.activities.preferences.GeneralPreferenceFragment.java
com.scto.android.calma.activities.preferences.NavigationPreferenceFragment.java
com.scto.android.calma.activities.preferences.SettingsActivity.java
com.scto.android.calma.activities.preferences.TitlePreferenceFragment.java
com.scto.android.calma.adapter.NavDrawerListAdapter.java
com.scto.android.calma.fragments.CommunityFragment.java
com.scto.android.calma.fragments.FindPeopleFragment.java
com.scto.android.calma.fragments.HomeFragment.java
com.scto.android.calma.fragments.PagesFragment.java
com.scto.android.calma.fragments.PhotosFragment.java
com.scto.android.calma.fragments.WhatsHotFragment.java
com.scto.android.calma.model.NavDrawerItem.java
com.scto.android.calma.preferences.AccessMode.java
com.scto.android.calma.preferences.CalmaSettings.java
com.scto.android.calma.preferences.ConfigurationListener.java
com.scto.android.calma.preferences.ObjectIdentifier.java
com.scto.android.calma.preferences.ObjectStringIdentifier.java
com.scto.android.calma.preferences.Preferences.java
com.scto.android.calma.ui.MyPrerference.java
com.scto.android.calma.utils.CalmaUtils.java
com.scto.android.calma.utils.Compress.java
com.scto.android.calma.utils.Decompress.java
com.scto.android.calma.utils.FileUtils.java
com.scto.android.calma.utils.LinuxShell.java
com.scto.android.calma.utils.PreferenceUtils.java
com.scto.android.calma.utils.SharedPreferencesCompat.java
com.scto.android.calma.utils.SortOrder.java
com.scto.android.calma.utils.Utils.java
com.stericson.RootTools.Constants.java
com.stericson.RootTools.RootTools.java
com.stericson.RootToolsTests.NativeJavaClass.java
com.stericson.RootToolsTests.SanityCheckRootTools.java
com.stericson.RootTools.containers.Mount.java
com.stericson.RootTools.containers.Permissions.java
com.stericson.RootTools.containers.RootClass.java
com.stericson.RootTools.containers.Symlink.java
com.stericson.RootTools.exceptions.RootDeniedException.java
com.stericson.RootTools.execution.CommandCapture.java
com.stericson.RootTools.execution.Command.java
com.stericson.RootTools.execution.JavaCommandCapture.java
com.stericson.RootTools.execution.Shell.java
com.stericson.RootTools.internal.Installer.java
com.stericson.RootTools.internal.InternalVariables.java
com.stericson.RootTools.internal.Remounter.java
com.stericson.RootTools.internal.RootToolsInternalMethods.java
com.stericson.RootTools.internal.Runner.java