Skip to content

Commit

Permalink
Exchanging contact images within chat works!
Browse files Browse the repository at this point in the history
  • Loading branch information
j4rvis committed May 23, 2017
1 parent 58503cf commit bc8b87a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 45 deletions.
39 changes: 7 additions & 32 deletions app/app.iml
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,20 @@
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
Expand Down Expand Up @@ -112,30 +112,5 @@
<orderEntry type="library" exported="" name="cardview-v7-24.2.1" level="project" />
<orderEntry type="library" exported="" name="design-24.2.1" level="project" />
<orderEntry type="module" module-name="api" exported="" />
<orderEntry type="library" exported="" scope="TEST" name="runner-0.5" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="espresso-idling-resource-2.2.2" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="hamcrest-library-1.3" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="hamcrest-integration-1.3" level="project" />
<orderEntry type="library" exported="" name="sharkfw-core-1.0-SNAPSHOT" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="jsr305-2.0.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="multidex-instrumentation-1.0.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="espresso-core-2.2.2" level="project" />
<orderEntry type="library" exported="" name="guava-18.0" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="exposed-instrumentation-api-publish-0.5" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="rules-0.5" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="uiautomator-v18-2.1.2" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="javax.annotation-api-1.2" level="project" />
<orderEntry type="library" exported="" name="lorem-2.1" level="project" />
<orderEntry type="library" exported="" name="sqlite-jdbc-3.16.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="javax.inject-1" level="project" />
<orderEntry type="library" exported="" name="annotations-2.0.1" level="project" />
<orderEntry type="library" exported="" name="rxjava-1.1.0" level="project" />
<orderEntry type="library" exported="" name="android-activation-1.5.5" level="project" />
<orderEntry type="library" exported="" name="android-mail-1.5.5" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="javawriter-2.1.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="hamcrest-core-1.3" level="project" />
<orderEntry type="library" exported="" name="javassist-3.18.2-GA" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="junit-4.12" level="project" />
<orderEntry type="library" exported="" name="reflections-0.9.10" level="project" />
</component>
</module>
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,18 @@ protected void onCreate(Bundle savedInstanceState) {
}
// TODO what if we reload the messages?
List<Contact> contacts = mChat.getContacts();
contacts.remove(getSharkApp().getAccount());
// contacts.remove(getSharkApp().getAccount());

if (mChat.getTitle() != null) {
setTitle(mChat.getTitle());
} else if (contacts.size() == 1) {
setTitle(contacts.get(0).getName());
if(contacts.get(0).equals(getSharkApp().getAccount())){
setTitle(mChat.getOwner().getName());
} else {
setTitle(contacts.get(0).getName());
}
}
L.d(mChat.toString(), this);

setProgressMessage(R.string.chat_progress_load_messages);
}
Expand Down
12 changes: 2 additions & 10 deletions app/src/main/java/net/sharksystem/sharknet/dummy/Dummy.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public static void createDummyData(Context context, SharkNetApi api) throws Shar

Random random = new Random(System.currentTimeMillis());

int numberOfContacts = 8;
int numberOfContacts = 5;
for (int i = 0; i < numberOfContacts; i++) {
contacts.add(dummyContactGenerator.newContact());
}
Expand Down Expand Up @@ -105,19 +105,11 @@ public static void createDummyData(Context context, SharkNetApi api) throws Shar
Chat chat4 = new Chat(account, contacts);
chat4.setTitle("Allesamt");
chat4.setImage(BitmapFactory.decodeStream(assets.open("pictures/groups/" + pictures[3])));
Chat chat5 = new Chat(account, contacts.get(2));
Chat chat6 = new Chat(account, contacts.get(5));
Chat chat7 = new Chat(account, contacts.get(4));
Chat chat8 = new Chat(account, contacts.get(7));

chats.add(chat1);
chats.add(chat2);
chats.add(chat3);
chats.add(chat4);
chats.add(chat5);
chats.add(chat6);
chats.add(chat7);
chats.add(chat8);

L.d("Chats created");

Expand All @@ -126,7 +118,7 @@ public static void createDummyData(Context context, SharkNetApi api) throws Shar
for (Chat chat : chats) {
List<Contact> contactList = chat.getContacts();
contactList.add(chat.getOwner());
int numberOfMessages = random.nextInt(20);
int numberOfMessages = random.nextInt(10);
numberOfMessages+=3;
long date = lastWeek;
for (int i = 0; i < numberOfMessages; i++) {
Expand Down

0 comments on commit bc8b87a

Please sign in to comment.