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 interface BasePresenter { | |
void start(); | |
} |
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
//we use fromCallable method to run expensive method inside and return an observable to subscribe on | |
Observable.fromCallable(Database::readValue) | |
.subscribeOn(Schedulers.io()) | |
.observeOn(AndroidSchedulers.mainThread()) | |
.subscribe(result -> { | |
resultTextView.setText(result); | |
hideProgress(); | |
}); |
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
ReplaySubject | |
"Default ReplaySubject" | |
unsubscribe(); | |
createSubscription(); | |
ReplaySubject<Stock> stockReplaySubject = ReplaySubject.create(); | |
stockReplaySubject.onNext(new Stock(GOOG, 715.09)); |
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
class CalenderRepository(private val context: Context) { | |
private val contentResolver = context.contentResolver | |
} |
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 val INSTANCE_PROJECTION = arrayOf( | |
CalendarContract.Instances.EVENT_ID, // 0 | |
CalendarContract.Instances.BEGIN, // 1 | |
CalendarContract.Instances.END, //2 | |
CalendarContract.Instances.TITLE, // 3 | |
CalendarContract.Instances.ORGANIZER, //4 | |
CalendarContract.Instances.DESCRIPTION, //5 | |
CalendarContract.Instances.CALENDAR_ID //6 | |
) |
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 fun queryCalenderProvider( | |
uri: Uri = CalendarContract.Calendars.CONTENT_URI, | |
eventProjection: Array<String>, | |
selection: String? = null, | |
selectionArgs: Array<String>? = null, | |
callback: (Cursor?) -> Unit | |
) { | |
if (ContextCompat.checkSelfPermission( |
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 fun getEventsFromCursor( | |
cur: Cursor?, callback: (MutableList<CalenderEvent>) -> Unit | |
) { | |
val events = mutableListOf<CalenderEvent>() | |
cur?.let { | |
doAsync { | |
while (cur.moveToNext()) { | |
events.add( | |
CalenderEvent( |
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
fun getEventsInTimeRange( | |
beginTime: Long, endTime: Long, callback: (MutableList<CalenderEvent>) -> Unit | |
) { | |
if (primaryData == null) { | |
getPrimaryData { | |
performEventsQuery(beginTime, endTime, callback) | |
} | |
} else { | |
performEventsQuery(beginTime, endTime, callback) | |
} |
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
<androidx.cardview.widget.CardView | |
android:layout_width="match_parent" | |
android:layout_marginEnd="8dp" | |
android:layout_marginStart="8dp" | |
android:layout_marginTop="8dp" | |
app:cardCornerRadius="16dp" | |
android:padding="16dp" | |
android:layout_height="wrap_content"> | |
<LinearLayout android:layout_width="match_parent" | |
android:layout_marginEnd="8dp" |
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
include ':ApiBaseModule', ':BaseModule', ':IdentityModule', ':TransactionsApiModule', ':StaticModule' | |
project(':ApiBaseModule').projectDir = new File('/Users/ahmedelshaer/Projects/Trella-Files/trella-apibasemodule-module/APIBase') | |
project(':BaseModule').projectDir = new File('/Users/ahmedelshaer/Projects/Trella-Files/trella-basemodule-module/base_module') | |
project(':IdentityModule').projectDir = new File('/Users/ahmedelshaer/Projects/Trella-Files/trella-identitiymodule-module/identity') | |
project(':TransactionsApiModule').projectDir = new File('/Users/ahmedelshaer/Projects/Trella-Files/trella-transactionsapimodule-module/transactionsApi') | |
project(':StaticModule').projectDir = new File('/Users/ahmedelshaer/Projects/Trella-Files/trella-staticmodule-module/staticModule') | |
OlderNewer