setting to increase font size. fixed #420

This commit is contained in:
iNPUTmice 2014-09-08 23:58:37 +02:00
parent d9c4637b31
commit d92e8381db
40 changed files with 229 additions and 172 deletions

View file

@ -28,14 +28,14 @@
android:scrollHorizontally="false" android:scrollHorizontally="false"
android:singleLine="true" android:singleLine="true"
android:textColor="@color/primarytext" android:textColor="@color/primarytext"
android:textSize="18sp" /> android:textSize="?attr/TextSizeHeadline" />
<TextView <TextView
android:id="@+id/account_status" android:id="@+id/account_status"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/account_status_unknown" android:text="@string/account_status_unknown"
android:textSize="14sp" android:textSize="?attr/TextSizeBody"
android:textColor="@color/secondarytext" android:textColor="@color/secondarytext"
android:textStyle="bold"/> android:textStyle="bold"/>
</LinearLayout> </LinearLayout>

View file

@ -44,7 +44,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingLeft="8dp" android:paddingLeft="8dp"
android:singleLine="true" android:singleLine="true"
android:textSize="14sp" android:textSize="?attr/TextSizeBody"
android:textColor="@color/primarytext"/> android:textColor="@color/primarytext"/>
<TextView <TextView
@ -52,7 +52,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingLeft="16dp" android:paddingLeft="16dp"
android:textSize="18sp" android:textSize="?attr/TextSizeHeadline"
android:textColor="@color/primarytext" android:textColor="@color/primarytext"
android:textStyle="bold" /> android:textStyle="bold" />
<TextView <TextView
@ -61,7 +61,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingLeft="8dp" android:paddingLeft="8dp"
android:singleLine="true" android:singleLine="true"
android:textSize="14sp" android:textSize="?attr/TextSizeBody"
android:textColor="@color/primarytext"/> android:textColor="@color/primarytext"/>
</LinearLayout> </LinearLayout>
@ -80,7 +80,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingLeft="8dp" android:paddingLeft="8dp"
android:textSize="14sp" android:textSize="?attr/TextSizeBody"
android:textColor="@color/primarytext" /> android:textColor="@color/primarytext" />
<TextView <TextView
style="@style/sectionHeader" style="@style/sectionHeader"
@ -95,7 +95,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/send_presence_updates" android:text="@string/send_presence_updates"
android:textSize="14sp" android:textSize="?attr/TextSizeBody"
android:textColor="@color/primarytext" /> android:textColor="@color/primarytext" />
<CheckBox <CheckBox
@ -103,7 +103,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/receive_presence_updates" android:text="@string/receive_presence_updates"
android:textSize="14sp" android:textSize="?attr/TextSizeBody"
android:textColor="@color/primarytext" /> android:textColor="@color/primarytext" />
<TextView <TextView
style="@style/sectionHeader" style="@style/sectionHeader"

View file

@ -27,7 +27,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/account_settings_jabber_id" android:text="@string/account_settings_jabber_id"
android:textColor="@color/primarytext" android:textColor="@color/primarytext"
android:textSize="14sp" /> android:textSize="?attr/TextSizeBody" />
<AutoCompleteTextView <AutoCompleteTextView
android:id="@+id/account_jid" android:id="@+id/account_jid"
@ -42,7 +42,7 @@
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:text="@string/account_settings_password" android:text="@string/account_settings_password"
android:textColor="@color/primarytext" android:textColor="@color/primarytext"
android:textSize="14sp" /> android:textSize="?attr/TextSizeBody" />
<EditText <EditText
android:id="@+id/account_password" android:id="@+id/account_password"
@ -58,7 +58,7 @@
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:text="@string/register_account" android:text="@string/register_account"
android:textColor="@color/primarytext" android:textColor="@color/primarytext"
android:textSize="14sp" /> android:textSize="?attr/TextSizeBody" />
<TextView <TextView
android:id="@+id/account_confirm_password_desc" android:id="@+id/account_confirm_password_desc"
@ -66,7 +66,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/account_settings_confirm_password" android:text="@string/account_settings_confirm_password"
android:textColor="@color/primarytext" android:textColor="@color/primarytext"
android:textSize="14sp" android:textSize="?attr/TextSizeBody"
android:visibility="gone" /> android:visibility="gone" />
<EditText <EditText
@ -94,7 +94,7 @@
android:gravity="center_horizontal" android:gravity="center_horizontal"
android:text="@string/additional_information" android:text="@string/additional_information"
android:textColor="@color/secondarytext" android:textColor="@color/secondarytext"
android:textSize="18sp" android:textSize="?attr/TextSizeHeadline"
android:textStyle="bold" /> android:textStyle="bold" />
<TableLayout <TableLayout
@ -177,7 +177,7 @@
android:gravity="center_horizontal" android:gravity="center_horizontal"
android:text="@string/otr_fingerprint" android:text="@string/otr_fingerprint"
android:textColor="@color/secondarytext" android:textColor="@color/secondarytext"
android:textSize="18sp" android:textSize="?attr/TextSizeHeadline"
android:textStyle="bold" /> android:textStyle="bold" />
<TextView <TextView
@ -185,7 +185,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:textSize="14sp" android:textSize="?attr/TextSizeBody"
android:typeface="monospace" /> android:typeface="monospace" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>

View file

@ -24,7 +24,7 @@
android:singleLine="true" android:singleLine="true"
android:text="@string/account_settings_example_jabber_id" android:text="@string/account_settings_example_jabber_id"
android:textColor="@color/primarytext" android:textColor="@color/primarytext"
android:textSize="14sp"/> android:textSize="?attr/TextSizeBody"/>
<TextView <TextView
style="@style/sectionHeader" style="@style/sectionHeader"
@ -64,7 +64,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:singleLine="true" android:singleLine="true"
android:textColor="@color/primarytext" android:textColor="@color/primarytext"
android:textSize="18sp" /> android:textSize="?attr/TextSizeHeadline" />
<TextView <TextView
android:id="@+id/muc_role" android:id="@+id/muc_role"
@ -72,7 +72,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:singleLine="true" android:singleLine="true"
android:textColor="@color/primarytext" android:textColor="@color/primarytext"
android:textSize="14sp" /> android:textSize="?attr/TextSizeBody" />
</LinearLayout> </LinearLayout>
<ImageButton <ImageButton

