Permalink
Please sign in to comment.
Showing
with
1,473 additions
and 0 deletions.
- +9 −0 .classpath
- +33 −0 .project
- +48 −0 AndroidManifest.xml
- +48 −0 bin/AndroidManifest.xml
- BIN bin/SecureConversations.apk
- BIN bin/classes.dex
- BIN bin/classes/de/gultsch/chat/BuildConfig.class
- BIN bin/classes/de/gultsch/chat/Contact.class
- BIN bin/classes/de/gultsch/chat/Conversation.class
- BIN bin/classes/de/gultsch/chat/ConversationCursor.class
- BIN bin/classes/de/gultsch/chat/ConversationList$1.class
- BIN bin/classes/de/gultsch/chat/ConversationList.class
- BIN bin/classes/de/gultsch/chat/Message.class
- BIN bin/classes/de/gultsch/chat/R$array.class
- BIN bin/classes/de/gultsch/chat/R$attr.class
- BIN bin/classes/de/gultsch/chat/R$dimen.class
- BIN bin/classes/de/gultsch/chat/R$drawable.class
- BIN bin/classes/de/gultsch/chat/R$id.class
- BIN bin/classes/de/gultsch/chat/R$layout.class
- BIN bin/classes/de/gultsch/chat/R$menu.class
- BIN bin/classes/de/gultsch/chat/R$string.class
- BIN bin/classes/de/gultsch/chat/R$style.class
- BIN bin/classes/de/gultsch/chat/R$xml.class
- BIN bin/classes/de/gultsch/chat/R.class
- BIN bin/classes/de/gultsch/chat/services/XmppConnectionService$XmppConnectionBinder.class
- BIN bin/classes/de/gultsch/chat/services/XmppConnectionService.class
- BIN bin/classes/de/gultsch/chat/ui/ConversationActivity$1.class
- BIN bin/classes/de/gultsch/chat/ui/ConversationActivity$2.class
- BIN bin/classes/de/gultsch/chat/ui/ConversationActivity.class
- BIN bin/classes/de/gultsch/chat/ui/ConversationFragment.class
- BIN bin/classes/de/gultsch/chat/ui/ManageAccountActivity.class
- BIN bin/classes/de/gultsch/chat/ui/NewConversationActivity$1.class
- BIN bin/classes/de/gultsch/chat/ui/NewConversationActivity$2.class
- BIN bin/classes/de/gultsch/chat/ui/NewConversationActivity$3.class
- BIN bin/classes/de/gultsch/chat/ui/NewConversationActivity.class
- BIN bin/classes/de/gultsch/chat/ui/SettingsActivity.class
- BIN bin/classes/de/gultsch/chat/ui/SettingsFragment.class
- BIN bin/dexedLibs/android-support-v4-6dc474cfe2b92e991d4a9010169faf31.jar
- BIN bin/dexedLibs/android-support-v4-84d310e21a82b69cbcd4bdc6eebebae6.jar
- +3 −0 bin/jarlist.cache
- BIN bin/res/crunch/drawable-hdpi/ic_action_add.png
- BIN bin/res/crunch/drawable-hdpi/ic_action_send.png
- BIN bin/res/crunch/drawable-hdpi/ic_action_send_now.png
- BIN bin/res/crunch/drawable-hdpi/ic_action_unsecure.png
- BIN bin/res/crunch/drawable-hdpi/ic_launcher.png
- BIN bin/res/crunch/drawable-hdpi/ic_profile.png
- BIN bin/res/crunch/drawable-mdpi/ic_action_add.png
- BIN bin/res/crunch/drawable-mdpi/ic_action_send.png
- BIN bin/res/crunch/drawable-mdpi/ic_action_unsecure.png
- BIN bin/res/crunch/drawable-mdpi/ic_launcher.png
- BIN bin/res/crunch/drawable-mdpi/ic_profile.png
- BIN bin/res/crunch/drawable-xhdpi/ic_action_add.png
- BIN bin/res/crunch/drawable-xhdpi/ic_action_send.png
- BIN bin/res/crunch/drawable-xhdpi/ic_action_send_now.png
- BIN bin/res/crunch/drawable-xhdpi/ic_action_unsecure.png
- BIN bin/res/crunch/drawable-xhdpi/ic_launcher.png
- BIN bin/res/crunch/drawable-xhdpi/ic_profile.png
- BIN bin/res/crunch/drawable-xxhdpi/ic_launcher.png
- BIN bin/res/crunch/drawable-xxhdpi/ic_profile.png
- BIN bin/resources.ap_
- +6 −0 gen/de/gultsch/chat/BuildConfig.java
- +123 −0 gen/de/gultsch/chat/R.java
- BIN ic_launcher-web.png
- BIN ic_profile-web.png
- BIN libs/android-support-v4.jar
- +20 −0 proguard-project.txt
- +14 −0 project.properties
- +8 −0 res/drawable-hdpi/es_slidingpane_shadow.xml
- BIN res/drawable-hdpi/ic_action_add.png
- BIN res/drawable-hdpi/ic_action_send.png
- BIN res/drawable-hdpi/ic_action_send_now.png
- BIN res/drawable-hdpi/ic_action_unsecure.png
- BIN res/drawable-hdpi/ic_launcher.png
- BIN res/drawable-hdpi/ic_profile.png
- +8 −0 res/drawable-mdpi/es_slidingpane_shadow.xml
- BIN res/drawable-mdpi/ic_action_add.png
- BIN res/drawable-mdpi/ic_action_send.png
- BIN res/drawable-mdpi/ic_action_unsecure.png
- BIN res/drawable-mdpi/ic_launcher.png
- BIN res/drawable-mdpi/ic_profile.png
- +7 −0 res/drawable-xhdpi/es_slidingpane_shadow.xml
- BIN res/drawable-xhdpi/ic_action_add.png
- BIN res/drawable-xhdpi/ic_action_send.png
- BIN res/drawable-xhdpi/ic_action_send_now.png
- BIN res/drawable-xhdpi/ic_action_unsecure.png
- BIN res/drawable-xhdpi/ic_launcher.png
- BIN res/drawable-xhdpi/ic_profile.png
- +10 −0 res/drawable-xhdpi/section_header.xml
- +8 −0 res/drawable-xxhdpi/es_slidingpane_shadow.xml
- BIN res/drawable-xxhdpi/ic_launcher.png
- BIN res/drawable-xxhdpi/ic_profile.png
- +29 −0 res/layout/activity_conversations.xml
- +82 −0 res/layout/activity_new_conversation.xml
- +44 −0 res/layout/contact.xml
- +62 −0 res/layout/conversation_list_row.xml
- +64 −0 res/layout/frament_conversation.xml
- +42 −0 res/menu/conversations.xml
- +8 −0 res/values-sw600dp/dimens.xml
- +9 −0 res/values-sw720dp-land/dimens.xml
- +11 −0 res/values-v11/styles.xml
- +12 −0 res/values-v14/styles.xml
- +13 −0 res/values/arrays.xml
- +7 −0 res/values/dimens.xml
- +14 −0 res/values/strings.xml
- +37 −0 res/values/styles.xml
- +41 −0 res/xml/preferences.xml
- +35 −0 src/de/gultsch/chat/Contact.java
- +21 −0 src/de/gultsch/chat/Conversation.java
- +94 −0 src/de/gultsch/chat/ConversationCursor.java
- +41 −0 src/de/gultsch/chat/ConversationList.java
- +19 −0 src/de/gultsch/chat/Message.java
- +29 −0 src/de/gultsch/chat/services/XmppConnectionService.java
- +161 −0 src/de/gultsch/chat/ui/ConversationActivity.java
- +18 −0 src/de/gultsch/chat/ui/ConversationFragment.java
- +7 −0 src/de/gultsch/chat/ui/ManageAccountActivity.java
- +197 −0 src/de/gultsch/chat/ui/NewConversationActivity.java
- +16 −0 src/de/gultsch/chat/ui/SettingsActivity.java
- +15 −0 src/de/gultsch/chat/ui/SettingsFragment.java
9
.classpath
| @@ -0,0 +1,9 @@ | ||
| +<?xml version="1.0" encoding="UTF-8"?> | ||
| +<classpath> | ||
| + <classpathentry kind="src" path="src"/> | ||
| + <classpathentry kind="src" path="gen"/> | ||
| + <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/> | ||
| + <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/> | ||
| + <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/> | ||
| + <classpathentry kind="output" path="bin/classes"/> | ||
| +</classpath> |
33
.project
| @@ -0,0 +1,33 @@ | ||
| +<?xml version="1.0" encoding="UTF-8"?> | ||
| +<projectDescription> | ||
| + <name>SecureConversations</name> | ||
| + <comment></comment> | ||
| + <projects> | ||
| + </projects> | ||
| + <buildSpec> | ||
| + <buildCommand> | ||
| + <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name> | ||
| + <arguments> | ||
| + </arguments> | ||
| + </buildCommand> | ||
| + <buildCommand> | ||
| + <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name> | ||
| + <arguments> | ||
| + </arguments> | ||
| + </buildCommand> | ||
| + <buildCommand> | ||
| + <name>org.eclipse.jdt.core.javabuilder</name> | ||
| + <arguments> | ||
| + </arguments> | ||
| + </buildCommand> | ||
| + <buildCommand> | ||
| + <name>com.android.ide.eclipse.adt.ApkBuilder</name> | ||
| + <arguments> | ||
| + </arguments> | ||
| + </buildCommand> | ||
| + </buildSpec> | ||
| + <natures> | ||
| + <nature>com.android.ide.eclipse.adt.AndroidNature</nature> | ||
| + <nature>org.eclipse.jdt.core.javanature</nature> | ||
| + </natures> | ||
| +</projectDescription> |
48
AndroidManifest.xml
| @@ -0,0 +1,48 @@ | ||
| +<?xml version="1.0" encoding="utf-8"?> | ||
| +<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
| + package="de.gultsch.chat" | ||
| + android:versionCode="1" | ||
| + android:versionName="1.0" > | ||
| + | ||
| + <uses-sdk | ||
| + android:minSdkVersion="14" | ||
| + android:targetSdkVersion="19" /> | ||
| + | ||
| + <uses-permission android:name="android.permission.READ_CONTACTS" /> | ||
| + | ||
| + <application | ||
| + android:allowBackup="true" | ||
| + android:icon="@drawable/ic_launcher" | ||
| + android:label="@string/app_name" | ||
| + android:theme="@android:style/Theme.Holo.Light" > | ||
| + <activity | ||
| + android:name="de.gultsch.chat.ui.ConversationActivity" | ||
| + android:label="Secure Conversations"> | ||
| + <intent-filter> | ||
| + <action android:name="android.intent.action.MAIN" /> | ||
| + | ||
| + <category android:name="android.intent.category.LAUNCHER" /> | ||
| + </intent-filter> | ||
| + </activity> | ||
| + <activity | ||
| + android:name="de.gultsch.chat.ui.SettingsActivity" | ||
| + android:label="Settings" | ||
| + android:parentActivityName="de.gultsch.chat.ui.ConversationActivity" > | ||
| + </activity> | ||
| + <activity | ||
| + android:name="de.gultsch.chat.ui.ManageAccountActivity" | ||
| + android:label="Manage Accounts" | ||
| + android:parentActivityName="de.gultsch.chat.ui.ConversationActivity" > | ||
| + </activity> | ||
| + <activity | ||
| + android:name="de.gultsch.chat.ui.NewConversationActivity" | ||
| + android:label="@string/title_activity_new_conversation" | ||
| + android:parentActivityName="de.gultsch.chat.ui.ConversationActivity" | ||
| + android:windowSoftInputMode="stateHidden"> | ||
| + <meta-data | ||
| + android:name="android.support.PARENT_ACTIVITY" | ||
| + android:value="de.gultsch.chat.ui.ConversationActivity" /> | ||
| + </activity> | ||
| + </application> | ||
| + | ||
| +</manifest> |
48
bin/AndroidManifest.xml
| @@ -0,0 +1,48 @@ | ||
| +<?xml version="1.0" encoding="utf-8"?> | ||
| +<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
| + package="de.gultsch.chat" | ||
| + android:versionCode="1" | ||
| + android:versionName="1.0" > | ||
| + | ||
| + <uses-sdk | ||
| + android:minSdkVersion="14" | ||
| + android:targetSdkVersion="19" /> | ||
| + | ||
| + <uses-permission android:name="android.permission.READ_CONTACTS" /> | ||
| + | ||
| + <application | ||
| + android:allowBackup="true" | ||
| + android:icon="@drawable/ic_launcher" | ||
| + android:label="@string/app_name" | ||
| + android:theme="@android:style/Theme.Holo.Light" > | ||
| + <activity | ||
| + android:name="de.gultsch.chat.ui.ConversationActivity" | ||
| + android:label="Secure Conversations"> | ||
| + <intent-filter> | ||
| + <action android:name="android.intent.action.MAIN" /> | ||
| + | ||
| + <category android:name="android.intent.category.LAUNCHER" /> | ||
| + </intent-filter> | ||
| + </activity> | ||
| + <activity | ||
| + android:name="de.gultsch.chat.ui.SettingsActivity" | ||
| + android:label="Settings" | ||
| + android:parentActivityName="de.gultsch.chat.ui.ConversationActivity" > | ||
| + </activity> | ||
| + <activity | ||
| + android:name="de.gultsch.chat.ui.ManageAccountActivity" | ||
| + android:label="Manage Accounts" | ||
| + android:parentActivityName="de.gultsch.chat.ui.ConversationActivity" > | ||
| + </activity> | ||
| + <activity | ||
| + android:name="de.gultsch.chat.ui.NewConversationActivity" | ||
| + android:label="@string/title_activity_new_conversation" | ||
| + android:parentActivityName="de.gultsch.chat.ui.ConversationActivity" | ||
| + android:windowSoftInputMode="stateHidden"> | ||
| + <meta-data | ||
| + android:name="android.support.PARENT_ACTIVITY" | ||
| + android:value="de.gultsch.chat.ui.ConversationActivity" /> | ||
| + </activity> | ||
| + </application> | ||
| + | ||
| +</manifest> |
BIN
bin/SecureConversations.apk
Binary file not shown
BIN
bin/classes.dex
Binary file not shown
BIN
bin/classes/de/gultsch/chat/BuildConfig.class
Binary file not shown
BIN
bin/classes/de/gultsch/chat/Contact.class
Binary file not shown
BIN
bin/classes/de/gultsch/chat/Conversation.class
Binary file not shown
BIN
bin/classes/de/gultsch/chat/ConversationCursor.class
Binary file not shown
BIN
bin/classes/de/gultsch/chat/ConversationList$1.class
Binary file not shown
BIN
bin/classes/de/gultsch/chat/ConversationList.class
Binary file not shown
BIN
bin/classes/de/gultsch/chat/Message.class
Binary file not shown
BIN
bin/classes/de/gultsch/chat/R$array.class
Binary file not shown
BIN
bin/classes/de/gultsch/chat/R$attr.class
Binary file not shown
BIN
bin/classes/de/gultsch/chat/R$dimen.class
Binary file not shown
BIN
bin/classes/de/gultsch/chat/R$drawable.class
Binary file not shown
BIN
bin/classes/de/gultsch/chat/R$id.class
Binary file not shown
BIN
bin/classes/de/gultsch/chat/R$layout.class
Binary file not shown
BIN
bin/classes/de/gultsch/chat/R$menu.class
Binary file not shown
BIN
bin/classes/de/gultsch/chat/R$string.class
Binary file not shown
BIN
bin/classes/de/gultsch/chat/R$style.class
Binary file not shown
BIN
bin/classes/de/gultsch/chat/R$xml.class
Binary file not shown
BIN
bin/classes/de/gultsch/chat/R.class
Binary file not shown
BIN
bin/classes/de/gultsch/chat/services/XmppConnectionService$XmppConnectionBinder.class
Binary file not shown
BIN
bin/classes/de/gultsch/chat/services/XmppConnectionService.class
Binary file not shown
BIN
bin/classes/de/gultsch/chat/ui/ConversationActivity$1.class
Binary file not shown
BIN
bin/classes/de/gultsch/chat/ui/ConversationActivity$2.class
Binary file not shown
BIN
bin/classes/de/gultsch/chat/ui/ConversationActivity.class
Binary file not shown
BIN
bin/classes/de/gultsch/chat/ui/ConversationFragment.class
Binary file not shown
BIN
bin/classes/de/gultsch/chat/ui/ManageAccountActivity.class
Binary file not shown
BIN
bin/classes/de/gultsch/chat/ui/NewConversationActivity$1.class
Binary file not shown
BIN
bin/classes/de/gultsch/chat/ui/NewConversationActivity$2.class
Binary file not shown
BIN
bin/classes/de/gultsch/chat/ui/NewConversationActivity$3.class
Binary file not shown
BIN
bin/classes/de/gultsch/chat/ui/NewConversationActivity.class
Binary file not shown
BIN
bin/classes/de/gultsch/chat/ui/SettingsActivity.class
Binary file not shown
BIN
bin/classes/de/gultsch/chat/ui/SettingsFragment.class
Binary file not shown
BIN
bin/dexedLibs/android-support-v4-6dc474cfe2b92e991d4a9010169faf31.jar
Binary file not shown
BIN
bin/dexedLibs/android-support-v4-84d310e21a82b69cbcd4bdc6eebebae6.jar
Binary file not shown
3
bin/jarlist.cache
| @@ -0,0 +1,3 @@ | ||
| +# cache for current jar dependency. DO NOT EDIT. | ||
| +# format is <lastModified> <length> <SHA-1> <path> | ||
| +# Encoding is UTF-8 |
BIN
bin/res/crunch/drawable-hdpi/ic_action_add.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN
bin/res/crunch/drawable-hdpi/ic_action_send.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN
bin/res/crunch/drawable-hdpi/ic_action_send_now.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN
bin/res/crunch/drawable-hdpi/ic_action_unsecure.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN
bin/res/crunch/drawable-hdpi/ic_launcher.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN
bin/res/crunch/drawable-hdpi/ic_profile.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN
bin/res/crunch/drawable-mdpi/ic_action_add.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN
bin/res/crunch/drawable-mdpi/ic_action_send.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN
bin/res/crunch/drawable-mdpi/ic_action_unsecure.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN
bin/res/crunch/drawable-mdpi/ic_launcher.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN
bin/res/crunch/drawable-mdpi/ic_profile.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN
bin/res/crunch/drawable-xhdpi/ic_action_add.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN
bin/res/crunch/drawable-xhdpi/ic_action_send.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN
bin/res/crunch/drawable-xhdpi/ic_action_send_now.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN
bin/res/crunch/drawable-xhdpi/ic_action_unsecure.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN
bin/res/crunch/drawable-xhdpi/ic_launcher.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN
bin/res/crunch/drawable-xhdpi/ic_profile.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN
bin/res/crunch/drawable-xxhdpi/ic_launcher.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN
bin/res/crunch/drawable-xxhdpi/ic_profile.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN
bin/resources.ap_
Binary file not shown
6
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; | ||
| +} |
123
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; | ||
| + } | ||
| +} |
BIN
ic_launcher-web.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN
ic_profile-web.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN
libs/android-support-v4.jar
Binary file not shown
20
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 *; | ||
| +#} |
14
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 |
8
res/drawable-hdpi/es_slidingpane_shadow.xml
| @@ -0,0 +1,8 @@ | ||
| +<?xml version="1.0" encoding="utf-8"?> | ||
| +<shape xmlns:android="http://schemas.android.com/apk/res/android" > | ||
| +<gradient | ||
| + android:centerColor="#8B0000" | ||
| + android:endColor="#34FFDD" | ||
| + android:startColor="#FF00FF" /> | ||
| +<size android:width="5.0dp" android:height="0.5dp" /> | ||
| +</shape> |
BIN
res/drawable-hdpi/ic_action_add.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN
res/drawable-hdpi/ic_action_send.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN
res/drawable-hdpi/ic_action_send_now.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN
res/drawable-hdpi/ic_action_unsecure.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN
res/drawable-hdpi/ic_launcher.png
Diff not rendered
BIN
res/drawable-hdpi/ic_profile.png
Diff not rendered
8
res/drawable-mdpi/es_slidingpane_shadow.xml
| @@ -0,0 +1,8 @@ | ||
| +<?xml version="1.0" encoding="utf-8"?> | ||
| +<shape xmlns:android="http://schemas.android.com/apk/res/android" > | ||
| +<gradient | ||
| + android:centerColor="#8B0000" | ||
| + android:endColor="#34FFDD" | ||
| + android:startColor="#FF00FF" /> | ||
| +<size android:width="5.0dp" android:height="0.5dp" /> | ||
| +</shape> |
BIN
res/drawable-mdpi/ic_action_add.png
Diff not rendered
BIN
res/drawable-mdpi/ic_action_send.png
Diff not rendered
BIN
res/drawable-mdpi/ic_action_unsecure.png
Diff not rendered
BIN
res/drawable-mdpi/ic_launcher.png
Diff not rendered
BIN
res/drawable-mdpi/ic_profile.png
Diff not rendered
7
res/drawable-xhdpi/es_slidingpane_shadow.xml
| @@ -0,0 +1,7 @@ | ||
| +<?xml version="1.0" encoding="utf-8"?> | ||
| +<shape xmlns:android="http://schemas.android.com/apk/res/android" > | ||
| +<gradient | ||
| + android:endColor="#cccccc" | ||
| + android:startColor="#f9f9f9" /> | ||
| +<size android:width="3.0dp" android:height="0.5dp" /> | ||
| +</shape> |
BIN
res/drawable-xhdpi/ic_action_add.png
Diff not rendered
BIN
res/drawable-xhdpi/ic_action_send.png
Diff not rendered
BIN
res/drawable-xhdpi/ic_action_send_now.png
Diff not rendered
BIN
res/drawable-xhdpi/ic_action_unsecure.png
Diff not rendered
BIN
res/drawable-xhdpi/ic_launcher.png
Diff not rendered
BIN
res/drawable-xhdpi/ic_profile.png
Diff not rendered
10
res/drawable-xhdpi/section_header.xml
| @@ -0,0 +1,10 @@ | ||
| +<?xml version="1.0" encoding="utf-8"?> | ||
| +<shape xmlns:android="http://schemas.android.com/apk/res/android" | ||
| + android:shape="rectangle" > | ||
| + | ||
| + <size | ||
| + android:height="1.5dp" | ||
| + android:width="1000dp" /> | ||
| + | ||
| + <solid android:color="#b7b7b7" /> | ||
| +</shape> |
8
res/drawable-xxhdpi/es_slidingpane_shadow.xml
| @@ -0,0 +1,8 @@ | ||
| +<?xml version="1.0" encoding="utf-8"?> | ||
| +<shape xmlns:android="http://schemas.android.com/apk/res/android" > | ||
| +<gradient | ||
| + android:centerColor="#8B0000" | ||
| + android:endColor="#34FFDD" | ||
| + android:startColor="#FF00FF" /> | ||
| +<size android:width="5.0dp" android:height="0.5dp" /> | ||
| +</shape> |
BIN
res/drawable-xxhdpi/ic_launcher.png
Diff not rendered
BIN
res/drawable-xxhdpi/ic_profile.png
Diff not rendered
29
res/layout/activity_conversations.xml
| @@ -0,0 +1,29 @@ | ||
| +<android.support.v4.widget.SlidingPaneLayout | ||
| + xmlns:android="http://schemas.android.com/apk/res/android" | ||
| + android:layout_width="match_parent" | ||
| + android:layout_height="match_parent" | ||
| + android:id="@+id/slidingpanelayout"> | ||
| +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
| + android:layout_width="336dp" | ||
| + android:layout_height="match_parent" | ||
| + android:orientation="vertical"> | ||
| + | ||
| + <ListView | ||
| + android:id="@+id/list" | ||
| + android:layout_width="fill_parent" | ||
| + android:layout_height="wrap_content" | ||
| + android:divider="#b5b5b5" | ||
| + android:dividerHeight="1dp" | ||
| + android:background="#f9f9f9" | ||
| + /> | ||
| + | ||
| +</LinearLayout> | ||
| +<LinearLayout | ||
| + android:id="@+id/selected_conversation" | ||
| + android:layout_width="400dp" | ||
| + android:layout_height="match_parent" | ||
| + android:layout_weight="1" | ||
| + android:background="#e5e5e5" | ||
| + android:orientation="vertical"> | ||
| +</LinearLayout> | ||
| +</android.support.v4.widget.SlidingPaneLayout> |
82
res/layout/activity_new_conversation.xml
| @@ -0,0 +1,82 @@ | ||
| +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
| + xmlns:tools="http://schemas.android.com/tools" | ||
| + android:layout_width="match_parent" | ||
| + android:layout_height="match_parent" | ||
| + android:background="#f9f9f9"> | ||
| + | ||
| + <EditText | ||
| + android:id="@+id/new_conversation_search" | ||
| + android:layout_width="wrap_content" | ||
| + android:layout_height="wrap_content" | ||
| + android:layout_alignParentLeft="true" | ||
| + android:layout_alignParentRight="true" | ||
| + android:layout_alignParentTop="true" | ||
| + android:ems="10" | ||
| + android:inputType="textEmailAddress" | ||
| + android:hint="Search or enter Jabber ID" | ||
| + android:background="#ffffff" | ||
| + android:layout_marginTop="12dp" | ||
| + android:layout_marginBottom="12dp" | ||
| + android:layout_marginLeft="8dp" | ||
| + android:layout_marginRight="8dp"/> | ||
| + | ||
| + <ScrollView | ||
| + android:id="@+id/scrollView1" | ||
| + android:layout_width="fill_parent" | ||
| + android:layout_height="fill_parent" | ||
| + android:layout_alignParentBottom="true" | ||
| + android:layout_alignParentLeft="true" | ||
| + android:layout_alignParentRight="true" | ||
| + android:layout_below="@+id/new_conversation_search" | ||
| + android:background="#e5e5e5" > | ||
| + | ||
| + <LinearLayout | ||
| + android:layout_width="match_parent" | ||
| + android:layout_height="380dp" | ||
| + android:orientation="vertical" | ||
| + android:padding="8dp" > | ||
| + | ||
| + <TextView | ||
| + android:id="@+id/phone_contacts_header" | ||
| + android:layout_width="wrap_content" | ||
| + android:layout_height="wrap_content" | ||
| + android:text="Phone Contacts" | ||
| + style="@style/sectionHeader"/> | ||
| + <LinearLayout | ||
| + android:id="@+id/phone_contacts" | ||
| + android:layout_height="fill_parent" | ||
| + android:layout_width="fill_parent" | ||
| + android:orientation="vertical"> | ||
| + | ||
| + </LinearLayout> | ||
| + <TextView | ||
| + android:id="@+id/jabber_contacts_header" | ||
| + android:layout_width="wrap_content" | ||
| + android:layout_height="wrap_content" | ||
| + android:text="Jabber Contacts" | ||
| + style="@style/sectionHeader"/> | ||
| + <LinearLayout | ||
| + android:id="@+id/jabber_contacts" | ||
| + android:layout_height="fill_parent" | ||
| + android:layout_width="fill_parent" | ||
| + android:orientation="vertical"> | ||
| + | ||
| + </LinearLayout> | ||
| + <TextView | ||
| + android:id="@+id/new_contact_header" | ||
| + android:layout_width="wrap_content" | ||
| + android:layout_height="wrap_content" | ||
| + android:text="create new contact" | ||
| + style="@style/sectionHeader" | ||
| + android:visibility="gone"/> | ||
| + <LinearLayout | ||
| + android:id="@+id/create_new_contact" | ||
| + android:layout_height="fill_parent" | ||
| + android:layout_width="fill_parent" | ||
| + android:orientation="vertical" | ||
| + android:visibility="gone"> | ||
| + | ||
| + </LinearLayout> | ||
| + </LinearLayout> | ||
| + </ScrollView> | ||
| +</RelativeLayout> |
44
res/layout/contact.xml
| @@ -0,0 +1,44 @@ | ||
| +<?xml version="1.0" encoding="utf-8"?> | ||
| +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
| + android:orientation="vertical" | ||
| + android:layout_width="fill_parent" | ||
| + android:layout_height="wrap_content"> | ||
| +<RelativeLayout | ||
| + android:layout_width="fill_parent" | ||
| + android:layout_height="wrap_content" | ||
| + android:paddingTop="8dp" | ||
| + android:paddingBottom="8dp"> | ||
| + | ||
| + <ImageView | ||
| + android:id="@+id/contact_photo" | ||
| + android:layout_width="48dp" | ||
| + android:layout_height="48dp" | ||
| + android:layout_alignParentLeft="true" | ||
| + android:src="@drawable/ic_profile"> | ||
| + </ImageView> | ||
| + <LinearLayout | ||
| + android:layout_width="wrap_content" | ||
| + android:layout_height="wrap_content" | ||
| + android:layout_toRightOf="@+id/contact_photo" | ||
| + android:layout_centerVertical="true" | ||
| + android:orientation="vertical" | ||
| + android:paddingLeft="8dp"> | ||
| + <TextView | ||
| + android:id="@+id/contact_display_name" | ||
| + android:layout_width="wrap_content" | ||
| + android:layout_height="wrap_content" | ||
| + android:textSize="18sp" | ||
| + android:textColor="#5b5b5b" | ||
| + /> | ||
| + <TextView | ||
| + android:id="@+id/contact_jid" | ||
| + android:layout_width="wrap_content" | ||
| + android:layout_height="wrap_content" | ||
| + android:textColor="#5b5b5b" | ||
| + /> | ||
| + </LinearLayout> | ||
| + | ||
| +</RelativeLayout> | ||
| + <View style="@style/Divider" | ||
| + android:id="@+id/contact_divider"/> | ||
| +</LinearLayout> |
62
res/layout/conversation_list_row.xml
| @@ -0,0 +1,62 @@ | ||
| +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
| + android:layout_width="fill_parent" | ||
| + android:layout_height="wrap_content" | ||
| + android:orientation="horizontal" | ||
| + android:padding="5dip"> | ||
| + | ||
| + <!-- ListRow Left sied Thumbnail image --> | ||
| + <LinearLayout android:id="@+id/thumbnail" | ||
| + android:layout_width="wrap_content" | ||
| + android:layout_height="wrap_content" | ||
| + android:padding="3dip" | ||
| + android:layout_alignParentLeft="true" | ||
| + android:layout_marginRight="5dip"> | ||
| + | ||
| + <ImageView | ||
| + android:id="@+id/imageView1" | ||
| + android:layout_width="wrap_content" | ||
| + android:layout_height="wrap_content" | ||
| + android:src="@drawable/ic_profile" /> | ||
| + | ||
| + </LinearLayout> | ||
| + | ||
| + <!-- Title Of Song--> | ||
| + <TextView | ||
| + android:id="@+id/conversation_name" | ||
| + android:layout_width="wrap_content" | ||
| + android:layout_height="wrap_content" | ||
| + android:layout_alignTop="@+id/thumbnail" | ||
| + android:layout_toRightOf="@+id/thumbnail" | ||
| + android:text="Rihanna Love the way lie" | ||
| + android:textColor="#636363" | ||
| + android:typeface="sans" | ||
| + android:textSize="20dip"/> | ||
| + | ||
| + <!-- Artist Name --> | ||
| + <TextView | ||
| + android:id="@+id/conversation_lastmsg" | ||
| + android:layout_width="fill_parent" | ||
| + android:layout_height="wrap_content" | ||
| + android:layout_below="@id/conversation_name" | ||
| + android:textColor="#636363" | ||
| + android:textSize="12dip" | ||
| + android:layout_marginTop="1dip" | ||
| + android:layout_toRightOf="@+id/thumbnail" | ||
| + android:text="Just gona stand there and ..." /> | ||
| + | ||
| + <!-- Rightend Duration --> | ||
| + <TextView | ||
| + android:id="@+id/duration" | ||
| + android:layout_width="wrap_content" | ||
| + android:layout_height="wrap_content" | ||
| + android:layout_alignParentRight="true" | ||
| + android:layout_alignBottom="@id/conversation_name" | ||
| + android:gravity="right" | ||
| + android:text="5:45" | ||
| + android:layout_marginRight="5dip" | ||
| + android:textSize="10dip" | ||
| + android:textColor="#636363"/> | ||
| + | ||
| + | ||
| + | ||
| +</RelativeLayout> |
64
res/layout/frament_conversation.xml
| @@ -0,0 +1,64 @@ | ||
| +<?xml version="1.0" encoding="utf-8"?> | ||
| +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
| + android:layout_width="match_parent" | ||
| + android:layout_height="match_parent" | ||
| + android:background="#f9f9f9"> | ||
| + | ||
| + <RelativeLayout | ||
| + android:id="@+id/textsend" | ||
| + android:layout_width="fill_parent" | ||
| + android:layout_height="wrap_content" | ||
| + android:layout_alignParentBottom="true" | ||
| + android:layout_alignParentLeft="true" > | ||
| + | ||
| + <EditText | ||
| + android:id="@+id/editText1" | ||
| + android:layout_width="wrap_content" | ||
| + android:layout_height="wrap_content" | ||
| + android:layout_alignParentLeft="true" | ||
| + android:layout_toLeftOf="@+id/imageButton1" | ||
| + android:ems="10" | ||
| + android:inputType="textMultiLine" | ||
| + android:minLines="1" | ||
| + android:background="#ffffff" | ||
| + android:layout_marginTop="12dp" | ||
| + android:layout_marginBottom="12dp" | ||
| + android:layout_marginLeft="8dp" | ||
| + android:layout_marginRight="8dp"> | ||
| + </EditText> | ||
| + | ||
| + <ImageButton | ||
| + android:id="@+id/imageButton1" | ||
| + android:layout_width="48dp" | ||
| + android:layout_height="48dp" | ||
| + android:layout_alignParentRight="true" | ||
| + android:layout_centerVertical="true" | ||
| + android:background="?android:selectableItemBackground" | ||
| + android:src="@drawable/ic_action_send_now" /> | ||
| + | ||
| + </RelativeLayout> | ||
| + | ||
| + <ScrollView | ||
| + android:id="@+id/scrollView1" | ||
| + android:layout_width="fill_parent" | ||
| + android:layout_height="fill_parent" | ||
| + android:layout_above="@+id/textsend" | ||
| + android:layout_alignParentLeft="true" | ||
| + android:layout_alignParentTop="true" | ||
| + android:background="#e5e5e5" > | ||
| + | ||
| + <LinearLayout | ||
| + android:layout_width="fill_parent" | ||
| + android:layout_height="fill_parent" | ||
| + android:background="#e5e5e5" | ||
| + android:orientation="vertical" > | ||
| + | ||
| + <TextView | ||
| + android:id="@+id/textView1" | ||
| + android:layout_width="wrap_content" | ||
| + android:layout_height="wrap_content" | ||
| + android:text="TextView" /> | ||
| + </LinearLayout> | ||
| + </ScrollView> | ||
| + | ||
| +</RelativeLayout> |
42
res/menu/conversations.xml
| @@ -0,0 +1,42 @@ | ||
| +<menu xmlns:android="http://schemas.android.com/apk/res/android" > | ||
| + | ||
| + <item | ||
| + android:id="@+id/action_add" | ||
| + android:orderInCategory="10" | ||
| + android:icon="@drawable/ic_action_add" | ||
| + android:showAsAction="always" | ||
| + android:title="@string/action_add" /> | ||
| + | ||
| + <item | ||
| + android:id="@+id/action_security" | ||
| + android:orderInCategory="20" | ||
| + android:showAsAction="always" | ||
| + android:icon="@drawable/ic_action_unsecure" | ||
| + android:title="@string/action_secure" /> | ||
| + | ||
| + <item | ||
| + android:id="@+id/action_details" | ||
| + android:orderInCategory="40" | ||
| + android:showAsAction="never" | ||
| + android:title="@string/action_details" /> | ||
| + | ||
| + <item | ||
| + android:id="@+id/action_archive" | ||
| + android:orderInCategory="50" | ||
| + android:showAsAction="never" | ||
| + android:title="@string/action_archive" /> | ||
| + | ||
| + <item | ||
| + android:id="@+id/action_accounts" | ||
| + android:orderInCategory="90" | ||
| + android:showAsAction="never" | ||
| + android:title="@string/action_accounts" | ||
| + /> | ||
| + | ||
| + <item | ||
| + android:id="@+id/action_settings" | ||
| + android:orderInCategory="100" | ||
| + android:showAsAction="never" | ||
| + android:title="@string/action_settings"/> | ||
| + | ||
| +</menu> |
8
res/values-sw600dp/dimens.xml
| @@ -0,0 +1,8 @@ | ||
| +<resources> | ||
| + | ||
| + <!-- | ||
| + Customize dimensions originally defined in res/values/dimens.xml (such as | ||
| + screen margins) for sw600dp devices (e.g. 7" tablets) here. | ||
| + --> | ||
| + | ||
| +</resources> |
9
res/values-sw720dp-land/dimens.xml
| @@ -0,0 +1,9 @@ | ||
| +<resources> | ||
| + | ||
| + <!-- | ||
| + Customize dimensions originally defined in res/values/dimens.xml (such as | ||
| + screen margins) for sw720dp devices (e.g. 10" tablets) in landscape here. | ||
| + --> | ||
| + <dimen name="activity_horizontal_margin">128dp</dimen> | ||
| + | ||
| +</resources> |
11
res/values-v11/styles.xml
| @@ -0,0 +1,11 @@ | ||
| +<resources> | ||
| + | ||
| + <!-- | ||
| + Base application theme for API 11+. This theme completely replaces | ||
| + AppBaseTheme from res/values/styles.xml on API 11+ devices. | ||
| + --> | ||
| + <style name="AppBaseTheme" parent="android:Theme.Holo.Light"> | ||
| + <!-- API 11 theme customizations can go here. --> | ||
| + </style> | ||
| + | ||
| +</resources> |
12
res/values-v14/styles.xml
| @@ -0,0 +1,12 @@ | ||
| +<resources> | ||
| + | ||
| + <!-- | ||
| + 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. | ||
| + --> | ||
| + <style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar"> | ||
| + <!-- API 14 theme customizations can go here. --> | ||
| + </style> | ||
| + | ||
| +</resources> |
13
res/values/arrays.xml
| @@ -0,0 +1,13 @@ | ||
| +<?xml version="1.0" encoding="utf-8"?> | ||
| +<resources> | ||
| + <array name="conversation_encryption_type_entries"> | ||
| + <item>None</item> | ||
| + <item>OpenPGP</item> | ||
| + <item>Off the record</item> | ||
| + </array> | ||
| + <array name="conversation_encryption_type_values"> | ||
| + <item>none</item> | ||
| + <item>pgp</item> | ||
| + <item>otr</item> | ||
| + </array> | ||
| +</resources> |
7
res/values/dimens.xml
| @@ -0,0 +1,7 @@ | ||
| +<resources> | ||
| + | ||
| + <!-- Default screen margins, per the Android Design guidelines. --> | ||
| + <dimen name="activity_horizontal_margin">16dp</dimen> | ||
| + <dimen name="activity_vertical_margin">16dp</dimen> | ||
| + | ||
| +</resources> |
14
res/values/strings.xml
| @@ -0,0 +1,14 @@ | ||
| +<?xml version="1.0" encoding="utf-8"?> | ||
| +<resources> | ||
| + | ||
| + <string name="app_name">Secure Conversations</string> | ||
| + <string name="action_settings">Settings</string> | ||
| + <string name="action_add">New conversation</string> | ||
| + <string name="action_accounts">Manage accounts</string> | ||
| + <string name="action_archive">Archive</string> | ||
| + <string name="action_details">Show details</string> | ||
| + <string name="action_secure">Secure conversation</string> | ||
| + <string name="title_activity_new_conversation">New Conversation</string> | ||
| + <string name="hello_world">Hello world!</string> | ||
| + | ||
| +</resources> |
37
res/values/styles.xml
| @@ -0,0 +1,37 @@ | ||
| +<resources xmlns:android="http://schemas.android.com/apk/res/android"> | ||
| + | ||
| + <!-- | ||
| + Base application theme, dependent on API level. This theme is replaced | ||
| + by AppBaseTheme from res/values-vXX/styles.xml on newer devices. | ||
| + --> | ||
| + <style name="AppBaseTheme" parent="android:Theme.Light"> | ||
| + <!-- | ||
| + Theme customizations available in newer API levels can go in | ||
| + res/values-vXX/styles.xml, while customizations related to | ||
| + backward-compatibility can go here. | ||
| + --> | ||
| + </style> | ||
| + | ||
| + <!-- Application theme. --> | ||
| + <style name="AppTheme" parent="AppBaseTheme"> | ||
| + <!-- All customizations that are NOT specific to a particular API-level can go here. --> | ||
| + </style> | ||
| + | ||
| + | ||
| + <style name="sectionHeader" parent="android:Widget.Holo.Light.TextView"> | ||
| + <item name="android:drawableBottom">@drawable/section_header</item> | ||
| + <item name="android:drawablePadding">4dp</item> | ||
| + <item name="android:layout_marginTop">8dp</item> | ||
| + <item name="android:textSize">14sp</item> | ||
| + <item name="android:textAllCaps">true</item> | ||
| + <item name="android:textColor">#5b5b5b</item> | ||
| + <item name="android:textStyle">bold</item> | ||
| + </style> | ||
| + | ||
| + <style name="Divider"> | ||
| + <item name="android:layout_width">match_parent</item> | ||
| + <item name="android:layout_height">1.5dp</item> | ||
| + <item name="android:background">#b7b7b7</item> | ||
| + </style> | ||
| + | ||
| +</resources> |
41
res/xml/preferences.xml
| @@ -0,0 +1,41 @@ | ||
| +<?xml version="1.0" encoding="utf-8"?> | ||
| +<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" > | ||
| + <PreferenceCategory | ||
| + android:title="Security"> | ||
| + <CheckBoxPreference | ||
| + android:key="trust_unknown_tls_certificates" | ||
| + android:title="Trust TLS certificates" | ||
| + android:summary="Accounts with untrusted certificates simply will not connect to server" | ||
| + /> | ||
| + <ListPreference | ||
| + android:key="default_conversation_encryption_type" | ||
| + android:title="Default conversation encryption" | ||
| + android:dialogTitle="Default conversation encryption" | ||
| + android:entries="@array/conversation_encryption_type_entries" | ||
| + android:entryValues="@array/conversation_encryption_type_values" | ||
| + android:defaultValue="pgp"/> | ||
| + </PreferenceCategory> | ||
| + <PreferenceCategory | ||
| + android:title="Notification settings"> | ||
| + <CheckBoxPreference | ||
| + android:key="show_notification" | ||
| + android:title="Notification" | ||
| + android:summary="Show notification in status bar when a new message arrives" | ||
| + /> | ||
| + <CheckBoxPreference | ||
| + android:key="vibrate_on_notification" | ||
| + android:dependency="show_notification" | ||
| + android:title="Vibrate" | ||
| + android:summary="Also vibrate when a new message arrives"/> | ||
| + <RingtonePreference | ||
| + android:key="notification_ringtone" | ||
| + android:title="Sound" | ||
| + android:ringtoneType="notification" | ||
| + android:dependency="show_notification" | ||
| + android:summary="Play ringtone with notification"/> | ||
| + </PreferenceCategory> | ||
| + <PreferenceCategory | ||
| + android:title="Advanced settings"> | ||
| + | ||
| + </PreferenceCategory> | ||
| +</PreferenceScreen> |
35
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()))); | ||
| + } | ||
| +} |
21
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<Message> msgs = new ArrayList<Message>(); | ||
| + | ||
| + public Conversation(String name) { | ||
| + this.name = name; | ||
| + } | ||
| + | ||
| + public ArrayList<Message> getLastMessages(int count, int offset) { | ||
| + msgs.add(new Message("this is my last message")); | ||
| + return msgs; | ||
| + } | ||
| + public String getName() { | ||
| + return this.name; | ||
| + } | ||
| +} |
94
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<Conversation> 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; | ||
| + } | ||
| + | ||
| +} |
41
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<Conversation> { | ||
| + | ||
| + 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<Conversation>() { | ||
| + | ||
| + @Override | ||
| + public int compare(Conversation lhs, Conversation rhs) { | ||
| + // TODO Auto-generated method stub | ||
| + return 0; | ||
| + } | ||
| + }); | ||
| + | ||
| + this.selectedConversationPosition = this.indexOf(selectedConversation); | ||
| + } | ||
| +} |
19
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"; | ||
| + } | ||
| + | ||
| +} |
29
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; | ||
| + } | ||
| + | ||
| +} |
161
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<Conversation, ConversationFragment> conversationFragments = new HashMap<Conversation, ConversationFragment>(); | ||
| + | ||
| + @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(); | ||
| + } | ||
| + | ||
| +} |
18
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); | ||
| + } | ||
| +} |
7
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 { | ||
| + | ||
| +} |
197
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<Contact, View> availablePhoneContacts = new LinkedHashMap<Contact, View>(); | ||
| + final protected LinkedHashMap<Contact, View> availableJabberContacts = new LinkedHashMap<Contact, View>(); | ||
| + 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<Contact, View> entry : availablePhoneContacts.entrySet()) { | ||
| + if (entry.getValue() == v) { | ||
| + clickedContact = entry.getKey(); | ||
| + break; | ||
| + } | ||
| + } | ||
| + for(Entry<Contact, View> 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<Cursor>() { | ||
| + | ||
| + @Override | ||
| + public void onLoadComplete(Loader<Cursor> 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<Contact, View> contacts, String search) { | ||
| + layout.removeAllViews(); | ||
| + for(Entry<Contact, View> 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); | ||
| + } | ||
| + } | ||
| +} |
16
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(); | ||
| + } | ||
| + | ||
| +} |
15
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); | ||
| + } | ||
| +} |
0 comments on commit
35f8ab5