Java Code Examples for com.orhanobut.hawk.Hawk#put()

The following examples show how to use com.orhanobut.hawk.Hawk#put() . 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: Benchmark.java    From Paper with Apache License 2.0 4 votes vote down vote up
@Override
public void run(int i, List<Person> extra) {
    String key = "contacts" + i;
    Hawk.put(key, extra);
    Hawk.<List<Person>>get(key);
}
 
Example 2
Source File: HawkKeyValueStorage.java    From AndroidSchool with Apache License 2.0 4 votes vote down vote up
public void saveUserName(@NonNull String userName) {
    Hawk.put(USER_NAME_KEY, userName);
}
 
Example 3
Source File: PreferenceUtils.java    From AndroidSchool with Apache License 2.0 4 votes vote down vote up
public static void saveWalkthroughPassed() {
    Hawk.put(WALKTHROUGH_PASSED_KEY, true);
}
 
Example 4
Source File: Benchmark.java    From Iron with Apache License 2.0 4 votes vote down vote up
@Override
public void run(int i, List<Person> extra) {
    String key = "contacts" + i;
    Hawk.put(key, extra);
    Hawk.<List<Person>>get(key);
}
 
Example 5
Source File: UserStorage.java    From mvvm-starter with MIT License 4 votes vote down vote up
@Override
public void add (User obj)
{
    Hawk.put(String.format(K.USER_DETAIL, obj.getId()), obj);
}
 
Example 6
Source File: HawkKeyValueStorage.java    From AndroidSchool with Apache License 2.0 4 votes vote down vote up
public void saveToken(@NonNull String token) {
    Hawk.put(TOKEN_KEY, token);
}
 
Example 7
Source File: ThemeHelper.java    From Android-AudioRecorder-App with Apache License 2.0 4 votes vote down vote up
public void setBaseTheme(Theme baseTheme) {
  this.baseTheme = baseTheme;
  Hawk.put(context.getString(R.string.preference_base_theme), getBaseTheme().getValue());
}
 
Example 8
Source File: Benchmark.java    From Paper with Apache License 2.0 4 votes vote down vote up
@Override
public void run(int i, List<Person> extra) {
    String key = "contacts" + i;
    Hawk.put(key, extra);
}
 
Example 9
Source File: ThemeHelper.java    From Liz with GNU General Public License v3.0 4 votes vote down vote up
public void setBaseTheme(Theme baseTheme) {
	this.baseTheme = baseTheme;
	Hawk.put(context.getString(R.string.preference_base_theme), getBaseTheme().getValue());
}
 
Example 10
Source File: PreferenceUtils.java    From AndroidSchool with Apache License 2.0 4 votes vote down vote up
public static void saveUserName(@NonNull String userName) {
    Hawk.put(USER_NAME_KEY, userName);
}
 
Example 11
Source File: UserStorage.java    From mvvm-starter with MIT License 4 votes vote down vote up
@Override
public void addAll (List<User> objs)
{
    Hawk.put(K.USER_LIST, objs);
}
 
Example 12
Source File: Security.java    From leafpicrevived with GNU General Public License v3.0 4 votes vote down vote up
public static boolean setPassword(String newValue) {
    return Hawk.put("password_hash", sha256(newValue));
}
 
Example 13
Source File: Security.java    From leafpicrevived with GNU General Public License v3.0 4 votes vote down vote up
public static void setFingerprintUnlock(boolean passwordOnHidden) {
    Hawk.put("fingerprint_security", passwordOnHidden);
}
 
Example 14
Source File: Security.java    From leafpicrevived with GNU General Public License v3.0 4 votes vote down vote up
public static void setPasswordOnHidden(boolean passwordOnHidden) {
    Hawk.put("password_on_hidden", passwordOnHidden);
}
 
Example 15
Source File: Security.java    From leafpicrevived with GNU General Public License v3.0 4 votes vote down vote up
public static void setPasswordOnDelete(boolean passwordOnDelete) {
    Hawk.put("password_on_delete", passwordOnDelete);
}
 
Example 16
Source File: BillingCache.java    From RxIAPv3 with Apache License 2.0 4 votes vote down vote up
public void put(PurchaseDataModel purchaseDataModel) {
       Log.e(TAG,"Just put: " + purchaseDataModel.getProductId() + " into cache.");
       Hawk.put(purchaseDataModel.getProductId(), purchaseDataModel);
       if(!productIds.contains(purchaseDataModel.getProductId()))
           productIds.add(purchaseDataModel.getProductId());
}
 
Example 17
Source File: WordTaskActivity.java    From Duolingo-Clone with MIT License 3 votes vote down vote up
@Override
protected void onStop() {

    progressBarValue = 0;

    Hawk.put("progressBarValue", progressBarValue);

    finish();

    super.onStop();
}
 
Example 18
Source File: TapPairActivity.java    From Duolingo-Clone with MIT License 3 votes vote down vote up
@Override
protected void onStop() {

    progressBarValue = 0;

    Hawk.put("progressBarValue", progressBarValue);

    finish();

    super.onStop();
}
 
Example 19
Source File: TSTaskActivity.java    From Duolingo-Clone with MIT License 3 votes vote down vote up
@Override
protected void onStop() {

    progressBarValue = 0;

    Hawk.put("progressBarValue", progressBarValue);

    finish();

    super.onStop();
}
 
Example 20
Source File: StorageHelper.java    From leafpicrevived with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Set a shared preference for an Uri.
 *
 * @param context context
 * @param uri     the target value of the preference.
 */
public static void saveSdCardInfo(Context context, @Nullable final Uri uri) {
    Hawk.put(context.getString(R.string.preference_internal_uri_extsdcard_photos),
            uri == null ? null : uri.toString());
    Hawk.put("sd_card_path", StorageHelper.getSdcardPath(context));
}