Skip to content

Commit

Permalink
Merge pull request #100 from PawWithU/feature/inter_home
Browse files Browse the repository at this point in the history
feat/inter_home: ViewModel 분리 및 잘못된 경로 수정
  • Loading branch information
kang9366 authored Mar 26, 2024
2 parents fb36ef4 + 47c8c9b commit 290a499
Show file tree
Hide file tree
Showing 92 changed files with 135 additions and 88 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.kusitms.connectdog.feature.home.screen

import android.util.Log
import android.widget.Toast
import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
Expand Down Expand Up @@ -42,6 +43,7 @@ import androidx.compose.ui.draw.shadow
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.painter.ColorPainter
import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
Expand Down Expand Up @@ -168,7 +170,6 @@ private fun StatisticBanner(modifier: Modifier) {
Column(horizontalAlignment = Alignment.End, modifier = modifier) {
Row(
modifier = Modifier
.clickable { }
.padding(end = 10.dp),
verticalAlignment = Alignment.CenterVertically
) {
Expand Down Expand Up @@ -261,6 +262,7 @@ private fun StatisticInfoItem(

@Composable
private fun BannerGuideline() {
val context = LocalContext.current
Row(
modifier = Modifier
.fillMaxWidth()
Expand All @@ -276,7 +278,7 @@ private fun BannerGuideline() {
color = MaterialTheme.colorScheme.background
)
Button(
onClick = {},
onClick = { Toast.makeText(context, "아직 준비중인 기능입니다.", Toast.LENGTH_SHORT).show() },
colors = ButtonDefaults.buttonColors(
containerColor = MaterialTheme.colorScheme.background,
contentColor = MaterialTheme.colorScheme.primary
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,11 @@
import javax.inject.Inject;

@dagger.hilt.android.lifecycle.HiltViewModel
@kotlin.Metadata(mv = {1, 8, 0}, k = 1, d1 = {"\u0000\u0088\u0001\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u0003\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\t\n\u0002\u0018\u0002\n\u0002\b\t\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\t\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010 \n\u0002\u0010\u0000\n\u0002\b\r\b\u0007\u0018\u00002\u00020\u0001B\u000f\b\u0007\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u00a2\u0006\u0002\u0010\u0004J\u000e\u00105\u001a\u0002062\u0006\u00107\u001a\u000208J\u000e\u00109\u001a\u0002062\u0006\u00107\u001a\u000208J:\u0010:\u001a\b\u0012\u0004\u0012\u00020\t0\u00182\"\u0010;\u001a\u001e\b\u0001\u0012\u0010\u0012\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020,0>0=\u0012\u0006\u0012\u0004\u0018\u00010?0<H\u0002\u00f8\u0001\u0000\u00a2\u0006\u0002\u0010@J\u0006\u0010A\u001a\u000206J\u000e\u0010B\u001a\u0002062\u0006\u00107\u001a\u000208J\u0006\u0010C\u001a\u000206J\u0006\u0010D\u001a\u000206JK\u0010E\u001a\u0002062\"\u0010F\u001a\u001e\b\u0001\u0012\u0010\u0012\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020,0>0=\u0012\u0006\u0012\u0004\u0018\u00010?0<2\f\u0010G\u001a\b\u0012\u0004\u0012\u00020\t0\b2\u0006\u0010H\u001a\u00020\u0006H\u0082@\u00f8\u0001\u0000\u00a2\u0006\u0002\u0010IJ\u0006\u0010J\u001a\u000206J\u000e\u0010K\u001a\u0002062\u0006\u00107\u001a\u000208R\u000e\u0010\u0005\u001a\u00020\u0006X\u0082D\u00a2\u0006\u0002\n\u0000R\u0014\u0010\u0007\u001a\b\u0012\u0004\u0012\u00020\t0\bX\u0082\u0004\u00a2\u0006\u0002\n\u0000R\u0014\u0010\n\u001a\b\u0012\u0004\u0012\u00020\f0\u000bX\u0082\u0004\u00a2\u0006\u0002\n\u0000R\u0014\u0010\r\u001a\b\u0012\u0004\u0012\u00020\u000e0\bX\u0082\u0004\u00a2\u0006\u0002\n\u0000R\u0014\u0010\u000f\u001a\b\u0012\u0004\u0012\u00020\u00110\u0010X\u0082\u0004\u00a2\u0006\u0002\n\u0000R\u0014\u0010\u0012\u001a\b\u0012\u0004\u0012\u00020\u000e0\bX\u0082\u0004\u00a2\u0006\u0002\n\u0000R\u0014\u0010\u0013\u001a\b\u0012\u0004\u0012\u00020\t0\bX\u0082\u0004\u00a2\u0006\u0002\n\u0000R\u0014\u0010\u0014\u001a\b\u0012\u0004\u0012\u00020\u00150\u0010X\u0082\u0004\u00a2\u0006\u0002\n\u0000R\u0014\u0010\u0016\u001a\b\u0012\u0004\u0012\u00020\t0\bX\u0082\u0004\u00a2\u0006\u0002\n\u0000R\u0017\u0010\u0017\u001a\b\u0012\u0004\u0012\u00020\t0\u0018\u00a2\u0006\b\n\u0000\u001a\u0004\b\u0019\u0010\u001aR\u0017\u0010\u001b\u001a\b\u0012\u0004\u0012\u00020\f0\u001c8F\u00a2\u0006\u0006\u001a\u0004\b\u001d\u0010\u001eR\u000e\u0010\u0002\u001a\u00020\u0003X\u0082\u0004\u00a2\u0006\u0002\n\u0000R\u0017\u0010\u001f\u001a\b\u0012\u0004\u0012\u00020\u000e0\u0018\u00a2\u0006\b\n\u0000\u001a\u0004\b \u0010\u001aR\u0017\u0010!\u001a\b\u0012\u0004\u0012\u00020\u00110\"\u00a2\u0006\b\n\u0000\u001a\u0004\b#\u0010$R\u0017\u0010%\u001a\b\u0012\u0004\u0012\u00020\u000e0\u0018\u00a2\u0006\b\n\u0000\u001a\u0004\b&\u0010\u001aR\u0017\u0010\'\u001a\b\u0012\u0004\u0012\u00020\t0\u0018\u00a2\u0006\b\n\u0000\u001a\u0004\b(\u0010\u001aR\u0017\u0010)\u001a\b\u0012\u0004\u0012\u00020\t0\u0018\u00a2\u0006\b\n\u0000\u001a\u0004\b*\u0010\u001aR\u001c\u0010+\u001a\u0004\u0018\u00010,X\u0086\u000e\u00a2\u0006\u000e\n\u0000\u001a\u0004\b-\u0010.\"\u0004\b/\u00100R\u0017\u00101\u001a\b\u0012\u0004\u0012\u00020\u00150\"8F\u00a2\u0006\u0006\u001a\u0004\b2\u0010$R\u0017\u00103\u001a\b\u0012\u0004\u0012\u00020\t0\u0018\u00a2\u0006\b\n\u0000\u001a\u0004\b4\u0010\u001a\u0082\u0002\u0004\n\u0002\b\u0019\u00a8\u0006L"}, d2 = {"Lcom/kusitms/connectdog/feature/intermediator/InterManagementViewModel;", "Landroidx/lifecycle/ViewModel;", "managementRepository", "Lcom/kusitms/connectdog/core/data/repository/InterManagementRepository;", "(Lcom/kusitms/connectdog/core/data/repository/InterManagementRepository;)V", "TAG", "", "_completedUiState", "Lkotlinx/coroutines/flow/MutableStateFlow;", "Lcom/kusitms/connectdog/feature/intermediator/InterApplicationUiState;", "_errorFlow", "Lkotlinx/coroutines/flow/MutableSharedFlow;", "", "_pendingDataState", "Lcom/kusitms/connectdog/core/model/DataUiState;", "_profile", "Landroidx/lifecycle/MutableLiveData;", "Lcom/kusitms/connectdog/core/data/api/model/intermediator/IntermediatorProfileInfoResponseItem;", "_progressDataState", "_progressUiState", "_volunteerResponse", "Lcom/kusitms/connectdog/core/model/Volunteer;", "_waitingUiState", "completedUiState", "Lkotlinx/coroutines/flow/StateFlow;", "getCompletedUiState", "()Lkotlinx/coroutines/flow/StateFlow;", "errorFlow", "Lkotlinx/coroutines/flow/SharedFlow;", "getErrorFlow", "()Lkotlinx/coroutines/flow/SharedFlow;", "pendingDataState", "getPendingDataState", "profile", "Landroidx/lifecycle/LiveData;", "getProfile", "()Landroidx/lifecycle/LiveData;", "progressDataState", "getProgressDataState", "progressUiState", "getProgressUiState", "recruitingUiState", "getRecruitingUiState", "selectedApplication", "Lcom/kusitms/connectdog/core/model/InterApplication;", "getSelectedApplication", "()Lcom/kusitms/connectdog/core/model/InterApplication;", "setSelectedApplication", "(Lcom/kusitms/connectdog/core/model/InterApplication;)V", "volunteerResponse", "getVolunteerResponse", "waitingUiState", "getWaitingUiState", "completeApplication", "", "applicationId", "", "confirmVolunteer", "createUiStateFlow", "getApplication", "Lkotlin/Function1;", "Lkotlin/coroutines/Continuation;", "", "", "(Lkotlin/jvm/functions/Function1;)Lkotlinx/coroutines/flow/StateFlow;", "getIntermediatorInfo", "getVolunteer", "refreshCompletedUiState", "refreshInProgressUiState", "refreshUiState", "getApplications", "uiState", "tag", "(Lkotlin/jvm/functions/Function1;Lkotlinx/coroutines/flow/MutableStateFlow;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "refreshWaitingUiState", "rejectVolunteer", "intermediator_debug"})
@kotlin.Metadata(mv = {1, 8, 0}, k = 1, d1 = {"\u0000\u0082\u0001\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u0003\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u000b\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\t\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010 \n\u0002\u0010\u0000\n\u0002\b\f\b\u0007\u0018\u00002\u00020\u0001B\u000f\b\u0007\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u00a2\u0006\u0002\u0010\u0004J\u000e\u00101\u001a\u0002022\u0006\u00103\u001a\u000204J\u000e\u00105\u001a\u0002022\u0006\u00103\u001a\u000204J:\u00106\u001a\b\u0012\u0004\u0012\u00020\t0\u00162\"\u00107\u001a\u001e\b\u0001\u0012\u0010\u0012\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020&0:09\u0012\u0006\u0012\u0004\u0018\u00010;08H\u0002\u00f8\u0001\u0000\u00a2\u0006\u0002\u0010<J\u000e\u0010=\u001a\u0002022\u0006\u00103\u001a\u000204J\u0006\u0010>\u001a\u000202J\u0006\u0010?\u001a\u000202JK\u0010@\u001a\u0002022\"\u0010A\u001a\u001e\b\u0001\u0012\u0010\u0012\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020&0:09\u0012\u0006\u0012\u0004\u0018\u00010;082\f\u0010B\u001a\b\u0012\u0004\u0012\u00020\t0\b2\u0006\u0010C\u001a\u00020\u0006H\u0082@\u00f8\u0001\u0000\u00a2\u0006\u0002\u0010DJ\u0006\u0010E\u001a\u000202J\u000e\u0010F\u001a\u0002022\u0006\u00103\u001a\u000204R\u000e\u0010\u0005\u001a\u00020\u0006X\u0082D\u00a2\u0006\u0002\n\u0000R\u0014\u0010\u0007\u001a\b\u0012\u0004\u0012\u00020\t0\bX\u0082\u0004\u00a2\u0006\u0002\n\u0000R\u0014\u0010\n\u001a\b\u0012\u0004\u0012\u00020\f0\u000bX\u0082\u0004\u00a2\u0006\u0002\n\u0000R\u0014\u0010\r\u001a\b\u0012\u0004\u0012\u00020\u000e0\bX\u0082\u0004\u00a2\u0006\u0002\n\u0000R\u0014\u0010\u000f\u001a\b\u0012\u0004\u0012\u00020\u000e0\bX\u0082\u0004\u00a2\u0006\u0002\n\u0000R\u0014\u0010\u0010\u001a\b\u0012\u0004\u0012\u00020\t0\bX\u0082\u0004\u00a2\u0006\u0002\n\u0000R\u0014\u0010\u0011\u001a\b\u0012\u0004\u0012\u00020\u00130\u0012X\u0082\u0004\u00a2\u0006\u0002\n\u0000R\u0014\u0010\u0014\u001a\b\u0012\u0004\u0012\u00020\t0\bX\u0082\u0004\u00a2\u0006\u0002\n\u0000R\u0017\u0010\u0015\u001a\b\u0012\u0004\u0012\u00020\t0\u0016\u00a2\u0006\b\n\u0000\u001a\u0004\b\u0017\u0010\u0018R\u0017\u0010\u0019\u001a\b\u0012\u0004\u0012\u00020\f0\u001a8F\u00a2\u0006\u0006\u001a\u0004\b\u001b\u0010\u001cR\u000e\u0010\u0002\u001a\u00020\u0003X\u0082\u0004\u00a2\u0006\u0002\n\u0000R\u0017\u0010\u001d\u001a\b\u0012\u0004\u0012\u00020\u000e0\u0016\u00a2\u0006\b\n\u0000\u001a\u0004\b\u001e\u0010\u0018R\u0017\u0010\u001f\u001a\b\u0012\u0004\u0012\u00020\u000e0\u0016\u00a2\u0006\b\n\u0000\u001a\u0004\b \u0010\u0018R\u0017\u0010!\u001a\b\u0012\u0004\u0012\u00020\t0\u0016\u00a2\u0006\b\n\u0000\u001a\u0004\b\"\u0010\u0018R\u0017\u0010#\u001a\b\u0012\u0004\u0012\u00020\t0\u0016\u00a2\u0006\b\n\u0000\u001a\u0004\b$\u0010\u0018R\u001c\u0010%\u001a\u0004\u0018\u00010&X\u0086\u000e\u00a2\u0006\u000e\n\u0000\u001a\u0004\b\'\u0010(\"\u0004\b)\u0010*R\u0017\u0010+\u001a\b\u0012\u0004\u0012\u00020\u00130,8F\u00a2\u0006\u0006\u001a\u0004\b-\u0010.R\u0017\u0010/\u001a\b\u0012\u0004\u0012\u00020\t0\u0016\u00a2\u0006\b\n\u0000\u001a\u0004\b0\u0010\u0018\u0082\u0002\u0004\n\u0002\b\u0019\u00a8\u0006G"}, d2 = {"Lcom/kusitms/connectdog/feature/intermediator/InterManagementViewModel;", "Landroidx/lifecycle/ViewModel;", "managementRepository", "Lcom/kusitms/connectdog/core/data/repository/InterManagementRepository;", "(Lcom/kusitms/connectdog/core/data/repository/InterManagementRepository;)V", "TAG", "", "_completedUiState", "Lkotlinx/coroutines/flow/MutableStateFlow;", "Lcom/kusitms/connectdog/feature/intermediator/InterApplicationUiState;", "_errorFlow", "Lkotlinx/coroutines/flow/MutableSharedFlow;", "", "_pendingDataState", "Lcom/kusitms/connectdog/core/model/DataUiState;", "_progressDataState", "_progressUiState", "_volunteerResponse", "Landroidx/lifecycle/MutableLiveData;", "Lcom/kusitms/connectdog/core/model/Volunteer;", "_waitingUiState", "completedUiState", "Lkotlinx/coroutines/flow/StateFlow;", "getCompletedUiState", "()Lkotlinx/coroutines/flow/StateFlow;", "errorFlow", "Lkotlinx/coroutines/flow/SharedFlow;", "getErrorFlow", "()Lkotlinx/coroutines/flow/SharedFlow;", "pendingDataState", "getPendingDataState", "progressDataState", "getProgressDataState", "progressUiState", "getProgressUiState", "recruitingUiState", "getRecruitingUiState", "selectedApplication", "Lcom/kusitms/connectdog/core/model/InterApplication;", "getSelectedApplication", "()Lcom/kusitms/connectdog/core/model/InterApplication;", "setSelectedApplication", "(Lcom/kusitms/connectdog/core/model/InterApplication;)V", "volunteerResponse", "Landroidx/lifecycle/LiveData;", "getVolunteerResponse", "()Landroidx/lifecycle/LiveData;", "waitingUiState", "getWaitingUiState", "completeApplication", "", "applicationId", "", "confirmVolunteer", "createUiStateFlow", "getApplication", "Lkotlin/Function1;", "Lkotlin/coroutines/Continuation;", "", "", "(Lkotlin/jvm/functions/Function1;)Lkotlinx/coroutines/flow/StateFlow;", "getVolunteer", "refreshCompletedUiState", "refreshInProgressUiState", "refreshUiState", "getApplications", "uiState", "tag", "(Lkotlin/jvm/functions/Function1;Lkotlinx/coroutines/flow/MutableStateFlow;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "refreshWaitingUiState", "rejectVolunteer", "intermediator_debug"})
public final class InterManagementViewModel extends androidx.lifecycle.ViewModel {
private final com.kusitms.connectdog.core.data.repository.InterManagementRepository managementRepository = null;
private final java.lang.String TAG = "InterManagementViewModel";
private final kotlinx.coroutines.flow.MutableSharedFlow<java.lang.Throwable> _errorFlow = null;
private final androidx.lifecycle.MutableLiveData<com.kusitms.connectdog.core.data.api.model.intermediator.IntermediatorProfileInfoResponseItem> _profile = null;
@org.jetbrains.annotations.NotNull
private final androidx.lifecycle.LiveData<com.kusitms.connectdog.core.data.api.model.intermediator.IntermediatorProfileInfoResponseItem> profile = null;
@org.jetbrains.annotations.NotNull
private final kotlinx.coroutines.flow.StateFlow<com.kusitms.connectdog.feature.intermediator.InterApplicationUiState> recruitingUiState = null;
private final kotlinx.coroutines.flow.MutableStateFlow<com.kusitms.connectdog.feature.intermediator.InterApplicationUiState> _waitingUiState = null;
Expand Down Expand Up @@ -57,11 +54,6 @@ public final kotlinx.coroutines.flow.SharedFlow<java.lang.Throwable> getErrorFlo
return null;
}

@org.jetbrains.annotations.NotNull
public final androidx.lifecycle.LiveData<com.kusitms.connectdog.core.data.api.model.intermediator.IntermediatorProfileInfoResponseItem> getProfile() {
return null;
}

@org.jetbrains.annotations.NotNull
public final kotlinx.coroutines.flow.StateFlow<com.kusitms.connectdog.feature.intermediator.InterApplicationUiState> getRecruitingUiState() {
return null;
Expand Down Expand Up @@ -106,9 +98,6 @@ public final kotlinx.coroutines.flow.StateFlow<com.kusitms.connectdog.core.model
return null;
}

public final void getIntermediatorInfo() {
}

public final void getVolunteer(long applicationId) {
}

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
package com.kusitms.connectdog.feature.intermediator

import android.util.Log
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.kusitms.connectdog.core.data.repository.InterManagementRepository
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.launch
import javax.inject.Inject

@HiltViewModel
class InterHomeViewModel @Inject constructor(
private val managementRepository: InterManagementRepository
) : ViewModel() {
private val _profileImage = MutableStateFlow<String>("")
val profileImage: StateFlow<String>
get() = _profileImage

private val _completedCount = MutableStateFlow<Int?>(null)
val completedCount: StateFlow<Int?>
get() = _completedCount

private val _progressingCount = MutableStateFlow<Int?>(null)
val progressingCount: StateFlow<Int?>
get() = _progressingCount

private val _waitingCount = MutableStateFlow<Int?>(null)
val waitingCount: StateFlow<Int?>
get() = _waitingCount

private val _recruitingCount = MutableStateFlow<Int?>(null)
val recruitingCount: StateFlow<Int?>
get() = _recruitingCount

private val _intro = MutableStateFlow<String>("")
val intro: StateFlow<String>
get() = _intro

private val _intermediaryName = MutableStateFlow<String>("")
val intermediaryName: StateFlow<String>
get() = _intermediaryName

fun fetchIntermediatorInfo() {
viewModelScope.launch {
try {
val response = managementRepository.getIntermediatorProfileInfo()
_profileImage.value = response.profileImage
_intermediaryName.value = response.intermediaryName
_completedCount.value = response.completedCount.toInt()
_progressingCount.value = response.progressingCount.toInt()
_waitingCount.value = response.waitingCount.toInt()
_recruitingCount.value = response.recruitingCount.toInt()
_intro.value = response.intro
} catch (e: Exception) {
Log.d("asdf", e.message.toString())
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.kusitms.connectdog.core.data.api.model.intermediator.IntermediatorProfileInfoResponseItem
import com.kusitms.connectdog.core.data.repository.InterManagementRepository
import com.kusitms.connectdog.core.model.DataUiState
import com.kusitms.connectdog.core.model.InterApplication
Expand Down Expand Up @@ -34,9 +33,6 @@ class InterManagementViewModel @Inject constructor(
private val _errorFlow = MutableSharedFlow<Throwable>()
val errorFlow: SharedFlow<Throwable> get() = _errorFlow

private val _profile = MutableLiveData<IntermediatorProfileInfoResponseItem>()
val profile: LiveData<IntermediatorProfileInfoResponseItem> = _profile

val recruitingUiState: StateFlow<InterApplicationUiState> =
createUiStateFlow { managementRepository.getApplicationRecruiting() }

Expand Down Expand Up @@ -68,13 +64,6 @@ class InterManagementViewModel @Inject constructor(
refreshCompletedUiState()
}

fun getIntermediatorInfo() {
viewModelScope.launch {
val response = managementRepository.getIntermediatorProfileInfo()
_profile.postValue(response)
}
}

fun getVolunteer(applicationId: Long) {
viewModelScope.launch {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@ fun NavController.navigateInterManagement(tabIndex: Int) {

fun NavGraphBuilder.intermediatorNavGraph(
onBackClick: () -> Unit,
onSettingClick: () -> Unit
onSettingClick: () -> Unit,
onNotificationClick: () -> Unit,
onManagementClick: (Int) -> Unit
) {
composable(route = IntermediatorRoute.route) {
IntermediatorHomeScreen(
onNotificationClick = { },
onNotificationClick = onNotificationClick,
onSettingClick = onSettingClick,
onDataClick = { }
// index -> navigator.navigateInterManagement(index)
onDataClick = onManagementClick
)
}

Expand All @@ -44,5 +45,5 @@ fun NavGraphBuilder.intermediatorNavGraph(

object IntermediatorRoute {
const val route = "inter_home"
const val management = "management"
const val management = "inter_management"
}
Loading

0 comments on commit 290a499

Please sign in to comment.