Add back the highlight and sticker tools.

This commit is contained in:
Greyson Parrelli 2019-03-21 10:47:59 -07:00
parent 749d096931
commit aa5e32f0ee
24 changed files with 37 additions and 6 deletions

View File

@ -400,7 +400,7 @@
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/> android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
<activity android:name=".scribbles.StickerSelectActivity" <activity android:name=".scribbles.StickerSelectActivity"
android:theme="@style/TextSecure.ScribbleTheme" android:theme="@style/TextSecure.DarkTheme"
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/> android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
<activity android:name="com.theartofdev.edmodo.cropper.CropImageActivity" <activity android:name="com.theartofdev.edmodo.cropper.CropImageActivity"

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 782 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 609 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

View File

@ -57,6 +57,22 @@
android:padding="8dp" android:padding="8dp"
android:src="@drawable/ic_undo_36" /> android:src="@drawable/ic_undo_36" />
<ImageView
android:id="@+id/scribble_draw_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackgroundBorderless"
android:padding="8dp"
android:src="@drawable/ic_marker_36" />
<ImageView
android:id="@+id/scribble_highlight_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackgroundBorderless"
android:padding="8dp"
android:src="@drawable/ic_highlighter_36" />
<ImageView <ImageView
android:id="@+id/scribble_text_button" android:id="@+id/scribble_text_button"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -66,12 +82,12 @@
android:src="@drawable/ic_text_36" /> android:src="@drawable/ic_text_36" />
<ImageView <ImageView
android:id="@+id/scribble_draw_button" android:id="@+id/scribble_sticker_button"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="?attr/selectableItemBackgroundBorderless" android:background="?attr/selectableItemBackgroundBorderless"
android:padding="8dp" android:padding="8dp"
android:src="@drawable/ic_marker_36" /> android:src="@drawable/ic_camera_emoji_36" />
<ImageView <ImageView
android:id="@+id/scribble_confirm_button" android:id="@+id/scribble_confirm_button"

View File

@ -9,15 +9,14 @@
android:id="@+id/tabs" android:id="@+id/tabs"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:tabBackground="@color/signal_primary" app:tabBackground="@color/core_grey_90"
app:tabMode="fixed"/> app:tabMode="fixed"/>
<android.support.v4.view.ViewPager <android.support.v4.view.ViewPager
android:id="@+id/pager" android:id="@+id/pager"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0px" android:layout_height="0px"
android:layout_weight="1" android:layout_weight="1" />
android:background="@android:color/white" />
</LinearLayout> </LinearLayout>

View File

