Support for stickers and scribbles

// FREEBIE
This commit is contained in:
Moxie Marlinspike
2016-12-08 14:20:38 -08:00
parent c8fe671f9c
commit 1b44bdcd3c
351 changed files with 4738 additions and 24 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 268 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 416 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 443 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 391 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 593 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 459 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 303 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 304 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 244 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 376 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 293 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 315 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 500 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 426 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 457 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 774 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 449 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 429 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 334 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 724 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 753 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 675 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 734 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 281 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 532 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 386 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 856 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 927 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 908 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 843 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 365 B

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<size android:height="30dp" android:width="30dp"/>
<solid android:color="@color/grey_400_transparent"/>
<corners android:bottomLeftRadius="0dp" android:topLeftRadius="0dp" android:topRightRadius="0dp" android:bottomRightRadius="@dimen/message_bubble_corner_radius"/>
</shape>
</item>
<item android:drawable="@drawable/ic_create_white_24dp"
android:left="5dp"
android:right="5dp"
android:top="5dp"
android:bottom="5dp"
android:scaleType="centerInside">
</item>
</layer-list>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<stroke android:width="1dp" android:color="@color/white" />
<size android:width="2dp" />
</shape>

View File

@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto">
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context="org.thoughtcrime.securesms.components.AudioView">
<LinearLayout android:id="@+id/audio_widget_container"
android:orientation="vertical"

View File

@@ -40,7 +40,7 @@
android:background="?android:windowBackground"
android:visibility="gone">
<org.thoughtcrime.securesms.components.RemovableMediaView
<org.thoughtcrime.securesms.components.RemovableEditableMediaView
android:id="@+id/removable_media_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -67,13 +67,13 @@
android:layout_width="210dp"
android:layout_height="wrap_content"
android:visibility="gone"
android:background="@color/white"
android:paddingTop="15dp"
android:paddingBottom="15dp"
app:widgetBackground="@color/white"
app:foregroundTintColor="@color/grey_500"
app:backgroundTintColor="@color/white"/>
</org.thoughtcrime.securesms.components.RemovableMediaView>
</org.thoughtcrime.securesms.components.RemovableEditableMediaView>
</FrameLayout>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/edit_image_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|right"
android:src="@drawable/conversation_attachment_edit"
android:visibility="gone"/>

View File

@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="org.thoughtcrime.securesms.scribbles.ScribbleActivity">
<org.thoughtcrime.securesms.scribbles.ScribbleToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"/>
<FrameLayout android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_gravity="center"
android:background="@color/grey_300"
android:gravity="center">
<org.thoughtcrime.securesms.scribbles.widget.ScribbleView
android:id="@+id/scribble_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"/>
<org.thoughtcrime.securesms.scribbles.widget.VerticalSlideColorPicker
android:id="@+id/scribble_color_picker"
android:layout_width="13dp"
android:layout_height="300dp"
android:layout_gravity="top|right"
android:layout_marginRight="25dp"
android:layout_marginTop="20dp"
app:pickerBorderWidth="1dp"
app:pickerBorderColor="@color/grey_600"
app:pickerColors="@array/scribble_colors"/>
</FrameLayout>
</LinearLayout>

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabBackground="@color/signal_primary"
app:tabMode="fixed"/>
<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="1"
android:background="@android:color/white" />
</LinearLayout>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.RecyclerView
android:id="@+id/stickers_recycler_view"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"/>

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<ImageView android:id="@+id/sticker_image"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="120dp"
android:layout_height="120dp"
android:padding="16dp"
android:scaleType="centerInside"/>

View File

