From dee0ca238be6ffccbc5f81ccbfb45020ab9e037a Mon Sep 17 00:00:00 2001 From: Torsten Grote <t@grobox.de> Date: Mon, 28 May 2018 16:11:30 -0300 Subject: [PATCH] Address first round of review comments --- .../keyagreement/ShowQrCodeFragment.java | 21 +++-- .../briar/android/login/PasswordActivity.java | 1 + .../threaded/BaseThreadItemViewHolder.java | 2 +- .../briar/android/util/UiUtils.java | 17 ++++ .../briar/android/view/AuthorView.java | 11 ++- .../securesms/components/emoji/EmojiView.java | 9 +- .../src/main/res/color/button_text.xml | 9 ++ .../res/drawable-night/contact_connected.xml | 2 +- .../drawable-night/contact_disconnected.xml | 2 +- .../src/main/res/drawable/bubble.xml | 2 +- .../res/drawable/ic_fullscreen_black_48dp.xml | 11 ++- .../drawable/list_item_thread_background.xml | 4 + .../src/main/res/layout/fragment_error.xml | 4 +- .../res/layout/fragment_keyagreement_qr.xml | 49 +++-------- .../list_item_conversation_notice_out.xml | 5 +- .../src/main/res/layout/power_view.xml | 4 +- .../main/res/layout/preferences_category.xml | 23 ++--- .../src/main/res/layout/text_input_view.xml | 84 +++++++++---------- .../src/main/res/values-night/color.xml | 9 +- briar-android/src/main/res/values/color.xml | 9 +- briar-android/src/main/res/values/styles.xml | 4 +- 21 files changed, 148 insertions(+), 134 deletions(-) create mode 100644 briar-android/src/main/res/color/button_text.xml diff --git a/briar-android/src/main/java/org/briarproject/briar/android/keyagreement/ShowQrCodeFragment.java b/briar-android/src/main/java/org/briarproject/briar/android/keyagreement/ShowQrCodeFragment.java index aec6c26bb7..2c38043fbb 100644 --- a/briar-android/src/main/java/org/briarproject/briar/android/keyagreement/ShowQrCodeFragment.java +++ b/briar-android/src/main/java/org/briarproject/briar/android/keyagreement/ShowQrCodeFragment.java @@ -86,9 +86,8 @@ public class ShowQrCodeFragment extends BaseEventFragment private CameraView cameraView; private View statusView; private TextView status; + private View qrCodeContainer; private ImageView qrCode; - private TextView mainProgressTitle; - private ViewGroup mainProgressContainer; private boolean fullscreen = false; private boolean gotRemotePayload; @@ -131,12 +130,10 @@ public class ShowQrCodeFragment extends BaseEventFragment cameraView = view.findViewById(R.id.camera_view); statusView = view.findViewById(R.id.status_container); status = view.findViewById(R.id.connect_status); + qrCodeContainer = view.findViewById(R.id.qr_code_container); qrCode = view.findViewById(R.id.qr_code); - mainProgressTitle = view.findViewById(R.id.title_progress_bar); - mainProgressContainer = view.findViewById(R.id.container_progress); ImageView fullscreenButton = view.findViewById(R.id.fullscreen_button); fullscreenButton.setOnClickListener(v -> { - View qrCodeContainer = view.findViewById(R.id.qr_code_container); LinearLayout cameraOverlay = view.findViewById(R.id.camera_overlay); LayoutParams statusParams, qrCodeParams; if (fullscreen) { @@ -303,8 +300,8 @@ public class ShowQrCodeFragment extends BaseEventFragment keyAgreementAborted(event.didRemoteAbort()); } else if (e instanceof KeyAgreementFinishedEvent) { runOnUiThreadUnlessDestroyed(() -> { - mainProgressContainer.setVisibility(VISIBLE); - mainProgressTitle.setText(R.string.exchanging_contact_details); + statusView.setVisibility(VISIBLE); + status.setText(R.string.exchanging_contact_details); }); } } @@ -363,16 +360,18 @@ public class ShowQrCodeFragment extends BaseEventFragment private void keyAgreementStarted() { runOnUiThreadUnlessDestroyed(() -> { - mainProgressContainer.setVisibility(VISIBLE); - mainProgressTitle.setText(R.string.authenticating_with_device); + qrCodeContainer.setVisibility(INVISIBLE); + statusView.setVisibility(VISIBLE); + status.setText(R.string.authenticating_with_device); }); } private void keyAgreementAborted(boolean remoteAborted) { runOnUiThreadUnlessDestroyed(() -> { reset(); - mainProgressContainer.setVisibility(INVISIBLE); - mainProgressTitle.setText(""); + qrCodeContainer.setVisibility(VISIBLE); + statusView.setVisibility(INVISIBLE); + status.setText(null); // TODO show abort somewhere persistent? Toast.makeText(getActivity(), remoteAborted ? R.string.connection_aborted_remote : diff --git a/briar-android/src/main/java/org/briarproject/briar/android/login/PasswordActivity.java b/briar-android/src/main/java/org/briarproject/briar/android/login/PasswordActivity.java index 55f08b204b..f4368dd9a0 100644 --- a/briar-android/src/main/java/org/briarproject/briar/android/login/PasswordActivity.java +++ b/briar-android/src/main/java/org/briarproject/briar/android/login/PasswordActivity.java @@ -107,6 +107,7 @@ public class PasswordActivity extends BaseActivity { private void deleteAccount() { passwordController.deleteAccount(this); Localizer.reinitialize(); + UiUtils.setTheme(this, getString(R.string.pref_theme_light_value)); setResult(RESULT_CANCELED); Intent i = new Intent(this, SetupActivity.class); i.setFlags(FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_CLEAR_TASK); diff --git a/briar-android/src/main/java/org/briarproject/briar/android/threaded/BaseThreadItemViewHolder.java b/briar-android/src/main/java/org/briarproject/briar/android/threaded/BaseThreadItemViewHolder.java index dc21378d6c..45f66b83b3 100644 --- a/briar-android/src/main/java/org/briarproject/briar/android/threaded/BaseThreadItemViewHolder.java +++ b/briar-android/src/main/java/org/briarproject/briar/android/threaded/BaseThreadItemViewHolder.java @@ -63,7 +63,7 @@ public abstract class BaseThreadItemViewHolder<I extends ThreadItem> ValueAnimator anim = new ValueAnimator(); int viewColor = getColor(getContext(), R.color.thread_item_highlight); anim.setIntValues(viewColor, - getColor(getContext(), R.color.window_background)); + getColor(getContext(), R.color.thread_item_background)); anim.setEvaluator(new ArgbEvaluator()); anim.setInterpolator(new AccelerateInterpolator()); anim.addListener(new Animator.AnimatorListener() { diff --git a/briar-android/src/main/java/org/briarproject/briar/android/util/UiUtils.java b/briar-android/src/main/java/org/briarproject/briar/android/util/UiUtils.java index a5589a11a6..ee30d8d37f 100644 --- a/briar-android/src/main/java/org/briarproject/briar/android/util/UiUtils.java +++ b/briar-android/src/main/java/org/briarproject/briar/android/util/UiUtils.java @@ -7,6 +7,9 @@ import android.content.DialogInterface.OnClickListener; import android.content.Intent; import android.net.Uri; import android.os.PowerManager; +import android.support.annotation.AttrRes; +import android.support.annotation.ColorInt; +import android.support.annotation.ColorRes; import android.support.design.widget.TextInputLayout; import android.support.v4.app.FragmentManager; import android.support.v4.content.ContextCompat; @@ -20,6 +23,7 @@ import android.text.format.DateUtils; import android.text.style.ClickableSpan; import android.text.style.ForegroundColorSpan; import android.text.style.URLSpan; +import android.util.TypedValue; import android.view.View; import android.widget.TextView; @@ -212,4 +216,17 @@ public class UiUtils { } } + public static int resolveAttribute(Context ctx, @AttrRes int attr) { + TypedValue outValue = new TypedValue(); + ctx.getTheme().resolveAttribute(attr, outValue, true); + return outValue.resourceId; + } + + @ColorInt + public static int resolveColorAttribute(Context ctx, @AttrRes int res) { + @ColorRes + int color = resolveAttribute(ctx, res); + return ContextCompat.getColor(ctx, color); + } + } diff --git a/briar-android/src/main/java/org/briarproject/briar/android/view/AuthorView.java b/briar-android/src/main/java/org/briarproject/briar/android/view/AuthorView.java index 117ce12cbe..cbb3cc8d0f 100644 --- a/briar-android/src/main/java/org/briarproject/briar/android/view/AuthorView.java +++ b/briar-android/src/main/java/org/briarproject/briar/android/view/AuthorView.java @@ -6,7 +6,6 @@ import android.graphics.Typeface; import android.support.annotation.DimenRes; import android.support.annotation.UiThread; import android.util.AttributeSet; -import android.util.TypedValue; import android.view.LayoutInflater; import android.view.View; import android.widget.ImageView; @@ -28,6 +27,7 @@ import static android.graphics.Typeface.BOLD; import static android.util.TypedValue.COMPLEX_UNIT_PX; import static org.briarproject.bramble.api.identity.Author.Status.NONE; import static org.briarproject.bramble.api.identity.Author.Status.OURSELVES; +import static org.briarproject.briar.android.util.UiUtils.resolveAttribute; @UiThread public class AuthorView extends RelativeLayout { @@ -107,16 +107,15 @@ public class AuthorView extends RelativeLayout { public void setAuthorClickable(OnClickListener listener) { setClickable(true); - TypedValue outValue = new TypedValue(); - getContext().getTheme().resolveAttribute( - android.R.attr.selectableItemBackground, outValue, true); - setBackgroundResource(outValue.resourceId); + int res = + resolveAttribute(getContext(), R.attr.selectableItemBackground); + setBackgroundResource(res); setOnClickListener(listener); } public void setAuthorNotClickable() { setClickable(false); - setBackgroundResource(android.R.color.transparent); + setBackgroundResource(0); setOnClickListener(null); } diff --git a/briar-android/src/main/java/org/thoughtcrime/securesms/components/emoji/EmojiView.java b/briar-android/src/main/java/org/thoughtcrime/securesms/components/emoji/EmojiView.java index 50217e3b77..2b6d61039b 100644 --- a/briar-android/src/main/java/org/thoughtcrime/securesms/components/emoji/EmojiView.java +++ b/briar-android/src/main/java/org/thoughtcrime/securesms/components/emoji/EmojiView.java @@ -6,17 +6,15 @@ import android.graphics.Paint; import android.graphics.drawable.Drawable; import android.support.annotation.NonNull; import android.support.annotation.UiThread; -import android.support.v4.content.ContextCompat; import android.util.AttributeSet; import android.view.View; -import org.briarproject.briar.R; - import javax.annotation.Nullable; import static android.graphics.Paint.ANTI_ALIAS_FLAG; import static android.graphics.Paint.Align.CENTER; import static android.graphics.Paint.FILTER_BITMAP_FLAG; +import static org.briarproject.briar.android.util.UiUtils.resolveColorAttribute; @UiThread public class EmojiView extends View implements Drawable.Callback { @@ -63,8 +61,9 @@ public class EmojiView extends View implements Drawable.Callback { float targetFontSize = 0.75f * getHeight() - getPaddingTop() - getPaddingBottom(); paint.setTextSize(targetFontSize); - paint.setColor(ContextCompat - .getColor(getContext(), R.color.emoji_text_color)); + int color = resolveColorAttribute(getContext(), + android.R.attr.textColorPrimary); + paint.setColor(color); paint.setTextAlign(CENTER); int xPos = (canvas.getWidth() / 2); int yPos = (int) ((canvas.getHeight() / 2) - diff --git a/briar-android/src/main/res/color/button_text.xml b/briar-android/src/main/res/color/button_text.xml new file mode 100644 index 0000000000..bbe56156e3 --- /dev/null +++ b/briar-android/src/main/res/color/button_text.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8"?> +<selector + xmlns:android="http://schemas.android.com/apk/res/android"> + <item + android:color="?attr/colorControlNormal" + android:state_enabled="false"/> + <item + android:color="#ffffffff"/> +</selector> \ No newline at end of file diff --git a/briar-android/src/main/res/drawable-night/contact_connected.xml b/briar-android/src/main/res/drawable-night/contact_connected.xml index f62562b735..e4e45826a2 100644 --- a/briar-android/src/main/res/drawable-night/contact_connected.xml +++ b/briar-android/src/main/res/drawable-night/contact_connected.xml @@ -6,7 +6,7 @@ android:viewportWidth="24"> <path - android:fillColor="#ffffff" + android:fillColor="#abffffff" android:pathData="M12,2 C6.48,2,2,6.48,2,12 S6.48,22,12,22 S22,17.52,22,12 S17.52,2,12,2 Z M12,20 C7.58,20,4,16.42,4,12 S7.58,4,12,4 S20,7.58,20,12 S16.42,20,12,20 Z"/> diff --git a/briar-android/src/main/res/drawable-night/contact_disconnected.xml b/briar-android/src/main/res/drawable-night/contact_disconnected.xml index 60c5f829c1..1dd34144fa 100644 --- a/briar-android/src/main/res/drawable-night/contact_disconnected.xml +++ b/briar-android/src/main/res/drawable-night/contact_disconnected.xml @@ -4,6 +4,6 @@ android:viewportHeight="24.0" android:viewportWidth="24.0"> <path - android:fillColor="#ffffff" + android:fillColor="#abffffff" android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zm0,18c-4.42,0 -8,-3.58 -8,-8s3.58,-8 8,-8 8,3.58 8,8 -3.58,8 -8,8z"/> </vector> diff --git a/briar-android/src/main/res/drawable/bubble.xml b/briar-android/src/main/res/drawable/bubble.xml index a00f451ed1..8d2dd0c808 100644 --- a/briar-android/src/main/res/drawable/bubble.xml +++ b/briar-android/src/main/res/drawable/bubble.xml @@ -12,7 +12,7 @@ android:bottom="1px"/> <solid - android:color="@color/briar_primary"/> + android:color="@color/briar_accent"/> <stroke android:color="@color/briar_text_primary_inverse" diff --git a/briar-android/src/main/res/drawable/ic_fullscreen_black_48dp.xml b/briar-android/src/main/res/drawable/ic_fullscreen_black_48dp.xml index affab0d465..29b26803eb 100644 --- a/briar-android/src/main/res/drawable/ic_fullscreen_black_48dp.xml +++ b/briar-android/src/main/res/drawable/ic_fullscreen_black_48dp.xml @@ -1,4 +1,9 @@ -<vector android:height="48dp" android:viewportHeight="24.0" - android:viewportWidth="24.0" android:width="48dp" xmlns:android="http://schemas.android.com/apk/res/android"> - <path android:fillColor="#FF000000" android:pathData="M7,14L5,14v5h5v-2L7,17v-3zM5,10h2L7,7h3L10,5L5,5v5zM17,17h-3v2h5v-5h-2v3zM14,5v2h3v3h2L19,5h-5z"/> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="48dp" + android:height="48dp" + android:viewportHeight="24.0" + android:viewportWidth="24.0"> + <path + android:fillColor="#FF000000" + android:pathData="M7,14L5,14v5h5v-2L7,17v-3zM5,10h2L7,7h3L10,5L5,5v5zM17,17h-3v2h5v-5h-2v3zM14,5v2h3v3h2L19,5h-5z"/> </vector> diff --git a/briar-android/src/main/res/drawable/list_item_thread_background.xml b/briar-android/src/main/res/drawable/list_item_thread_background.xml index 40891618b4..4d71497abd 100644 --- a/briar-android/src/main/res/drawable/list_item_thread_background.xml +++ b/briar-android/src/main/res/drawable/list_item_thread_background.xml @@ -2,6 +2,10 @@ <selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item + android:drawable="@color/thread_item_background" + android:state_activated="false"/> + <item android:drawable="@color/thread_item_highlight" android:state_activated="true"/> diff --git a/briar-android/src/main/res/layout/fragment_error.xml b/briar-android/src/main/res/layout/fragment_error.xml index 71b521cd1a..b705051ccd 100644 --- a/briar-android/src/main/res/layout/fragment_error.xml +++ b/briar-android/src/main/res/layout/fragment_error.xml @@ -6,7 +6,7 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - <ImageView + <android.support.v7.widget.AppCompatImageView android:id="@+id/errorIcon" android:layout_width="128dp" android:layout_height="128dp" @@ -14,10 +14,10 @@ android:layout_marginStart="8dp" android:layout_marginTop="8dp" android:src="@drawable/alerts_and_states_error" - android:tint="?attr/colorControlNormal" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" + app:tint="?attr/colorControlNormal" tools:ignore="ContentDescription"/> <TextView diff --git a/briar-android/src/main/res/layout/fragment_keyagreement_qr.xml b/briar-android/src/main/res/layout/fragment_keyagreement_qr.xml index be534ca224..d9527df8fd 100644 --- a/briar-android/src/main/res/layout/fragment_keyagreement_qr.xml +++ b/briar-android/src/main/res/layout/fragment_keyagreement_qr.xml @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent"> @@ -14,19 +15,19 @@ android:id="@+id/camera_overlay" android:layout_width="match_parent" android:layout_height="match_parent" - android:orientation="vertical" - android:baselineAligned="false"> + android:baselineAligned="false" + android:orientation="vertical"> <LinearLayout android:id="@+id/status_container" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" - android:background="@android:color/background_light" android:gravity="center" android:orientation="vertical" android:padding="@dimen/margin_medium" - android:visibility="invisible"> + android:visibility="invisible" + tools:visibility="visible"> <ProgressBar style="?android:attr/progressBarStyleLarge" @@ -65,46 +66,22 @@ android:layout_height="match_parent" android:layout_centerInParent="true" android:contentDescription="@string/qr_code" - android:scaleType="fitCenter"/> + android:scaleType="fitCenter" + tools:src="@drawable/startup_lock"/> <ImageView android:id="@+id/fullscreen_button" - android:background="?selectableItemBackground" - android:src="@drawable/ic_fullscreen_black_48dp" - android:alpha="0.54" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_margin="@dimen/margin_small" android:layout_alignParentBottom="true" - android:layout_alignParentRight="true" android:layout_alignParentEnd="true" - android:contentDescription="@string/show_qr_code_fullscreen"/> + android:layout_alignParentRight="true" + android:layout_margin="@dimen/margin_small" + android:alpha="0.54" + android:background="?selectableItemBackground" + android:contentDescription="@string/show_qr_code_fullscreen" + android:src="@drawable/ic_fullscreen_black_48dp"/> </RelativeLayout> </FrameLayout> </LinearLayout> - - <RelativeLayout - android:id="@+id/container_progress" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:background="@android:color/white" - android:visibility="invisible"> - - <ProgressBar - android:id="@+id/progress_bar" - style="?android:attr/progressBarStyleLarge" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_above="@+id/title_progress_bar" - android:layout_centerHorizontal="true"/> - - <TextView - android:id="@+id/title_progress_bar" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_centerInParent="true" - android:gravity="center" - android:paddingTop="@dimen/margin_large" - tools:text="@string/waiting_for_contact_to_scan"/> - </RelativeLayout> </FrameLayout> diff --git a/briar-android/src/main/res/layout/list_item_conversation_notice_out.xml b/briar-android/src/main/res/layout/list_item_conversation_notice_out.xml index 58a847d9f0..3ffee121ba 100644 --- a/briar-android/src/main/res/layout/list_item_conversation_notice_out.xml +++ b/briar-android/src/main/res/layout/list_item_conversation_notice_out.xml @@ -1,6 +1,7 @@ <?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" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" @@ -48,7 +49,7 @@ android:textSize="@dimen/text_size_tiny" tools:text="Dec 24, 13:37"/> - <ImageView + <android.support.v7.widget.AppCompatImageView android:id="@+id/status" android:layout_width="wrap_content" android:layout_height="wrap_content" @@ -56,7 +57,7 @@ android:layout_marginLeft="@dimen/margin_medium" android:layout_toEndOf="@+id/time" android:layout_toRightOf="@+id/time" - android:tint="?attr/colorControlNormal" + app:tint="?attr/colorControlNormal" tools:ignore="ContentDescription" tools:src="@drawable/message_delivered"/> diff --git a/briar-android/src/main/res/layout/power_view.xml b/briar-android/src/main/res/layout/power_view.xml index 3a89a89200..b04c7dd7bf 100644 --- a/briar-android/src/main/res/layout/power_view.xml +++ b/briar-android/src/main/res/layout/power_view.xml @@ -18,17 +18,17 @@ app:layout_constraintTop_toTopOf="parent" tools:text="@string/setup_huawei_text"/> - <ImageView + <android.support.v7.widget.AppCompatImageView android:id="@+id/checkImage" android:layout_width="24dp" android:layout_height="24dp" android:layout_margin="8dp" android:src="@drawable/ic_check_white" - android:tint="?attr/colorControlNormal" android:visibility="invisible" app:layout_constraintBottom_toBottomOf="@+id/button" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="@+id/button" + app:tint="?attr/colorControlNormal" tools:ignore="ContentDescription"/> <Button diff --git a/briar-android/src/main/res/layout/preferences_category.xml b/briar-android/src/main/res/layout/preferences_category.xml index 4e068a7cd1..ced92b8ae9 100644 --- a/briar-android/src/main/res/layout/preferences_category.xml +++ b/briar-android/src/main/res/layout/preferences_category.xml @@ -1,11 +1,14 @@ <?xml version="1.0" encoding="utf-8"?> -<TextView xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@android:id/title" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginTop="16dp" - android:layout_marginLeft="16dp" - android:layout_marginStart="16dp" - android:textSize="14sp" - android:textStyle="bold" - android:textColor="@color/briar_blue_light"/> \ No newline at end of file +<TextView + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:id="@android:id/title" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="16dp" + android:layout_marginLeft="16dp" + android:layout_marginStart="16dp" + android:textSize="14sp" + android:textStyle="bold" + android:textColor="@color/preference_category" + tools:text="This is a category"/> \ No newline at end of file diff --git a/briar-android/src/main/res/layout/text_input_view.xml b/briar-android/src/main/res/layout/text_input_view.xml index 6669c4de97..f5d989acce 100644 --- a/briar-android/src/main/res/layout/text_input_view.xml +++ b/briar-android/src/main/res/layout/text_input_view.xml @@ -11,54 +11,46 @@ style="@style/Divider.Horizontal" android:layout_alignParentTop="true"/> - <android.support.v7.widget.CardView + <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" - app:cardCornerRadius="0dp" - app:cardUseCompatPadding="false" - app:elevation="0dp"> - - <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content"> - - <org.thoughtcrime.securesms.components.emoji.EmojiToggle - android:id="@+id/emoji_toggle" - android:layout_width="@dimen/text_input_height" - android:layout_height="@dimen/text_input_height" - android:background="?attr/selectableItemBackground" - android:padding="@dimen/margin_small" - android:scaleType="center" - app:tint="?attr/colorControlNormal"/> - - <org.thoughtcrime.securesms.components.emoji.EmojiEditText - android:id="@+id/input_text" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_weight="1" - android:background="@android:color/transparent" - android:inputType="textMultiLine|textCapSentences" - android:maxLines="3" - android:minHeight="@dimen/text_input_height" - android:textColor="?android:attr/textColorPrimary" - android:textColorHint="?android:attr/textColorTertiary"/> - - <ImageButton - android:id="@+id/btn_send" - android:layout_width="@dimen/text_input_height" - android:layout_height="@dimen/text_input_height" - android:background="?attr/selectableItemBackground" - android:clickable="true" - android:contentDescription="@string/send" - android:enabled="false" - android:focusable="true" - android:padding="@dimen/margin_small" - android:src="@drawable/social_send_now_white" - android:tint="@color/briar_accent"/> - - </LinearLayout> - - </android.support.v7.widget.CardView> + android:background="@color/card_background"> + + <org.thoughtcrime.securesms.components.emoji.EmojiToggle + android:id="@+id/emoji_toggle" + android:layout_width="@dimen/text_input_height" + android:layout_height="@dimen/text_input_height" + android:background="?attr/selectableItemBackground" + android:padding="@dimen/margin_small" + android:scaleType="center" + app:tint="?attr/colorControlNormal"/> + + <org.thoughtcrime.securesms.components.emoji.EmojiEditText + android:id="@+id/input_text" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:background="@android:color/transparent" + android:inputType="textMultiLine|textCapSentences" + android:maxLines="3" + android:minHeight="@dimen/text_input_height" + android:textColor="?android:attr/textColorPrimary" + android:textColorHint="?android:attr/textColorTertiary"/> + + <android.support.v7.widget.AppCompatImageButton + android:id="@+id/btn_send" + android:layout_width="@dimen/text_input_height" + android:layout_height="@dimen/text_input_height" + android:background="?attr/selectableItemBackground" + android:clickable="true" + android:contentDescription="@string/send" + android:enabled="false" + android:focusable="true" + android:padding="@dimen/margin_small" + android:src="@drawable/social_send_now_white" + app:tint="@color/briar_accent"/> + + </LinearLayout> <org.thoughtcrime.securesms.components.emoji.EmojiDrawer android:id="@+id/emoji_drawer" diff --git a/briar-android/src/main/res/values-night/color.xml b/briar-android/src/main/res/values-night/color.xml index 6dcfb7264e..24ed1f6cd8 100644 --- a/briar-android/src/main/res/values-night/color.xml +++ b/briar-android/src/main/res/values-night/color.xml @@ -1,13 +1,18 @@ <?xml version="1.0" encoding="utf-8"?> <resources> - <color name="briar_accent">#476380</color> + <color name="briar_accent">@color/briar_blue_light2</color> + <color name="preference_category">@color/briar_blue_light2</color> <color name="color_primary">#ffffff</color> <color name="color_primary_inverse">#dd000000</color> <color name="color_secondary">#b2ffffff</color> <color name="window_background">#ff303030</color> - <color name="thread_item_highlight">#2D3E50</color> + <color name="card_background">@color/cardview_dark_background</color> + <color name="divider">#666666</color> + + <color name="thread_item_background">@color/window_background</color> + <color name="thread_item_highlight">#000000</color> </resources> \ No newline at end of file diff --git a/briar-android/src/main/res/values/color.xml b/briar-android/src/main/res/values/color.xml index d5767587f1..ad806a0b3d 100644 --- a/briar-android/src/main/res/values/color.xml +++ b/briar-android/src/main/res/values/color.xml @@ -3,11 +3,12 @@ <color name="briar_blue">#2D3E50</color> <color name="briar_blue_dark">#0F1720</color> <color name="briar_blue_light">#4F6C8C</color> - <color name="briar_gold">#FCCF1C</color> + <color name="briar_blue_light2">#5a7da3</color> <color name="briar_green_light">#95D220</color> <color name="briar_link">#06B9FF</color> <color name="window_background">#fffafafa</color> + <color name="card_background">@color/cardview_light_background</color> <color name="action_bar_text">#FFFFFF</color> <color name="button_bar_background">#FFFFFF</color> <color name="private_message_date">#AAAAAA</color> @@ -32,17 +33,19 @@ <color name="briar_text_secondary_inverse">#b4ffffff</color> <color name="briar_text_tertiary">#61000000</color> <color name="briar_text_tertiary_inverse">#80ffffff</color> + <color name="preference_category">@color/briar_blue_light</color> + <color name="briar_button_positive">@color/briar_link</color> <color name="briar_button_negative">#ff0000</color> <color name="briar_warning_background">#ff0000</color> - <color name="emoji_text_color">#ff000000</color> <color name="emoji_pager_background">@color/window_background</color> <color name="thread_indicator">#9e9e9e</color> + <color name="thread_item_background">#eceff1</color> + <color name="thread_item_highlight">#ffffff</color> <color name="divider">#c1c1c1</color> <color name="menu_background">#FFFFFF</color> <color name="spinner_border">#61000000</color> <!-- 38% Black --> - <color name="thread_item_highlight">#729ecc</color> </resources> \ No newline at end of file diff --git a/briar-android/src/main/res/values/styles.xml b/briar-android/src/main/res/values/styles.xml index c65995bc76..83ef288838 100644 --- a/briar-android/src/main/res/values/styles.xml +++ b/briar-android/src/main/res/values/styles.xml @@ -32,7 +32,7 @@ <item name="android:layout_height">wrap_content</item> <item name="android:textSize">@dimen/text_size_medium</item> <item name="android:padding">@dimen/margin_large</item> - <item name="android:textColor">@color/briar_text_primary_inverse</item> + <item name="android:textColor">@color/button_text</item> </style> <style name="BriarButtonFlat.Negative" parent="Widget.AppCompat.Button.Borderless"> @@ -73,7 +73,7 @@ <style name="BriarAvatar"> <item name="civ_border_width">@dimen/avatar_border_width</item> - <item name="civ_border_color">?android:attr/textColorPrimary</item> + <item name="civ_border_color">?android:attr/textColorSecondary</item> </style> <style name="NavMenuButton" parent="Widget.AppCompat.Button.Borderless.Colored"> -- GitLab