mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-29 05:43:55 +01:00
Convert few model classes to kotlin (#3270)
This commit is contained in:
parent
d0f97398a5
commit
b0be4970ef
86 changed files with 661 additions and 1300 deletions
|
|
@ -1,41 +0,0 @@
|
|||
package fr.free.nrw.commons.bookmarks;
|
||||
|
||||
import android.net.Uri;
|
||||
|
||||
public class Bookmark {
|
||||
private Uri contentUri;
|
||||
private String mediaName;
|
||||
private String mediaCreator;
|
||||
|
||||
public Bookmark(String mediaName, String mediaCreator, Uri contentUri) {
|
||||
this.contentUri = contentUri;
|
||||
this.mediaName = mediaName == null ? "" : mediaName;
|
||||
this.mediaCreator = mediaCreator == null ? "" : mediaCreator;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the media name
|
||||
* @return the media name
|
||||
*/
|
||||
public String getMediaName() {
|
||||
return mediaName;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets media creator
|
||||
* @return creator name
|
||||
*/
|
||||
public String getMediaCreator() { return mediaCreator; }
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Gets the content URI for this bookmark
|
||||
* @return content URI
|
||||
*/
|
||||
public Uri getContentUri() {
|
||||
return contentUri;
|
||||
}
|
||||
|
||||
}
|
||||
26
app/src/main/java/fr/free/nrw/commons/bookmarks/Bookmark.kt
Normal file
26
app/src/main/java/fr/free/nrw/commons/bookmarks/Bookmark.kt
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
package fr.free.nrw.commons.bookmarks
|
||||
|
||||
import android.net.Uri
|
||||
|
||||
class Bookmark(mediaName: String?, mediaCreator: String?,
|
||||
/**
|
||||
* Modifies the content URI - marking this bookmark as already saved in the database
|
||||
* @param contentUri the content URI
|
||||
*/
|
||||
var contentUri: Uri?) {
|
||||
/**
|
||||
* Gets the content URI for this bookmark
|
||||
* @return content URI
|
||||
*/
|
||||
/**
|
||||
* Gets the media name
|
||||
* @return the media name
|
||||
*/
|
||||
val mediaName: String = mediaName ?: ""
|
||||
/**
|
||||
* Gets media creator
|
||||
* @return creator name
|
||||
*/
|
||||
val mediaCreator: String = mediaCreator ?: ""
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue