Add camera preview to message composition

This commit is contained in:
Calvin Hu
2015-04-16 01:38:33 -04:00
committed by Moxie Marlinspike
parent 13eed3baa7
commit c4a37e38ab
55 changed files with 1698 additions and 19 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 457 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 640 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 324 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 469 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 310 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 362 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 290 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 310 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 915 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 534 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 644 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 234 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 548 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 560 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 781 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 303 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 983 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 539 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 795 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 784 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape
android:innerRadiusRatio="3"
android:shape="ring"
android:thickness="2dp"
android:useLevel="false" >
<solid android:color="@android:color/white" />
<size
android:height="52dp"
android:width="52dp" />
</shape>
</item>
<item>
<shape
android:innerRadiusRatio="3"
android:shape="ring"
android:thickness="2dp"
android:useLevel="false" >
<solid android:color="#40ffffff" />
<size
android:height="52dp"
android:width="52dp" />
</shape>
</item>
</selector>

View File

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<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:gravity="bottom"
tools:background="@android:color/darker_gray">
<ImageButton
android:id="@+id/shutter_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@drawable/quick_camera_shutter_ring"
android:src="@drawable/quick_shutter_button"
android:padding="20dp"/>
<ImageButton
android:id="@+id/fullscreen_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:background="#00000000"
android:src="@drawable/quick_camera_fullscreen"
android:padding="20dp"/>
<ImageButton
android:id="@+id/swap_camera_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:background="#00000000"
android:src="@drawable/quick_camera_front"
android:padding="20dp"
android:visibility="invisible"
tools:visibility="visible"/>
</RelativeLayout>

View File

@@ -10,6 +10,12 @@
android:background="?conversation_background"
android:orientation="vertical">
<org.thoughtcrime.securesms.components.QuickAttachmentDrawer
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/quick_attachment_drawer"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
@@ -95,6 +101,14 @@
tools:hint="Send TextSecure message" />
</LinearLayout>
<ImageButton android:id="@+id/quick_attachment_toggle"
android:layout_width="wrap_content"
android:layout_height="44dp"
android:src="?quick_camera_icon"
android:background="@drawable/touch_highlight_background"
android:contentDescription="@string/conversation_activity__quick_attachment_drawer_toggle_description"
android:padding="10dp"/>
<org.thoughtcrime.securesms.components.AnimatingToggle
android:id="@+id/button_toggle"
android:layout_width="50dp"
@@ -141,4 +155,6 @@
</LinearLayout>
</RelativeLayout>
</org.thoughtcrime.securesms.components.QuickAttachmentDrawer>
</org.thoughtcrime.securesms.components.KeyboardAwareLinearLayout>

View File

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<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:gravity="bottom"
tools:background="@android:color/darker_gray">
<ImageButton
android:id="@+id/shutter_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:background="@drawable/quick_camera_shutter_ring"
android:src="@drawable/quick_shutter_button"
android:padding="20dp"/>
<ImageButton
android:id="@+id/fullscreen_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:background="#00000000"
android:src="@drawable/quick_camera_fullscreen"
android:padding="20dp"/>
<ImageButton
android:id="@+id/swap_camera_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:background="#00000000"
android:src="@drawable/quick_camera_front"
android:padding="20dp"
android:visibility="invisible"
tools:visibility="visible"/>
</RelativeLayout>

View File

@@ -52,6 +52,7 @@
<attr name="emoji_category_places" format="reference"/>
<attr name="emoji_category_symbol" format="reference"/>
<attr name="emoji_category_emoticons" format="reference"/>
<attr name="quick_camera_icon" format="reference"/>
<attr name="conversation_item_background" format="reference"/>
<attr name="conversation_item_bubble_background" format="reference|color"/>

View File

@@ -28,4 +28,5 @@
<dimen name="color_grid_extra_padding">32dp</dimen>
<dimen name="color_grid_item_size">48dp</dimen>
<dimen name="quick_media_drawer_default_height">250dp</dimen>
</resources>

View File

@@ -521,6 +521,7 @@
<string name="conversation_activity__compose_description">Message composition</string>
<string name="conversation_activity__emoji_toggle_description">Toggle emoji keyboard</string>
<string name="conversation_activity__attachment_thumbnail">Attachment Thumbnail</string>
<string name="conversation_activity__quick_attachment_drawer_toggle_description">Toggle attachment drawer</string>
<!-- conversation_item -->
<string name="conversation_item__mms_downloading_description">Media message downloading</string>
@@ -981,6 +982,9 @@
<!-- transport_selection_list_item -->
<string name="transport_selection_list_item__transport_icon">Transport icon</string>
<!-- quick_attachment_drawer -->
<string name="quick_camera_unavailable">Camera unavailable</string>
<!-- EOF -->
</resources>

View File

@@ -40,6 +40,7 @@
<item name="ic_arrow_forward">@drawable/ic_arrow_forward_dark</item>
<item name="lockscreen_watermark">@drawable/lockscreen_watermark_dark</item>
<item name="android:windowBackground">@color/black</item>
<item name="conversation_background">@color/black</item>
</style>
<style name="PopupAnimation" parent="@android:style/Animation">
@@ -124,6 +125,9 @@
<item name="conversation_item_sent_text_indicator_tab_color">#99000000</item>
<item name="conversation_item_received_text_primary_color">@color/white</item>
<item name="conversation_item_received_text_secondary_color">#BFffffff</item>
<item name="quick_camera_icon">@drawable/quick_camera_light</item>
<item name="conversation_item_background">@drawable/conversation_item_background</item>
<item name="conversation_item_sent_indicator_text_background">@drawable/conversation_item_sent_indicator_text_shape</item>
@@ -250,6 +254,8 @@
<item name="emoji_category_symbol">@drawable/emoji_category_symbol_dark</item>
<item name="emoji_category_emoticons">@drawable/emoji_category_emoticons_dark</item>
<item name="quick_camera_icon">@drawable/quick_camera_dark</item>
<item name="menu_new_conversation_icon">@drawable/ic_add_white_24dp</item>
<item name="menu_group_icon">@drawable/ic_group_white_24dp</item>
<item name="menu_search_icon">@drawable/ic_search_white_24dp</item>