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
// | |
// HomeViewModel.swift | |
// Okukk | |
// | |
// Created by Ememobong Akpanekpo on 06/02/2020. | |
// Copyright © 2020 AltaLabs. All rights reserved. | |
// | |
import Domain | |
import RxCocoa |
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
package com.entraid.remote.implementation | |
import android.content.Context | |
import android.util.Log | |
import bolts.Continuation | |
import bolts.Task | |
import com.entraid.data.repository.visitors.VisitorRemote | |
import com.entraid.models.EluziniParseDbConstants | |
import com.entraid.models.GetHostResponseRequestModel | |
import com.entraid.models.welcome.* |
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
package com.entraid.remote.implementation | |
import android.content.Context | |
import android.util.Log | |
import bolts.Continuation | |
import bolts.Task | |
import com.entraid.data.repository.visitors.VisitorRemote | |
import com.entraid.models.EluziniParseDbConstants | |
import com.entraid.models.GetHostResponseRequestModel | |
import com.entraid.models.welcome.* |
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
fun String.isValidPhoneNumber(): Boolean { | |
val clearDigitsRegex = "[^\\d]" | |
this.replace(clearDigitsRegex.toRegex(), "") | |
val regInternationalised = "^234[7,8,9]\\d{9}\$" | |
val regNorm = "^0[7,8,9]\\d{9}\$" | |
val pattern: Pattern = Pattern.compile(regNorm) | |
val internationalizedPattern: Pattern = Pattern.compile(regInternationalised) | |
return pattern.matcher(this).find().or(internationalizedPattern.matcher(this).find()) |
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
mWeekService.getCachedLessons() // From Cache | |
.doFinally(() -> { | |
mWeekService.getLessons() // From Network | |
.subscribeOn(Schedulers.io()) | |
.observeOn(AndroidSchedulers.mainThread()) | |
.map(new Function<WeekResponse, List<WeekModel>>() { | |
@Override | |
public List<WeekModel> apply( | |
@io.reactivex.annotations.NonNull final WeekResponse response) | |
throws Exception { |
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
package com.dryva.data.boilerplate.source.trip | |
import android.arch.paging.PagedList | |
import com.dryva.data.boilerplate.repository.driver.DryvaCache | |
import com.dryva.data.boilerplate.repository.trip.TripCache | |
import com.dryva.data.boilerplate.repository.trip.TripRemote | |
import com.dryva.domain.model.BookingData | |
import io.reactivex.disposables.CompositeDisposable | |
import io.reactivex.schedulers.Schedulers | |
import io.reactivex.subjects.PublishSubject |
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
allprojects { | |
apply from: "$rootDir/ktlint.gradle" | |
} |
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
Go to File -> Settings... -> Editor | |
General -> Auto Import | |
check Optimize imports on the fly (for current project). | |
Code Style -> Kotlin | |
Set from... -> Predefined style -> Kotlin style guide (Kotlin plugin 1.2.20+). | |
open Code Generation tab | |
uncheck Line comment at first column; | |
select Add a space at comment start. | |
open Imports tab |
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
curl -sSLO https://github.com/pinterest/ktlint/releases/download/0.33.0/ktlint && | |
chmod a+x ktlint && | |
sudo mv ktlint /usr/local/bin/ |
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
apply plugin: 'kotlin' | |
apply from: "../ktlint.gradle" |