commit 35f8ab58f4b6f97f02031b056d2a5f6f993672cf Author: Daniel Gultsch Date: Fri Jan 24 02:04:05 2014 +0100 inital commit diff --git a/.classpath b/.classpath new file mode 100644 index 0000000000000000000000000000000000000000..96e9275b0cadb015020db5eb7622f7206fc7d2cb --- /dev/null +++ b/.classpath @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/.project b/.project new file mode 100644 index 0000000000000000000000000000000000000000..01f891d23a3f2a576fc3e2e55ce8519d258654d6 --- /dev/null +++ b/.project @@ -0,0 +1,33 @@ + + + SecureConversations + + + + + + com.android.ide.eclipse.adt.ResourceManagerBuilder + + + + + com.android.ide.eclipse.adt.PreCompilerBuilder + + + + + org.eclipse.jdt.core.javabuilder + + + + + com.android.ide.eclipse.adt.ApkBuilder + + + + + + com.android.ide.eclipse.adt.AndroidNature + org.eclipse.jdt.core.javanature + + diff --git a/AndroidManifest.xml b/AndroidManifest.xml new file mode 100644 index 0000000000000000000000000000000000000000..a2716651330443c7a48f9b5329ebac9054ca573d --- /dev/null +++ b/AndroidManifest.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bin/AndroidManifest.xml b/bin/AndroidManifest.xml new file mode 100644 index 0000000000000000000000000000000000000000..a2716651330443c7a48f9b5329ebac9054ca573d --- /dev/null +++ b/bin/AndroidManifest.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bin/SecureConversations.apk b/bin/SecureConversations.apk new file mode 100644 index 0000000000000000000000000000000000000000..d4ae5a61ead1110d595b64a31f30edf35444793b Binary files /dev/null and b/bin/SecureConversations.apk differ diff --git a/bin/classes.dex b/bin/classes.dex new file mode 100644 index 0000000000000000000000000000000000000000..dd5510e69809d28763cc4ff3bad105461597b3da Binary files /dev/null and b/bin/classes.dex differ diff --git a/bin/classes/de/gultsch/chat/BuildConfig.class b/bin/classes/de/gultsch/chat/BuildConfig.class new file mode 100644 index 0000000000000000000000000000000000000000..ea4b0483e79d1c744cb6aa7ecd15b8ed95f2c737 Binary files /dev/null and b/bin/classes/de/gultsch/chat/BuildConfig.class differ diff --git a/bin/classes/de/gultsch/chat/Contact.class b/bin/classes/de/gultsch/chat/Contact.class new file mode 100644 index 0000000000000000000000000000000000000000..6432ac09df6e55d3363352b14b82a9164be91bf3 Binary files /dev/null and b/bin/classes/de/gultsch/chat/Contact.class differ diff --git a/bin/classes/de/gultsch/chat/Conversation.class b/bin/classes/de/gultsch/chat/Conversation.class new file mode 100644 index 0000000000000000000000000000000000000000..37e0d0df2af9ff83ea0d8b66ebeb307ce2aa7a8d Binary files /dev/null and b/bin/classes/de/gultsch/chat/Conversation.class differ diff --git a/bin/classes/de/gultsch/chat/ConversationCursor.class b/bin/classes/de/gultsch/chat/ConversationCursor.class new file mode 100644 index 0000000000000000000000000000000000000000..e5d6023ec417fbd54be4876994c744e56c872a59 Binary files /dev/null and b/bin/classes/de/gultsch/chat/ConversationCursor.class differ diff --git a/bin/classes/de/gultsch/chat/ConversationList$1.class b/bin/classes/de/gultsch/chat/ConversationList$1.class new file mode 100644 index 0000000000000000000000000000000000000000..c0fbcdeffcea9948c9c3ff3d2a1b29a9349f1db2 Binary files /dev/null and b/bin/classes/de/gultsch/chat/ConversationList$1.class differ diff --git a/bin/classes/de/gultsch/chat/ConversationList.class b/bin/classes/de/gultsch/chat/ConversationList.class new file mode 100644 index 0000000000000000000000000000000000000000..e45ad2bb80079296340479cb95be4e6c2ea8dabe Binary files /dev/null and b/bin/classes/de/gultsch/chat/ConversationList.class differ diff --git a/bin/classes/de/gultsch/chat/Message.class b/bin/classes/de/gultsch/chat/Message.class new file mode 100644 index 0000000000000000000000000000000000000000..1dbcab2c4c460deea6c7be9898cc90eb9f49cfb8 Binary files /dev/null and b/bin/classes/de/gultsch/chat/Message.class differ diff --git a/bin/classes/de/gultsch/chat/R$array.class b/bin/classes/de/gultsch/chat/R$array.class new file mode 100644 index 0000000000000000000000000000000000000000..5044b3299411d1d7600b0722cde20731fd81745e Binary files /dev/null and b/bin/classes/de/gultsch/chat/R$array.class differ diff --git a/bin/classes/de/gultsch/chat/R$attr.class b/bin/classes/de/gultsch/chat/R$attr.class new file mode 100644 index 0000000000000000000000000000000000000000..51bfe702346748102f11c96478b46cf3071a2390 Binary files /dev/null and b/bin/classes/de/gultsch/chat/R$attr.class differ diff --git a/bin/classes/de/gultsch/chat/R$dimen.class b/bin/classes/de/gultsch/chat/R$dimen.class new file mode 100644 index 0000000000000000000000000000000000000000..c8834c65e46a2c71ae35a570db4570f7575d2393 Binary files /dev/null and b/bin/classes/de/gultsch/chat/R$dimen.class differ diff --git a/bin/classes/de/gultsch/chat/R$drawable.class b/bin/classes/de/gultsch/chat/R$drawable.class new file mode 100644 index 0000000000000000000000000000000000000000..e862ed4487386501cbb7592b9078acdb9ba83fd2 Binary files /dev/null and b/bin/classes/de/gultsch/chat/R$drawable.class differ diff --git a/bin/classes/de/gultsch/chat/R$id.class b/bin/classes/de/gultsch/chat/R$id.class new file mode 100644 index 0000000000000000000000000000000000000000..ac0183a78bf900e6ec0336bdb9e78d25f3c5b9ca Binary files /dev/null and b/bin/classes/de/gultsch/chat/R$id.class differ diff --git a/bin/classes/de/gultsch/chat/R$layout.class b/bin/classes/de/gultsch/chat/R$layout.class new file mode 100644 index 0000000000000000000000000000000000000000..1f9040ae594269d80b2c8edb0eeed5318ec360f6 Binary files /dev/null and b/bin/classes/de/gultsch/chat/R$layout.class differ diff --git a/bin/classes/de/gultsch/chat/R$menu.class b/bin/classes/de/gultsch/chat/R$menu.class new file mode 100644 index 0000000000000000000000000000000000000000..0ed4eae1ab89bb3364bc8ea3574c11088122f670 Binary files /dev/null and b/bin/classes/de/gultsch/chat/R$menu.class differ diff --git a/bin/classes/de/gultsch/chat/R$string.class b/bin/classes/de/gultsch/chat/R$string.class new file mode 100644 index 0000000000000000000000000000000000000000..22df3f3c91a6a1b36dd17bde64f7b2c25ef14d3f Binary files /dev/null and b/bin/classes/de/gultsch/chat/R$string.class differ diff --git a/bin/classes/de/gultsch/chat/R$style.class b/bin/classes/de/gultsch/chat/R$style.class new file mode 100644 index 0000000000000000000000000000000000000000..c1f8230a501b230f6eb4b2223e538b463c77ec80 Binary files /dev/null and b/bin/classes/de/gultsch/chat/R$style.class differ diff --git a/bin/classes/de/gultsch/chat/R$xml.class b/bin/classes/de/gultsch/chat/R$xml.class new file mode 100644 index 0000000000000000000000000000000000000000..7104856f99b734930d42a499d54c010a16120343 Binary files /dev/null and b/bin/classes/de/gultsch/chat/R$xml.class differ diff --git a/bin/classes/de/gultsch/chat/R.class b/bin/classes/de/gultsch/chat/R.class new file mode 100644 index 0000000000000000000000000000000000000000..fd18617c3269f407e96a528e03f9283e57b1e7dc Binary files /dev/null and b/bin/classes/de/gultsch/chat/R.class differ diff --git a/bin/classes/de/gultsch/chat/services/XmppConnectionService$XmppConnectionBinder.class b/bin/classes/de/gultsch/chat/services/XmppConnectionService$XmppConnectionBinder.class new file mode 100644 index 0000000000000000000000000000000000000000..f6e7586a581466e11dae9d8471e83e3edd80996b Binary files /dev/null and b/bin/classes/de/gultsch/chat/services/XmppConnectionService$XmppConnectionBinder.class differ diff --git a/bin/classes/de/gultsch/chat/services/XmppConnectionService.class b/bin/classes/de/gultsch/chat/services/XmppConnectionService.class new file mode 100644 index 0000000000000000000000000000000000000000..91ea7355d055afc1d1f54009b87b004bebd17a56 Binary files /dev/null and b/bin/classes/de/gultsch/chat/services/XmppConnectionService.class differ diff --git a/bin/classes/de/gultsch/chat/ui/ConversationActivity$1.class b/bin/classes/de/gultsch/chat/ui/ConversationActivity$1.class new file mode 100644 index 0000000000000000000000000000000000000000..c10eda28ef581bed5f6ed68dfdf2316fe86ab3b7 Binary files /dev/null and b/bin/classes/de/gultsch/chat/ui/ConversationActivity$1.class differ diff --git a/bin/classes/de/gultsch/chat/ui/ConversationActivity$2.class b/bin/classes/de/gultsch/chat/ui/ConversationActivity$2.class new file mode 100644 index 0000000000000000000000000000000000000000..2a2480fa84106298aad32a3dfa6810e82cea1e6d Binary files /dev/null and b/bin/classes/de/gultsch/chat/ui/ConversationActivity$2.class differ diff --git a/bin/classes/de/gultsch/chat/ui/ConversationActivity.class b/bin/classes/de/gultsch/chat/ui/ConversationActivity.class new file mode 100644 index 0000000000000000000000000000000000000000..73587f53303429a91b9f94366d45580daf030b62 Binary files /dev/null and b/bin/classes/de/gultsch/chat/ui/ConversationActivity.class differ diff --git a/bin/classes/de/gultsch/chat/ui/ConversationFragment.class b/bin/classes/de/gultsch/chat/ui/ConversationFragment.class new file mode 100644 index 0000000000000000000000000000000000000000..fc8463c6f044e8cdfc0e02e7b29c07815548eb46 Binary files /dev/null and b/bin/classes/de/gultsch/chat/ui/ConversationFragment.class differ diff --git a/bin/classes/de/gultsch/chat/ui/ManageAccountActivity.class b/bin/classes/de/gultsch/chat/ui/ManageAccountActivity.class new file mode 100644 index 0000000000000000000000000000000000000000..da54422f8e98c4bd1a9c8f0f6e554d759a6f0620 Binary files /dev/null and b/bin/classes/de/gultsch/chat/ui/ManageAccountActivity.class differ diff --git a/bin/classes/de/gultsch/chat/ui/NewConversationActivity$1.class b/bin/classes/de/gultsch/chat/ui/NewConversationActivity$1.class new file mode 100644 index 0000000000000000000000000000000000000000..151d9df3418e4c0abf3b47b4b99dc8f6e27a1056 Binary files /dev/null and b/bin/classes/de/gultsch/chat/ui/NewConversationActivity$1.class differ diff --git a/bin/classes/de/gultsch/chat/ui/NewConversationActivity$2.class b/bin/classes/de/gultsch/chat/ui/NewConversationActivity$2.class new file mode 100644 index 0000000000000000000000000000000000000000..7419a15f9e8f09110d817b189575eeb9c2411a70 Binary files /dev/null and b/bin/classes/de/gultsch/chat/ui/NewConversationActivity$2.class differ diff --git a/bin/classes/de/gultsch/chat/ui/NewConversationActivity$3.class b/bin/classes/de/gultsch/chat/ui/NewConversationActivity$3.class new file mode 100644 index 0000000000000000000000000000000000000000..afa85e9fa393dbecf653e7b5f523e63a11cfa659 Binary files /dev/null and b/bin/classes/de/gultsch/chat/ui/NewConversationActivity$3.class differ diff --git a/bin/classes/de/gultsch/chat/ui/NewConversationActivity.class b/bin/classes/de/gultsch/chat/ui/NewConversationActivity.class new file mode 100644 index 0000000000000000000000000000000000000000..9b80c25625caebb7338848956d4c8200bb3cd4aa Binary files /dev/null and b/bin/classes/de/gultsch/chat/ui/NewConversationActivity.class differ diff --git a/bin/classes/de/gultsch/chat/ui/SettingsActivity.class b/bin/classes/de/gultsch/chat/ui/SettingsActivity.class new file mode 100644 index 0000000000000000000000000000000000000000..2f2344dc0872cfeaa803ef57b4a21cb9148afc97 Binary files /dev/null and b/bin/classes/de/gultsch/chat/ui/SettingsActivity.class differ diff --git a/bin/classes/de/gultsch/chat/ui/SettingsFragment.class b/bin/classes/de/gultsch/chat/ui/SettingsFragment.class new file mode 100644 index 0000000000000000000000000000000000000000..cd8046f25fb7682aaa38d38976d4bb97bc99615d Binary files /dev/null and b/bin/classes/de/gultsch/chat/ui/SettingsFragment.class differ diff --git a/bin/dexedLibs/android-support-v4-6dc474cfe2b92e991d4a9010169faf31.jar b/bin/dexedLibs/android-support-v4-6dc474cfe2b92e991d4a9010169faf31.jar new file mode 100644 index 0000000000000000000000000000000000000000..ea8e5c71e5959a1b4c6fb1930e5ecca8a94af0e6 Binary files /dev/null and b/bin/dexedLibs/android-support-v4-6dc474cfe2b92e991d4a9010169faf31.jar differ diff --git a/bin/dexedLibs/android-support-v4-84d310e21a82b69cbcd4bdc6eebebae6.jar b/bin/dexedLibs/android-support-v4-84d310e21a82b69cbcd4bdc6eebebae6.jar new file mode 100644 index 0000000000000000000000000000000000000000..796205bc01a60ed31a20d898ffb940054bcdf05c Binary files /dev/null and b/bin/dexedLibs/android-support-v4-84d310e21a82b69cbcd4bdc6eebebae6.jar differ diff --git a/bin/jarlist.cache b/bin/jarlist.cache new file mode 100644 index 0000000000000000000000000000000000000000..0565465f225d470f6791a61ca04463ad4ee2131b --- /dev/null +++ b/bin/jarlist.cache @@ -0,0 +1,3 @@ +# cache for current jar dependency. DO NOT EDIT. +# format is +# Encoding is UTF-8 diff --git a/bin/res/crunch/drawable-hdpi/ic_action_add.png b/bin/res/crunch/drawable-hdpi/ic_action_add.png new file mode 100644 index 0000000000000000000000000000000000000000..c7a0db246074f45551c72f5fbe4a2803086d2a43 Binary files /dev/null and b/bin/res/crunch/drawable-hdpi/ic_action_add.png differ diff --git a/bin/res/crunch/drawable-hdpi/ic_action_send.png b/bin/res/crunch/drawable-hdpi/ic_action_send.png new file mode 100644 index 0000000000000000000000000000000000000000..8c01c1075901fe38967525f37392d483dfb41cd2 Binary files /dev/null and b/bin/res/crunch/drawable-hdpi/ic_action_send.png differ diff --git a/bin/res/crunch/drawable-hdpi/ic_action_send_now.png b/bin/res/crunch/drawable-hdpi/ic_action_send_now.png new file mode 100644 index 0000000000000000000000000000000000000000..9a19771e2dda6eed75abc5f226428761de0f25b4 Binary files /dev/null and b/bin/res/crunch/drawable-hdpi/ic_action_send_now.png differ diff --git a/bin/res/crunch/drawable-hdpi/ic_action_unsecure.png b/bin/res/crunch/drawable-hdpi/ic_action_unsecure.png new file mode 100644 index 0000000000000000000000000000000000000000..592d9ebcd12f1285ab13b3a49f42c5f9b977a315 Binary files /dev/null and b/bin/res/crunch/drawable-hdpi/ic_action_unsecure.png differ diff --git a/bin/res/crunch/drawable-hdpi/ic_launcher.png b/bin/res/crunch/drawable-hdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..9ff16976e8b9e20747f4f5f28300f35fef000a72 Binary files /dev/null and b/bin/res/crunch/drawable-hdpi/ic_launcher.png differ diff --git a/bin/res/crunch/drawable-hdpi/ic_profile.png b/bin/res/crunch/drawable-hdpi/ic_profile.png new file mode 100644 index 0000000000000000000000000000000000000000..505c4beceaa2fd7d4e84696521489cb8c9e7d793 Binary files /dev/null and b/bin/res/crunch/drawable-hdpi/ic_profile.png differ diff --git a/bin/res/crunch/drawable-mdpi/ic_action_add.png b/bin/res/crunch/drawable-mdpi/ic_action_add.png new file mode 100644 index 0000000000000000000000000000000000000000..ca14aafd0c216a66897f79bae075e21efddbf27b Binary files /dev/null and b/bin/res/crunch/drawable-mdpi/ic_action_add.png differ diff --git a/bin/res/crunch/drawable-mdpi/ic_action_send.png b/bin/res/crunch/drawable-mdpi/ic_action_send.png new file mode 100644 index 0000000000000000000000000000000000000000..f6b0a3c278f5ea03bd378ba5c2f0b91e634f8814 Binary files /dev/null and b/bin/res/crunch/drawable-mdpi/ic_action_send.png differ diff --git a/bin/res/crunch/drawable-mdpi/ic_action_unsecure.png b/bin/res/crunch/drawable-mdpi/ic_action_unsecure.png new file mode 100644 index 0000000000000000000000000000000000000000..a6f558f8dd5f0dae994882d3bb71cf101f43318e Binary files /dev/null and b/bin/res/crunch/drawable-mdpi/ic_action_unsecure.png differ diff --git a/bin/res/crunch/drawable-mdpi/ic_launcher.png b/bin/res/crunch/drawable-mdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..719c528df730464169fbc981af5fd8c192174bb6 Binary files /dev/null and b/bin/res/crunch/drawable-mdpi/ic_launcher.png differ diff --git a/bin/res/crunch/drawable-mdpi/ic_profile.png b/bin/res/crunch/drawable-mdpi/ic_profile.png new file mode 100644 index 0000000000000000000000000000000000000000..d0a0a92c2d3ce45e2fd758b6160258e78ff4d11b Binary files /dev/null and b/bin/res/crunch/drawable-mdpi/ic_profile.png differ diff --git a/bin/res/crunch/drawable-xhdpi/ic_action_add.png b/bin/res/crunch/drawable-xhdpi/ic_action_add.png new file mode 100644 index 0000000000000000000000000000000000000000..b6a18bdec0b65921f73c19e5e88c9a6c714a47dc Binary files /dev/null and b/bin/res/crunch/drawable-xhdpi/ic_action_add.png differ diff --git a/bin/res/crunch/drawable-xhdpi/ic_action_send.png b/bin/res/crunch/drawable-xhdpi/ic_action_send.png new file mode 100644 index 0000000000000000000000000000000000000000..276097fdbcf8b73acad233bca2dceee97c8f7e74 Binary files /dev/null and b/bin/res/crunch/drawable-xhdpi/ic_action_send.png differ diff --git a/bin/res/crunch/drawable-xhdpi/ic_action_send_now.png b/bin/res/crunch/drawable-xhdpi/ic_action_send_now.png new file mode 100644 index 0000000000000000000000000000000000000000..b62e30e17d58409ef88cf0ea8c4fc0d320e83a06 Binary files /dev/null and b/bin/res/crunch/drawable-xhdpi/ic_action_send_now.png differ diff --git a/bin/res/crunch/drawable-xhdpi/ic_action_unsecure.png b/bin/res/crunch/drawable-xhdpi/ic_action_unsecure.png new file mode 100644 index 0000000000000000000000000000000000000000..9b722b8527793ae2c852a045a71d2ac6f9a79ca2 Binary files /dev/null and b/bin/res/crunch/drawable-xhdpi/ic_action_unsecure.png differ diff --git a/bin/res/crunch/drawable-xhdpi/ic_launcher.png b/bin/res/crunch/drawable-xhdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..44c64af9b029f99b1b3329e6b27edffa548ba906 Binary files /dev/null and b/bin/res/crunch/drawable-xhdpi/ic_launcher.png differ diff --git a/bin/res/crunch/drawable-xhdpi/ic_profile.png b/bin/res/crunch/drawable-xhdpi/ic_profile.png new file mode 100644 index 0000000000000000000000000000000000000000..75a8838b1ec044d9a68060791ec4ffa287a3004d Binary files /dev/null and b/bin/res/crunch/drawable-xhdpi/ic_profile.png differ diff --git a/bin/res/crunch/drawable-xxhdpi/ic_launcher.png b/bin/res/crunch/drawable-xxhdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..5a44e82fc1509c1a9eb53607c68e87f071311843 Binary files /dev/null and b/bin/res/crunch/drawable-xxhdpi/ic_launcher.png differ diff --git a/bin/res/crunch/drawable-xxhdpi/ic_profile.png b/bin/res/crunch/drawable-xxhdpi/ic_profile.png new file mode 100644 index 0000000000000000000000000000000000000000..461c12bab3d04666b0c34bfe5aa5839d7e2250af Binary files /dev/null and b/bin/res/crunch/drawable-xxhdpi/ic_profile.png differ diff --git a/bin/resources.ap_ b/bin/resources.ap_ new file mode 100644 index 0000000000000000000000000000000000000000..6d54a50228ff16735576630f6b623eb033d2e66d Binary files /dev/null and b/bin/resources.ap_ differ diff --git a/gen/de/gultsch/chat/BuildConfig.java b/gen/de/gultsch/chat/BuildConfig.java new file mode 100644 index 0000000000000000000000000000000000000000..7ab91d7ee3da9fd58d456e702326e3d6ce0b41f5 --- /dev/null +++ b/gen/de/gultsch/chat/BuildConfig.java @@ -0,0 +1,6 @@ +/** Automatically generated file. DO NOT MODIFY */ +package de.gultsch.chat; + +public final class BuildConfig { + public final static boolean DEBUG = true; +} \ No newline at end of file diff --git a/gen/de/gultsch/chat/R.java b/gen/de/gultsch/chat/R.java new file mode 100644 index 0000000000000000000000000000000000000000..d9f298ffc501b4cb08b2cb9d83ea3b62bed2ee20 --- /dev/null +++ b/gen/de/gultsch/chat/R.java @@ -0,0 +1,123 @@ +/* AUTO-GENERATED FILE. DO NOT MODIFY. + * + * This class was automatically generated by the + * aapt tool from the resource data it found. It + * should not be modified by hand. + */ + +package de.gultsch.chat; + +public final class R { + public static final class array { + public static final int conversation_encryption_type_entries=0x7f050000; + public static final int conversation_encryption_type_values=0x7f050001; + } + public static final class attr { + } + public static final class dimen { + /** Default screen margins, per the Android Design guidelines. + + Customize dimensions originally defined in res/values/dimens.xml (such as + screen margins) for sw720dp devices (e.g. 10" tablets) in landscape here. + + */ + public static final int activity_horizontal_margin=0x7f060000; + public static final int activity_vertical_margin=0x7f060001; + } + public static final class drawable { + public static final int es_slidingpane_shadow=0x7f020000; + public static final int ic_action_add=0x7f020001; + public static final int ic_action_send=0x7f020002; + public static final int ic_action_send_now=0x7f020003; + public static final int ic_action_unsecure=0x7f020004; + public static final int ic_launcher=0x7f020005; + public static final int ic_profile=0x7f020006; + public static final int section_header=0x7f020007; + } + public static final class id { + public static final int action_accounts=0x7f0a001c; + public static final int action_add=0x7f0a0018; + public static final int action_archive=0x7f0a001b; + public static final int action_details=0x7f0a001a; + public static final int action_security=0x7f0a0019; + public static final int action_settings=0x7f0a001d; + public static final int contact_display_name=0x7f0a000c; + public static final int contact_divider=0x7f0a000e; + public static final int contact_jid=0x7f0a000d; + public static final int contact_photo=0x7f0a000b; + public static final int conversation_lastmsg=0x7f0a0012; + public static final int conversation_name=0x7f0a0011; + public static final int create_new_contact=0x7f0a000a; + public static final int duration=0x7f0a0013; + public static final int editText1=0x7f0a0015; + public static final int imageButton1=0x7f0a0016; + public static final int imageView1=0x7f0a0010; + public static final int jabber_contacts=0x7f0a0008; + public static final int jabber_contacts_header=0x7f0a0007; + public static final int list=0x7f0a0001; + public static final int new_contact_header=0x7f0a0009; + public static final int new_conversation_search=0x7f0a0003; + public static final int phone_contacts=0x7f0a0006; + public static final int phone_contacts_header=0x7f0a0005; + public static final int scrollView1=0x7f0a0004; + public static final int selected_conversation=0x7f0a0002; + public static final int slidingpanelayout=0x7f0a0000; + public static final int textView1=0x7f0a0017; + public static final int textsend=0x7f0a0014; + public static final int thumbnail=0x7f0a000f; + } + public static final class layout { + public static final int activity_conversations=0x7f030000; + public static final int activity_new_conversation=0x7f030001; + public static final int contact=0x7f030002; + public static final int conversation_list_row=0x7f030003; + public static final int frament_conversation=0x7f030004; + } + public static final class menu { + public static final int conversations=0x7f090000; + } + public static final class string { + public static final int action_accounts=0x7f070003; + public static final int action_add=0x7f070002; + public static final int action_archive=0x7f070004; + public static final int action_details=0x7f070005; + public static final int action_secure=0x7f070006; + public static final int action_settings=0x7f070001; + public static final int app_name=0x7f070000; + public static final int hello_world=0x7f070008; + public static final int title_activity_new_conversation=0x7f070007; + } + public static final class style { + /** + Base application theme, dependent on API level. This theme is replaced + by AppBaseTheme from res/values-vXX/styles.xml on newer devices. + + + Theme customizations available in newer API levels can go in + res/values-vXX/styles.xml, while customizations related to + backward-compatibility can go here. + + + Base application theme for API 11+. This theme completely replaces + AppBaseTheme from res/values/styles.xml on API 11+ devices. + + API 11 theme customizations can go here. + + Base application theme for API 14+. This theme completely replaces + AppBaseTheme from BOTH res/values/styles.xml and + res/values-v11/styles.xml on API 14+ devices. + + API 14 theme customizations can go here. + */ + public static final int AppBaseTheme=0x7f080000; + /** Application theme. + All customizations that are NOT specific to a particular API-level can go here. + */ + public static final int AppTheme=0x7f080001; + public static final int Divider=0x7f080003; + public static final int sectionHeader=0x7f080002; + } + public static final class xml { + public static final int preferences=0x7f040000; + } +} diff --git a/ic_launcher-web.png b/ic_launcher-web.png new file mode 100644 index 0000000000000000000000000000000000000000..8e26a93105349c0f78c3142c60854c146bc53112 Binary files /dev/null and b/ic_launcher-web.png differ diff --git a/ic_profile-web.png b/ic_profile-web.png new file mode 100644 index 0000000000000000000000000000000000000000..c0c6ca8f6c1b05aa970fe8ddfe14b87a61bd0dd3 Binary files /dev/null and b/ic_profile-web.png differ diff --git a/libs/android-support-v4.jar b/libs/android-support-v4.jar new file mode 100644 index 0000000000000000000000000000000000000000..9056828a04daaded875fbfaa106cf3e2305fe386 Binary files /dev/null and b/libs/android-support-v4.jar differ diff --git a/proguard-project.txt b/proguard-project.txt new file mode 100644 index 0000000000000000000000000000000000000000..f2fe1559a217865a5454add526dcc446f892385b --- /dev/null +++ b/proguard-project.txt @@ -0,0 +1,20 @@ +# To enable ProGuard in your project, edit project.properties +# to define the proguard.config property as described in that file. +# +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in ${sdk.dir}/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the ProGuard +# include property in project.properties. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} diff --git a/project.properties b/project.properties new file mode 100644 index 0000000000000000000000000000000000000000..4ab125693c7c484a0252ee7eca9616e0f9b1ac67 --- /dev/null +++ b/project.properties @@ -0,0 +1,14 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system edit +# "ant.properties", and override values to adapt the script to your +# project structure. +# +# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): +#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt + +# Project target. +target=android-19 diff --git a/res/drawable-hdpi/es_slidingpane_shadow.xml b/res/drawable-hdpi/es_slidingpane_shadow.xml new file mode 100644 index 0000000000000000000000000000000000000000..eaca7894e7147885f92df2df429f86e369aa94c9 --- /dev/null +++ b/res/drawable-hdpi/es_slidingpane_shadow.xml @@ -0,0 +1,8 @@ + + + + + \ No newline at end of file diff --git a/res/drawable-hdpi/ic_action_add.png b/res/drawable-hdpi/ic_action_add.png new file mode 100644 index 0000000000000000000000000000000000000000..aa7cf4f2c36c674a10fe46e3aaa5d64d27c6e9df Binary files /dev/null and b/res/drawable-hdpi/ic_action_add.png differ diff --git a/res/drawable-hdpi/ic_action_send.png b/res/drawable-hdpi/ic_action_send.png new file mode 100644 index 0000000000000000000000000000000000000000..6384a4eeca9ea50549697355ded549f826a768a2 Binary files /dev/null and b/res/drawable-hdpi/ic_action_send.png differ diff --git a/res/drawable-hdpi/ic_action_send_now.png b/res/drawable-hdpi/ic_action_send_now.png new file mode 100644 index 0000000000000000000000000000000000000000..ff0e369ee4e77c759668f484b413bd8bbadabd7e Binary files /dev/null and b/res/drawable-hdpi/ic_action_send_now.png differ diff --git a/res/drawable-hdpi/ic_action_unsecure.png b/res/drawable-hdpi/ic_action_unsecure.png new file mode 100644 index 0000000000000000000000000000000000000000..b9f442d572af0b2342953a3f66dd1f9b22a15b24 Binary files /dev/null and b/res/drawable-hdpi/ic_action_unsecure.png differ diff --git a/res/drawable-hdpi/ic_launcher.png b/res/drawable-hdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..3125b12dd7e2cb9e74a7dfe1733b41c8b4a72743 Binary files /dev/null and b/res/drawable-hdpi/ic_launcher.png differ diff --git a/res/drawable-hdpi/ic_profile.png b/res/drawable-hdpi/ic_profile.png new file mode 100644 index 0000000000000000000000000000000000000000..3f071dec701a84652142d3483d2b230f771af5ac Binary files /dev/null and b/res/drawable-hdpi/ic_profile.png differ diff --git a/res/drawable-mdpi/es_slidingpane_shadow.xml b/res/drawable-mdpi/es_slidingpane_shadow.xml new file mode 100644 index 0000000000000000000000000000000000000000..eaca7894e7147885f92df2df429f86e369aa94c9 --- /dev/null +++ b/res/drawable-mdpi/es_slidingpane_shadow.xml @@ -0,0 +1,8 @@ + + + + + \ No newline at end of file diff --git a/res/drawable-mdpi/ic_action_add.png b/res/drawable-mdpi/ic_action_add.png new file mode 100644 index 0000000000000000000000000000000000000000..99b189a0c9bd69292549627a26f2a16ac40e0bd9 Binary files /dev/null and b/res/drawable-mdpi/ic_action_add.png differ diff --git a/res/drawable-mdpi/ic_action_send.png b/res/drawable-mdpi/ic_action_send.png new file mode 100644 index 0000000000000000000000000000000000000000..4552ae6db959d9cc4565b54c3c301be30520c40a Binary files /dev/null and b/res/drawable-mdpi/ic_action_send.png differ diff --git a/res/drawable-mdpi/ic_action_unsecure.png b/res/drawable-mdpi/ic_action_unsecure.png new file mode 100644 index 0000000000000000000000000000000000000000..84072abd93e691aea6a9daead6896c8eecfc1521 Binary files /dev/null and b/res/drawable-mdpi/ic_action_unsecure.png differ diff --git a/res/drawable-mdpi/ic_launcher.png b/res/drawable-mdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..b3c9a5e105a83540870092f7fa5605fe1b8dc729 Binary files /dev/null and b/res/drawable-mdpi/ic_launcher.png differ diff --git a/res/drawable-mdpi/ic_profile.png b/res/drawable-mdpi/ic_profile.png new file mode 100644 index 0000000000000000000000000000000000000000..0d056c7ccb28ea462a8999b54eabfecd81579183 Binary files /dev/null and b/res/drawable-mdpi/ic_profile.png differ diff --git a/res/drawable-xhdpi/es_slidingpane_shadow.xml b/res/drawable-xhdpi/es_slidingpane_shadow.xml new file mode 100644 index 0000000000000000000000000000000000000000..cc711819ed89b36d328b35fa427c1d8960f50f97 --- /dev/null +++ b/res/drawable-xhdpi/es_slidingpane_shadow.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/res/drawable-xhdpi/ic_action_add.png b/res/drawable-xhdpi/ic_action_add.png new file mode 100644 index 0000000000000000000000000000000000000000..9d6af042327a42ea1fe2adc96a25f40d1826b524 Binary files /dev/null and b/res/drawable-xhdpi/ic_action_add.png differ diff --git a/res/drawable-xhdpi/ic_action_send.png b/res/drawable-xhdpi/ic_action_send.png new file mode 100644 index 0000000000000000000000000000000000000000..652ac68d089a773a5cec709cc6e36dd284769d2b Binary files /dev/null and b/res/drawable-xhdpi/ic_action_send.png differ diff --git a/res/drawable-xhdpi/ic_action_send_now.png b/res/drawable-xhdpi/ic_action_send_now.png new file mode 100644 index 0000000000000000000000000000000000000000..373dde239e0ebd7e9935ae186473c955cfce9081 Binary files /dev/null and b/res/drawable-xhdpi/ic_action_send_now.png differ diff --git a/res/drawable-xhdpi/ic_action_unsecure.png b/res/drawable-xhdpi/ic_action_unsecure.png new file mode 100644 index 0000000000000000000000000000000000000000..96b128f2c1856cb83d7cc4a75f46a83212890e0c Binary files /dev/null and b/res/drawable-xhdpi/ic_action_unsecure.png differ diff --git a/res/drawable-xhdpi/ic_launcher.png b/res/drawable-xhdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..5ef36c2f15865ff33a63b5b9388e26c19a764275 Binary files /dev/null and b/res/drawable-xhdpi/ic_launcher.png differ diff --git a/res/drawable-xhdpi/ic_profile.png b/res/drawable-xhdpi/ic_profile.png new file mode 100644 index 0000000000000000000000000000000000000000..88a82cf09dd28ff333f090bb9c70eea6e5587db7 Binary files /dev/null and b/res/drawable-xhdpi/ic_profile.png differ diff --git a/res/drawable-xhdpi/section_header.xml b/res/drawable-xhdpi/section_header.xml new file mode 100644 index 0000000000000000000000000000000000000000..25f148ce20099388166d3d3dd05fab406310e738 --- /dev/null +++ b/res/drawable-xhdpi/section_header.xml @@ -0,0 +1,10 @@ + + + + + + + \ No newline at end of file diff --git a/res/drawable-xxhdpi/es_slidingpane_shadow.xml b/res/drawable-xxhdpi/es_slidingpane_shadow.xml new file mode 100644 index 0000000000000000000000000000000000000000..eaca7894e7147885f92df2df429f86e369aa94c9 --- /dev/null +++ b/res/drawable-xxhdpi/es_slidingpane_shadow.xml @@ -0,0 +1,8 @@ + + + + + \ No newline at end of file diff --git a/res/drawable-xxhdpi/ic_launcher.png b/res/drawable-xxhdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..9dbbdd9713a9a9fbb333072d33334dfcd3c23a74 Binary files /dev/null and b/res/drawable-xxhdpi/ic_launcher.png differ diff --git a/res/drawable-xxhdpi/ic_profile.png b/res/drawable-xxhdpi/ic_profile.png new file mode 100644 index 0000000000000000000000000000000000000000..309dc51386e829580d61b203031a5e2540078104 Binary files /dev/null and b/res/drawable-xxhdpi/ic_profile.png differ diff --git a/res/layout/activity_conversations.xml b/res/layout/activity_conversations.xml new file mode 100644 index 0000000000000000000000000000000000000000..ae60de40a582849924ed33225a45096a65a9e2ca --- /dev/null +++ b/res/layout/activity_conversations.xml @@ -0,0 +1,29 @@ + + + + + + + + + \ No newline at end of file diff --git a/res/layout/activity_new_conversation.xml b/res/layout/activity_new_conversation.xml new file mode 100644 index 0000000000000000000000000000000000000000..688367616fd54b2201a24479ff6cfe6e520a0735 --- /dev/null +++ b/res/layout/activity_new_conversation.xml @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/res/layout/contact.xml b/res/layout/contact.xml new file mode 100644 index 0000000000000000000000000000000000000000..1b11f0fc5a5e70ec040befa5512cec7f447565ef --- /dev/null +++ b/res/layout/contact.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/res/layout/conversation_list_row.xml b/res/layout/conversation_list_row.xml new file mode 100644 index 0000000000000000000000000000000000000000..5b3959c386d57636d458816e7862ee0b27303a9b --- /dev/null +++ b/res/layout/conversation_list_row.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/res/layout/frament_conversation.xml b/res/layout/frament_conversation.xml new file mode 100644 index 0000000000000000000000000000000000000000..02fe1f9030a93989070eee5699193b57c661a788 --- /dev/null +++ b/res/layout/frament_conversation.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/res/menu/conversations.xml b/res/menu/conversations.xml new file mode 100644 index 0000000000000000000000000000000000000000..39c36a5332f20ce42fd0f0474fa77cf2ba5a9e0d --- /dev/null +++ b/res/menu/conversations.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + diff --git a/res/values-sw600dp/dimens.xml b/res/values-sw600dp/dimens.xml new file mode 100644 index 0000000000000000000000000000000000000000..44f01db75f0fef18081132a9e86517f8d5efa8f6 --- /dev/null +++ b/res/values-sw600dp/dimens.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/res/values-sw720dp-land/dimens.xml b/res/values-sw720dp-land/dimens.xml new file mode 100644 index 0000000000000000000000000000000000000000..61e3fa8fbca01c469f05fb488bdb8f5ffdb9da3c --- /dev/null +++ b/res/values-sw720dp-land/dimens.xml @@ -0,0 +1,9 @@ + + + + 128dp + + diff --git a/res/values-v11/styles.xml b/res/values-v11/styles.xml new file mode 100644 index 0000000000000000000000000000000000000000..3c02242ad044be9b8c7c09e7c90c5d427763fe97 --- /dev/null +++ b/res/values-v11/styles.xml @@ -0,0 +1,11 @@ + + + + + + diff --git a/res/values-v14/styles.xml b/res/values-v14/styles.xml new file mode 100644 index 0000000000000000000000000000000000000000..a91fd0372b20f85e284fc2fa2ce949176dfdf6e5 --- /dev/null +++ b/res/values-v14/styles.xml @@ -0,0 +1,12 @@ + + + + + + diff --git a/res/values/arrays.xml b/res/values/arrays.xml new file mode 100644 index 0000000000000000000000000000000000000000..592007ba4bafc1d34bb182a0c3f263c3e5dcff9f --- /dev/null +++ b/res/values/arrays.xml @@ -0,0 +1,13 @@ + + + + None + OpenPGP + Off the record + + + none + pgp + otr + + diff --git a/res/values/dimens.xml b/res/values/dimens.xml new file mode 100644 index 0000000000000000000000000000000000000000..55c1e5908c7e0f157fe815acd6d5cd7358463390 --- /dev/null +++ b/res/values/dimens.xml @@ -0,0 +1,7 @@ + + + + 16dp + 16dp + + diff --git a/res/values/strings.xml b/res/values/strings.xml new file mode 100644 index 0000000000000000000000000000000000000000..053dfa5c1cbdb1b6a27a77014aa4df87b6a043fe --- /dev/null +++ b/res/values/strings.xml @@ -0,0 +1,14 @@ + + + + Secure Conversations + Settings + New conversation + Manage accounts + Archive + Show details + Secure conversation + New Conversation + Hello world! + + diff --git a/res/values/styles.xml b/res/values/styles.xml new file mode 100644 index 0000000000000000000000000000000000000000..31b2823f9fbba131c4be28d847a79e9d9c5aa8c2 --- /dev/null +++ b/res/values/styles.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + diff --git a/res/xml/preferences.xml b/res/xml/preferences.xml new file mode 100644 index 0000000000000000000000000000000000000000..696978debd4ba7c8a3c0fcc8bbc66580cca75698 --- /dev/null +++ b/res/xml/preferences.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + diff --git a/src/de/gultsch/chat/Contact.java b/src/de/gultsch/chat/Contact.java new file mode 100644 index 0000000000000000000000000000000000000000..64204461643580a436404f296f58363d130a2014 --- /dev/null +++ b/src/de/gultsch/chat/Contact.java @@ -0,0 +1,35 @@ +package de.gultsch.chat; + +import java.io.Serializable; + +import android.net.Uri; + +public class Contact implements Serializable { + private static final long serialVersionUID = -4570817093119419962L; + protected String display_name; + protected String jid; + protected String photo; + + public Contact(String display_name, String jid, String photo) { + this.display_name = display_name; + this.jid = jid; + this.photo = photo; + } + + public String getDisplayName() { + return this.display_name; + } + + public Uri getProfilePhoto() { + if (photo == null) return null; + return Uri.parse(photo); + } + + public String getJid() { + return this.jid; + } + + public boolean match(String needle) { + return (jid.toLowerCase().contains(needle.toLowerCase()) || (display_name.toLowerCase().contains(needle.toLowerCase()))); + } +} diff --git a/src/de/gultsch/chat/Conversation.java b/src/de/gultsch/chat/Conversation.java new file mode 100644 index 0000000000000000000000000000000000000000..cec96a3550cbad2ce53ef5763047a2a1158a2c42 --- /dev/null +++ b/src/de/gultsch/chat/Conversation.java @@ -0,0 +1,21 @@ +package de.gultsch.chat; + +import java.util.ArrayList; + + +public class Conversation { + private String name; + private ArrayList msgs = new ArrayList(); + + public Conversation(String name) { + this.name = name; + } + + public ArrayList getLastMessages(int count, int offset) { + msgs.add(new Message("this is my last message")); + return msgs; + } + public String getName() { + return this.name; + } +} diff --git a/src/de/gultsch/chat/ConversationCursor.java b/src/de/gultsch/chat/ConversationCursor.java new file mode 100644 index 0000000000000000000000000000000000000000..1ce431b48d481b0d5a3d512a8c32aeab7bb82e99 --- /dev/null +++ b/src/de/gultsch/chat/ConversationCursor.java @@ -0,0 +1,94 @@ +package de.gultsch.chat; + + +import java.util.ArrayList; + + +import android.database.AbstractCursor; + +public class ConversationCursor extends AbstractCursor { + + + protected ConversationList conversations; + + public static final String NAME = "conversationname"; + public static final String LAST_MSG = "lastmsg"; + public static final String DATE = "date"; + public static final String ID = "_id"; + + public ConversationCursor(ConversationList list) { + super(); + this.conversations = list; + } + + public ArrayList getConversationOverview() { + return this.conversations; + } + + public void setConversationOverview(ConversationList list) { + this.conversations = list; + } + + @Override + public String[] getColumnNames() { + return new String[]{ID,NAME,LAST_MSG,DATE}; + } + + @Override + public int getCount() { + return conversations.size(); + } + + @Override + public double getDouble(int column) { + // TODO Auto-generated method stub + return 0; + } + + @Override + public float getFloat(int column) { + // TODO Auto-generated method stub + return 0; + } + + @Override + public int getInt(int column) { + // TODO Auto-generated method stub + return 0; + } + + @Override + public long getLong(int column) { + // TODO Auto-generated method stub + return 0; + } + + @Override + public short getShort(int column) { + // TODO Auto-generated method stub + return 0; + } + + @Override + public String getString(int column) { + Conversation conversation = conversations.get(getPosition()); + Message lastMessage = conversation.getLastMessages(1,0).get(0); + switch (column) { + case 1: + return conversation.getName(); + case 2: + return lastMessage.toString(); + case 3: + return lastMessage.getTimeReadable(); + default: + return null; + } + } + + @Override + public boolean isNull(int column) { + // TODO Auto-generated method stub + return false; + } + +} \ No newline at end of file diff --git a/src/de/gultsch/chat/ConversationList.java b/src/de/gultsch/chat/ConversationList.java new file mode 100644 index 0000000000000000000000000000000000000000..b043f61a7c55e33bfdd646354fe8b32cb3bc9862 --- /dev/null +++ b/src/de/gultsch/chat/ConversationList.java @@ -0,0 +1,41 @@ +package de.gultsch.chat; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; + +public class ConversationList extends ArrayList { + + private static final long serialVersionUID = 3661496589984289968L; + + private int selectedConversationPosition = -1; + + private ConversationCursor cursor = new ConversationCursor(this); + + public ConversationCursor getCursor() { + return this.cursor; + } + + public Conversation getSelectedConversation() { + return this.get(this.selectedConversationPosition); + } + + public void setSelectedConversationPosition(int selectedConversation) { + this.selectedConversationPosition = selectedConversation; + } + + public void sort() { + Conversation selectedConversation = this.get(selectedConversationPosition); + //sort this + Collections.sort(this, new Comparator() { + + @Override + public int compare(Conversation lhs, Conversation rhs) { + // TODO Auto-generated method stub + return 0; + } + }); + + this.selectedConversationPosition = this.indexOf(selectedConversation); + } +} diff --git a/src/de/gultsch/chat/Message.java b/src/de/gultsch/chat/Message.java new file mode 100644 index 0000000000000000000000000000000000000000..b4e5e7ca54f86438c4338c234d893db9ed7052e8 --- /dev/null +++ b/src/de/gultsch/chat/Message.java @@ -0,0 +1,19 @@ +package de.gultsch.chat; + +public class Message { + + String msg; + + public Message(String msg) { + this.msg = msg; + } + + public String toString() { + return msg; + } + + public String getTimeReadable() { + return "2 min"; + } + +} diff --git a/src/de/gultsch/chat/services/XmppConnectionService.java b/src/de/gultsch/chat/services/XmppConnectionService.java new file mode 100644 index 0000000000000000000000000000000000000000..4477513d33e4a50c59077fa9e78ddb2fa96683a6 --- /dev/null +++ b/src/de/gultsch/chat/services/XmppConnectionService.java @@ -0,0 +1,29 @@ +package de.gultsch.chat.services; + +import android.app.Service; +import android.content.Intent; +import android.os.Binder; +import android.os.IBinder; + +public class XmppConnectionService extends Service { + + // Binder given to clients + private final IBinder mBinder = new XmppConnectionBinder(); + + /** + * Class used for the client Binder. Because we know this service always + * runs in the same process as its clients, we don't need to deal with IPC. + */ + public class XmppConnectionBinder extends Binder { + XmppConnectionService getService() { + // Return this instance of LocalService so clients can call public methods + return XmppConnectionService.this; + } + } + + @Override + public IBinder onBind(Intent intent) { + return mBinder; + } + +} diff --git a/src/de/gultsch/chat/ui/ConversationActivity.java b/src/de/gultsch/chat/ui/ConversationActivity.java new file mode 100644 index 0000000000000000000000000000000000000000..446a0c976636dd542ed998804c932a2f855e5db0 --- /dev/null +++ b/src/de/gultsch/chat/ui/ConversationActivity.java @@ -0,0 +1,161 @@ +package de.gultsch.chat.ui; + +import java.util.HashMap; + +import de.gultsch.chat.Contact; +import de.gultsch.chat.Conversation; +import de.gultsch.chat.ConversationCursor; +import de.gultsch.chat.ConversationList; +import de.gultsch.chat.R; +import de.gultsch.chat.R.id; +import android.os.Bundle; +import android.app.Activity; +import android.app.FragmentTransaction; +import android.content.Context; +import android.content.Intent; +import android.support.v4.widget.SlidingPaneLayout; +import android.support.v4.widget.SlidingPaneLayout.PanelSlideListener; +import android.util.Log; +import android.view.Menu; +import android.view.MenuItem; +import android.view.View; +import android.view.inputmethod.InputMethodManager; +import android.widget.AdapterView; +import android.widget.AdapterView.OnItemClickListener; +import android.widget.ListView; +import android.widget.SimpleCursorAdapter; + +public class ConversationActivity extends Activity { + + public static final String START_CONVERSATION = "startconversation"; + public static final String CONVERSATION_CONTACT = "conversationcontact"; + + protected SlidingPaneLayout spl; + + protected HashMap conversationFragments = new HashMap(); + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_conversations); + + final ConversationList conversationList = new ConversationList(); + + if (getIntent().getAction().equals(Intent.ACTION_VIEW)) { + if (getIntent().getType().equals(ConversationActivity.START_CONVERSATION)) { + Contact contact = (Contact) getIntent().getExtras().get(ConversationActivity.CONVERSATION_CONTACT); + Log.d("gultsch","start conversation with "+contact.getDisplayName()); + conversationList.add(new Conversation(contact.getDisplayName())); + } + } + String[] fromColumns = {ConversationCursor.NAME, + ConversationCursor.LAST_MSG}; + int[] toViews = {R.id.conversation_name, R.id.conversation_lastmsg}; + + final SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,R.layout.conversation_list_row, conversationList.getCursor(), fromColumns, toViews,0); + final ListView listView = (ListView) findViewById(R.id.list); + listView.setAdapter(adapter); + + listView.setOnItemClickListener(new OnItemClickListener() { + + @Override + public void onItemClick(AdapterView arg0, View clickedView, int position, + long arg3) { + conversationList.setSelectedConversationPosition(position); + swapConversationFragment(conversationList); + getActionBar().setTitle(conversationList.getSelectedConversation().getName()); + spl.closePane(); + } + }); + spl = (SlidingPaneLayout) findViewById(id.slidingpanelayout); + spl.setParallaxDistance(150); + spl.openPane(); + spl.setShadowResource(R.drawable.es_slidingpane_shadow); + spl.setSliderFadeColor(0); + spl.setPanelSlideListener(new PanelSlideListener() { + @Override + public void onPanelOpened(View arg0) { + getActionBar().setDisplayHomeAsUpEnabled(false); + getActionBar().setTitle(R.string.app_name); + invalidateOptionsMenu(); + + InputMethodManager inputManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); + + inputManager.hideSoftInputFromWindow( + getCurrentFocus().getWindowToken(), + InputMethodManager.HIDE_NOT_ALWAYS); + listView.requestFocus(); + } + + @Override + public void onPanelClosed(View arg0) { + getActionBar().setDisplayHomeAsUpEnabled(true); + getActionBar().setTitle(conversationList.getSelectedConversation().getName()); + invalidateOptionsMenu(); + + } + + @Override + public void onPanelSlide(View arg0, float arg1) { + // TODO Auto-generated method stub + + } + }); + if (conversationList.size() >= 1) { + conversationList.setSelectedConversationPosition(0); + swapConversationFragment(conversationList); + } else { + //start new conversation activity + } + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + // Inflate the menu; this adds items to the action bar if it is present. + getMenuInflater().inflate(R.menu.conversations, menu); + + if (spl.isOpen()) { + ((MenuItem) menu.findItem(R.id.action_archive)).setVisible(false); + ((MenuItem) menu.findItem(R.id.action_details)).setVisible(false); + ((MenuItem) menu.findItem(R.id.action_security)).setVisible(false); + } else { + ((MenuItem) menu.findItem(R.id.action_add)).setVisible(false); + } + return true; + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + switch(item.getItemId()) { + case android.R.id.home: + spl.openPane(); + break; + case R.id.action_settings: + startActivity(new Intent(this, SettingsActivity.class)); + break; + case R.id.action_accounts: + startActivity(new Intent(this, ManageAccountActivity.class)); + break; + case R.id.action_add: + startActivity(new Intent(this, NewConversationActivity.class)); + default: + break; + } + return super.onOptionsItemSelected(item); + } + + protected void swapConversationFragment( + final ConversationList conversationList) { + ConversationFragment selectedFragment; + if (conversationFragments.containsKey(conversationList.getSelectedConversation())) { + selectedFragment = conversationFragments.get(conversationList.getSelectedConversation()); + } else { + selectedFragment = new ConversationFragment(); + conversationFragments.put(conversationList.getSelectedConversation(), selectedFragment); + } + FragmentTransaction transaction = getFragmentManager().beginTransaction(); + transaction.replace(R.id.selected_conversation, selectedFragment); + transaction.commit(); + } + +} diff --git a/src/de/gultsch/chat/ui/ConversationFragment.java b/src/de/gultsch/chat/ui/ConversationFragment.java new file mode 100644 index 0000000000000000000000000000000000000000..0f6191768ea390b7508c9bdffaf690d7b231ab64 --- /dev/null +++ b/src/de/gultsch/chat/ui/ConversationFragment.java @@ -0,0 +1,18 @@ +package de.gultsch.chat.ui; + +import de.gultsch.chat.R; +import android.app.Fragment; +import android.os.Bundle; +import android.util.Log; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.EditText; + +public class ConversationFragment extends Fragment { + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + return inflater.inflate(R.layout.frament_conversation, container, false); + } +} diff --git a/src/de/gultsch/chat/ui/ManageAccountActivity.java b/src/de/gultsch/chat/ui/ManageAccountActivity.java new file mode 100644 index 0000000000000000000000000000000000000000..741f60c3791afae9bab1af41da7c470661e864bf --- /dev/null +++ b/src/de/gultsch/chat/ui/ManageAccountActivity.java @@ -0,0 +1,7 @@ +package de.gultsch.chat.ui; + +import android.app.Activity; + +public class ManageAccountActivity extends Activity { + +} diff --git a/src/de/gultsch/chat/ui/NewConversationActivity.java b/src/de/gultsch/chat/ui/NewConversationActivity.java new file mode 100644 index 0000000000000000000000000000000000000000..261f0ebf7a3eff3bff7bec39115e0496f6467114 --- /dev/null +++ b/src/de/gultsch/chat/ui/NewConversationActivity.java @@ -0,0 +1,197 @@ +package de.gultsch.chat.ui; + +import java.util.LinkedHashMap; +import java.util.Map.Entry; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import de.gultsch.chat.Contact; +import de.gultsch.chat.R; +import android.os.Bundle; +import android.provider.ContactsContract; +import android.text.Editable; +import android.text.TextWatcher; +import android.util.Log; +import android.view.LayoutInflater; +import android.view.View; +import android.view.View.OnClickListener; +import android.widget.LinearLayout; +import android.widget.TextView; +import android.widget.ImageView; +import android.app.Activity; +import android.content.Context; +import android.content.CursorLoader; +import android.content.Intent; +import android.content.Loader; +import android.content.Loader.OnLoadCompleteListener; +import android.database.Cursor; + +public class NewConversationActivity extends Activity { + + final protected LinkedHashMap availablePhoneContacts = new LinkedHashMap(); + final protected LinkedHashMap availableJabberContacts = new LinkedHashMap(); + protected View newContactView; + protected Contact newContact; + + public static final Pattern VALID_JID = + Pattern.compile("^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,6}$", Pattern.CASE_INSENSITIVE); + + static final String[] PROJECTION = new String[] { + ContactsContract.Data.CONTACT_ID, + ContactsContract.Data.DISPLAY_NAME, + ContactsContract.Data.PHOTO_THUMBNAIL_URI, + ContactsContract.CommonDataKinds.Im.DATA }; + + // This is the select criteria + static final String SELECTION = "(" + ContactsContract.Data.MIMETYPE + + "=\"" + ContactsContract.CommonDataKinds.Im.CONTENT_ITEM_TYPE + + "\") AND (" + ContactsContract.CommonDataKinds.Im.PROTOCOL + + "=\"" + ContactsContract.CommonDataKinds.Im.PROTOCOL_JABBER + + "\")"; + + protected View getViewForContact(Contact contact) { + LayoutInflater inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE); + View view = (View) inflater.inflate(R.layout.contact,null); + ((TextView) view.findViewById(R.id.contact_display_name)).setText(contact.getDisplayName()); + ((TextView) view.findViewById(R.id.contact_jid)).setText(contact.getJid()); + if (contact.getProfilePhoto() != null) { + ((ImageView) view.findViewById(R.id.contact_photo)).setImageURI(contact.getProfilePhoto()); + } + view.setOnClickListener(new OnClickListener() { + + @Override + public void onClick(View v) { + Contact clickedContact = null; + for(Entry entry : availablePhoneContacts.entrySet()) { + if (entry.getValue() == v) { + clickedContact = entry.getKey(); + break; + } + } + for(Entry entry : availableJabberContacts.entrySet()) { + if (entry.getValue() == v) { + clickedContact = entry.getKey(); + break; + } + } + if (newContactView==v) { + clickedContact = newContact; + } + Log.d("gultsch","clicked on "+clickedContact.getDisplayName()); + Intent startConversationIntent = new Intent(v.getContext(),ConversationActivity.class); + startConversationIntent.setAction(Intent.ACTION_VIEW); + startConversationIntent.putExtra(ConversationActivity.CONVERSATION_CONTACT, clickedContact); + startConversationIntent.setType(ConversationActivity.START_CONVERSATION); + startActivity(startConversationIntent); + } + }); + return view; + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_new_conversation); + CursorLoader mCursorLoader = new CursorLoader(this, + ContactsContract.Data.CONTENT_URI, PROJECTION, SELECTION, null, + null); + mCursorLoader.registerListener(0, new OnLoadCompleteListener() { + + @Override + public void onLoadComplete(Loader arg0, Cursor cursor) { + while (cursor.moveToNext()) { + Contact contact = new Contact( + cursor.getString(cursor + .getColumnIndex(ContactsContract.Data.DISPLAY_NAME)), + cursor.getString(cursor + .getColumnIndex(ContactsContract.CommonDataKinds.Im.DATA)), + cursor.getString(cursor + .getColumnIndex(ContactsContract.Data.PHOTO_THUMBNAIL_URI))); + View contactView = getViewForContact(contact); + availablePhoneContacts.put(contact, getViewForContact(contact)); + ((LinearLayout) findViewById(R.id.phone_contacts)).addView(contactView); + } + updateAvailableContacts(); + } + }); + mCursorLoader.startLoading(); + + ((TextView) findViewById(R.id.new_conversation_search)).addTextChangedListener(new TextWatcher() { + + @Override + public void onTextChanged(CharSequence s, int start, int before, int count) { + updateAvailableContacts(); + } + + @Override + public void afterTextChanged(Editable s) { + // TODO Auto-generated method stub + + } + + @Override + public void beforeTextChanged(CharSequence s, int start, int count, + int after) { + // TODO Auto-generated method stub + + } + }); + + } + + protected void updateAvailableContacts() { + String search = ((TextView) findViewById(R.id.new_conversation_search)).getText().toString(); + + LinearLayout phoneContacts = (LinearLayout) findViewById(R.id.phone_contacts); + filterAvailableContacts(phoneContacts,this.availablePhoneContacts,search); + + if (phoneContacts.getChildCount() == 0) { + findViewById(R.id.phone_contacts_header).setVisibility(View.GONE); + } else { + findViewById(R.id.phone_contacts_header).setVisibility(View.VISIBLE); + } + + LinearLayout jabberContacts = (LinearLayout) findViewById(R.id.jabber_contacts); + filterAvailableContacts(jabberContacts,this.availableJabberContacts,search); + if (jabberContacts.getChildCount() == 0) { + findViewById(R.id.jabber_contacts_header).setVisibility(View.GONE); + } else { + findViewById(R.id.jabber_contacts_header).setVisibility(View.VISIBLE); + } + + LinearLayout createNewContact = (LinearLayout) findViewById(R.id.create_new_contact); + Matcher matcher = VALID_JID.matcher(search); + if (matcher.find()) { + createNewContact.removeAllViews(); + String name = search.split("@")[0]; + newContact = new Contact(name,search,null); + newContactView = getViewForContact(newContact); + newContactView.findViewById(R.id.contact_divider).setVisibility(View.GONE); + createNewContact.addView(newContactView); + createNewContact.setVisibility(View.VISIBLE); + ((TextView) findViewById(R.id.new_contact_header)).setVisibility(View.VISIBLE); + } else { + createNewContact.setVisibility(View.GONE); + ((TextView) findViewById(R.id.new_contact_header)).setVisibility(View.GONE); + } + } + + private void filterAvailableContacts( + LinearLayout layout, LinkedHashMap contacts, String search) { + layout.removeAllViews(); + for(Entry entry : contacts.entrySet()) { + + if (entry.getKey().match(search)) { + entry.getValue().setVisibility(View.VISIBLE); + entry.getValue().findViewById(R.id.contact_divider).setVisibility(View.VISIBLE); + layout.addView(entry.getValue()); + } + } + int contactsCount = layout.getChildCount(); + if (contactsCount>=1) { + View lastContact = layout.getChildAt(contactsCount - 1); + lastContact.findViewById(R.id.contact_divider).setVisibility(View.GONE); + } + } +} diff --git a/src/de/gultsch/chat/ui/SettingsActivity.java b/src/de/gultsch/chat/ui/SettingsActivity.java new file mode 100644 index 0000000000000000000000000000000000000000..886c05cca2d86aafacc192d9d8c0472d9a5b08aa --- /dev/null +++ b/src/de/gultsch/chat/ui/SettingsActivity.java @@ -0,0 +1,16 @@ +package de.gultsch.chat.ui; + +import android.app.Activity; +import android.os.Bundle; + +public class SettingsActivity extends Activity { + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + // Display the fragment as the main content. + getFragmentManager().beginTransaction() + .replace(android.R.id.content, new SettingsFragment()).commit(); + } + +} diff --git a/src/de/gultsch/chat/ui/SettingsFragment.java b/src/de/gultsch/chat/ui/SettingsFragment.java new file mode 100644 index 0000000000000000000000000000000000000000..3ca4841afd3430fb3ed59663408228b81fcff1b0 --- /dev/null +++ b/src/de/gultsch/chat/ui/SettingsFragment.java @@ -0,0 +1,15 @@ +package de.gultsch.chat.ui; + +import de.gultsch.chat.R; +import android.os.Bundle; +import android.preference.PreferenceFragment; + +public class SettingsFragment extends PreferenceFragment { + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + // Load the preferences from an XML resource + addPreferencesFromResource(R.xml.preferences); + } +}