Skip to content

Commit

Permalink
Changed appcolor from blue to purple. Added conversation colors. Re-a…
Browse files Browse the repository at this point in the history
…dded password visibility toggle. Re-added ShortcutBadger.
  • Loading branch information
johanw666 committed Aug 28, 2019
1 parent 7c8f101 commit 257195d
Show file tree
Hide file tree
Showing 26 changed files with 418 additions and 298 deletions.
468 changes: 245 additions & 223 deletions build.gradle

Large diffs are not rendered by default.

Binary file added res/drawable-hdpi/ic_visibility_grey600_24dp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-hdpi/ic_visibility_off_grey600_24dp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-hdpi/ic_visibility_off_white_24dp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-hdpi/ic_visibility_white_24dp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-mdpi/ic_visibility_grey600_24dp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-mdpi/ic_visibility_off_grey600_24dp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-mdpi/ic_visibility_off_white_24dp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-mdpi/ic_visibility_white_24dp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xhdpi/ic_visibility_grey600_24dp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xhdpi/ic_visibility_off_white_24dp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xhdpi/ic_visibility_white_24dp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xxhdpi/ic_visibility_grey600_24dp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xxhdpi/ic_visibility_off_grey600_24dp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xxhdpi/ic_visibility_off_white_24dp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xxhdpi/ic_visibility_white_24dp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 15 additions & 15 deletions res/drawable/info_round.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape>
<corners android:radius="2dp" />
<solid android:color="#ff145c95" />
</shape>
</item>

<item>
<shape>
<corners android:radius="2dp" />
<solid android:color="#ff2090ea" />
</shape>
</item>
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape>
<corners android:radius="2dp" />
<solid android:color="#ff7365ad" />
</shape>
</item>

<item>
<shape>
<corners android:radius="2dp" />
<solid android:color="#ff7365ad" />
</shape>
</item>
</selector>
35 changes: 34 additions & 1 deletion res/layout/prompt_passphrase_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,40 @@
android:layout_marginRight="50dp"
android:singleLine="true"
android:paddingLeft="10dp"
android:paddingRight="10dp"/>
android:paddingRight="40dp"/>

<org.smssecure.smssecure.components.AnimatingToggle
android:id="@+id/button_toggle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="@+id/passphrase_edit"
android:layout_centerVertical="true"
android:layout_gravity="center"
android:gravity="center">

<ImageButton android:id="@+id/passphrase_visibility"
android:src="?ic_visibility"
android:background="@drawable/touch_highlight_background"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:paddingTop="3dp"
android:paddingBottom="3dp"
android:layout_centerVertical="true" />

<ImageButton android:id="@+id/passphrase_visibility_off"
android:src="?ic_visibility_off"
android:background="@drawable/touch_highlight_background"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:paddingTop="3dp"
android:paddingBottom="3dp"
android:layout_centerVertical="true" />

</org.smssecure.smssecure.components.AnimatingToggle>

<ImageButton android:id="@+id/ok_button"
android:src="?ic_arrow_forward"
Expand Down
3 changes: 3 additions & 0 deletions res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
<attr name="centered_app_title_color" format="reference|color" />
<attr name="ic_arrow_forward" format="reference" />

<attr name="ic_visibility" format="reference" /> <!-- JW: added -->
<attr name="ic_visibility_off" format="reference" /> <!-- JW: added -->

<attr name="conversation_background" format="reference|color"/>
<attr name="conversation_editor_background" format="reference|color"/>
<attr name="conversation_editor_text_color" format="reference|color"/>
Expand Down
99 changes: 51 additions & 48 deletions res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -1,48 +1,51 @@
<?xml version='1.0' encoding='UTF-8'?>
<resources>
<color name="silence_primary">#ff2090ea</color>
<color name="silence_primary_dark">#ff1c7ac5</color>
<color name="silence_primary_alpha33">#552090ea</color>
<color name="silence_primary_alpha_focus">#882090ea</color>

