Skip to content

Instantly share code, notes, and snippets.

View hosseiniSeyRo's full-sized avatar

R.Hosseini hosseiniSeyRo

  • tehran
View GitHub Profile
@DHosseiny
DHosseiny / BaseAdapter.java
Created February 16, 2018 08:12
Databinding BaseAdapter based on george mount's medium post.
import android.databinding.DataBindingUtil;
import android.databinding.ViewDataBinding;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
/**
* Created by Davud. MyApplication project.
*/
@john1jan
john1jan / PrefKeys.java
Last active February 16, 2022 23:45
Utils class for storing and retrieving data from SharedPreference in Android
/**
* Created by john.francis on 24/05/16.
*/
public class PrefKeys {
public static final String USER_INCOME = "USER_INCOME";
public static final String USER_MARITAL_STATUS = "USER_MARITAL_STATUS";
public static final String USER_SALARY_FLOAT= "USER_SALARY_FLOAT";
public static final String USER_SALARY_LONG= "USER_SALARY_LONG";
public static final String USER_AGE= "USER_AGE";
}
@lenamuit
lenamuit / SharePrefUtils.java
Last active December 7, 2019 07:55
SharePreferenceUtils for Android - the utils class to help you working with SharePreference
public class SharePrefUtils {
public enum Key{
//list of your keys here
}
private static SharedPreferences getSharePreference(Context context){
return context.getSharedPreferences("your_pref",Context.MODE_PRIVATE);
}
private static SharedPreferences.Editor getEditor(Context context){