Added "Warning" icon instead of "CW" text. (#1138)

* Added «Warning» icon instead of «CW» text.
Icon source: https://ionicons.com/

* Updated icon to "sms_failed"
This commit is contained in:
Evgeny Petrov 2019-04-01 20:19:37 +03:00 committed by Konrad Pozniak
parent 26b10fa68b
commit 735231150b
3 changed files with 14 additions and 7 deletions

View File

@ -29,6 +29,7 @@ import android.content.res.Resources;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.graphics.PorterDuff; import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.media.Image;
import android.net.Uri; import android.net.Uri;
import android.os.AsyncTask; import android.os.AsyncTask;
import android.os.Build; import android.os.Build;
@ -202,7 +203,7 @@ public final class ComposeActivity
private TootButton tootButton; private TootButton tootButton;
private ImageButton pickButton; private ImageButton pickButton;
private ImageButton visibilityButton; private ImageButton visibilityButton;
private Button contentWarningButton; private ImageButton contentWarningButton;
private ImageButton emojiButton; private ImageButton emojiButton;
private ImageButton hideMediaToggle; private ImageButton hideMediaToggle;
@ -1484,12 +1485,10 @@ public final class ComposeActivity
if (show) { if (show) {
statusMarkSensitive = true; statusMarkSensitive = true;
contentWarningBar.setVisibility(View.VISIBLE); contentWarningBar.setVisibility(View.VISIBLE);
contentWarningButton.setTextColor(ContextCompat.getColor(this, R.color.tusky_blue));
contentWarningEditor.setSelection(contentWarningEditor.getText().length()); contentWarningEditor.setSelection(contentWarningEditor.getText().length());
contentWarningEditor.requestFocus(); contentWarningEditor.requestFocus();
} else { } else {
contentWarningBar.setVisibility(View.GONE); contentWarningBar.setVisibility(View.GONE);
contentWarningButton.setTextColor(ThemeUtils.getColor(this, android.R.attr.textColorTertiary));
} }
updateHideMediaToggle(); updateHideMediaToggle();

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FF000000"
android:pathData="M20,2L4,2c-1.1,0 -1.99,0.9 -1.99,2L2,22l4,-4h14c1.1,0 2,-0.9 2,-2L22,4c0,-1.1 -0.9,-2 -2,-2zM13,14h-2v-2h2v2zM13,10h-2L11,6h2v4z"/>
</vector>

View File

@ -242,17 +242,16 @@
android:visibility="gone" android:visibility="gone"
tools:src="@drawable/ic_eye_24dp" /> tools:src="@drawable/ic_eye_24dp" />
<androidx.appcompat.widget.AppCompatButton <ImageButton
android:id="@+id/composeContentWarningButton" android:id="@+id/composeContentWarningButton"
style="?attr/image_button_style" style="?attr/image_button_style"
android:layout_width="36dp" android:layout_width="36dp"
android:layout_height="36dp" android:layout_height="36dp"
android:layout_marginEnd="4dp" android:layout_marginEnd="4dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/action_content_warning" android:contentDescription="@string/action_content_warning"
android:padding="4dp" android:padding="4dp"
android:text="@string/text_content_warning_button" android:tooltipText="@string/action_content_warning"
android:tooltipText="@string/action_content_warning" /> app:srcCompat="@drawable/ic_cw_24dp"/>
<ImageButton <ImageButton
android:id="@+id/composeEmojiButton" android:id="@+id/composeEmojiButton"