<color name="white">#ffffffff</color>
<color name="black">#ff000000</color>
<color name="gray5">#ffeeeeee</color>
<color name="gray10">#ffdddddd</color>
<color name="gray12">#ffe0e0e0</color>
<color name="gray13">#ffababab</color>
<color name="gray20">#ffcccccc</color>
<color name="gray27">#ffbbbbbb</color>
<color name="gray50">#ff808080</color>
<color name="gray65">#ff595959</color>
<color name="gray70">#ff4d4d4d</color>
<color name="gray78">#ff383838</color>
<color name="gray95">#ff111111</color>

<color name="gray95_transparent50">#7F111111</color>

<color name="conversation_compose_divider">#32000000</color>

<color name="conversation_list_item_background_read_light">@color/gray5</color>
<color name="conversation_list_item_background_unread_light">#ffffffff</color>
<color name="conversation_list_item_background_read_dark">#ff000000</color>
<color name="conversation_list_item_background_unread_dark">#ff333333</color>

<color name="conversation_list_divider_light">#15000000</color>
<color name="conversation_list_divider_dark">#22ffffff</color>

<color name="textsecure_holo_blue_light">#ff33b5e5</color>

<color name="dark_action_bar">#ff111111</color>
<color name="action_mode_status_bar">#ff1f1f1f</color>
<color name="touch_highlight">#400099cc</color>
<color name="light_button">#33ffffff</color>
<color name="light_button_highlight">#66ffffff</color>

<color name="import_export_item_background_light">#ffeeeeee</color>
<color name="import_export_item_background_dark">#ff333333</color>
<color name="import_export_item_background_shadow_light">#ffd5d5d5</color>
<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>
</resources>
<?xml version='1.0' encoding='UTF-8'?>
<resources>
<!-- JW: change silence_primary, silence_primary_dark, silence_primary_alpha33, silence_primary_alpha_focus -->
<color name="silence_primary">#ff7365ad</color>
<color name="silence_primary_dark">#ff7365ad</color>
<color name="silence_primary_alpha33">#b9b2da</color>
<color name="silence_primary_alpha_focus">#9575cd</color>

<color name="white">#ffffffff</color>
<color name="black">#ff000000</color>
<color name="gray5">#ffeeeeee</color>
<color name="gray10">#ffdddddd</color>
<color name="gray12">#ffe0e0e0</color>
<color name="gray13">#ffababab</color>
<color name="gray20">#ffcccccc</color>
<color name="gray27">#ffbbbbbb</color>
<color name="gray50">#ff808080</color>
<color name="gray65">#ff595959</color>
<color name="gray70">#ff4d4d4d</color>
<color name="gray78">#ff383838</color>
<color name="gray95">#ff111111</color>

<color name="gray95_transparent50">#7F111111</color>

<color name="conversation_compose_divider">#32000000</color>

<color name="conversation_list_item_background_read_light">@color/gray5</color>
<color name="conversation_list_item_background_unread_light">#ffffffff</color>
<color name="conversation_list_item_background_read_dark">#ff000000</color>
<color name="conversation_list_item_background_unread_dark">#ff333333</color>

<color name="conversation_list_divider_light">#15000000</color>
<color name="conversation_list_divider_dark">#22ffffff</color>

<!-- JW: change textsecure_holo_blue_light -->
<color name="textsecure_holo_blue_light">#7c4dff</color>

<color name="dark_action_bar">#ff111111</color>
<color name="action_mode_status_bar">#ff1f1f1f</color>
<color name="touch_highlight">#400099cc</color>
<color name="light_button">#33ffffff</color>
<color name="light_button_highlight">#66ffffff</color>