View file

@ -90,7 +90,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="@color/primarytext" android:textColor="@color/primarytext"
android:textSize="18sp"/> android:textSize="?attr/TextSizeHeadline"/>
<TextView <TextView
android:id="@+id/hint_or_warning" android:id="@+id/hint_or_warning"
@ -99,7 +99,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/publish_avatar_explanation" android:text="@string/publish_avatar_explanation"
android:textColor="@color/primarytext" android:textColor="@color/primarytext"
android:textSize="14sp" android:textSize="?attr/TextSizeBody"
android:minLines="3" /> android:minLines="3" />
</LinearLayout> </LinearLayout>

View file

@ -1,10 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="8dp" android:background="?android:attr/activatedBackgroundIndicator"
android:paddingBottom="8dp" android:padding="8dp" >
android:background="?android:attr/activatedBackgroundIndicator">
<ImageView <ImageView
android:id="@+id/contact_photo" android:id="@+id/contact_photo"
@ -12,40 +11,41 @@
android:layout_height="48dp" android:layout_height="48dp"
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:scaleType="centerCrop" android:scaleType="centerCrop"
android:src="@drawable/ic_profile"> android:src="@drawable/ic_profile" >
</ImageView> </ImageView>
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_toRightOf="@+id/contact_photo"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_toRightOf="@+id/contact_photo"
android:orientation="vertical" android:orientation="vertical"
android:paddingLeft="8dp"> android:paddingLeft="8dp" >
<TextView <TextView
android:id="@+id/contact_display_name" android:id="@+id/contact_display_name"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="18sp"
android:textColor="@color/primarytext"
android:singleLine="true" android:singleLine="true"
/> android:textSize="?attr/TextSizeHeadline"
android:textColor="@color/primarytext" />
<TextView <TextView
android:id="@+id/contact_jid" android:id="@+id/contact_jid"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:singleLine="true" android:singleLine="true"
android:textSize="14sp"
android:textColor="@color/primarytext" android:textColor="@color/primarytext"
/> android:textSize="?attr/TextSizeBody" />
<TextView <TextView
android:id="@+id/key" android:id="@+id/key"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="18sp"
android:textColor="@color/primarytext" android:textColor="@color/primarytext"
android:textSize="?attr/TextSizeHeadline"
android:typeface="monospace" android:typeface="monospace"
android:visibility="gone" android:visibility="gone" />
/>
</LinearLayout> </LinearLayout>
</RelativeLayout> </RelativeLayout>

View file

@ -16,7 +16,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="@color/primarytext" android:textColor="@color/primarytext"
android:textSize="18sp" android:textSize="?attr/TextSizeHeadline"
android:typeface="monospace" /> android:typeface="monospace" />
<TextView <TextView

View file

@ -26,7 +26,7 @@
android:layout_alignLeft="@+id/conversation_lastwrapper" android:layout_alignLeft="@+id/conversation_lastwrapper"
android:layout_toLeftOf="@+id/conversation_lastupdate" android:layout_toLeftOf="@+id/conversation_lastupdate"
android:singleLine="true" android:singleLine="true"
android:textSize="18sp" android:textSize="?attr/TextSizeHeadline"
android:textColor="@color/primarytext" android:textColor="@color/primarytext"
android:typeface="sans" /> android:typeface="sans" />
@ -42,7 +42,7 @@
android:id="@+id/conversation_lastmsg" android:id="@+id/conversation_lastmsg"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="14sp" android:textSize="?attr/TextSizeBody"
android:textColor="@color/primarytext" android:textColor="@color/primarytext"
android:singleLine="true" android:singleLine="true"
android:scrollHorizontally="false" android:scrollHorizontally="false"
@ -63,7 +63,7 @@
android:layout_alignBaseline="@+id/conversation_name" android:layout_alignBaseline="@+id/conversation_name"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:gravity="right" android:gravity="right"
android:textSize="12sp" android:textSize="?attr/TextSizeInfo"
android:textColor="@color/secondarytext"/> android:textColor="@color/secondarytext"/>
</RelativeLayout> </RelativeLayout>

View file

@ -9,7 +9,7 @@
android:id="@+id/your_account" android:id="@+id/your_account"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="14sp" android:textSize="?attr/TextSizeBody"
android:textColor="@color/primarytext" android:textColor="@color/primarytext"
android:text="@string/your_account" /> android:text="@string/your_account" />
<Spinner <Spinner
@ -22,7 +22,7 @@
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="14sp" android:textSize="?attr/TextSizeBody"
android:textColor="@color/primarytext" android:textColor="@color/primarytext"
android:text="@string/account_settings_jabber_id" /> android:text="@string/account_settings_jabber_id" />

View file

@ -8,7 +8,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/clear_histor_msg" android:text="@string/clear_histor_msg"
android:textSize="14sp" android:textSize="?attr/TextSizeBody"
android:paddingBottom="8dp"/> android:paddingBottom="8dp"/>
<CheckBox <CheckBox
android:id="@+id/end_conversation_checkbox" android:id="@+id/end_conversation_checkbox"

View file