@@ -0,0 +1,82 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<LinearLayout android:layout_marginLeft="16dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:gravity="left|center_vertical"
android:layout_gravity="left">
<ImageView android:id="@+id/save"
android:src="@drawable/ic_check_white_36dp"
android:tint="@color/grey_800"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
<LinearLayout android:id="@+id/tools_view"
android:layout_marginRight="16dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:gravity="right"
android:animateLayoutChanges="true"
android:layout_gravity="right">
<ImageView android:id="@+id/delete"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="6dp"
android:padding="7dp"
android:tint="@color/grey_800"
android:src="@drawable/ic_delete_white_24dp"
android:visibility="gone"
tools:visibility="visible"/>
<ImageView android:id="@+id/undo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="6dp"
android:padding="7dp"
android:visibility="gone"
android:tint="@color/grey_800"
android:src="@drawable/ic_replay_white_24dp"/>
<ImageView android:id="@+id/separator"
android:layout_width="wrap_content"
android:layout_height="24dp"
android:layout_marginTop="7dp"
android:layout_marginLeft="6dp"
android:tint="@color/grey_800"
android:src="@drawable/vertical_separator"
android:visibility="gone"
tools:visibility="visible"/>
<ImageView android:id="@+id/sticker_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="6dp"
android:tint="@color/grey_800"
android:padding="7dp"
android:src="@drawable/ic_tag_faces_white_24dp"/>
<ImageView android:id="@+id/text_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="6dp"
android:tint="@color/grey_800"
android:padding="7dp"
android:src="@drawable/ic_text_fields_white_24dp"/>
<ImageView android:id="@+id/brush_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="6dp"
android:tint="@color/grey_800"
android:padding="7dp"
android:src="@drawable/ic_brush_white_24dp"/>
</LinearLayout>
</merge>

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<merge tools:parentTag="FrameLayout"
xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView android:id="@+id/image_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleType="centerInside"
android:adjustViewBounds="true"/>
<org.thoughtcrime.securesms.scribbles.widget.MotionView
android:id="@+id/motion_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<org.thoughtcrime.securesms.scribbles.widget.CanvasView
android:id="@+id/canvas_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/transparent"/>
</merge>

View File

@@ -253,4 +253,12 @@
<item>604800</item>
</integer-array>
<array name="scribble_colors">
<item>#000000</item>
<item>#ff0000</item>
<item>#ffff00</item>
<item>#00ffff</item>
<item>#ff00ff</item>
</array>
</resources>

View File

@@ -154,6 +154,7 @@
</declare-styleable>
<declare-styleable name="AudioView">
<attr name="widgetBackground" format="color"/>
<attr name="foregroundTintColor" format="color" />
<attr name="backgroundTintColor" format="color" />
</declare-styleable>
@@ -183,4 +184,10 @@
<attr name="square_height" format="boolean"/>
</declare-styleable>
<declare-styleable name="VerticalSlideColorPicker">
<attr name="pickerBorderColor" format="color" />
<attr name="pickerBorderWidth" format="dimension" />
<attr name="pickerColors" format="reference" />
</declare-styleable>
</resources>

View File

@@ -52,4 +52,7 @@
<color name="import_export_item_background_shadow_dark">#ff222222</color>
<color name="import_export_touch_highlight_light">#400099cc</color>
<color name="import_export_touch_highlight_dark">#40ffffff</color>
<color name="sticker_selected_color">#8cf437</color>
<color name="transparent">#00FFFFFF</color>
</resources>

View File

@@ -25,6 +25,7 @@
<dimen name="media_bubble_height">210dp</dimen>
<dimen name="media_bubble_border_width">3dp</dimen>
<dimen name="media_bubble_remove_button_size">24dp</dimen>
<dimen name="media_bubble_edit_button_size">24dp</dimen>
<integer name="media_overview_cols">3</integer>
<dimen name="message_details_table_row_pad">10dp</dimen>
@@ -63,4 +64,6 @@
<dimen name="onboarding_watermark_size">140dp</dimen>
<dimen name="onboarding_title_size">34sp</dimen>
<dimen name="onboarding_subtitle_size">20sp</dimen>
<dimen name="scribble_stroke_size">3dp</dimen>
</resources>

View File

@@ -273,4 +273,6 @@
<color name="grey_800">#424242</color>
<color name="grey_900">#212121</color>
<color name="grey_400_transparent">#44BDBDBD</color>
</resources>