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 kr.co.seoft.ca.ui.contact | |
| import android.content.Context | |
| import android.content.Intent | |
| import android.os.Bundle | |
| import androidx.appcompat.app.AppCompatActivity | |
| import androidx.recyclerview.widget.LinearLayoutManager | |
| import androidx.recyclerview.widget.RecyclerView | |
| import kr.co.seoft.ca.databinding.ActivityContactBinding | |
| import kr.co.seoft.ca.util.toast |
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 kr.co.seoft.ca.data | |
| import kr.co.seoft.ca.domain.entity.CreateContactEntity | |
| import java.util.* | |
| import kotlin.random.Random | |
| fun CreateContactEntity.Companion.generateContact(): CreateContactEntity { | |
| return CreateContactEntity( | |
| UUID.randomUUID().toString().replace("-", "").substring(0, 5), | |
| UUID.randomUUID().toString().replace("-", "") |
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 kr.co.seoft.ca.data.repository.contact | |
| import io.reactivex.Completable | |
| import io.reactivex.Single | |
| import kr.co.seoft.ca.data.repository.contact.interfaces.ContactLocalDataSource | |
| import kr.co.seoft.ca.data.repository.contact.interfaces.ContactRemoteDataSource | |
| import kr.co.seoft.ca.data.util.zipToPair | |
| import kr.co.seoft.ca.domain.entity.ContactEntity | |
| import kr.co.seoft.ca.domain.entity.CreateContactEntity | |
| import kr.co.seoft.ca.domain.repository.ContactRepository |
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 kr.co.seoft.ca.data.api | |
| import io.reactivex.Single | |
| import kr.co.seoft.ca.data.api.model.ContactResponse | |
| import kr.co.seoft.ca.data.api.model.ContactsResponse | |
| import kr.co.seoft.ca.data.api.model.CreateContact | |
| import retrofit2.http.* | |
| interface ContactApi { |
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 kr.co.seoft.ca.data.api.model | |
| data class CreateContact(val name: String, val email: String) | |
| data class ContactResponse(val contact: Contact) | |
| data class ContactsResponse(val contacts: List<Contact>) | |
| data class Contact(val id: Long, val name: String, val email: String) |
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 kr.co.seoft.ca.domain.usecase.contact | |
| import io.reactivex.Single | |
| import kr.co.seoft.ca.domain.entity.ContactEntity | |
| import kr.co.seoft.ca.domain.entity.CreateContactEntity | |
| import kr.co.seoft.ca.domain.repository.ContactRepository | |
| import kr.co.seoft.ca.domain.usecase.common.RxScheduler | |
| import kr.co.seoft.ca.domain.usecase.common.SUseCase | |
| class AddContactUseCase( |
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 kr.co.seoft.ca.domain.entity | |
| data class ContactEntity(val id: Long, val name: String, val email: String, val isBookmark: Boolean) | |
| data class CreateContactEntity(val name: String, val email: String) { | |
| companion object | |
| } |
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 kr.co.seoft.ca.domain.usecase.common | |
| import io.reactivex.Single | |
| abstract class SUseCase<in Param, Result> { | |
| abstract val scheduler: RxScheduler | |
| internal abstract fun implement(param: Param): Single<Result> |
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
| // project 수준 gradle | |
| allprojects { | |
| repositories { | |
| jcenter() | |
| maven { url "https://jitpack.io" } | |
| } | |
| } | |
| // app 수준 gradle | |
| dependencies { |
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
| processRemoteConfig.requestRemoteConfig(object : OnRemoteConfigListener { | |
| override fun onRun(message: String?, etc: String?) { | |
| Log.d(TAG, "onRun $message $etc") | |
| startActivity(Intent(baseContext, MainActivity::class.java)) | |
| finish() | |
| } | |
| override fun onBlock(message: String?, etc: String?) { | |
| Log.d(TAG, "onBlock $message $etc") | |
| Toast.makeText(baseContext, message, Toast.LENGTH_LONG).show() |