App: neue Chat-Bubbles, neue Avatare, neuer ImageConverter zum rundmachen der Avatare. Neuer Style

This commit is contained in:
staccatomamba
2016-10-07 12:40:16 +02:00
parent bbd26cca9c
commit c504e994cb
40 changed files with 383 additions and 292 deletions

View File

@@ -51,7 +51,19 @@ public class DatabaseHandler extends SQLiteOpenHelper {
private static final String KEY_TEAM_MEMBER_OIDS = "teammemberoids";
private static final String KEY_TEAM_MEMBER_NAMES = "teammembernames";
private static final String KEY_VERSION = "version";
private static final String KEY_IS_EMPLOYEE = "isemployee";
private static final String[] CONTACTS_COLUMNS = new String[] {
KEY_ID,
KEY_KONTAKT_NAME,
KEY_PERSONOID,
KEY_PICTURE_BLOB,
KEY_IS_TEAM,
KEY_TEAM_MEMBER_OIDS,
KEY_TEAM_MEMBER_NAMES,
KEY_VERSION,
KEY_IS_EMPLOYEE
};
// ChatMessage-Tabelle
private static final String KEY_ID_CHATMESSAGE = "id";
@@ -100,7 +112,8 @@ public class DatabaseHandler extends SQLiteOpenHelper {
KEY_IS_TEAM + " INTEGER, " +
KEY_TEAM_MEMBER_NAMES + " TEXT, " +
KEY_TEAM_MEMBER_OIDS + " TEXT, " +
KEY_VERSION + " INTEGER)";
KEY_VERSION + " INTEGER, " +
KEY_IS_EMPLOYEE + " INTEGER)";
db.execSQL(CREATE_CONTACTS_TABLE);
@@ -294,6 +307,7 @@ public class DatabaseHandler extends SQLiteOpenHelper {
values.put(KEY_TEAM_MEMBER_NAMES, contact.teamMemberNames);
values.put(KEY_TEAM_MEMBER_OIDS, contact.teamMemberOids);
values.put(KEY_VERSION, contact.getVersion());
values.put(KEY_IS_EMPLOYEE, contact.getIsEmployee());
writableDatabase.insertOrThrow(TABLE_CONTACTS, null, values);
}
@@ -422,15 +436,7 @@ public class DatabaseHandler extends SQLiteOpenHelper {
SQLiteDatabase readableDatabase = this.getReadableDatabase();
Cursor cursor = readableDatabase.query(TABLE_CONTACTS,
new String[]{
KEY_ID,
KEY_KONTAKT_NAME,
KEY_PERSONOID,
KEY_PICTURE_BLOB,
KEY_IS_TEAM,
KEY_TEAM_MEMBER_NAMES,
KEY_TEAM_MEMBER_OIDS,
KEY_VERSION},
CONTACTS_COLUMNS,
KEY_ID + "=?",
new String[]{String.valueOf(id)},
null,null,null,null);
@@ -446,8 +452,9 @@ public class DatabaseHandler extends SQLiteOpenHelper {
String teamMemberOids = cursor.getString(5);
String teamMemberNames = cursor.getString(6);
int contactVersion = cursor.getInt(7);
boolean isEmployee = cursor.getInt(8) == 1;
ContactListItem contact = new ContactListItem(contactId, contactName, contactPersonOid, contactPicture, contactIsTeam, teamMemberOids, teamMemberNames, contactVersion);
ContactListItem contact = new ContactListItem(contactId, contactName, contactPersonOid, contactPicture, contactIsTeam, teamMemberOids, teamMemberNames, contactVersion, isEmployee);
cursor.close();
@@ -476,6 +483,7 @@ public class DatabaseHandler extends SQLiteOpenHelper {
contact.teamMemberNames = cursor.getString(5);
contact.teamMemberOids = cursor.getString(6);
contact.setVersion(cursor.getInt(7));
contact.setIsEmployee(cursor.getInt(8) == 1);
contactList.add(contact);
} while (cursor.moveToNext());
@@ -529,6 +537,7 @@ public class DatabaseHandler extends SQLiteOpenHelper {
values.put(KEY_TEAM_MEMBER_NAMES, contact.teamMemberNames);
values.put(KEY_TEAM_MEMBER_OIDS, contact.teamMemberOids);
values.put(KEY_VERSION, contact.getVersion());
values.put(KEY_IS_EMPLOYEE, contact.getIsEmployee());
return writableDatabase.update(TABLE_CONTACTS, values, KEY_ID + " = ?", new String[] { String.valueOf(contact.getId()) });
}
@@ -574,15 +583,7 @@ public class DatabaseHandler extends SQLiteOpenHelper {
SQLiteDatabase readableDatabase = this.getReadableDatabase();
Cursor cursor = readableDatabase.query(TABLE_CONTACTS,
new String[]{
KEY_ID,
KEY_KONTAKT_NAME,
KEY_PERSONOID,
KEY_PICTURE_BLOB,
KEY_IS_TEAM,
KEY_TEAM_MEMBER_NAMES,
KEY_TEAM_MEMBER_OIDS,
KEY_VERSION},
CONTACTS_COLUMNS,
KEY_PERSONOID + "=? AND " + KEY_IS_TEAM + "=?",
new String[]{String.valueOf(personOid), String.valueOf((isTeam ? 1 : 0))},
null,null,null,null);
@@ -597,8 +598,9 @@ public class DatabaseHandler extends SQLiteOpenHelper {
String teamMemberOids = cursor.getString(5);
String teamMemberNames = cursor.getString(6);
int contactVersion = cursor.getInt(7);
boolean isEmployee = cursor.getInt(8) == 1;
ContactListItem contact = new ContactListItem(contactId, contactName, contactPersonOid, contactPicture, contactIsTeam, teamMemberOids, teamMemberNames, contactVersion);
ContactListItem contact = new ContactListItem(contactId, contactName, contactPersonOid, contactPicture, contactIsTeam, teamMemberOids, teamMemberNames, contactVersion, isEmployee);
cursor.close();