diff --git a/app/src/main/java/org/sopt/sample/presentation/main/gallery/GalleryViewModel.kt b/app/src/main/java/org/sopt/sample/presentation/main/gallery/GalleryViewModel.kt index ace9dd6..ec65596 100644 --- a/app/src/main/java/org/sopt/sample/presentation/main/gallery/GalleryViewModel.kt +++ b/app/src/main/java/org/sopt/sample/presentation/main/gallery/GalleryViewModel.kt @@ -7,9 +7,9 @@ import androidx.lifecycle.viewModelScope import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.launch import org.sopt.sample.data.dto.request.RequestRegisterMusicDto -import org.sopt.sample.util.UiState import org.sopt.sample.data.repository.MusicRepository import org.sopt.sample.util.ContentUriRequestBody +import org.sopt.sample.util.UiState import retrofit2.HttpException import timber.log.Timber import javax.inject.Inject diff --git a/app/src/main/java/org/sopt/sample/presentation/main/music/MusicFragment.kt b/app/src/main/java/org/sopt/sample/presentation/main/music/MusicFragment.kt index fd2ed4b..8779d86 100644 --- a/app/src/main/java/org/sopt/sample/presentation/main/music/MusicFragment.kt +++ b/app/src/main/java/org/sopt/sample/presentation/main/music/MusicFragment.kt @@ -32,14 +32,14 @@ class MusicFragment : BindingFragment(R.layout.fragment_mu private fun observeStateMessage() { viewModel.stateMessage.observe(viewLifecycleOwner) { when (it) { - UiState.Success -> viewModel.musicList.value?.let { it -> + is UiState.Success -> viewModel.musicList.value?.let { it -> musicAdapter.submitList(it) } is UiState.Failure -> requireContext().showSnackbar( binding.root, getString(R.string.msg_music_null) ) - UiState.Error -> requireContext().showSnackbar( + is UiState.Error -> requireContext().showSnackbar( binding.root, getString(R.string.msg_server_error) ) diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_home.xml index a2c7c9e..4cd7baa 100644 --- a/app/src/main/res/layout/fragment_home.xml +++ b/app/src/main/res/layout/fragment_home.xml @@ -23,12 +23,9 @@ android:clipToPadding="false" android:paddingHorizontal="20dp" android:paddingBottom="30dp" - app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.0" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" - app:layout_constraintVertical_bias="0.0" tools:layoutManager="androidx.recyclerview.widget.GridLayoutManager" tools:listitem="@layout/item_home_follower" tools:spanCount="2" /> diff --git a/app/src/main/res/layout/fragment_music.xml b/app/src/main/res/layout/fragment_music.xml index 7f9472b..96fcd04 100644 --- a/app/src/main/res/layout/fragment_music.xml +++ b/app/src/main/res/layout/fragment_music.xml @@ -22,7 +22,6 @@ android:clipToPadding="false" android:paddingBottom="10dp" android:paddingHorizontal="20dp" - app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent"