nextcloud / nextcloud/android

Refactor: Create a ThumbImageView

Offen
#77 13 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

♻️ refactor feature: previews and thumbnails technical debt
Vorherrschende Sprache
Kotlin
Sterne
5.6k
Forks
2k
Ø Merge
2 T. 2 Std.
Gemergte PRs (30 T.)
102

Beschreibung

Thumbnails of images are currently shown in 3 different places. The uploadlist, the local file browser and the normal folder view of an nextcloud folder.

The code to generate a thumbnail / kickof the thumbnail generation is present in all of there places.

To unify this, i would like to propose a ThumbImageView class which subclases ImageView. This Class should handle all concern regarding File or OCFile -> Thumbnail, by calling ThumbManager and so on.

The ImageView objects are reused in the list views, all code accesing these Views has to check whether the reference they use, still refer to a View with the initial File, this could be solved by having a Reference to OCFile or File on the ThumbImageView aswell as the unique thumbnail CacheKey!

So we have some new methods like
void setFile(File file);
void setOCFile(OCFile file);
int getCacheKey(); (maybe override .hashCode(), but this could be problematic with OCFiles not existing)

Another possibility would be to introduce two additional classes
FileThumbImageView and OCFileThumbImageView.. As far as i understand it, the Upload Queue and local filebrowser lists use File and the nextcloud folder browser uses OCFile..

This should only a refactor not any addition of new functionality.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Ermittle die Upload-Liste, den lokalen Dateibrowser und die normale Ordneransicht und vergleiche anschließend deren bestehende Pfade zur Thumbnail-Generierung über ThumbManager sowie die Verwendung von ImageView. Definiere den gemeinsamen ThumbImageView-Ansatz anhand von File- und OCFile-Referenzen und überprüfe, dass alle drei Ansichten ihn verwenden, ohne Funktionalität hinzuzufügen oder wiederverwendete Listenansichten falsch zu behandeln.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
android, java, kotlin
Bereich
mobile-dev
Issue-Typ
Refactoring
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
32/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.