<color name="import_export_item_background_light">#ffeeeeee</color>
<color name="import_export_item_background_dark">#ff333333</color>
<color name="import_export_item_background_shadow_light">#ffd5d5d5</color>
<color name="import_export_item_background_shadow_dark">#ff222222</color>
<!-- JW: change import_export_touch_highlight_light -->
<color name="import_export_touch_highlight_light">#b39ddb</color>
<color name="import_export_touch_highlight_dark">#40ffffff</color>
</resources>
7 changes: 7 additions & 0 deletions res/values/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@
<item name="centered_app_title_color">#55000000</item>
<item name="ic_arrow_forward">@drawable/ic_arrow_forward_light</item>
<item name="lockscreen_watermark">@drawable/lockscreen_watermark_light</item>
<!-- JW: added 3 lines -->
<item name="android:windowBackground">@color/gray5</item>
<item name="ic_visibility">@drawable/ic_visibility_grey600_24dp</item>
<item name="ic_visibility_off">@drawable/ic_visibility_off_grey600_24dp</item>
</style>

<style name="Silence.DarkIntroTheme" parent="@style/Theme.AppCompat">
Expand All @@ -60,6 +64,9 @@
<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>
<!-- JW: added 2 lines -->
<item name="ic_visibility">@drawable/ic_visibility_white_24dp</item>
<item name="ic_visibility_off">@drawable/ic_visibility_off_white_24dp</item>
</style>

<style name="PopupAnimation" parent="@android:style/Animation">
Expand Down
46 changes: 44 additions & 2 deletions src/org/smssecure/smssecure/PassphrasePromptActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.text.Editable;
import android.text.InputType;
import android.text.SpannableString;
import android.text.Spanned;
import android.text.style.RelativeSizeSpan;
Expand All @@ -35,6 +36,7 @@
import android.widget.ImageButton;
import android.widget.TextView;