@ -41,7 +41,9 @@ import java.util.Set;
public class ScribbleHud extends InputAwareLayout implements ViewTreeObserver.OnGlobalLayoutListener { public class ScribbleHud extends InputAwareLayout implements ViewTreeObserver.OnGlobalLayoutListener {
private View drawButton; private View drawButton;
private View highlightButton;
private View textButton; private View textButton;
private View stickerButton;
private View undoButton; private View undoButton;
private View deleteButton; private View deleteButton;
private View confirmButton; private View confirmButton;
@ -110,7 +112,9 @@ public class ScribbleHud extends InputAwareLayout implements ViewTreeObserver.On
setOrientation(VERTICAL); setOrientation(VERTICAL);
drawButton = findViewById(R.id.scribble_draw_button); drawButton = findViewById(R.id.scribble_draw_button);
highlightButton = findViewById(R.id.scribble_highlight_button);
textButton = findViewById(R.id.scribble_text_button); textButton = findViewById(R.id.scribble_text_button);
stickerButton = findViewById(R.id.scribble_sticker_button);
undoButton = findViewById(R.id.scribble_undo_button); undoButton = findViewById(R.id.scribble_undo_button);
deleteButton = findViewById(R.id.scribble_delete_button); deleteButton = findViewById(R.id.scribble_delete_button);
confirmButton = findViewById(R.id.scribble_confirm_button); confirmButton = findViewById(R.id.scribble_confirm_button);
@ -255,7 +259,9 @@ public class ScribbleHud extends InputAwareLayout implements ViewTreeObserver.On
private void presentModeNone() { private void presentModeNone() {
drawButton.setVisibility(VISIBLE); drawButton.setVisibility(VISIBLE);
highlightButton.setVisibility(VISIBLE);
textButton.setVisibility(VISIBLE); textButton.setVisibility(VISIBLE);
stickerButton.setVisibility(VISIBLE);
undoButton.setVisibility(GONE); undoButton.setVisibility(GONE);
deleteButton.setVisibility(GONE); deleteButton.setVisibility(GONE);
@ -264,7 +270,9 @@ public class ScribbleHud extends InputAwareLayout implements ViewTreeObserver.On
colorPalette.setVisibility(GONE); colorPalette.setVisibility(GONE);
drawButton.setOnClickListener(v -> setMode(Mode.DRAW)); drawButton.setOnClickListener(v -> setMode(Mode.DRAW));
highlightButton.setOnClickListener(v -> setMode(Mode.HIGHLIGHT));
textButton.setOnClickListener(v -> setMode(Mode.TEXT)); textButton.setOnClickListener(v -> setMode(Mode.TEXT));
stickerButton.setOnClickListener(v -> setMode(Mode.STICKER));
} }
private void presentModeDraw() { private void presentModeDraw() {
@ -274,7 +282,9 @@ public class ScribbleHud extends InputAwareLayout implements ViewTreeObserver.On
colorPalette.setVisibility(VISIBLE); colorPalette.setVisibility(VISIBLE);
drawButton.setVisibility(GONE); drawButton.setVisibility(GONE);
highlightButton.setVisibility(GONE);
textButton.setVisibility(GONE); textButton.setVisibility(GONE);
stickerButton.setVisibility(GONE);
deleteButton.setVisibility(GONE); deleteButton.setVisibility(GONE);
@ -289,8 +299,10 @@ public class ScribbleHud extends InputAwareLayout implements ViewTreeObserver.On
colorPalette.setVisibility(VISIBLE); colorPalette.setVisibility(VISIBLE);
drawButton.setVisibility(GONE); drawButton.setVisibility(GONE);
highlightButton.setVisibility(GONE);
textButton.setVisibility(GONE); textButton.setVisibility(GONE);
deleteButton.setVisibility(GONE); deleteButton.setVisibility(GONE);
stickerButton.setVisibility(GONE);
colorPicker.setOnColorChangeListener(highlightOnColorChangeListener); colorPicker.setOnColorChangeListener(highlightOnColorChangeListener);
colorPicker.setActiveColor(Color.YELLOW); colorPicker.setActiveColor(Color.YELLOW);
@ -304,6 +316,8 @@ public class ScribbleHud extends InputAwareLayout implements ViewTreeObserver.On
textButton.setVisibility(GONE); textButton.setVisibility(GONE);
drawButton.setVisibility(GONE); drawButton.setVisibility(GONE);
highlightButton.setVisibility(GONE);
stickerButton.setVisibility(GONE);
undoButton.setVisibility(GONE); undoButton.setVisibility(GONE);
colorPicker.setOnColorChangeListener(standardOnColorChangeListener); colorPicker.setOnColorChangeListener(standardOnColorChangeListener);
@ -315,7 +329,9 @@ public class ScribbleHud extends InputAwareLayout implements ViewTreeObserver.On
confirmButton.setVisibility(VISIBLE); confirmButton.setVisibility(VISIBLE);
drawButton.setVisibility(GONE); drawButton.setVisibility(GONE);
highlightButton.setVisibility(GONE);
textButton.setVisibility(GONE); textButton.setVisibility(GONE);
stickerButton.setVisibility(GONE);
undoButton.setVisibility(GONE); undoButton.setVisibility(GONE);
colorPicker.setVisibility(GONE); colorPicker.setVisibility(GONE);
colorPalette.setVisibility(GONE); colorPalette.setVisibility(GONE);