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 ConversationMapper { | |
Observable<List<ConversationsResponse.ConversationItem>> observable; | |
public ConversationMapper(Observable<List<ConversationsResponse.ConversationItem>> observable) { | |
this.observable = observable; | |
} | |
public Observable<List<ConversationEntity>> getObservable() { | |
return observable |
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 ConversationMapper { | |
Observable<List<ConversationsResponse.ConversationItem>> observable; | |
public ConversationMapper(Observable<List<ConversationsResponse.ConversationItem>> observable) { | |
this.observable = observable; | |
} | |
public Observable<List<ConversationEntity>> getObservable() { | |
return observable | |
.observeOn(Schedulers.io()) |
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 ExpanseMapper { | |
Observable<List<GroupExpensesResponse.ExpenseItem>> observable; | |
public ExpanseMapper(Observable<List<GroupExpensesResponse.ExpenseItem>> observable) { | |
this.observable = observable; | |
} | |
public Observable<List<ExpenseEntity>> getObservable() { | |
return observable | |
.flatMapIterable(expenseItems -> expenseItems) |
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 Item { | |
private String _type; | |
public String getType() { | |
return _type; | |
} | |
private Item(String type) { | |
this._type = type; | |
} |
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
ext.versions = [ | |
minSdkVersion : 15, | |
targetSdkVersion : 26, | |
compileSdkVersion: 26, | |
buildToolsVersion: "26.0.2", | |
appCompatVertsion: "26.1.0", | |
firebaseVersion : "10.0.1", | |
kotlinVersion : "1.2.31", |
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
private void copyDataBase() { | |
try { | |
String asstFileDir = "databases/" + DB_NAME; | |
Log.i(TAG, "Copy DB from " + asstFileDir); | |
InputStream is = context.getAssets().open(asstFileDir); | |
Log.i(TAG, "available : " + is.available()); | |
File folder = new File(NEW_DB_PATH); |
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
@RequiresApi(Build.VERSION_CODES.M) | |
class FingerprintHelper(var context: Context, var fingerInterface: FingerInterface?) : FingerprintManager.AuthenticationCallback() { | |
private var keyguardManager: KeyguardManager = context.getSystemService(Context.KEYGUARD_SERVICE) as KeyguardManager | |
private var fingerManager: FingerprintManager = context.getSystemService(Context.FINGERPRINT_SERVICE) as FingerprintManager | |
private var cancellationSignal: CancellationSignal = CancellationSignal() | |
private var keyStore: KeyStore? = null | |
private var keyGenerator: KeyGenerator? = null | |
private var cipher: Cipher? = null |
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
@Multipart | |
@POST("/endpoint") | |
Call<Post> sendPost(@Part("caption") String caption, @Part MultipartBody.Part image); |
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
android { | |
... | |
if (project.hasProperty("myproject.properties") && new File(project.property("myproject.properties")).exists()) { | |
Properties props = new Properties() | |
props.load(new FileInputStream(file(project.property("myproject.properties")))) | |
signingConfigs { | |
release { | |
storeFile file(props['storeFile']) |
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.beigirad.zeroapplication.widget; | |
import android.support.v7.widget.GridLayoutManager; | |
import android.support.v7.widget.LinearLayoutManager; | |
import android.support.v7.widget.RecyclerView; | |
import android.support.v7.widget.StaggeredGridLayoutManager; | |
/** | |
* Created by farhad-mbp on 8/28/17. |