@ -13,14 +13,14 @@
android:paddingTop="8dp" android:paddingTop="8dp"
android:text="Jabber ID" android:text="Jabber ID"
android:textColor="@color/primarytext" android:textColor="@color/primarytext"
android:textSize="18sp"/> android:textSize="?attr/TextSizeHeadline"/>
<TextView <TextView
android:id="@+id/verify_otr_jid" android:id="@+id/verify_otr_jid"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingLeft="8dp" android:paddingLeft="8dp"
android:textSize="14sp" android:textSize="?attr/TextSizeBody"
android:textColor="@color/secondarytext"/> android:textColor="@color/secondarytext"/>
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -28,14 +28,14 @@
android:paddingTop="8dp" android:paddingTop="8dp"
android:text="@string/otr_fingerprint" android:text="@string/otr_fingerprint"
android:textColor="@color/primarytext" android:textColor="@color/primarytext"
android:textSize="18sp"/> android:textSize="?attr/TextSizeHeadline"/>
<TextView <TextView
android:id="@+id/verify_otr_fingerprint" android:id="@+id/verify_otr_fingerprint"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingLeft="8dp" android:paddingLeft="8dp"
android:textSize="14sp" android:textSize="?attr/TextSizeBody"
android:typeface="monospace" android:typeface="monospace"
android:textColor="@color/secondarytext"/> android:textColor="@color/secondarytext"/>
<TextView <TextView
@ -43,7 +43,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingTop="8dp" android:paddingTop="8dp"
android:text="@string/your_fingerprint" android:text="@string/your_fingerprint"
android:textSize="18sp" android:textSize="?attr/TextSizeHeadline"
android:textColor="@color/primarytext"/> android:textColor="@color/primarytext"/>
<TextView <TextView
@ -51,7 +51,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingLeft="8dp" android:paddingLeft="8dp"
android:textSize="14sp" android:textSize="?attr/TextSizeBody"
android:typeface="monospace" android:typeface="monospace"
android:textColor="@color/secondarytext"/> android:textColor="@color/secondarytext"/>
</LinearLayout> </LinearLayout>

View file

@ -81,7 +81,7 @@
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:paddingLeft="24dp" android:paddingLeft="24dp"
android:textColor="@color/ondarktext" android:textColor="@color/ondarktext"
android:textSize="14sp" android:textSize="?attr/TextSizeBody"
android:layout_toLeftOf="@+id/snackbar_action"/> android:layout_toLeftOf="@+id/snackbar_action"/>
<TextView <TextView
@ -96,7 +96,7 @@
android:paddingTop="16dp" android:paddingTop="16dp"
android:textAllCaps="true" android:textAllCaps="true"
android:textColor="@color/ondarktext" android:textColor="@color/ondarktext"
android:textSize="14sp" android:textSize="?attr/TextSizeBody"
android:textStyle="bold" /> android:textStyle="bold" />
</RelativeLayout> </RelativeLayout>

View file

@ -9,7 +9,7 @@
android:id="@+id/your_account" android:id="@+id/your_account"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="14sp" android:textSize="?attr/TextSizeBody"
android:textColor="@color/primarytext" android:textColor="@color/primarytext"
android:text="@string/your_account" /> android:text="@string/your_account" />
<Spinner <Spinner
@ -22,7 +22,7 @@
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="14sp" android:textSize="?attr/TextSizeBody"
android:textColor="@color/primarytext" android:textColor="@color/primarytext"
android:text="@string/conference_address" /> android:text="@string/conference_address" />

View file

@ -44,7 +44,7 @@
android:autoLink="web" android:autoLink="web"
android:textColor="@color/primarytext" android:textColor="@color/primarytext"
android:textIsSelectable="true" android:textIsSelectable="true"
android:textSize="14sp" /> android:textSize="?attr/TextSizeBody" />
<Button <Button
android:id="@+id/download_button" android:id="@+id/download_button"
@ -62,8 +62,8 @@
<ImageView <ImageView
android:id="@+id/security_indicator" android:id="@+id/security_indicator"
android:layout_width="12sp" android:layout_width="?attr/TextSizeInfo"
android:layout_height="12sp" android:layout_height="?attr/TextSizeInfo"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginRight="6sp" android:layout_marginRight="6sp"
android:layout_marginTop="2sp" android:layout_marginTop="2sp"
@ -78,7 +78,7 @@
android:gravity="center_vertical" android:gravity="center_vertical"
android:text="@string/sending" android:text="@string/sending"
android:textColor="@color/secondarytext" android:textColor="@color/secondarytext"
android:textSize="12sp" /> android:textSize="?attr/TextSizeInfo" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>

View file

@ -44,7 +44,7 @@
android:autoLink="web" android:autoLink="web"
android:textColor="@color/primarytext" android:textColor="@color/primarytext"
android:textIsSelectable="true" android:textIsSelectable="true"
android:textSize="14sp" /> android:textSize="?attr/TextSizeBody" />
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -61,12 +61,12 @@
android:gravity="center_vertical" android:gravity="center_vertical"
android:text="@string/sending" android:text="@string/sending"
android:textColor="@color/secondarytext" android:textColor="@color/secondarytext"
android:textSize="12sp" /> android:textSize="?attr/TextSizeInfo" />
<ImageView <ImageView
android:id="@+id/security_indicator" android:id="@+id/security_indicator"
android:layout_width="12sp" android:layout_width="?attr/TextSizeInfo"
android:layout_height="12sp" android:layout_height="?attr/TextSizeInfo"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginLeft="6sp" android:layout_marginLeft="6sp"
android:layout_marginTop="2sp" android:layout_marginTop="2sp"

6
res/values/attrs.xml Normal file
View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<attr name="TextSizeInfo" format="dimension"/>
<attr name="TextSizeBody" format="dimension"/>
<attr name="TextSizeHeadline" format="dimension"/>
</resources>

View file

