• sundernegi

    sundernegi

    1 year ago
    Anybudy give me best reference to learn MVVM architecture in Koltin
    sundernegi
    1 replies
    Copy to Clipboard
  • f

    frankelot

    1 year ago
    reposting this here 🙂 hope it doesn’t come across as spam
    f
    Will Shelor
    2 replies
    Copy to Clipboard
  • Napa Ram

    Napa Ram

    1 year ago
    Hi Everyone is ViewModel support to Kotlin Multi-platform if not how i can create my own VIewModel Please share if anyone is having good reference
    Napa Ram
    1 replies
    Copy to Clipboard
  • FunkyMuse

    FunkyMuse

    1 year ago
    Hey guys I have library: serverurls Which has productFlavors local,dev,prod The server URLs are in the gradle file I want to include those in the :networking module of mine and in the : app But when i do implementation project (path: '😒erverurls') I can't seem to get it to work
    FunkyMuse
    George Pandian
    2 replies
    Copy to Clipboard
  • k

    KV

    1 year ago
    Hi guys, I am using pagination library for fetch the data from the API call, and got to know that my API calls are made 3 times, with page number: 1 , 2 , 3 With Page Number 1 -> I got success response - which is correct behaviour. But does anyone know why page number 2 and 3 triggers (which is failure)?
    private const val STARTING_PAGE_INDEX = 1
    
    class AbsencePagingDataSource(
        private val apiProvider: ApiProvider,
        private val absenceDataMapper: AbsenceDataMapper,
        private val workspaceId: String
    ) :
        PagingSource<Int, AbsenceData>() {
        lateinit var response: ListApiResponse<WorkspaceAbsenceResponse>
    
        override suspend fun load(params: LoadParams<Int>): LoadResult<Int, AbsenceData> {
            val position = params.key ?: STARTING_PAGE_INDEX
    
            val request = Endpoint.GetWorkspaceAbsence(
                workspaceId = workspaceId,
                Queries = listOf(
                    Queries.Paginate(position, 50),   -------> SEE URL BELOW
                )
            )
            return try {
                apiProvider.api.performRequest<ListApiResponse<WorkspaceAbsenceResponse>>(request).map { listApiResponse ->
                    response = listApiResponse
                }
                val endOfPaginationReached = response.data.isEmpty()
    
                LoadResult.Page(
                    data = absenceDataMapper.mapToDomain(response),
                    prevKey = if (position == STARTING_PAGE_INDEX) null else position - 1,
                    nextKey = if (endOfPaginationReached) null else position + 1
                )
            } catch (exception: IOException) {
                LoadResult.Error(exception)
            }
        }
    
        override fun getRefreshKey(state: PagingState<Int, AbsenceData>): Int? {
            return state.anchorPosition?.let { anchorPosition ->
                state.closestPageToPosition(anchorPosition)?.prevKey?.plus(1)
                    ?: state.closestPageToPosition(anchorPosition)?.nextKey?.minus(1)
            }
        }
    }
    
    URL/request looks like -> 
    ---------------------------
    1. url=<https://PATH/api/v3/workspaces/120/absences?page=1&items=50> ----> 200
    2. url=<https://PATH/api/v3/workspaces/120/absences?page=2&items=50> ----> 422
    3. url=<https://PATH/api/v3/workspaces/120/absences?page=3&items=50> ----> 422
    k
    solidogen
    23 replies
    Copy to Clipboard
  • s

    suhas

    1 year ago
    Do you guys use service layer in MVP?
    s
    marlonlom
    +1
    6 replies
    Copy to Clipboard
  • Cicero

    Cicero

    1 year ago
    I came here to cry a little bit about interfaces.
    Cicero
    marlonlom
    5 replies
    Copy to Clipboard
  • gzhenjin

    gzhenjin

    1 year ago
    • Can someone please explain to me the advantages and necessity of mvi ?
    gzhenjin
    m
    +1
    8 replies
    Copy to Clipboard
  • Aaron Waller

    Aaron Waller

    1 year ago
    Anyone else facing problems with dagger-hilt version 2.38 and Gradle 7.1.0-alpha03? Since I upgraded from hilt 2.28 to 2.38 the field injection stopped working and I get the following error message:
    lateinit property analytics has not been initialized
    Aaron Waller
    Eugen Martynov
    +1
    4 replies
    Copy to Clipboard
  • v

    Vyshas

    1 year ago
    Navigation across dynamic feature modules: Navigation from a fragment in one dynamic feature module to a fragment nested in another onDemand dynamic feature module.. this cannot be done using deeplinks for sure and neither the document mentioned here(https://developer.android.com/guide/navigation/navigation-multi-module) mentions about this... What is the best way to achieve navigation in these scenarios ?
    v
    1 replies
    Copy to Clipboard