refractoring (#4545)

This commit is contained in:
Aditya-Srivastav 2021-08-12 17:19:07 +05:30 committed by GitHub
parent dfabaf8b42
commit 79447cfaf3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 0 deletions

View file

@ -123,6 +123,10 @@ class FolderFragment : CommonsDaggerSupportFragment() {
}
}
/**
* onResume
* notifyDataSetChanged, rebuild the holder views to account for deleted images, folders.
*/
override fun onResume() {
folderAdapter.notifyDataSetChanged()
super.onResume()

View file

@ -26,6 +26,9 @@ import java.io.FileInputStream
import java.net.URI
import javax.inject.Inject
/**
* Custom Selector Image Fragment.
*/
class ImageFragment: CommonsDaggerSupportFragment() {
/**
@ -169,6 +172,10 @@ class ImageFragment: CommonsDaggerSupportFragment() {
// todo change span count depending on the device orientation and other factos.
}
/**
* onResume
* notifyDataSetChanged, rebuild the holder views to account for deleted images.
*/
override fun onResume() {
imageAdapter.notifyDataSetChanged()
super.onResume()

View file

@ -266,7 +266,14 @@ class ImageLoader @Inject constructor(
object ERROR : Result()
}
/**
* Companion Object
*/
companion object {
/**
* Invalidate Day count.
* False Database Entries are invalid after INVALIDATE_DAY_COUNT and need to be re-queried.
*/
const val INVALIDATE_DAY_COUNT: Long = 7
}

View file

@ -23,6 +23,11 @@ public class UploadItem {
private final String createdTimestampSource;
private final BehaviorSubject<Integer> imageQuality;
private boolean hasInvalidLocation;
/**
* Uri of uploadItem
* Uri points to image location or name, eg content://media/external/images/camera/10495 (Android 10)
*/
private final Uri contentUri;