@ -108,6 +108,7 @@
<string name="pref_never_send_crash_summary">By sending in stack traces you are helping the ongoing development of Conversations</string> <string name="pref_never_send_crash_summary">By sending in stack traces you are helping the ongoing development of Conversations</string>
<string name="pref_confirm_messages">Confirm Messages</string> <string name="pref_confirm_messages">Confirm Messages</string>
<string name="pref_confirm_messages_summary">Let your contact know when you have received and read a message</string> <string name="pref_confirm_messages_summary">Let your contact know when you have received and read a message</string>
<string name="pref_ui_options">UI Options</string>
<string name="openpgp_error">OpenKeychain reported an error</string> <string name="openpgp_error">OpenKeychain reported an error</string>
<string name="error_decrypting_file">I/O Error decrypting file</string> <string name="error_decrypting_file">I/O Error decrypting file</string>
<string name="accept">Accept</string> <string name="accept">Accept</string>
@ -251,4 +252,6 @@
<string name="pref_dont_save_encrypted_summary">Warning: This could lead to message loss</string> <string name="pref_dont_save_encrypted_summary">Warning: This could lead to message loss</string>
<string name="pref_expert_options">Expert options</string> <string name="pref_expert_options">Expert options</string>
<string name="pref_expert_options_summary">Please be very careful with those</string> <string name="pref_expert_options_summary">Please be very careful with those</string>
<string name="pref_use_larger_font">Increase font size</string>
<string name="pref_use_larger_font_summary">Use larger font sizes across the entire app</string>
</resources> </resources>

View file

@ -5,6 +5,15 @@
<item name="android:actionBarStyle">@style/ConversationsActionBar</item> <item name="android:actionBarStyle">@style/ConversationsActionBar</item>
<item name="android:actionBarWidgetTheme">@style/ConversationsActionBarWidget</item> <item name="android:actionBarWidgetTheme">@style/ConversationsActionBarWidget</item>
<item name="android:actionBarTabStyle">@style/ConversationsActionBarTabs</item> <item name="android:actionBarTabStyle">@style/ConversationsActionBarTabs</item>
<item name="TextSizeInfo">12sp</item>
<item name="TextSizeBody">14sp</item>
<item name="TextSizeHeadline">20sp</item>
</style>
<style name="ConversationsTheme.LargerText" parent="ConversationsTheme">
<item name="TextSizeInfo">14sp</item>
<item name="TextSizeBody">16sp</item>
<item name="TextSizeHeadline">22sp</item>
</style> </style>
<style name="ConversationsActionBar" parent="@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse"> <style name="ConversationsActionBar" parent="@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse">

View file

@ -62,6 +62,14 @@
android:summary="@string/pref_notification_grace_period_summary" android:summary="@string/pref_notification_grace_period_summary"
android:title="@string/pref_notification_grace_period" /> android:title="@string/pref_notification_grace_period" />
</PreferenceCategory> </PreferenceCategory>
<PreferenceCategory
android:title="@string/pref_ui_options">
<CheckBoxPreference
android:defaultValue="false"
android:key="use_larger_font"
android:title="@string/pref_use_larger_font"
android:summary="@string/pref_use_larger_font_summary"/>
</PreferenceCategory>
<PreferenceCategory android:title="@string/pref_advanced_options" > <PreferenceCategory android:title="@string/pref_advanced_options" >
<PreferenceScreen <PreferenceScreen
android:summary="@string/pref_expert_options_summary" android:summary="@string/pref_expert_options_summary"

View file

