View shapeAppearanceModel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float radius = context.getResources().getDimension(R.dimen.border_radius_hug); | |
shapeAppearanceModel = new ShapeAppearanceModel() | |
.toBuilder() | |
.setAllCorners(CornerFamily.ROUNDED,radius) | |
.build(); | |
imageView.setShapeAppearanceModel(shapeAppearanceModel) |
View rrrr.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"_id": "5eb65d5a44459aedbfba12de", | |
"index": 0, | |
"guid": "720089b7-6999-40d6-ab60-cca019e88b6b", | |
"isActive": false, | |
"balance": "$2,261.61", | |
"picture": "http://placehold.it/32x32", | |
"age": 28, | |
"eyeColor": "green", | |
"name": "Horn Cash", |
View rrrr.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"_id": "5eb65d5a44459aedbfba12de", | |
"index": 0, | |
"guid": "720089b7-6999-40d6-ab60-cca019e88b6b", | |
"isActive": false, | |
"balance": "$2,261.61", | |
"picture": "http://placehold.it/32x32", | |
"age": 28, | |
"eyeColor": "green", |
View MyFragment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyFragment extends Fragment { | |
@Override | |
public void onCreate(@Nullable Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
// This callback will only be called when MyFragment is at least Started. | |
OnBackPressedCallback callback = new OnBackPressedCallback(true /* enabled by default */) { | |
@Override | |
public void handleOnBackPressed() { |
View MyFragment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyFragment extends Fragment { | |
@Override | |
public void onCreate(@Nullable Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
// This callback will only be called when MyFragment is at least Started. | |
OnBackPressedCallback callback = new OnBackPressedCallback(true /* enabled by default */) { | |
@Override | |
public void handleOnBackPressed() { |
View LiveDataList
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LiveDataList<T> extends LiveData<List<T>> { | |
public void addAll(List<T> items) { | |
if (getValue() != null && items != null) { | |
getValue().addAll(items); | |
setValue(getValue()); | |
} | |
} | |
public void clear() { | |
if (getValue() != null) { |
View ObservableRxList
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ObservableRxList<T> { | |
protected final List<T> list; | |
protected final PublishSubject<List<T>> subject; | |
public ObservableRxList() { | |
this.list = new ArrayList<T>(); | |
this.subject = PublishSubject.create(); | |
} | |
public void add(T value) { |
View CalendarTools.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.besat.Utils; | |
import java.text.DateFormat; | |
import java.text.ParseException; | |
import java.text.SimpleDateFormat; | |
import java.util.Calendar; | |
import java.util.Date; | |
import java.util.GregorianCalendar; | |
import java.util.Locale; |
View Prefs.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ir.gushtomorghebaradaran.Utils; | |
import android.content.Context; | |
import android.content.SharedPreferences; | |
import android.preference.PreferenceManager; | |
import com.google.gson.Gson; | |
public class Prefs<T> { |
NewerOlder