import org.smssecure.smssecure.components.AnimatingToggle;
import org.smssecure.smssecure.crypto.InvalidPassphraseException;
import org.smssecure.smssecure.crypto.MasterSecretUtil;
import org.smssecure.smssecure.util.DynamicIntroTheme;
Expand All @@ -51,7 +53,10 @@ public class PassphrasePromptActivity extends PassphraseActivity {
private DynamicIntroTheme dynamicTheme = new DynamicIntroTheme();
private DynamicLanguage dynamicLanguage = new DynamicLanguage();

private EditText passphraseText;
private EditText passphraseText;
private ImageButton showButton; // JW: added
private ImageButton hideButton; // JW: added
private AnimatingToggle visibilityToggle; // JW: added

@Override
public void onCreate(Bundle savedInstanceState) {
Expand Down Expand Up @@ -115,18 +120,37 @@ private void handlePassphrase() {
}
}

// // JW: added
private void setPassphraseVisibility(boolean visibility) {
int cursorPosition = passphraseText.getSelectionStart();
if (visibility) {
passphraseText.setInputType(InputType.TYPE_CLASS_TEXT |
InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD);
} else {
passphraseText.setInputType(InputType.TYPE_CLASS_TEXT |
InputType.TYPE_TEXT_VARIATION_PASSWORD);
}
passphraseText.setSelection(cursorPosition);
}

private void initializeResources() {
getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
getSupportActionBar().setCustomView(R.layout.centered_app_title);

ImageButton okButton = (ImageButton) findViewById(R.id.ok_button);
passphraseText = (EditText) findViewById(R.id.passphrase_edit);

showButton = (ImageButton) findViewById(R.id.passphrase_visibility); // JW: added
hideButton = (ImageButton) findViewById(R.id.passphrase_visibility_off); // JW: added
visibilityToggle = (AnimatingToggle) findViewById(R.id.button_toggle); // JW: added
passphraseText = (EditText) findViewById(R.id.passphrase_edit);
SpannableString hint = new SpannableString(" " + getString(R.string.PassphrasePromptActivity_enter_passphrase));
hint.setSpan(new RelativeSizeSpan(0.9f), 0, hint.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
hint.setSpan(new TypefaceSpan("sans-serif"), 0, hint.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);

passphraseText.setHint(hint);
okButton.setOnClickListener(new OkButtonClickListener());
showButton.setOnClickListener(new ShowButtonOnClickListener()); // JW: added
hideButton.setOnClickListener(new HideButtonOnClickListener()); // JW: added
passphraseText.setOnEditorActionListener(new PassphraseActionListener());
passphraseText.setImeActionLabel(getString(R.string.prompt_passphrase_activity__unlock),
EditorInfo.IME_ACTION_DONE);
Expand Down Expand Up @@ -158,6 +182,24 @@ public void onClick(View v) {
}
}

// JW: added
private class ShowButtonOnClickListener implements OnClickListener {
@Override
public void onClick(View v) {
visibilityToggle.display(hideButton);
setPassphraseVisibility(true);
}
}

// JW: added
private class HideButtonOnClickListener implements OnClickListener {
@Override
public void onClick(View v) {
visibilityToggle.display(showButton);
setPassphraseVisibility(false);
}
}

@Override
protected void cleanup() {
this.passphraseText.setText("");
Expand Down
1 change: 1 addition & 0 deletions src/org/smssecure/smssecure/color/MaterialColor.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public enum MaterialColor {
BROWN (R.color.brown_500, R.color.brown_700, R.color.brown_700, R.color.brown_900, "brown"),
GREY (R.color.grey_500, R.color.grey_700, R.color.grey_700, R.color.grey_900, "grey"),
BLUE_GREY (R.color.blue_grey_500, R.color.blue_grey_700, R.color.blue_grey_700, R.color.blue_grey_900, "blue_grey"),
BLACK (R.color.black, R.color.black, R.color.black, R.color.black, "black"),

GROUP (GREY.conversationColorLight, R.color.silence_primary, R.color.silence_primary_dark,
GREY.conversationColorDark, R.color.gray95, R.color.black,
Expand Down
16 changes: 7 additions & 9 deletions src/org/smssecure/smssecure/color/MaterialColors.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,23 @@ public class MaterialColors {
MaterialColor.RED,
MaterialColor.PINK,
MaterialColor.PURPLE,

MaterialColor.DEEP_PURPLE,
MaterialColor.INDIGO,
MaterialColor.BLUE,

MaterialColor.LIGHT_BLUE,
MaterialColor.CYAN,
MaterialColor.TEAL,
MaterialColor.GREEN,
MaterialColor.LIGHT_GREEN,
// Lime
// Yellow
// Amber
MaterialColor.LIME,
MaterialColor.YELLOW,
MaterialColor.AMBER,
MaterialColor.ORANGE,
MaterialColor.DEEP_ORANGE,
// MaterialColor.BROWN,
MaterialColor.AMBER,
// Grey
MaterialColor.BLUE_GREY
MaterialColor.BROWN,
MaterialColor.GREY,
MaterialColor.BLUE_GREY,
MaterialColor.BLACK
)));

public static class MaterialColorList {
Expand Down
11 changes: 11 additions & 0 deletions src/org/smssecure/smssecure/notifications/MessageNotifier.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@
import java.util.ListIterator;
import java.util.concurrent.TimeUnit;

import me.leolin.shortcutbadger.ShortcutBadger; // JW

/**
* Handles posting system notifications for new messages.
*
Expand Down Expand Up @@ -493,6 +495,15 @@ protected Void doInBackground(Void... params) {

private static void updateBadge(Context context, int count) {
BadgeWidgetProvider.getInstance(context, (Class) ConversationListActivity.class).updateBadge(count);
// JW: re-implement badges on icon
try {
if (count == 0) ShortcutBadger.removeCount(context);
else ShortcutBadger.applyCount(context, count);
} catch (Throwable t) {
// NOTE :: I don't totally trust this thing, so I'm catching
// everything.
Log.w("MessageNotifier", t);
}
}

}

0 comments on commit 257195d

Please sign in to comment.