This file contains hidden or 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 MoviesAdapter extends RecyclerView.Adapter<MoviesAdapter.MyViewHolder> { | |
public Context mContext; | |
public List<Movie> itemsData; | |
public MoviesAdapter(Context mContext, List<Movie> itemsData) { | |
this.mContext = mContext; | |
this.itemsData = itemsData; | |
} | |
@Override |
This file contains hidden or 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 static final Pattern VALID_EMAIL_ADDRESS_REGEX = | |
Pattern.compile("^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,6}$", Pattern.CASE_INSENSITIVE); | |
ObservableTransformer<String,Boolean> minCharacter(int min) { | |
return observable -> observable.map((t)->{ | |
if(t.length()>min) | |
return true; | |
return false; | |
}); | |
} |
This file contains hidden or 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 MainActivity extends AppCompatActivity { | |
List<Observable<Integer>> mlist; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); |
This file contains hidden or 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
import android.content.Context; | |
import android.content.res.Resources; | |
import android.graphics.Bitmap; | |
import android.graphics.Canvas; | |
import android.graphics.Color; | |
import android.graphics.Paint; | |
import android.graphics.PorterDuff; | |
import android.graphics.PorterDuffXfermode; | |
import android.support.annotation.Nullable; | |
import android.support.v7.widget.AppCompatImageView; |
This file contains hidden or 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
// nahveye kar ba gson | |
String json= " ...... " | |
Gson g=new Gson(); | |
Tmp t=g.fromJson(json,Tmp.class); | |
String posts=t.Posts; | |
List<Post> ta=g.fromJson(posts,new TypeToken<List<Post>>(){}.getType()); | |
// class haye template ke baraye gson estefade shodan | |
// class 1 |
This file contains hidden or 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 VerticalTimelineDecoration extends RecyclerView.ItemDecoration { | |
Paint paintFill = null; | |
Paint paintStrokeFill = null; | |
Paint paintStroke = null; | |
Paint paintDotLine = null; | |
Paint paintText=null; | |
Paint paintTextBold=null; |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>ir.oveissi</groupId> | |
<artifactId>dagger</artifactId> | |
<version>1.0-SNAPSHOT</version> |
This file contains hidden or 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
{ | |
"code" : 1234, | |
"message" : "Something bad happened :(", | |
} |
This file contains hidden or 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
{ | |
"code" : 1024, | |
"message" : "Validation Failed", | |
"errors" : [ | |
{ | |
"code" : 5432, | |
"field" : "first_name", | |
"message" : "First name cannot have fancy characters" | |
}, |
This file contains hidden or 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 enum Relationship | |
{ | |
FOLLOWING, | |
FOLLOWER, | |
FRIEND | |
} | |
public static class User | |
{ | |
public String name; |