@ -174,7 +174,8 @@ public class OtrEngine implements OtrEngineHost {
@Override @Override
public void messageFromAnotherInstanceReceived(SessionID id) { public void messageFromAnotherInstanceReceived(SessionID id) {
Log.d(Config.LOGTAG,"unreadable message received from "+id.getAccountID()); Log.d(Config.LOGTAG,
"unreadable message received from " + id.getAccountID());
} }
@Override @Override

View file

@ -106,8 +106,8 @@ public class PgpEngine {
outputFile.getAbsolutePath(), options); outputFile.getAbsolutePath(), options);
int imageHeight = options.outHeight; int imageHeight = options.outHeight;
int imageWidth = options.outWidth; int imageWidth = options.outWidth;
message.setBody(Long.toString(outputFile.getSize()) + ',' message.setBody(Long.toString(outputFile.getSize())
+ imageWidth + ',' + imageHeight); + ',' + imageWidth + ',' + imageHeight);
message.setEncryption(Message.ENCRYPTION_DECRYPTED); message.setEncryption(Message.ENCRYPTION_DECRYPTED);
PgpEngine.this.mXmppConnectionService PgpEngine.this.mXmppConnectionService
.updateMessage(message); .updateMessage(message);
@ -301,7 +301,7 @@ public class PgpEngine {
os.flush(); os.flush();
String[] lines = os.toString().split("\n"); String[] lines = os.toString().split("\n");
boolean sig = false; boolean sig = false;
for(String line : lines) { for (String line : lines) {
if (sig) { if (sig) {
if (line.contains("END PGP SIGNATURE")) { if (line.contains("END PGP SIGNATURE")) {
sig = false; sig = false;

View file

@ -149,9 +149,11 @@ public class Message extends AbstractEntity {
public String getReadableBody(Context context) { public String getReadableBody(Context context) {
if ((encryption == ENCRYPTION_PGP) && (type == TYPE_TEXT)) { if ((encryption == ENCRYPTION_PGP) && (type == TYPE_TEXT)) {
return context.getText(R.string.encrypted_message_received).toString(); return context.getText(R.string.encrypted_message_received)
.toString();
} else if ((encryption == ENCRYPTION_OTR) && (type == TYPE_IMAGE)) { } else if ((encryption == ENCRYPTION_OTR) && (type == TYPE_IMAGE)) {
return context.getText(R.string.encrypted_image_received).toString(); return context.getText(R.string.encrypted_image_received)
.toString();
} else if (encryption == ENCRYPTION_DECRYPTION_FAILED) { } else if (encryption == ENCRYPTION_DECRYPTION_FAILED) {
return context.getText(R.string.decryption_failed).toString(); return context.getText(R.string.decryption_failed).toString();
} else if (type == TYPE_IMAGE) { } else if (type == TYPE_IMAGE) {

View file

@ -158,8 +158,8 @@ public class MucOptions {
} }
aboutToRename = false; aboutToRename = false;
} }
if (conversation.getBookmark() != null && if (conversation.getBookmark() != null
conversation.getBookmark().isProvidePassword()) { && conversation.getBookmark().isProvidePassword()) {
this.passwordChanged = false; this.passwordChanged = false;
} }
} else { } else {
@ -194,8 +194,8 @@ public class MucOptions {
this.error = ERROR_NICK_IN_USE; this.error = ERROR_NICK_IN_USE;
} }
} else if (error.hasChild("not-authorized")) { } else if (error.hasChild("not-authorized")) {
if (conversation.getBookmark() != null && if (conversation.getBookmark() != null
conversation.getBookmark().isProvidePassword()) { && conversation.getBookmark().isProvidePassword()) {
this.passwordChanged = true; this.passwordChanged = true;
} }
this.error = ERROR_PASSWORD_REQUIRED; this.error = ERROR_PASSWORD_REQUIRED;
@ -323,8 +323,8 @@ public class MucOptions {
} }
public String getPassword() { public String getPassword() {
if (conversation.getBookmark() != null && if (conversation.getBookmark() != null
conversation.getBookmark().getPassword() != null) { && conversation.getBookmark().getPassword() != null) {
return conversation.getBookmark().getPassword(); return conversation.getBookmark().getPassword();
} else { } else {
return this.password; return this.password;
@ -332,8 +332,8 @@ public class MucOptions {
} }
public void setPassword(String password) { public void setPassword(String password) {
if (conversation.getBookmark() != null && if (conversation.getBookmark() != null
conversation.getBookmark().isProvidePassword()) { && conversation.getBookmark().isProvidePassword()) {
conversation.getBookmark().setPassword(password); conversation.getBookmark().setPassword(password);
} else { } else {
this.password = password; this.password = password;

View file

@ -75,9 +75,8 @@ public class MessageParser extends AbstractParser implements
} }
if (!conversation.hasValidOtrSession()) { if (!conversation.hasValidOtrSession()) {
if (properlyAddressed) { if (properlyAddressed) {
conversation.startOtrSession( conversation.startOtrSession(mXmppConnectionService, presence,
mXmppConnectionService, false);
presence, false);
} else { } else {
return null; return null;
} }
@ -87,8 +86,7 @@ public class MessageParser extends AbstractParser implements
if (!foreignPresence.equals(presence)) { if (!foreignPresence.equals(presence)) {
conversation.endOtrIfNeeded(); conversation.endOtrIfNeeded();
if (properlyAddressed) { if (properlyAddressed) {
conversation.startOtrSession( conversation.startOtrSession(mXmppConnectionService,
mXmppConnectionService,
presence, false); presence, false);
} else { } else {
return null; return null;
@ -289,7 +287,8 @@ public class MessageParser extends AbstractParser implements
if (!conversation.getMucOptions().online()) { if (!conversation.getMucOptions().online()) {
if (x.hasChild("password")) { if (x.hasChild("password")) {
Element password = x.findChild("password"); Element password = x.findChild("password");
conversation.getMucOptions().setPassword(password.getContent()); conversation.getMucOptions().setPassword(
password.getContent());
} }
mXmppConnectionService.joinMuc(conversation); mXmppConnectionService.joinMuc(conversation);
mXmppConnectionService.updateConversationUi(); mXmppConnectionService.updateConversationUi();
@ -453,7 +452,8 @@ public class MessageParser extends AbstractParser implements
Conversation conversation = message.getConversation(); Conversation conversation = message.getConversation();
conversation.getMessages().add(message); conversation.getMessages().add(message);
if (packet.getType() != MessagePacket.TYPE_ERROR) { if (packet.getType() != MessagePacket.TYPE_ERROR) {
if (message.getEncryption() == Message.ENCRYPTION_NONE || mXmppConnectionService.saveEncryptedMessages()) { if (message.getEncryption() == Message.ENCRYPTION_NONE
|| mXmppConnectionService.saveEncryptedMessages()) {
mXmppConnectionService.databaseBackend.createMessage(message); mXmppConnectionService.databaseBackend.createMessage(message);
} }
} }

View file

@ -107,7 +107,8 @@ public class PresenceParser extends AbstractParser implements
contact.setOption(Contact.Options.PENDING_SUBSCRIPTION_REQUEST); contact.setOption(Contact.Options.PENDING_SUBSCRIPTION_REQUEST);
} }
} }
Element nick = packet.findChild("nick", "http://jabber.org/protocol/nick"); Element nick = packet.findChild("nick",
"http://jabber.org/protocol/nick");
if (nick != null) { if (nick != null) {
contact.setPresenceName(nick.getContent()); contact.setPresenceName(nick.getContent());
} }

View file

@ -163,7 +163,8 @@ public class DatabaseBackend extends SQLiteOpenHelper {
+ "=?", selectionArgs, null, null, Message.TIME_SENT + "=?", selectionArgs, null, null, Message.TIME_SENT
+ " DESC", String.valueOf(limit)); + " DESC", String.valueOf(limit));
} else { } else {
String[] selectionArgs = { conversation.getUuid(), Long.toString(timestamp) }; String[] selectionArgs = { conversation.getUuid(),
Long.toString(timestamp) };
cursor = db.query(Message.TABLENAME, null, Message.CONVERSATION cursor = db.query(Message.TABLENAME, null, Message.CONVERSATION
+ "=? and " + Message.TIME_SENT + "<?", selectionArgs, + "=? and " + Message.TIME_SENT + "<?", selectionArgs,
null, null, Message.TIME_SENT + " DESC", null, null, Message.TIME_SENT + " DESC",

View file

@ -585,7 +585,8 @@ public class XmppConnectionService extends Service {
} }
if (saveInDb) { if (saveInDb) {
if (message.getEncryption() == Message.ENCRYPTION_NONE || saveEncryptedMessages()) { if (message.getEncryption() == Message.ENCRYPTION_NONE
|| saveEncryptedMessages()) {
databaseBackend.createMessage(message); databaseBackend.createMessage(message);
} }
} }

View file

@ -82,8 +82,7 @@ public class ChooseContactActivity extends XmppActivity {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_choose_contact); setContentView(R.layout.activity_choose_contact);
mListView = (ListView) findViewById(R.id.choose_contact_list); mListView = (ListView) findViewById(R.id.choose_contact_list);
mContactsAdapter = new ListItemAdapter(getApplicationContext(), mContactsAdapter = new ListItemAdapter(this, contacts);
contacts);
mListView.setAdapter(mContactsAdapter); mListView.setAdapter(mContactsAdapter);
mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() { mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@ -98,7 +97,7 @@ public class ChooseContactActivity extends XmppActivity {
ListItem mListItem = contacts.get(position); ListItem mListItem = contacts.get(position);
data.putExtra("contact", mListItem.getJid()); data.putExtra("contact", mListItem.getJid());
String account = request.getStringExtra("account"); String account = request.getStringExtra("account");
if (account==null && mListItem instanceof Contact) { if (account == null && mListItem instanceof Contact) {
account = ((Contact) mListItem).getAccount().getJid(); account = ((Contact) mListItem).getAccount().getJid();
} }
data.putExtra("account", account); data.putExtra("account", account);

View file

@ -325,10 +325,12 @@ public class ContactDetailsActivity extends XmppActivity {
for (Iterator<String> iterator = contact.getOtrFingerprints() for (Iterator<String> iterator = contact.getOtrFingerprints()
.iterator(); iterator.hasNext();) { .iterator(); iterator.hasNext();) {
final String otrFingerprint = iterator.next(); final String otrFingerprint = iterator.next();
View view = (View) inflater.inflate(R.layout.contact_key, keys,false); View view = (View) inflater.inflate(R.layout.contact_key, keys,
false);
TextView key = (TextView) view.findViewById(R.id.key); TextView key = (TextView) view.findViewById(R.id.key);
TextView keyType = (TextView) view.findViewById(R.id.key_type); TextView keyType = (TextView) view.findViewById(R.id.key_type);
ImageButton remove = (ImageButton) view.findViewById(R.id.button_remove); ImageButton remove = (ImageButton) view
.findViewById(R.id.button_remove);
remove.setVisibility(View.VISIBLE); remove.setVisibility(View.VISIBLE);
keyType.setText("OTR Fingerprint"); keyType.setText("OTR Fingerprint");
key.setText(otrFingerprint); key.setText(otrFingerprint);
@ -342,7 +344,8 @@ public class ContactDetailsActivity extends XmppActivity {
}); });
} }
if (contact.getPgpKeyId() != 0) { if (contact.getPgpKeyId() != 0) {
View view = (View) inflater.inflate(R.layout.contact_key, keys,false); View view = (View) inflater.inflate(R.layout.contact_key, keys,
false);
TextView key = (TextView) view.findViewById(R.id.key); TextView key = (TextView) view.findViewById(R.id.key);
TextView keyType = (TextView) view.findViewById(R.id.key_type); TextView keyType = (TextView) view.findViewById(R.id.key_type);
keyType.setText("PGP Key ID"); keyType.setText("PGP Key ID");
@ -376,13 +379,15 @@ public class ContactDetailsActivity extends XmppActivity {
builder.setTitle(R.string.delete_fingerprint); builder.setTitle(R.string.delete_fingerprint);
builder.setMessage(R.string.sure_delete_fingerprint); builder.setMessage(R.string.sure_delete_fingerprint);
builder.setNegativeButton(R.string.cancel, null); builder.setNegativeButton(R.string.cancel, null);
builder.setPositiveButton(R.string.delete,new android.content.DialogInterface.OnClickListener() { builder.setPositiveButton(R.string.delete,
new android.content.DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {
if (contact.deleteOtrFingerprint(fingerprint)) { if (contact.deleteOtrFingerprint(fingerprint)) {
populateView(); populateView();
xmppConnectionService.syncRosterToDisk(contact.getAccount()); xmppConnectionService.syncRosterToDisk(contact
.getAccount());
} }
} }

View file

@ -324,7 +324,8 @@ public class ConversationActivity extends XmppActivity {
} else { } else {
showInstallPgpDialog(); showInstallPgpDialog();
} }
} else if (getSelectedConversation().getNextEncryption(forceEncryption()) == Message.ENCRYPTION_NONE) { } else if (getSelectedConversation().getNextEncryption(
forceEncryption()) == Message.ENCRYPTION_NONE) {
selectPresenceToAttachFile(attachmentChoice); selectPresenceToAttachFile(attachmentChoice);
} else { } else {
selectPresenceToAttachFile(attachmentChoice); selectPresenceToAttachFile(attachmentChoice);
@ -440,7 +441,8 @@ public class ConversationActivity extends XmppActivity {
popup.inflate(R.menu.encryption_choices); popup.inflate(R.menu.encryption_choices);
MenuItem otr = popup.getMenu().findItem( MenuItem otr = popup.getMenu().findItem(
R.id.encryption_choice_otr); R.id.encryption_choice_otr);
MenuItem none = popup.getMenu().findItem(R.id.encryption_choice_none); MenuItem none = popup.getMenu().findItem(
R.id.encryption_choice_none);
if (conversation.getMode() == Conversation.MODE_MULTI) { if (conversation.getMode() == Conversation.MODE_MULTI) {
otr.setEnabled(false); otr.setEnabled(false);
} else { } else {

View file

@ -2,6 +2,7 @@ package eu.siacs.conversations.ui;
import java.util.Locale; import java.util.Locale;
import eu.siacs.conversations.R;
import eu.siacs.conversations.entities.Account; import eu.siacs.conversations.entities.Account;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.SharedPreferences.OnSharedPreferenceChangeListener; import android.content.SharedPreferences.OnSharedPreferenceChangeListener;

View file

@ -191,8 +191,7 @@ public class StartConversationActivity extends XmppActivity {
} }
}); });
mConferenceAdapter = new ListItemAdapter(getApplicationContext(), mConferenceAdapter = new ListItemAdapter(this, conferences);
conferences);
mConferenceListFragment.setListAdapter(mConferenceAdapter); mConferenceListFragment.setListAdapter(mConferenceAdapter);
mConferenceListFragment.setContextMenu(R.menu.conference_context); mConferenceListFragment.setContextMenu(R.menu.conference_context);
mConferenceListFragment mConferenceListFragment
@ -205,8 +204,7 @@ public class StartConversationActivity extends XmppActivity {
} }
}); });
mContactsAdapter = new ListItemAdapter(getApplicationContext(), mContactsAdapter = new ListItemAdapter(this, contacts);
contacts);
mContactsListFragment.setListAdapter(mContactsAdapter); mContactsListFragment.setListAdapter(mContactsAdapter);
mContactsListFragment.setContextMenu(R.menu.contact_context); mContactsListFragment.setContextMenu(R.menu.contact_context);
mContactsListFragment mContactsListFragment

View file

@ -21,6 +21,7 @@ import android.app.AlertDialog.Builder;
import android.content.ComponentName; import android.content.ComponentName;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.content.DialogInterface.OnClickListener; import android.content.DialogInterface.OnClickListener;
import android.content.IntentSender.SendIntentException; import android.content.IntentSender.SendIntentException;
import android.content.res.Resources; import android.content.res.Resources;
@ -33,6 +34,7 @@ import android.net.Uri;
import android.os.AsyncTask; import android.os.AsyncTask;
import android.os.Bundle; import android.os.Bundle;
import android.os.IBinder; import android.os.IBinder;
import android.preference.PreferenceManager;
import android.text.InputType; import android.text.InputType;
import android.util.DisplayMetrics; import android.util.DisplayMetrics;
import android.util.Log; import android.util.Log;
@ -183,6 +185,14 @@ public abstract class XmppActivity extends Activity {
mSecondaryTextColor = getResources().getColor(R.color.secondarytext); mSecondaryTextColor = getResources().getColor(R.color.secondarytext);
mWarningTextColor = getResources().getColor(R.color.warningtext); mWarningTextColor = getResources().getColor(R.color.warningtext);
mPrimaryColor = getResources().getColor(R.color.primary); mPrimaryColor = getResources().getColor(R.color.primary);
if (getPreferences().getBoolean("use_larger_font", false)) {
setTheme(R.style.ConversationsTheme_LargerText);
}
}
protected SharedPreferences getPreferences() {
return PreferenceManager
.getDefaultSharedPreferences(getApplicationContext());
} }
public void switchToConversation(Conversation conversation) { public void switchToConversation(Conversation conversation) {
@ -309,8 +319,9 @@ public abstract class XmppActivity extends Activity {
@Override @Override
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {
if (xmppConnectionServiceBound) { if (xmppConnectionServiceBound) {
xmppConnectionService.sendPresencePacket(contact.getAccount(), xmppConnectionService.sendPresencePacket(contact
xmppConnectionService.getPresenceGenerator() .getAccount(), xmppConnectionService
.getPresenceGenerator()
.requestPresenceUpdatesFrom(contact)); .requestPresenceUpdatesFrom(contact));
} }
} }
@ -318,7 +329,8 @@ public abstract class XmppActivity extends Activity {
builder.create().show(); builder.create().show();
} }
private void warnMutalPresenceSubscription(final Conversation conversation,final OnPresenceSelected listener) { private void warnMutalPresenceSubscription(final Conversation conversation,
final OnPresenceSelected listener) {
AlertDialog.Builder builder = new AlertDialog.Builder(this); AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(conversation.getContact().getJid()); builder.setTitle(conversation.getContact().getJid());
builder.setMessage(R.string.without_mutual_presence_updates); builder.setMessage(R.string.without_mutual_presence_updates);
@ -328,7 +340,7 @@ public abstract class XmppActivity extends Activity {
@Override @Override
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {
conversation.setNextPresence(null); conversation.setNextPresence(null);
if (listener!=null) { if (listener != null) {
listener.onPresenceSelected(); listener.onPresenceSelected();
} }
} }
@ -388,8 +400,9 @@ public abstract class XmppActivity extends Activity {
&& !contact.getOption(Contact.Options.ASKING) && !contact.getOption(Contact.Options.ASKING)
&& contact.getAccount().getStatus() == Account.STATUS_ONLINE) { && contact.getAccount().getStatus() == Account.STATUS_ONLINE) {
showAskForPresenceDialog(contact); showAskForPresenceDialog(contact);
} else if (!contact.getOption(Contact.Options.TO) || !contact.getOption(Contact.Options.FROM)) { } else if (!contact.getOption(Contact.Options.TO)
warnMutalPresenceSubscription(conversation,listener); || !contact.getOption(Contact.Options.FROM)) {
warnMutalPresenceSubscription(conversation, listener);
} else { } else {
conversation.setNextPresence(null); conversation.setNextPresence(null);
listener.onPresenceSelected(); listener.onPresenceSelected();

View file

@ -462,7 +462,8 @@ public class MessageAdapter extends ArrayAdapter<Message> {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
Downloadable downloadable = item.getDownloadable(); Downloadable downloadable = item
.getDownloadable();
if (downloadable != null) { if (downloadable != null) {
downloadable.start(); downloadable.start();
} }

View file

@ -215,8 +215,8 @@ public class UIHelper {
List<User> members = conversation.getMucOptions().getUsers(); List<User> members = conversation.getMucOptions().getUsers();
if (members.size() == 0) { if (members.size() == 0) {
return getUnknownContactPicture( return getUnknownContactPicture(
new String[] { conversation.getName() }, size, new String[] { conversation.getName() }, size, bgColor,
bgColor, fgColor); fgColor);
} }
ArrayList<String> names = new ArrayList<String>(); ArrayList<String> names = new ArrayList<String>();
names.add(conversation.getMucOptions().getActualNick()); names.add(conversation.getMucOptions().getActualNick());
@ -548,10 +548,13 @@ public class UIHelper {
private final static class EmoticonPattern { private final static class EmoticonPattern {
Pattern pattern; Pattern pattern;
String replacement; String replacement;
EmoticonPattern(String ascii, int unicode) { EmoticonPattern(String ascii, int unicode) {
this.pattern = Pattern.compile("(?<=(^|\\s))" + ascii + "(?=(\\s|$))"); this.pattern = Pattern.compile("(?<=(^|\\s))" + ascii
this.replacement = new String(new int[]{unicode, }, 0, 1); + "(?=(\\s|$))");
this.replacement = new String(new int[] { unicode, }, 0, 1);
} }
String replaceAll(String body) { String replaceAll(String body) {
return pattern.matcher(body).replaceAll(replacement); return pattern.matcher(body).replaceAll(replacement);
} }
@ -571,12 +574,11 @@ public class UIHelper {
new EmoticonPattern(":-?[Ppb]", 0x1f61b), new EmoticonPattern(":-?[Ppb]", 0x1f61b),
new EmoticonPattern(":-?\\(", 0x1f61e), new EmoticonPattern(":-?\\(", 0x1f61e),
new EmoticonPattern(":-?[0Oo]", 0x1f62e), new EmoticonPattern(":-?[0Oo]", 0x1f62e),
new EmoticonPattern("\\\\o/", 0x1F631), new EmoticonPattern("\\\\o/", 0x1F631), };
};
public static String transformAsciiEmoticons(String body) { public static String transformAsciiEmoticons(String body) {
if (body != null) { if (body != null) {
for (EmoticonPattern p: patterns) { for (EmoticonPattern p : patterns) {
body = p.replaceAll(body); body = p.replaceAll(body);
} }
body = body.trim(); body = body.trim();

View file

@ -763,12 +763,15 @@ public class XmppConnection implements Runnable {
}); });
} }
private void processStreamError(Tag currentTag) throws XmlPullParserException, IOException { private void processStreamError(Tag currentTag)
throws XmlPullParserException, IOException {
Element streamError = tagReader.readElement(currentTag); Element streamError = tagReader.readElement(currentTag);
if (streamError!=null && streamError.hasChild("conflict")) { if (streamError != null && streamError.hasChild("conflict")) {
String resource = account.getResource().split("\\.")[0]; String resource = account.getResource().split("\\.")[0];
account.setResource(resource+"."+nextRandomId()); account.setResource(resource + "." + nextRandomId());
Log.d(Config.LOGTAG,account.getJid()+": switching resource due to conflict ("+account.getResource()+")"); Log.d(Config.LOGTAG,
account.getJid() + ": switching resource due to conflict ("
+ account.getResource() + ")");
} }
} }

View file

@ -96,8 +96,8 @@ public class JingleConnection implements Downloadable {
BitmapFactory.decodeFile(file.getAbsolutePath(), options); BitmapFactory.decodeFile(file.getAbsolutePath(), options);
int imageHeight = options.outHeight; int imageHeight = options.outHeight;
int imageWidth = options.outWidth; int imageWidth = options.outWidth;
message.setBody(Long.toString(file.getSize()) + ',' + imageWidth + ',' message.setBody(Long.toString(file.getSize()) + ','
+ imageHeight); + imageWidth + ',' + imageHeight);
mXmppConnectionService.databaseBackend.createMessage(message); mXmppConnectionService.databaseBackend.createMessage(message);
mXmppConnectionService.markMessage(message, mXmppConnectionService.markMessage(message,
Message.STATUS_RECEIVED); Message.STATUS_RECEIVED);

View file

@ -135,7 +135,8 @@ public class JingleInbandTransport extends JingleTransport {
Element data = iq.addChild("data", Element data = iq.addChild("data",
"http://jabber.org/protocol/ibb"); "http://jabber.org/protocol/ibb");
data.setAttribute("seq", Integer.toString(this.seq)); data.setAttribute("seq", Integer.toString(this.seq));
data.setAttribute("block-size", Integer.toString(this.blockSize)); data.setAttribute("block-size",
Integer.toString(this.blockSize));
data.setAttribute("sid", this.sessionId); data.setAttribute("sid", this.sessionId);
data.setContent(base64); data.setContent(base64);
this.account.getXmppConnection().sendIqPacket(iq, this.account.getXmppConnection().sendIqPacket(iq,

View file

@ -58,9 +58,9 @@ public class JingleSocks5Transport extends JingleTransport {
byte[] reply = new byte[2]; byte[] reply = new byte[2];
outputStream.write(login); outputStream.write(login);
inputStream.read(reply); inputStream.read(reply);
final String connect = Character.toString('\u0005') + '\u0001' + '\u0000' final String connect = Character.toString('\u0005')
+ '\u0003' + '\u0028' + destination + '\u0000' + '\u0001' + '\u0000' + '\u0003' + '\u0028'
+ '\u0000'; + destination + '\u0000' + '\u0000';
if (Arrays.equals(reply, expectedReply)) { if (Arrays.equals(reply, expectedReply)) {
outputStream.write(connect.getBytes()); outputStream.write(connect.getBytes());
byte[] result = new byte[2]; byte[] result = new byte[2];