app可以跑起来
This commit is contained in:
@@ -0,0 +1,215 @@
|
||||
package com.saars.chatplatform.data.local;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.room.DatabaseConfiguration;
|
||||
import androidx.room.InvalidationTracker;
|
||||
import androidx.room.RoomDatabase;
|
||||
import androidx.room.RoomOpenHelper;
|
||||
import androidx.room.migration.AutoMigrationSpec;
|
||||
import androidx.room.migration.Migration;
|
||||
import androidx.room.util.DBUtil;
|
||||
import androidx.room.util.TableInfo;
|
||||
import androidx.sqlite.db.SupportSQLiteDatabase;
|
||||
import androidx.sqlite.db.SupportSQLiteOpenHelper;
|
||||
import com.saars.chatplatform.data.local.dao.ConversationDao;
|
||||
import com.saars.chatplatform.data.local.dao.ConversationDao_Impl;
|
||||
import com.saars.chatplatform.data.local.dao.MessageDao;
|
||||
import com.saars.chatplatform.data.local.dao.MessageDao_Impl;
|
||||
import java.lang.Class;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.lang.SuppressWarnings;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import javax.annotation.processing.Generated;
|
||||
|
||||
@Generated("androidx.room.RoomProcessor")
|
||||
@SuppressWarnings({"unchecked", "deprecation"})
|
||||
public final class AppDatabase_Impl extends AppDatabase {
|
||||
private volatile ConversationDao _conversationDao;
|
||||
|
||||
private volatile MessageDao _messageDao;
|
||||
|
||||
@Override
|
||||
@NonNull
|
||||
protected SupportSQLiteOpenHelper createOpenHelper(@NonNull final DatabaseConfiguration config) {
|
||||
final SupportSQLiteOpenHelper.Callback _openCallback = new RoomOpenHelper(config, new RoomOpenHelper.Delegate(1) {
|
||||
@Override
|
||||
public void createAllTables(@NonNull final SupportSQLiteDatabase db) {
|
||||
db.execSQL("CREATE TABLE IF NOT EXISTS `conversations` (`id` TEXT NOT NULL, `title` TEXT, `lastMessageAt` TEXT, `updatedAt` INTEGER NOT NULL, PRIMARY KEY(`id`))");
|
||||
db.execSQL("CREATE TABLE IF NOT EXISTS `messages` (`id` TEXT NOT NULL, `conversationId` TEXT, `senderId` TEXT, `content` TEXT, `contentType` TEXT, `createdAt` TEXT, `pending` INTEGER NOT NULL, PRIMARY KEY(`id`))");
|
||||
db.execSQL("CREATE INDEX IF NOT EXISTS `index_messages_conversationId` ON `messages` (`conversationId`)");
|
||||
db.execSQL("CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)");
|
||||
db.execSQL("INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '2b9adf94e79307bc8f27a6c15b55b45f')");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dropAllTables(@NonNull final SupportSQLiteDatabase db) {
|
||||
db.execSQL("DROP TABLE IF EXISTS `conversations`");
|
||||
db.execSQL("DROP TABLE IF EXISTS `messages`");
|
||||
final List<? extends RoomDatabase.Callback> _callbacks = mCallbacks;
|
||||
if (_callbacks != null) {
|
||||
for (RoomDatabase.Callback _callback : _callbacks) {
|
||||
_callback.onDestructiveMigration(db);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(@NonNull final SupportSQLiteDatabase db) {
|
||||
final List<? extends RoomDatabase.Callback> _callbacks = mCallbacks;
|
||||
if (_callbacks != null) {
|
||||
for (RoomDatabase.Callback _callback : _callbacks) {
|
||||
_callback.onCreate(db);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOpen(@NonNull final SupportSQLiteDatabase db) {
|
||||
mDatabase = db;
|
||||
internalInitInvalidationTracker(db);
|
||||
final List<? extends RoomDatabase.Callback> _callbacks = mCallbacks;
|
||||
if (_callbacks != null) {
|
||||
for (RoomDatabase.Callback _callback : _callbacks) {
|
||||
_callback.onOpen(db);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPreMigrate(@NonNull final SupportSQLiteDatabase db) {
|
||||
DBUtil.dropFtsSyncTriggers(db);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPostMigrate(@NonNull final SupportSQLiteDatabase db) {
|
||||
}
|
||||
|
||||
@Override
|
||||
@NonNull
|
||||
public RoomOpenHelper.ValidationResult onValidateSchema(
|
||||
@NonNull final SupportSQLiteDatabase db) {
|
||||
final HashMap<String, TableInfo.Column> _columnsConversations = new HashMap<String, TableInfo.Column>(4);
|
||||
_columnsConversations.put("id", new TableInfo.Column("id", "TEXT", true, 1, null, TableInfo.CREATED_FROM_ENTITY));
|
||||
_columnsConversations.put("title", new TableInfo.Column("title", "TEXT", false, 0, null, TableInfo.CREATED_FROM_ENTITY));
|
||||
_columnsConversations.put("lastMessageAt", new TableInfo.Column("lastMessageAt", "TEXT", false, 0, null, TableInfo.CREATED_FROM_ENTITY));
|
||||
_columnsConversations.put("updatedAt", new TableInfo.Column("updatedAt", "INTEGER", true, 0, null, TableInfo.CREATED_FROM_ENTITY));
|
||||
final HashSet<TableInfo.ForeignKey> _foreignKeysConversations = new HashSet<TableInfo.ForeignKey>(0);
|
||||
final HashSet<TableInfo.Index> _indicesConversations = new HashSet<TableInfo.Index>(0);
|
||||
final TableInfo _infoConversations = new TableInfo("conversations", _columnsConversations, _foreignKeysConversations, _indicesConversations);
|
||||
final TableInfo _existingConversations = TableInfo.read(db, "conversations");
|
||||
if (!_infoConversations.equals(_existingConversations)) {
|
||||
return new RoomOpenHelper.ValidationResult(false, "conversations(com.saars.chatplatform.data.local.entity.ConversationEntity).\n"
|
||||
+ " Expected:\n" + _infoConversations + "\n"
|
||||
+ " Found:\n" + _existingConversations);
|
||||
}
|
||||
final HashMap<String, TableInfo.Column> _columnsMessages = new HashMap<String, TableInfo.Column>(7);
|
||||
_columnsMessages.put("id", new TableInfo.Column("id", "TEXT", true, 1, null, TableInfo.CREATED_FROM_ENTITY));
|
||||
_columnsMessages.put("conversationId", new TableInfo.Column("conversationId", "TEXT", false, 0, null, TableInfo.CREATED_FROM_ENTITY));
|
||||
_columnsMessages.put("senderId", new TableInfo.Column("senderId", "TEXT", false, 0, null, TableInfo.CREATED_FROM_ENTITY));
|
||||
_columnsMessages.put("content", new TableInfo.Column("content", "TEXT", false, 0, null, TableInfo.CREATED_FROM_ENTITY));
|
||||
_columnsMessages.put("contentType", new TableInfo.Column("contentType", "TEXT", false, 0, null, TableInfo.CREATED_FROM_ENTITY));
|
||||
_columnsMessages.put("createdAt", new TableInfo.Column("createdAt", "TEXT", false, 0, null, TableInfo.CREATED_FROM_ENTITY));
|
||||
_columnsMessages.put("pending", new TableInfo.Column("pending", "INTEGER", true, 0, null, TableInfo.CREATED_FROM_ENTITY));
|
||||
final HashSet<TableInfo.ForeignKey> _foreignKeysMessages = new HashSet<TableInfo.ForeignKey>(0);
|
||||
final HashSet<TableInfo.Index> _indicesMessages = new HashSet<TableInfo.Index>(1);
|
||||
_indicesMessages.add(new TableInfo.Index("index_messages_conversationId", false, Arrays.asList("conversationId"), Arrays.asList("ASC")));
|
||||
final TableInfo _infoMessages = new TableInfo("messages", _columnsMessages, _foreignKeysMessages, _indicesMessages);
|
||||
final TableInfo _existingMessages = TableInfo.read(db, "messages");
|
||||
if (!_infoMessages.equals(_existingMessages)) {
|
||||
return new RoomOpenHelper.ValidationResult(false, "messages(com.saars.chatplatform.data.local.entity.MessageEntity).\n"
|
||||
+ " Expected:\n" + _infoMessages + "\n"
|
||||
+ " Found:\n" + _existingMessages);
|
||||
}
|
||||
return new RoomOpenHelper.ValidationResult(true, null);
|
||||
}
|
||||
}, "2b9adf94e79307bc8f27a6c15b55b45f", "c08f559980075b94cd02ff0a6951b7a6");
|
||||
final SupportSQLiteOpenHelper.Configuration _sqliteConfig = SupportSQLiteOpenHelper.Configuration.builder(config.context).name(config.name).callback(_openCallback).build();
|
||||
final SupportSQLiteOpenHelper _helper = config.sqliteOpenHelperFactory.create(_sqliteConfig);
|
||||
return _helper;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NonNull
|
||||
protected InvalidationTracker createInvalidationTracker() {
|
||||
final HashMap<String, String> _shadowTablesMap = new HashMap<String, String>(0);
|
||||
final HashMap<String, Set<String>> _viewTables = new HashMap<String, Set<String>>(0);
|
||||
return new InvalidationTracker(this, _shadowTablesMap, _viewTables, "conversations","messages");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearAllTables() {
|
||||
super.assertNotMainThread();
|
||||
final SupportSQLiteDatabase _db = super.getOpenHelper().getWritableDatabase();
|
||||
try {
|
||||
super.beginTransaction();
|
||||
_db.execSQL("DELETE FROM `conversations`");
|
||||
_db.execSQL("DELETE FROM `messages`");
|
||||
super.setTransactionSuccessful();
|
||||
} finally {
|
||||
super.endTransaction();
|
||||
_db.query("PRAGMA wal_checkpoint(FULL)").close();
|
||||
if (!_db.inTransaction()) {
|
||||
_db.execSQL("VACUUM");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@NonNull
|
||||
protected Map<Class<?>, List<Class<?>>> getRequiredTypeConverters() {
|
||||
final HashMap<Class<?>, List<Class<?>>> _typeConvertersMap = new HashMap<Class<?>, List<Class<?>>>();
|
||||
_typeConvertersMap.put(ConversationDao.class, ConversationDao_Impl.getRequiredConverters());
|
||||
_typeConvertersMap.put(MessageDao.class, MessageDao_Impl.getRequiredConverters());
|
||||
return _typeConvertersMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NonNull
|
||||
public Set<Class<? extends AutoMigrationSpec>> getRequiredAutoMigrationSpecs() {
|
||||
final HashSet<Class<? extends AutoMigrationSpec>> _autoMigrationSpecsSet = new HashSet<Class<? extends AutoMigrationSpec>>();
|
||||
return _autoMigrationSpecsSet;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NonNull
|
||||
public List<Migration> getAutoMigrations(
|
||||
@NonNull final Map<Class<? extends AutoMigrationSpec>, AutoMigrationSpec> autoMigrationSpecs) {
|
||||
final List<Migration> _autoMigrations = new ArrayList<Migration>();
|
||||
return _autoMigrations;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConversationDao conversationDao() {
|
||||
if (_conversationDao != null) {
|
||||
return _conversationDao;
|
||||
} else {
|
||||
synchronized(this) {
|
||||
if(_conversationDao == null) {
|
||||
_conversationDao = new ConversationDao_Impl(this);
|
||||
}
|
||||
return _conversationDao;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MessageDao messageDao() {
|
||||
if (_messageDao != null) {
|
||||
return _messageDao;
|
||||
} else {
|
||||
synchronized(this) {
|
||||
if(_messageDao == null) {
|
||||
_messageDao = new MessageDao_Impl(this);
|
||||
}
|
||||
return _messageDao;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,202 @@
|
||||
package com.saars.chatplatform.data.local.dao;
|
||||
|
||||
import android.database.Cursor;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.room.EntityInsertionAdapter;
|
||||
import androidx.room.RoomDatabase;
|
||||
import androidx.room.RoomSQLiteQuery;
|
||||
import androidx.room.SharedSQLiteStatement;
|
||||
import androidx.room.util.CursorUtil;
|
||||
import androidx.room.util.DBUtil;
|
||||
import androidx.sqlite.db.SupportSQLiteStatement;
|
||||
import com.saars.chatplatform.data.local.entity.ConversationEntity;
|
||||
import java.lang.Class;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.lang.SuppressWarnings;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import javax.annotation.processing.Generated;
|
||||
|
||||
@Generated("androidx.room.RoomProcessor")
|
||||
@SuppressWarnings({"unchecked", "deprecation"})
|
||||
public final class ConversationDao_Impl implements ConversationDao {
|
||||
private final RoomDatabase __db;
|
||||
|
||||
private final EntityInsertionAdapter<ConversationEntity> __insertionAdapterOfConversationEntity;
|
||||
|
||||
private final SharedSQLiteStatement __preparedStmtOfDeleteAll;
|
||||
|
||||
public ConversationDao_Impl(@NonNull final RoomDatabase __db) {
|
||||
this.__db = __db;
|
||||
this.__insertionAdapterOfConversationEntity = new EntityInsertionAdapter<ConversationEntity>(__db) {
|
||||
@Override
|
||||
@NonNull
|
||||
protected String createQuery() {
|
||||
return "INSERT OR REPLACE INTO `conversations` (`id`,`title`,`lastMessageAt`,`updatedAt`) VALUES (?,?,?,?)";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void bind(@NonNull final SupportSQLiteStatement statement,
|
||||
final ConversationEntity entity) {
|
||||
if (entity.id == null) {
|
||||
statement.bindNull(1);
|
||||
} else {
|
||||
statement.bindString(1, entity.id);
|
||||
}
|
||||
if (entity.title == null) {
|
||||
statement.bindNull(2);
|
||||
} else {
|
||||
statement.bindString(2, entity.title);
|
||||
}
|
||||
if (entity.lastMessageAt == null) {
|
||||
statement.bindNull(3);
|
||||
} else {
|
||||
statement.bindString(3, entity.lastMessageAt);
|
||||
}
|
||||
statement.bindLong(4, entity.updatedAt);
|
||||
}
|
||||
};
|
||||
this.__preparedStmtOfDeleteAll = new SharedSQLiteStatement(__db) {
|
||||
@Override
|
||||
@NonNull
|
||||
public String createQuery() {
|
||||
final String _query = "DELETE FROM conversations";
|
||||
return _query;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertAll(final List<ConversationEntity> list) {
|
||||
__db.assertNotSuspendingTransaction();
|
||||
__db.beginTransaction();
|
||||
try {
|
||||
__insertionAdapterOfConversationEntity.insert(list);
|
||||
__db.setTransactionSuccessful();
|
||||
} finally {
|
||||
__db.endTransaction();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insert(final ConversationEntity e) {
|
||||
__db.assertNotSuspendingTransaction();
|
||||
__db.beginTransaction();
|
||||
try {
|
||||
__insertionAdapterOfConversationEntity.insert(e);
|
||||
__db.setTransactionSuccessful();
|
||||
} finally {
|
||||
__db.endTransaction();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteAll() {
|
||||
__db.assertNotSuspendingTransaction();
|
||||
final SupportSQLiteStatement _stmt = __preparedStmtOfDeleteAll.acquire();
|
||||
try {
|
||||
__db.beginTransaction();
|
||||
try {
|
||||
_stmt.executeUpdateDelete();
|
||||
__db.setTransactionSuccessful();
|
||||
} finally {
|
||||
__db.endTransaction();
|
||||
}
|
||||
} finally {
|
||||
__preparedStmtOfDeleteAll.release(_stmt);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ConversationEntity> getAll() {
|
||||
final String _sql = "SELECT * FROM conversations ORDER BY updatedAt DESC";
|
||||
final RoomSQLiteQuery _statement = RoomSQLiteQuery.acquire(_sql, 0);
|
||||
__db.assertNotSuspendingTransaction();
|
||||
final Cursor _cursor = DBUtil.query(__db, _statement, false, null);
|
||||
try {
|
||||
final int _cursorIndexOfId = CursorUtil.getColumnIndexOrThrow(_cursor, "id");
|
||||
final int _cursorIndexOfTitle = CursorUtil.getColumnIndexOrThrow(_cursor, "title");
|
||||
final int _cursorIndexOfLastMessageAt = CursorUtil.getColumnIndexOrThrow(_cursor, "lastMessageAt");
|
||||
final int _cursorIndexOfUpdatedAt = CursorUtil.getColumnIndexOrThrow(_cursor, "updatedAt");
|
||||
final List<ConversationEntity> _result = new ArrayList<ConversationEntity>(_cursor.getCount());
|
||||
while (_cursor.moveToNext()) {
|
||||
final ConversationEntity _item;
|
||||
_item = new ConversationEntity();
|
||||
if (_cursor.isNull(_cursorIndexOfId)) {
|
||||
_item.id = null;
|
||||
} else {
|
||||
_item.id = _cursor.getString(_cursorIndexOfId);
|
||||
}
|
||||
if (_cursor.isNull(_cursorIndexOfTitle)) {
|
||||
_item.title = null;
|
||||
} else {
|
||||
_item.title = _cursor.getString(_cursorIndexOfTitle);
|
||||
}
|
||||
if (_cursor.isNull(_cursorIndexOfLastMessageAt)) {
|
||||
_item.lastMessageAt = null;
|
||||
} else {
|
||||
_item.lastMessageAt = _cursor.getString(_cursorIndexOfLastMessageAt);
|
||||
}
|
||||
_item.updatedAt = _cursor.getLong(_cursorIndexOfUpdatedAt);
|
||||
_result.add(_item);
|
||||
}
|
||||
return _result;
|
||||
} finally {
|
||||
_cursor.close();
|
||||
_statement.release();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConversationEntity getById(final String id) {
|
||||
final String _sql = "SELECT * FROM conversations WHERE id = ? LIMIT 1";
|
||||
final RoomSQLiteQuery _statement = RoomSQLiteQuery.acquire(_sql, 1);
|
||||
int _argIndex = 1;
|
||||
if (id == null) {
|
||||
_statement.bindNull(_argIndex);
|
||||
} else {
|
||||
_statement.bindString(_argIndex, id);
|
||||
}
|
||||
__db.assertNotSuspendingTransaction();
|
||||
final Cursor _cursor = DBUtil.query(__db, _statement, false, null);
|
||||
try {
|
||||
final int _cursorIndexOfId = CursorUtil.getColumnIndexOrThrow(_cursor, "id");
|
||||
final int _cursorIndexOfTitle = CursorUtil.getColumnIndexOrThrow(_cursor, "title");
|
||||
final int _cursorIndexOfLastMessageAt = CursorUtil.getColumnIndexOrThrow(_cursor, "lastMessageAt");
|
||||
final int _cursorIndexOfUpdatedAt = CursorUtil.getColumnIndexOrThrow(_cursor, "updatedAt");
|
||||
final ConversationEntity _result;
|
||||
if (_cursor.moveToFirst()) {
|
||||
_result = new ConversationEntity();
|
||||
if (_cursor.isNull(_cursorIndexOfId)) {
|
||||
_result.id = null;
|
||||
} else {
|
||||
_result.id = _cursor.getString(_cursorIndexOfId);
|
||||
}
|
||||
if (_cursor.isNull(_cursorIndexOfTitle)) {
|
||||
_result.title = null;
|
||||
} else {
|
||||
_result.title = _cursor.getString(_cursorIndexOfTitle);
|
||||
}
|
||||
if (_cursor.isNull(_cursorIndexOfLastMessageAt)) {
|
||||
_result.lastMessageAt = null;
|
||||
} else {
|
||||
_result.lastMessageAt = _cursor.getString(_cursorIndexOfLastMessageAt);
|
||||
}
|
||||
_result.updatedAt = _cursor.getLong(_cursorIndexOfUpdatedAt);
|
||||
} else {
|
||||
_result = null;
|
||||
}
|
||||
return _result;
|
||||
} finally {
|
||||
_cursor.close();
|
||||
_statement.release();
|
||||
}
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static List<Class<?>> getRequiredConverters() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,330 @@
|
||||
package com.saars.chatplatform.data.local.dao;
|
||||
|
||||
import android.database.Cursor;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.room.EntityInsertionAdapter;
|
||||
import androidx.room.RoomDatabase;
|
||||
import androidx.room.RoomSQLiteQuery;
|
||||
import androidx.room.SharedSQLiteStatement;
|
||||
import androidx.room.util.CursorUtil;
|
||||
import androidx.room.util.DBUtil;
|
||||
import androidx.sqlite.db.SupportSQLiteStatement;
|
||||
import com.saars.chatplatform.data.local.entity.MessageEntity;
|
||||
import java.lang.Class;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.lang.SuppressWarnings;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import javax.annotation.processing.Generated;
|
||||
|
||||
@Generated("androidx.room.RoomProcessor")
|
||||
@SuppressWarnings({"unchecked", "deprecation"})
|
||||
public final class MessageDao_Impl implements MessageDao {
|
||||
private final RoomDatabase __db;
|
||||
|
||||
private final EntityInsertionAdapter<MessageEntity> __insertionAdapterOfMessageEntity;
|
||||
|
||||
private final SharedSQLiteStatement __preparedStmtOfDeleteByConversation;
|
||||
|
||||
private final SharedSQLiteStatement __preparedStmtOfDeleteById;
|
||||
|
||||
private final SharedSQLiteStatement __preparedStmtOfDeleteAll;
|
||||
|
||||
public MessageDao_Impl(@NonNull final RoomDatabase __db) {
|
||||
this.__db = __db;
|
||||
this.__insertionAdapterOfMessageEntity = new EntityInsertionAdapter<MessageEntity>(__db) {
|
||||
@Override
|
||||
@NonNull
|
||||
protected String createQuery() {
|
||||
return "INSERT OR REPLACE INTO `messages` (`id`,`conversationId`,`senderId`,`content`,`contentType`,`createdAt`,`pending`) VALUES (?,?,?,?,?,?,?)";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void bind(@NonNull final SupportSQLiteStatement statement,
|
||||
final MessageEntity entity) {
|
||||
if (entity.id == null) {
|
||||
statement.bindNull(1);
|
||||
} else {
|
||||
statement.bindString(1, entity.id);
|
||||
}
|
||||
if (entity.conversationId == null) {
|
||||
statement.bindNull(2);
|
||||
} else {
|
||||
statement.bindString(2, entity.conversationId);
|
||||
}
|
||||
if (entity.senderId == null) {
|
||||
statement.bindNull(3);
|
||||
} else {
|
||||
statement.bindString(3, entity.senderId);
|
||||
}
|
||||
if (entity.content == null) {
|
||||
statement.bindNull(4);
|
||||
} else {
|
||||
statement.bindString(4, entity.content);
|
||||
}
|
||||
if (entity.contentType == null) {
|
||||
statement.bindNull(5);
|
||||
} else {
|
||||
statement.bindString(5, entity.contentType);
|
||||
}
|
||||
if (entity.createdAt == null) {
|
||||
statement.bindNull(6);
|
||||
} else {
|
||||
statement.bindString(6, entity.createdAt);
|
||||
}
|
||||
final int _tmp = entity.pending ? 1 : 0;
|
||||
statement.bindLong(7, _tmp);
|
||||
}
|
||||
};
|
||||
this.__preparedStmtOfDeleteByConversation = new SharedSQLiteStatement(__db) {
|
||||
@Override
|
||||
@NonNull
|
||||
public String createQuery() {
|
||||
final String _query = "DELETE FROM messages WHERE conversationId = ?";
|
||||
return _query;
|
||||
}
|
||||
};
|
||||
this.__preparedStmtOfDeleteById = new SharedSQLiteStatement(__db) {
|
||||
@Override
|
||||
@NonNull
|
||||
public String createQuery() {
|
||||
final String _query = "DELETE FROM messages WHERE id = ?";
|
||||
return _query;
|
||||
}
|
||||
};
|
||||
this.__preparedStmtOfDeleteAll = new SharedSQLiteStatement(__db) {
|
||||
@Override
|
||||
@NonNull
|
||||
public String createQuery() {
|
||||
final String _query = "DELETE FROM messages";
|
||||
return _query;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insert(final MessageEntity m) {
|
||||
__db.assertNotSuspendingTransaction();
|
||||
__db.beginTransaction();
|
||||
try {
|
||||
__insertionAdapterOfMessageEntity.insert(m);
|
||||
__db.setTransactionSuccessful();
|
||||
} finally {
|
||||
__db.endTransaction();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertAll(final List<MessageEntity> list) {
|
||||
__db.assertNotSuspendingTransaction();
|
||||
__db.beginTransaction();
|
||||
try {
|
||||
__insertionAdapterOfMessageEntity.insert(list);
|
||||
__db.setTransactionSuccessful();
|
||||
} finally {
|
||||
__db.endTransaction();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteByConversation(final String conversationId) {
|
||||
__db.assertNotSuspendingTransaction();
|
||||
final SupportSQLiteStatement _stmt = __preparedStmtOfDeleteByConversation.acquire();
|
||||
int _argIndex = 1;
|
||||
if (conversationId == null) {
|
||||
_stmt.bindNull(_argIndex);
|
||||
} else {
|
||||
_stmt.bindString(_argIndex, conversationId);
|
||||
}
|
||||
try {
|
||||
__db.beginTransaction();
|
||||
try {
|
||||
_stmt.executeUpdateDelete();
|
||||
__db.setTransactionSuccessful();
|
||||
} finally {
|
||||
__db.endTransaction();
|
||||
}
|
||||
} finally {
|
||||
__preparedStmtOfDeleteByConversation.release(_stmt);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteById(final String id) {
|
||||
__db.assertNotSuspendingTransaction();
|
||||
final SupportSQLiteStatement _stmt = __preparedStmtOfDeleteById.acquire();
|
||||
int _argIndex = 1;
|
||||
if (id == null) {
|
||||
_stmt.bindNull(_argIndex);
|
||||
} else {
|
||||
_stmt.bindString(_argIndex, id);
|
||||
}
|
||||
try {
|
||||
__db.beginTransaction();
|
||||
try {
|
||||
_stmt.executeUpdateDelete();
|
||||
__db.setTransactionSuccessful();
|
||||
} finally {
|
||||
__db.endTransaction();
|
||||
}
|
||||
} finally {
|
||||
__preparedStmtOfDeleteById.release(_stmt);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteAll() {
|
||||
__db.assertNotSuspendingTransaction();
|
||||
final SupportSQLiteStatement _stmt = __preparedStmtOfDeleteAll.acquire();
|
||||
try {
|
||||
__db.beginTransaction();
|
||||
try {
|
||||
_stmt.executeUpdateDelete();
|
||||
__db.setTransactionSuccessful();
|
||||
} finally {
|
||||
__db.endTransaction();
|
||||
}
|
||||
} finally {
|
||||
__preparedStmtOfDeleteAll.release(_stmt);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MessageEntity> getByConversation(final String conversationId) {
|
||||
final String _sql = "SELECT * FROM messages WHERE conversationId = ? ORDER BY createdAt ASC";
|
||||
final RoomSQLiteQuery _statement = RoomSQLiteQuery.acquire(_sql, 1);
|
||||
int _argIndex = 1;
|
||||
if (conversationId == null) {
|
||||
_statement.bindNull(_argIndex);
|
||||
} else {
|
||||
_statement.bindString(_argIndex, conversationId);
|
||||
}
|
||||
__db.assertNotSuspendingTransaction();
|
||||
final Cursor _cursor = DBUtil.query(__db, _statement, false, null);
|
||||
try {
|
||||
final int _cursorIndexOfId = CursorUtil.getColumnIndexOrThrow(_cursor, "id");
|
||||
final int _cursorIndexOfConversationId = CursorUtil.getColumnIndexOrThrow(_cursor, "conversationId");
|
||||
final int _cursorIndexOfSenderId = CursorUtil.getColumnIndexOrThrow(_cursor, "senderId");
|
||||
final int _cursorIndexOfContent = CursorUtil.getColumnIndexOrThrow(_cursor, "content");
|
||||
final int _cursorIndexOfContentType = CursorUtil.getColumnIndexOrThrow(_cursor, "contentType");
|
||||
final int _cursorIndexOfCreatedAt = CursorUtil.getColumnIndexOrThrow(_cursor, "createdAt");
|
||||
final int _cursorIndexOfPending = CursorUtil.getColumnIndexOrThrow(_cursor, "pending");
|
||||
final List<MessageEntity> _result = new ArrayList<MessageEntity>(_cursor.getCount());
|
||||
while (_cursor.moveToNext()) {
|
||||
final MessageEntity _item;
|
||||
_item = new MessageEntity();
|
||||
if (_cursor.isNull(_cursorIndexOfId)) {
|
||||
_item.id = null;
|
||||
} else {
|
||||
_item.id = _cursor.getString(_cursorIndexOfId);
|
||||
}
|
||||
if (_cursor.isNull(_cursorIndexOfConversationId)) {
|
||||
_item.conversationId = null;
|
||||
} else {
|
||||
_item.conversationId = _cursor.getString(_cursorIndexOfConversationId);
|
||||
}
|
||||
if (_cursor.isNull(_cursorIndexOfSenderId)) {
|
||||
_item.senderId = null;
|
||||
} else {
|
||||
_item.senderId = _cursor.getString(_cursorIndexOfSenderId);
|
||||
}
|
||||
if (_cursor.isNull(_cursorIndexOfContent)) {
|
||||
_item.content = null;
|
||||
} else {
|
||||
_item.content = _cursor.getString(_cursorIndexOfContent);
|
||||
}
|
||||
if (_cursor.isNull(_cursorIndexOfContentType)) {
|
||||
_item.contentType = null;
|
||||
} else {
|
||||
_item.contentType = _cursor.getString(_cursorIndexOfContentType);
|
||||
}
|
||||
if (_cursor.isNull(_cursorIndexOfCreatedAt)) {
|
||||
_item.createdAt = null;
|
||||
} else {
|
||||
_item.createdAt = _cursor.getString(_cursorIndexOfCreatedAt);
|
||||
}
|
||||
final int _tmp;
|
||||
_tmp = _cursor.getInt(_cursorIndexOfPending);
|
||||
_item.pending = _tmp != 0;
|
||||
_result.add(_item);
|
||||
}
|
||||
return _result;
|
||||
} finally {
|
||||
_cursor.close();
|
||||
_statement.release();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MessageEntity getById(final String id) {
|
||||
final String _sql = "SELECT * FROM messages WHERE id = ? LIMIT 1";
|
||||
final RoomSQLiteQuery _statement = RoomSQLiteQuery.acquire(_sql, 1);
|
||||
int _argIndex = 1;
|
||||
if (id == null) {
|
||||
_statement.bindNull(_argIndex);
|
||||
} else {
|
||||
_statement.bindString(_argIndex, id);
|
||||
}
|
||||
__db.assertNotSuspendingTransaction();
|
||||
final Cursor _cursor = DBUtil.query(__db, _statement, false, null);
|
||||
try {
|
||||
final int _cursorIndexOfId = CursorUtil.getColumnIndexOrThrow(_cursor, "id");
|
||||
final int _cursorIndexOfConversationId = CursorUtil.getColumnIndexOrThrow(_cursor, "conversationId");
|
||||
final int _cursorIndexOfSenderId = CursorUtil.getColumnIndexOrThrow(_cursor, "senderId");
|
||||
final int _cursorIndexOfContent = CursorUtil.getColumnIndexOrThrow(_cursor, "content");
|
||||
final int _cursorIndexOfContentType = CursorUtil.getColumnIndexOrThrow(_cursor, "contentType");
|
||||
final int _cursorIndexOfCreatedAt = CursorUtil.getColumnIndexOrThrow(_cursor, "createdAt");
|
||||
final int _cursorIndexOfPending = CursorUtil.getColumnIndexOrThrow(_cursor, "pending");
|
||||
final MessageEntity _result;
|
||||
if (_cursor.moveToFirst()) {
|
||||
_result = new MessageEntity();
|
||||
if (_cursor.isNull(_cursorIndexOfId)) {
|
||||
_result.id = null;
|
||||
} else {
|
||||
_result.id = _cursor.getString(_cursorIndexOfId);
|
||||
}
|
||||
if (_cursor.isNull(_cursorIndexOfConversationId)) {
|
||||
_result.conversationId = null;
|
||||
} else {
|
||||
_result.conversationId = _cursor.getString(_cursorIndexOfConversationId);
|
||||
}
|
||||
if (_cursor.isNull(_cursorIndexOfSenderId)) {
|
||||
_result.senderId = null;
|
||||
} else {
|
||||
_result.senderId = _cursor.getString(_cursorIndexOfSenderId);
|
||||
}
|
||||
if (_cursor.isNull(_cursorIndexOfContent)) {
|
||||
_result.content = null;
|
||||
} else {
|
||||
_result.content = _cursor.getString(_cursorIndexOfContent);
|
||||
}
|
||||
if (_cursor.isNull(_cursorIndexOfContentType)) {
|
||||
_result.contentType = null;
|
||||
} else {
|
||||
_result.contentType = _cursor.getString(_cursorIndexOfContentType);
|
||||
}
|
||||
if (_cursor.isNull(_cursorIndexOfCreatedAt)) {
|
||||
_result.createdAt = null;
|
||||
} else {
|
||||
_result.createdAt = _cursor.getString(_cursorIndexOfCreatedAt);
|
||||
}
|
||||
final int _tmp;
|
||||
_tmp = _cursor.getInt(_cursorIndexOfPending);
|
||||
_result.pending = _tmp != 0;
|
||||
} else {
|
||||
_result = null;
|
||||
}
|
||||
return _result;
|
||||
} finally {
|
||||
_cursor.close();
|
||||
_statement.release();
|
||||
}
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static List<Class<?>> getRequiredConverters() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
// Generated by view binder compiler. Do not edit!
|
||||
package com.saars.chatplatform.databinding;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.LinearLayout;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.viewbinding.ViewBinding;
|
||||
import androidx.viewbinding.ViewBindings;
|
||||
import com.google.android.material.appbar.MaterialToolbar;
|
||||
import com.saars.chatplatform.R;
|
||||
import java.lang.NullPointerException;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
|
||||
public final class ActivityAgentChatBinding implements ViewBinding {
|
||||
@NonNull
|
||||
private final LinearLayout rootView;
|
||||
|
||||
@NonNull
|
||||
public final Button btnSend;
|
||||
|
||||
@NonNull
|
||||
public final EditText etInput;
|
||||
|
||||
@NonNull
|
||||
public final RecyclerView recycler;
|
||||
|
||||
@NonNull
|
||||
public final MaterialToolbar toolbar;
|
||||
|
||||
private ActivityAgentChatBinding(@NonNull LinearLayout rootView, @NonNull Button btnSend,
|
||||
@NonNull EditText etInput, @NonNull RecyclerView recycler, @NonNull MaterialToolbar toolbar) {
|
||||
this.rootView = rootView;
|
||||
this.btnSend = btnSend;
|
||||
this.etInput = etInput;
|
||||
this.recycler = recycler;
|
||||
this.toolbar = toolbar;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NonNull
|
||||
public LinearLayout getRoot() {
|
||||
return rootView;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static ActivityAgentChatBinding inflate(@NonNull LayoutInflater inflater) {
|
||||
return inflate(inflater, null, false);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static ActivityAgentChatBinding inflate(@NonNull LayoutInflater inflater,
|
||||
@Nullable ViewGroup parent, boolean attachToParent) {
|
||||
View root = inflater.inflate(R.layout.activity_agent_chat, parent, false);
|
||||
if (attachToParent) {
|
||||
parent.addView(root);
|
||||
}
|
||||
return bind(root);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static ActivityAgentChatBinding bind(@NonNull View rootView) {
|
||||
// The body of this method is generated in a way you would not otherwise write.
|
||||
// This is done to optimize the compiled bytecode for size and performance.
|
||||
int id;
|
||||
missingId: {
|
||||
id = R.id.btnSend;
|
||||
Button btnSend = ViewBindings.findChildViewById(rootView, id);
|
||||
if (btnSend == null) {
|
||||
break missingId;
|
||||
}
|
||||
|
||||
id = R.id.etInput;
|
||||
EditText etInput = ViewBindings.findChildViewById(rootView, id);
|
||||
if (etInput == null) {
|
||||
break missingId;
|
||||
}
|
||||
|
||||
id = R.id.recycler;
|
||||
RecyclerView recycler = ViewBindings.findChildViewById(rootView, id);
|
||||
if (recycler == null) {
|
||||
break missingId;
|
||||
}
|
||||
|
||||
id = R.id.toolbar;
|
||||
MaterialToolbar toolbar = ViewBindings.findChildViewById(rootView, id);
|
||||
if (toolbar == null) {
|
||||
break missingId;
|
||||
}
|
||||
|
||||
return new ActivityAgentChatBinding((LinearLayout) rootView, btnSend, etInput, recycler,
|
||||
toolbar);
|
||||
}
|
||||
String missingId = rootView.getResources().getResourceName(id);
|
||||
throw new NullPointerException("Missing required view with ID: ".concat(missingId));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
// Generated by view binder compiler. Do not edit!
|
||||
package com.saars.chatplatform.databinding;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.LinearLayout;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.viewbinding.ViewBinding;
|
||||
import androidx.viewbinding.ViewBindings;
|
||||
import com.google.android.material.appbar.MaterialToolbar;
|
||||
import com.saars.chatplatform.R;
|
||||
import java.lang.NullPointerException;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
|
||||
public final class ActivityChatBinding implements ViewBinding {
|
||||
@NonNull
|
||||
private final LinearLayout rootView;
|
||||
|
||||
@NonNull
|
||||
public final Button btnSend;
|
||||
|
||||
@NonNull
|
||||
public final EditText etInput;
|
||||
|
||||
@NonNull
|
||||
public final RecyclerView recycler;
|
||||
|
||||
@NonNull
|
||||
public final MaterialToolbar toolbar;
|
||||
|
||||
private ActivityChatBinding(@NonNull LinearLayout rootView, @NonNull Button btnSend,
|
||||
@NonNull EditText etInput, @NonNull RecyclerView recycler, @NonNull MaterialToolbar toolbar) {
|
||||
this.rootView = rootView;
|
||||
this.btnSend = btnSend;
|
||||
this.etInput = etInput;
|
||||
this.recycler = recycler;
|
||||
this.toolbar = toolbar;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NonNull
|
||||
public LinearLayout getRoot() {
|
||||
return rootView;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static ActivityChatBinding inflate(@NonNull LayoutInflater inflater) {
|
||||
return inflate(inflater, null, false);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static ActivityChatBinding inflate(@NonNull LayoutInflater inflater,
|
||||
@Nullable ViewGroup parent, boolean attachToParent) {
|
||||
View root = inflater.inflate(R.layout.activity_chat, parent, false);
|
||||
if (attachToParent) {
|
||||
parent.addView(root);
|
||||
}
|
||||
return bind(root);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static ActivityChatBinding bind(@NonNull View rootView) {
|
||||
// The body of this method is generated in a way you would not otherwise write.
|
||||
// This is done to optimize the compiled bytecode for size and performance.
|
||||
int id;
|
||||
missingId: {
|
||||
id = R.id.btnSend;
|
||||
Button btnSend = ViewBindings.findChildViewById(rootView, id);
|
||||
if (btnSend == null) {
|
||||
break missingId;
|
||||
}
|
||||
|
||||
id = R.id.etInput;
|
||||
EditText etInput = ViewBindings.findChildViewById(rootView, id);
|
||||
if (etInput == null) {
|
||||
break missingId;
|
||||
}
|
||||
|
||||
id = R.id.recycler;
|
||||
RecyclerView recycler = ViewBindings.findChildViewById(rootView, id);
|
||||
if (recycler == null) {
|
||||
break missingId;
|
||||
}
|
||||
|
||||
id = R.id.toolbar;
|
||||
MaterialToolbar toolbar = ViewBindings.findChildViewById(rootView, id);
|
||||
if (toolbar == null) {
|
||||
break missingId;
|
||||
}
|
||||
|
||||
return new ActivityChatBinding((LinearLayout) rootView, btnSend, etInput, recycler, toolbar);
|
||||
}
|
||||
String missingId = rootView.getResources().getResourceName(id);
|
||||
throw new NullPointerException("Missing required view with ID: ".concat(missingId));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
// Generated by view binder compiler. Do not edit!
|
||||
package com.saars.chatplatform.databinding;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ScrollView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.viewbinding.ViewBinding;
|
||||
import androidx.viewbinding.ViewBindings;
|
||||
import com.google.android.material.button.MaterialButton;
|
||||
import com.google.android.material.textfield.TextInputEditText;
|
||||
import com.saars.chatplatform.R;
|
||||
import java.lang.NullPointerException;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
|
||||
public final class ActivityLoginBinding implements ViewBinding {
|
||||
@NonNull
|
||||
private final ScrollView rootView;
|
||||
|
||||
@NonNull
|
||||
public final MaterialButton btnLogin;
|
||||
|
||||
@NonNull
|
||||
public final MaterialButton btnRegister;
|
||||
|
||||
@NonNull
|
||||
public final TextInputEditText etEmail;
|
||||
|
||||
@NonNull
|
||||
public final TextInputEditText etPassword;
|
||||
|
||||
@NonNull
|
||||
public final TextInputEditText etUsername;
|
||||
|
||||
private ActivityLoginBinding(@NonNull ScrollView rootView, @NonNull MaterialButton btnLogin,
|
||||
@NonNull MaterialButton btnRegister, @NonNull TextInputEditText etEmail,
|
||||
@NonNull TextInputEditText etPassword, @NonNull TextInputEditText etUsername) {
|
||||
this.rootView = rootView;
|
||||
this.btnLogin = btnLogin;
|
||||
this.btnRegister = btnRegister;
|
||||
this.etEmail = etEmail;
|
||||
this.etPassword = etPassword;
|
||||
this.etUsername = etUsername;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NonNull
|
||||
public ScrollView getRoot() {
|
||||
return rootView;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static ActivityLoginBinding inflate(@NonNull LayoutInflater inflater) {
|
||||
return inflate(inflater, null, false);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static ActivityLoginBinding inflate(@NonNull LayoutInflater inflater,
|
||||
@Nullable ViewGroup parent, boolean attachToParent) {
|
||||
View root = inflater.inflate(R.layout.activity_login, parent, false);
|
||||
if (attachToParent) {
|
||||
parent.addView(root);
|
||||
}
|
||||
return bind(root);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static ActivityLoginBinding bind(@NonNull View rootView) {
|
||||
// The body of this method is generated in a way you would not otherwise write.
|
||||
// This is done to optimize the compiled bytecode for size and performance.
|
||||
int id;
|
||||
missingId: {
|
||||
id = R.id.btnLogin;
|
||||
MaterialButton btnLogin = ViewBindings.findChildViewById(rootView, id);
|
||||
if (btnLogin == null) {
|
||||
break missingId;
|
||||
}
|
||||
|
||||
id = R.id.btnRegister;
|
||||
MaterialButton btnRegister = ViewBindings.findChildViewById(rootView, id);
|
||||
if (btnRegister == null) {
|
||||
break missingId;
|
||||
}
|
||||
|
||||
id = R.id.etEmail;
|
||||
TextInputEditText etEmail = ViewBindings.findChildViewById(rootView, id);
|
||||
if (etEmail == null) {
|
||||
break missingId;
|
||||
}
|
||||
|
||||
id = R.id.etPassword;
|
||||
TextInputEditText etPassword = ViewBindings.findChildViewById(rootView, id);
|
||||
if (etPassword == null) {
|
||||
break missingId;
|
||||
}
|
||||
|
||||
id = R.id.etUsername;
|
||||
TextInputEditText etUsername = ViewBindings.findChildViewById(rootView, id);
|
||||
if (etUsername == null) {
|
||||
break missingId;
|
||||
}
|
||||
|
||||
return new ActivityLoginBinding((ScrollView) rootView, btnLogin, btnRegister, etEmail,
|
||||
etPassword, etUsername);
|
||||
}
|
||||
String missingId = rootView.getResources().getResourceName(id);
|
||||
throw new NullPointerException("Missing required view with ID: ".concat(missingId));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
// Generated by view binder compiler. Do not edit!
|
||||
package com.saars.chatplatform.databinding;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ProgressBar;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.coordinatorlayout.widget.CoordinatorLayout;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.viewbinding.ViewBinding;
|
||||
import androidx.viewbinding.ViewBindings;
|
||||
import com.google.android.material.appbar.MaterialToolbar;
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
import com.saars.chatplatform.R;
|
||||
import java.lang.NullPointerException;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
|
||||
public final class ActivityMainBinding implements ViewBinding {
|
||||
@NonNull
|
||||
private final CoordinatorLayout rootView;
|
||||
|
||||
@NonNull
|
||||
public final FloatingActionButton fabAgent;
|
||||
|
||||
@NonNull
|
||||
public final FloatingActionButton fabNew;
|
||||
|
||||
@NonNull
|
||||
public final ProgressBar progress;
|
||||
|
||||
@NonNull
|
||||
public final RecyclerView recycler;
|
||||
|
||||
@NonNull
|
||||
public final MaterialToolbar toolbar;
|
||||
|
||||
private ActivityMainBinding(@NonNull CoordinatorLayout rootView,
|
||||
@NonNull FloatingActionButton fabAgent, @NonNull FloatingActionButton fabNew,
|
||||
@NonNull ProgressBar progress, @NonNull RecyclerView recycler,
|
||||
@NonNull MaterialToolbar toolbar) {
|
||||
this.rootView = rootView;
|
||||
this.fabAgent = fabAgent;
|
||||
this.fabNew = fabNew;
|
||||
this.progress = progress;
|
||||
this.recycler = recycler;
|
||||
this.toolbar = toolbar;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NonNull
|
||||
public CoordinatorLayout getRoot() {
|
||||
return rootView;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static ActivityMainBinding inflate(@NonNull LayoutInflater inflater) {
|
||||
return inflate(inflater, null, false);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static ActivityMainBinding inflate(@NonNull LayoutInflater inflater,
|
||||
@Nullable ViewGroup parent, boolean attachToParent) {
|
||||
View root = inflater.inflate(R.layout.activity_main, parent, false);
|
||||
if (attachToParent) {
|
||||
parent.addView(root);
|
||||
}
|
||||
return bind(root);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static ActivityMainBinding bind(@NonNull View rootView) {
|
||||
// The body of this method is generated in a way you would not otherwise write.
|
||||
// This is done to optimize the compiled bytecode for size and performance.
|
||||
int id;
|
||||
missingId: {
|
||||
id = R.id.fabAgent;
|
||||
FloatingActionButton fabAgent = ViewBindings.findChildViewById(rootView, id);
|
||||
if (fabAgent == null) {
|
||||
break missingId;
|
||||
}
|
||||
|
||||
id = R.id.fabNew;
|
||||
FloatingActionButton fabNew = ViewBindings.findChildViewById(rootView, id);
|
||||
if (fabNew == null) {
|
||||
break missingId;
|
||||
}
|
||||
|
||||
id = R.id.progress;
|
||||
ProgressBar progress = ViewBindings.findChildViewById(rootView, id);
|
||||
if (progress == null) {
|
||||
break missingId;
|
||||
}
|
||||
|
||||
id = R.id.recycler;
|
||||
RecyclerView recycler = ViewBindings.findChildViewById(rootView, id);
|
||||
if (recycler == null) {
|
||||
break missingId;
|
||||
}
|
||||
|
||||
id = R.id.toolbar;
|
||||
MaterialToolbar toolbar = ViewBindings.findChildViewById(rootView, id);
|
||||
if (toolbar == null) {
|
||||
break missingId;
|
||||
}
|
||||
|
||||
return new ActivityMainBinding((CoordinatorLayout) rootView, fabAgent, fabNew, progress,
|
||||
recycler, toolbar);
|
||||
}
|
||||
String missingId = rootView.getResources().getResourceName(id);
|
||||
throw new NullPointerException("Missing required view with ID: ".concat(missingId));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
// Generated by view binder compiler. Do not edit!
|
||||
package com.saars.chatplatform.databinding;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.viewbinding.ViewBinding;
|
||||
import androidx.viewbinding.ViewBindings;
|
||||
import com.saars.chatplatform.R;
|
||||
import java.lang.NullPointerException;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
|
||||
public final class ItemConversationBinding implements ViewBinding {
|
||||
@NonNull
|
||||
private final LinearLayout rootView;
|
||||
|
||||
@NonNull
|
||||
public final TextView tvTime;
|
||||
|
||||
@NonNull
|
||||
public final TextView tvTitle;
|
||||
|
||||
private ItemConversationBinding(@NonNull LinearLayout rootView, @NonNull TextView tvTime,
|
||||
@NonNull TextView tvTitle) {
|
||||
this.rootView = rootView;
|
||||
this.tvTime = tvTime;
|
||||
this.tvTitle = tvTitle;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NonNull
|
||||
public LinearLayout getRoot() {
|
||||
return rootView;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static ItemConversationBinding inflate(@NonNull LayoutInflater inflater) {
|
||||
return inflate(inflater, null, false);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static ItemConversationBinding inflate(@NonNull LayoutInflater inflater,
|
||||
@Nullable ViewGroup parent, boolean attachToParent) {
|
||||
View root = inflater.inflate(R.layout.item_conversation, parent, false);
|
||||
if (attachToParent) {
|
||||
parent.addView(root);
|
||||
}
|
||||
return bind(root);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static ItemConversationBinding bind(@NonNull View rootView) {
|
||||
// The body of this method is generated in a way you would not otherwise write.
|
||||
// This is done to optimize the compiled bytecode for size and performance.
|
||||
int id;
|
||||
missingId: {
|
||||
id = R.id.tvTime;
|
||||
TextView tvTime = ViewBindings.findChildViewById(rootView, id);
|
||||
if (tvTime == null) {
|
||||
break missingId;
|
||||
}
|
||||
|
||||
id = R.id.tvTitle;
|
||||
TextView tvTitle = ViewBindings.findChildViewById(rootView, id);
|
||||
if (tvTitle == null) {
|
||||
break missingId;
|
||||
}
|
||||
|
||||
return new ItemConversationBinding((LinearLayout) rootView, tvTime, tvTitle);
|
||||
}
|
||||
String missingId = rootView.getResources().getResourceName(id);
|
||||
throw new NullPointerException("Missing required view with ID: ".concat(missingId));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
// Generated by view binder compiler. Do not edit!
|
||||
package com.saars.chatplatform.databinding;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.viewbinding.ViewBinding;
|
||||
import androidx.viewbinding.ViewBindings;
|
||||
import com.saars.chatplatform.R;
|
||||
import java.lang.NullPointerException;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
|
||||
public final class ItemMessageBinding implements ViewBinding {
|
||||
@NonNull
|
||||
private final FrameLayout rootView;
|
||||
|
||||
@NonNull
|
||||
public final TextView tvMessage;
|
||||
|
||||
private ItemMessageBinding(@NonNull FrameLayout rootView, @NonNull TextView tvMessage) {
|
||||
this.rootView = rootView;
|
||||
this.tvMessage = tvMessage;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NonNull
|
||||
public FrameLayout getRoot() {
|
||||
return rootView;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static ItemMessageBinding inflate(@NonNull LayoutInflater inflater) {
|
||||
return inflate(inflater, null, false);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static ItemMessageBinding inflate(@NonNull LayoutInflater inflater,
|
||||
@Nullable ViewGroup parent, boolean attachToParent) {
|
||||
View root = inflater.inflate(R.layout.item_message, parent, false);
|
||||
if (attachToParent) {
|
||||
parent.addView(root);
|
||||
}
|
||||
return bind(root);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static ItemMessageBinding bind(@NonNull View rootView) {
|
||||
// The body of this method is generated in a way you would not otherwise write.
|
||||
// This is done to optimize the compiled bytecode for size and performance.
|
||||
int id;
|
||||
missingId: {
|
||||
id = R.id.tvMessage;
|
||||
TextView tvMessage = ViewBindings.findChildViewById(rootView, id);
|
||||
if (tvMessage == null) {
|
||||
break missingId;
|
||||
}
|
||||
|
||||
return new ItemMessageBinding((FrameLayout) rootView, tvMessage);
|
||||
}
|
||||
String missingId = rootView.getResources().getResourceName(id);
|
||||
throw new NullPointerException("Missing required view with ID: ".concat(missingId));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Automatically generated file. DO NOT MODIFY
|
||||
*/
|
||||
package com.saars.chatplatform;
|
||||
|
||||
public final class BuildConfig {
|
||||
public static final boolean DEBUG = Boolean.parseBoolean("true");
|
||||
public static final String APPLICATION_ID = "com.saars.chatplatform";
|
||||
public static final String BUILD_TYPE = "debug";
|
||||
public static final int VERSION_CODE = 1;
|
||||
public static final String VERSION_NAME = "1.0";
|
||||
// Field from default config.
|
||||
public static final String API_BASE_URL = "http://101.43.95.130:8052/";
|
||||
}
|
||||
Reference in New Issue
Block a user