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
interface ITestBaseAdapter<T : Any> { | |
fun add(item: T) | |
fun addAll(items: List<T>) | |
fun addTo(position: Int = 0, item: T) | |
fun remove(position: Int) | |
fun getList(): List<T> | |
fun update(newList: List<T>, callback: ApolloBaseDiffUtilCallback<T>) | |
fun clear() | |
} |
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 TestAdapter( | |
private val onItemClick: (id: Int) -> Unit | |
) : ApolloBaseAdapter<DrawerItemsAdapter.TestViewHolder>() { | |
private var items: ArrayList<String> = arrayListOf() | |
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): DrawerViewHolder { | |
val view = LayoutInflator.from(parent.context).inflate(R.layout.drawer_body_items_list, parent, false) | |
return DrawerViewHolder(view) | |
} |
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 LogInRequest( | |
private val service: ApolloService | |
) : UseCase<LoginData, LoginResponse>() { | |
override fun buildObservable(criteria: LoginData): Observable<LoginResponse> = | |
service.logIn(criteria) | |
.doOnError { | |
if (it is HttpException) { | |
Throwable(getMessageByCode(it.code())) | |
} else { | |
Throwable(it.message) |
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
{ | |
"id": "string", | |
"notifications": [ | |
{ | |
"content": "string", | |
"contentDates": [ | |
null | |
], | |
"id": "string", | |
"relatedEntity": { |