Skip to content

Commit

Permalink
Fixed bugs: archive photo could not be changed and the more options b…
Browse files Browse the repository at this point in the history
…utton from file selection screen should not have been visible.
  • Loading branch information
flaviahandrea-vsp committed Mar 21, 2024
1 parent dabd2d8 commit cc105e3
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -533,9 +533,10 @@ class NetworkClient(private var okHttpClient: OkHttpClient?, context: Context) {
}

fun updateProfilePhoto(
archiveNr: String?, archiveId: Int, thumbArchiveNr: String?
archiveNr: String?, archiveId: Int, archiveType: ArchiveType, thumbArchiveNr: String?
): Call<ResponseVO> {
val request = toJson(RequestContainer().addArchive(archiveNr, archiveId, thumbArchiveNr))
val request =
toJson(RequestContainer().addArchive(archiveNr, archiveId, archiveType, thumbArchiveNr))
val requestBody: RequestBody = request.toRequestBody(jsonMediaType)
return archiveService.updateProfilePhoto(requestBody)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,10 +396,16 @@ class RequestContainer {
return this
}

fun addArchive(archiveNr: String?, archiveId: Int, thumbArchiveNr: String?): RequestContainer {
fun addArchive(
archiveNr: String?,
archiveId: Int,
type: ArchiveType,
thumbArchiveNr: String?
): RequestContainer {
val archiveVO = ArchiveVO()
archiveVO.archiveId = archiveId
archiveVO.archiveNbr = archiveNr
archiveVO.type = type.backendString
archiveVO.thumbArchiveNbr = thumbArchiveNr
RequestVO.data?.get(0)?.ArchiveVO = archiveVO
return this
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class ArchiveRepositoryImpl(val context: Context) : IArchiveRepository {
NetworkClient.instance().updateProfilePhoto(
prefsHelper.getCurrentArchiveNr(),
prefsHelper.getCurrentArchiveId(),
prefsHelper.getCurrentArchiveType(),
thumbRecord.archiveNr
)
.enqueue(object : Callback<ResponseVO> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,14 @@ class MyFilesFragment : PermanentBaseFragment() {
viewModel.initSwipeRefreshLayout(binding.swipeRefreshLayout)
viewModel.loadRootFiles()
initDownloadsRecyclerView(binding.rvDownloads)
initFilesRecyclerView(binding.rvFiles, showScreenSimplified)
viewModel.registerDeviceForFCM()

arguments?.takeIf { it.containsKey(SHOW_SCREEN_SIMPLIFIED_KEY) }?.apply {
showScreenSimplified = getBoolean(SHOW_SCREEN_SIMPLIFIED_KEY)
if (showScreenSimplified) viewModel.setShowScreenSimplified()
}
initFilesRecyclerView(binding.rvFiles, showScreenSimplified)

arguments?.getParcelableArrayList<Uri>(MainActivity.SAVE_TO_PERMANENT_FILE_URIS_KEY)
?.let { showSaveToPermanentFragment(it) }
if (viewModel.isRelocationMode.value == true) resizeIslandWidthAnimated(
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/fragment_my_files.xml
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
app:layout_constraintBottom_toBottomOf="@+id/clFolderOptions"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/clFolderOptions"
android:visibility="@{viewModel.existsFiles == false ? View.GONE : View.VISIBLE}"
android:visibility="@{viewModel.existsFiles == false || viewModel.showScreenSimplified ? View.GONE : View.VISIBLE}"
app:viewModeIcon="@{viewModel.isListViewMode}" />

<TextView
Expand Down

0 comments on commit cc105e3

Please sign in to comment.