mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-26 17:53:14 +00:00
Merge pull request #47 from lacerta-doc/model/add_list_item_model
ListItemのモデルを追加
This commit is contained in:
commit
78ad88206c
|
@ -36,4 +36,6 @@ dependencies {
|
||||||
// JGit
|
// JGit
|
||||||
implementation 'org.eclipse.jgit:org.eclipse.jgit:6.8.0.202311291450-r'
|
implementation 'org.eclipse.jgit:org.eclipse.jgit:6.8.0.202311291450-r'
|
||||||
|
|
||||||
|
implementation project(":shared:ui")
|
||||||
|
|
||||||
}
|
}
|
41
model/src/main/java/one/nem/lacerta/model/ListItem.java
Normal file
41
model/src/main/java/one/nem/lacerta/model/ListItem.java
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
package one.nem.lacerta.model;
|
||||||
|
|
||||||
|
import android.graphics.drawable.Drawable;
|
||||||
|
|
||||||
|
public class ListItem {
|
||||||
|
|
||||||
|
// Properties
|
||||||
|
|
||||||
|
String title;
|
||||||
|
String description;
|
||||||
|
ListItemType itemType;
|
||||||
|
String itemId;
|
||||||
|
|
||||||
|
// Constructor
|
||||||
|
|
||||||
|
public ListItem(String title, String description, ListItemType itemType, String itemId) {
|
||||||
|
this.title = title;
|
||||||
|
this.description = description;
|
||||||
|
this.itemType = itemType;
|
||||||
|
this.itemId = itemId;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Getter
|
||||||
|
|
||||||
|
public String getTitle() {
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ListItemType getItemType() {
|
||||||
|
return itemType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getItemId() {
|
||||||
|
return itemId;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
17
model/src/main/java/one/nem/lacerta/model/ListItemType.java
Normal file
17
model/src/main/java/one/nem/lacerta/model/ListItemType.java
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
package one.nem.lacerta.model;
|
||||||
|
|
||||||
|
public enum ListItemType {
|
||||||
|
|
||||||
|
ITEM_TYPE_FOLDER(one.nem.lacerta.shared.ui.R.drawable.folder_24px),
|
||||||
|
ITEM_TYPE_DOCUMENT(one.nem.lacerta.shared.ui.R.drawable.description_24px);
|
||||||
|
|
||||||
|
private int iconId;
|
||||||
|
|
||||||
|
ListItemType(int iconId) {
|
||||||
|
this.iconId = iconId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getIconId() {
|
||||||
|
return iconId;
|
||||||
|
}
|
||||||
|
}
|
10
shared/ui/src/main/res/drawable/description_24px.xml
Normal file
10
shared/ui/src/main/res/drawable/description_24px.xml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="960"
|
||||||
|
android:viewportHeight="960"
|
||||||
|
android:tint="?attr/colorControlNormal">
|
||||||
|
<path
|
||||||
|
android:fillColor="@android:color/white"
|
||||||
|
android:pathData="M330,710L630,710L630,650L330,650L330,710ZM330,550L630,550L630,490L330,490L330,550ZM252.31,860Q222,860 201,839Q180,818 180,787.69L180,172.31Q180,142 201,121Q222,100 252.31,100L570,100L780,310L780,787.69Q780,818 759,839Q738,860 707.69,860L252.31,860ZM540,340L540,160L252.31,160Q247.69,160 243.85,163.85Q240,167.69 240,172.31L240,787.69Q240,792.31 243.85,796.15Q247.69,800 252.31,800L707.69,800Q712.31,800 716.15,796.15Q720,792.31 720,787.69L720,340L540,340ZM240,160L240,160L240,340L240,340L240,160L240,340L240,340L240,787.69Q240,792.31 240,796.15Q240,800 240,800L240,800Q240,800 240,796.15Q240,792.31 240,787.69L240,172.31Q240,167.69 240,163.85Q240,160 240,160Z"/>
|
||||||
|
</vector>
|
Loading…
Reference in New Issue
Block a user