diff --git a/app/build.gradle b/app/build.gradle index 0088b72..c131b36 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -35,19 +35,19 @@ android { } dependencies { - def room_version = "2.1.0-alpha04" implementation fileTree(include: ['*.jar'], dir: 'libs') implementation 'androidx.appcompat:appcompat:1.1.0-alpha02' implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha3' - implementation "androidx.room:room-runtime:$room_version" - annotationProcessor "androidx.room:room-compiler:$room_version" + implementation "androidx.room:room-runtime:2.1.0-alpha04" + annotationProcessor "androidx.room:room-compiler:2.1.0-alpha04" implementation('net.tomp2p:tomp2p-all:5.0-Beta8') { exclude group: 'org.mapdb', module: 'mapdb' } - implementation 'org.slf4j:slf4j-log4j12:+' + implementation 'org.slf4j:slf4j-log4j12:1.7.26' implementation group: 'com.h2database', name: 'h2-mvstore', version: '1.4.197' implementation 'com.google.android.material:material:1.1.0-alpha04' implementation 'androidx.preference:preference:1.1.0-alpha03' implementation 'com.google.code.gson:gson:2.8.5' implementation group: 'org.springframework.security', name: 'spring-security-crypto', version: '3.1.0.RELEASE' + implementation 'de.hdodenhof:circleimageview:3.0.0' } diff --git a/app/schemas/io.github.chronosx88.influence.helpers.RoomHelper/2.json b/app/schemas/io.github.chronosx88.influence.helpers.RoomHelper/2.json index e954cc6..03323fe 100644 --- a/app/schemas/io.github.chronosx88.influence.helpers.RoomHelper/2.json +++ b/app/schemas/io.github.chronosx88.influence.helpers.RoomHelper/2.json @@ -2,16 +2,22 @@ "formatVersion": 1, "database": { "version": 2, - "identityHash": "1fdccce4cf398929958d6bf1f0ccfea6", + "identityHash": "aa6543fc56b99224739cb0b53a63d48e", "entities": [ { "tableName": "messages", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `chatID` TEXT, `sender` TEXT, `date` TEXT, `text` TEXT, PRIMARY KEY(`id`))", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `type` INTEGER NOT NULL, `chatID` TEXT, `sender` TEXT, `timestamp` INTEGER NOT NULL, `text` TEXT)", "fields": [ { "fieldPath": "id", "columnName": "id", - "affinity": "TEXT", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "INTEGER", "notNull": true }, { @@ -27,10 +33,10 @@ "notNull": false }, { - "fieldPath": "date", - "columnName": "date", - "affinity": "TEXT", - "notNull": false + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "INTEGER", + "notNull": true }, { "fieldPath": "text", @@ -43,7 +49,7 @@ "columnNames": [ "id" ], - "autoGenerate": false + "autoGenerate": true }, "indices": [], "foreignKeys": [] @@ -96,7 +102,7 @@ "views": [], "setupQueries": [ "CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)", - "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, \"1fdccce4cf398929958d6bf1f0ccfea6\")" + "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, \"aa6543fc56b99224739cb0b53a63d48e\")" ] } } \ No newline at end of file diff --git a/app/src/main/java/io/github/chronosx88/influence/models/roomEntities/MessageEntity.java b/app/src/main/java/io/github/chronosx88/influence/models/roomEntities/MessageEntity.java index 86a85be..facffe6 100644 --- a/app/src/main/java/io/github/chronosx88/influence/models/roomEntities/MessageEntity.java +++ b/app/src/main/java/io/github/chronosx88/influence/models/roomEntities/MessageEntity.java @@ -7,7 +7,7 @@ import androidx.room.PrimaryKey; @Entity(tableName = "messages") public class MessageEntity { - @PrimaryKey(autoGenerate = true) String id; + @PrimaryKey(autoGenerate = true) public int id; @ColumnInfo public int type; @ColumnInfo public String chatID; @ColumnInfo public String sender; @@ -22,7 +22,7 @@ public class MessageEntity { this.text = text; } - public String getId() { + public int getId() { return id; }