Skip to content

Commit

Permalink
Merge pull request #290 from PermanentOrg/master
Browse files Browse the repository at this point in the history
Master
  • Loading branch information
flaviuvsp authored Aug 9, 2024
2 parents 74c0bf3 + 7526b83 commit 50ea297
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 7 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ android {
applicationId "org.permanent.PermanentArchive"
minSdkVersion 26
targetSdkVersion 34
versionCode 66
versionName "1.9.0"
versionCode 67
versionName "1.9.1"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -548,9 +548,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 @@ -417,10 +417,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 @@ -134,13 +134,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 50ea297

Please sign in to comment.