<commit_before>/*
 * Copyright (C) 2016 <NAME>
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 */

package com.justplay1.shoppist.preferences;

import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;

import com.justplay1.shoppist.data.R;
import com.justplay1.shoppist.entity.SortTypeDAO;

import javax.inject.Inject;
import javax.inject.Singleton;

/**
 * Created by <NAME>.
 */
@Singleton
public class AppPreferences {

    public static final String COLOR_PRIMARY = "color_theme";
    public static final String COLOR_PRIMARY_DARK = "color_status_bar_theme";
    public static final String LOCK_SCREEN = "LockScreen";

    public static final String CONFIRM_DELETE_DIALOG = "confirm_delete_dialog";
    public static final String IS_NEED_SHOW_RATE_DIALOG = "is_need_show_rate_dialog";
    public static final String DEFAULT_CURRENCY = "default_currency_id";
    public static final String CALCULATE_PRICE = "calculate_price";
    public static final String ADD_BUTTON_CLICK_ACTION = "add_button_click_action";

    public static final String SORT_FOR_SHOPPING_LISTS = "sort_for_shopping_lists";
    public static final String SORT_FOR_SHOPPING_LIST_ITEMS = "sort_for_shopping_list_items";
    public static final String SORT_FOR_GOODS = "sort_for_goods";

    public static final String LEFT_SHOPPING_LIST_ITEM_SWIPE_ACTION = "left_shopping_list_item_swipe_action";
    public static final String RIGHT_SHOPPING_LIST_ITEM_SWIPE_ACTION = "right_shopping_list_item_swipe_action";

    private SharedPreferences mPreference;
    private Context mContext;

    /**
     * Mirror variables of preference
     */
    private int mColorPrimary;
    private int mColorPrimaryDark;
    private boolean mLockScreen;

    private int mSortForShoppingLists;
    private int mSortForShoppingListItems;
    private int mSortForGoods;

    private boolean mConfirmDeleteDialog;
    private int mNeedShowRateDialog;
    private String mDefaultCurrency;
    private boolean mCalculatePrice;
    private int mAddButtonClickAction;

    private int mLeftShoppingListItemSwipeAction;
    private int mRightShoppingListItemSwipeAction;

    @Inject<commit_msg>small preferences refactoring<commit_after>/*
 * Copyright (C) 2016 <NAME>
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 */

package com.justplay1.shoppist.preferences;

import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;

import com.justplay1.shoppist.data.R;
import com.justplay1.shoppist.entity.SortTypeDAO;

import javax.inject.Inject;
import javax.inject.Singleton;

/**
 * Created by <NAME>.
 */
@Singleton
public class AppPreferences {

    private static final String COLOR_PRIMARY = "color_theme";
    private static final String COLOR_PRIMARY_DARK = "color_status_bar_theme";
    private static final String LOCK_SCREEN = "LockScreen";

    private static final String CONFIRM_DELETE_DIALOG = "confirm_delete_dialog";
    private static final String IS_NEED_SHOW_RATE_DIALOG = "is_need_show_rate_dialog";
    private static final String DEFAULT_CURRENCY = "default_currency_id";
    private static final String CALCULATE_PRICE = "calculate_price";
    private static final String ADD_BUTTON_CLICK_ACTION = "add_button_click_action";

    private static final String SORT_FOR_SHOPPING_LISTS = "sort_for_shopping_lists";
    private static final String SORT_FOR_SHOPPING_LIST_ITEMS = "sort_for_shopping_list_items";
    private static final String SORT_FOR_GOODS = "sort_for_goods";

    private static final String LEFT_SHOPPING_LIST_ITEM_SWIPE_ACTION = "left_shopping_list_item_swipe_action";
    private static final String RIGHT_SHOPPING_LIST_ITEM_SWIPE_ACTION = "right_shopping_list_item_swipe_action";

    private SharedPreferences mPreference;
    private Context mContext;

    /**
     * Mirror variables of preference
     */
    private int mColorPrimary;
    private int mColorPrimaryDark;
    private boolean mLockScreen;

    private int mSortForShoppingLists;
    private int mSortForShoppingListItems;
    private int mSortForGoods;

    private boolean mConfirmDeleteDialog;
    private int mNeedShowRateDialog;
    private String mDefaultCurrency;
    private boolean mCalculatePrice;
    private int mAddButtonClickAction;

    private int mLeftShoppingListItemSwipeAction;
    private int mRightShoppingListItemSwipeAction;

    @Inject
{'fraction_non_alphanumeric': 0.058941240676732766, 'fraction_numerical': 0.004002183008913953, 'mean_word_length': 4.593082400813835, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2278630', 'n_tokens_mistral': 1609, 'n_tokens_neox': 1580, 'n_words': 469}