From b5c4339894c0b03552da95469dee74f446ede174 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Tue, 7 Mar 2017 01:31:05 +0100 Subject: [PATCH] Switch dark color scheme to official Mastodon colors Switch status icons to Material ones Fix layouts on statuses --- .../keylesspalace/tusky/AccountActivity.java | 12 +-- .../keylesspalace/tusky/StatusViewHolder.java | 19 ++-- app/src/main/res/drawable/ic_lock_24dp.xml | 9 ++ .../main/res/drawable/ic_more_horiz_24dp.xml | 9 ++ app/src/main/res/drawable/ic_repeat_24dp.xml | 9 ++ app/src/main/res/drawable/ic_reply_24dp.xml | 9 ++ app/src/main/res/drawable/ic_star_24dp.xml | 9 ++ app/src/main/res/drawable/toggle_small.xml | 4 +- app/src/main/res/layout/activity_account.xml | 5 ++ app/src/main/res/layout/item_status.xml | 88 ++++++++++++------- app/src/main/res/values/colors.xml | 34 +++---- app/src/main/res/values/styles.xml | 3 +- 12 files changed, 138 insertions(+), 72 deletions(-) create mode 100644 app/src/main/res/drawable/ic_lock_24dp.xml create mode 100644 app/src/main/res/drawable/ic_more_horiz_24dp.xml create mode 100644 app/src/main/res/drawable/ic_repeat_24dp.xml create mode 100644 app/src/main/res/drawable/ic_reply_24dp.xml create mode 100644 app/src/main/res/drawable/ic_star_24dp.xml diff --git a/app/src/main/java/com/keylesspalace/tusky/AccountActivity.java b/app/src/main/java/com/keylesspalace/tusky/AccountActivity.java index dc81abfa..313086b3 100644 --- a/app/src/main/java/com/keylesspalace/tusky/AccountActivity.java +++ b/app/src/main/java/com/keylesspalace/tusky/AccountActivity.java @@ -295,23 +295,15 @@ public class AccountActivity extends BaseActivity { FloatingActionButton floatingBtn = (FloatingActionButton) findViewById(R.id.floating_btn); - if(!isSelf && !blocking) { + if(!isSelf && !blocking && !following) { floatingBtn.show(); - - if (!following) { - floatingBtn.setImageResource(R.drawable.ic_person_add_24dp); - } else { - floatingBtn.setImageResource(R.drawable.ic_person_outline_24dp); - } - + floatingBtn.setImageResource(R.drawable.ic_person_add_24dp); floatingBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { follow(accountId); } }); - } else if(!isSelf && blocking) { - // TODO: floating button becomes unblock } } diff --git a/app/src/main/java/com/keylesspalace/tusky/StatusViewHolder.java b/app/src/main/java/com/keylesspalace/tusky/StatusViewHolder.java index bc5d91f7..5be5cf2a 100644 --- a/app/src/main/java/com/keylesspalace/tusky/StatusViewHolder.java +++ b/app/src/main/java/com/keylesspalace/tusky/StatusViewHolder.java @@ -26,11 +26,13 @@ import android.text.style.URLSpan; import android.view.View; import android.widget.CompoundButton; import android.widget.ImageButton; +import android.widget.ImageView; import android.widget.TextView; import android.widget.ToggleButton; import com.android.volley.toolbox.ImageLoader; import com.android.volley.toolbox.NetworkImageView; +import com.squareup.picasso.Picasso; import java.util.Date; @@ -40,7 +42,7 @@ class StatusViewHolder extends RecyclerView.ViewHolder { private TextView username; private TextView sinceCreated; private TextView content; - private NetworkImageView avatar; + private ImageView avatar; private View rebloggedBar; private TextView rebloggedByDisplayName; private ImageButton replyButton; @@ -65,9 +67,7 @@ class StatusViewHolder extends RecyclerView.ViewHolder { username = (TextView) itemView.findViewById(R.id.status_username); sinceCreated = (TextView) itemView.findViewById(R.id.status_since_created); content = (TextView) itemView.findViewById(R.id.status_content); - avatar = (NetworkImageView) itemView.findViewById(R.id.status_avatar); - avatar.setDefaultImageResId(R.drawable.avatar_default); - avatar.setErrorImageResId(R.drawable.avatar_error); + avatar = (ImageView) itemView.findViewById(R.id.status_avatar); rebloggedBar = itemView.findViewById(R.id.status_reblogged_bar); rebloggedByDisplayName = (TextView) itemView.findViewById(R.id.status_reblogged); replyButton = (ImageButton) itemView.findViewById(R.id.status_reply); @@ -159,8 +159,11 @@ class StatusViewHolder extends RecyclerView.ViewHolder { return; } Context context = avatar.getContext(); - ImageLoader imageLoader = VolleySingleton.getInstance(context).getImageLoader(); - avatar.setImageUrl(url, imageLoader); + Picasso.with(context) + .load(url) + .placeholder(R.drawable.avatar_default) + .error(R.drawable.avatar_error) + .into(avatar); } private void setCreatedAt(@Nullable Date createdAt) { @@ -202,10 +205,10 @@ class StatusViewHolder extends RecyclerView.ViewHolder { private void setRebloggingEnabled(boolean enabled) { reblogButton.setEnabled(enabled); if (enabled) { - reblogButton.setImageResource(R.drawable.ic_reblog); + reblogButton.setImageResource(R.drawable.ic_repeat_24dp); } else { ThemeUtils.setImageViewTint(reblogButton, R.attr.status_reblog_button_disabled_tint); - reblogButton.setImageResource(R.drawable.ic_reblog_disabled); + reblogButton.setImageResource(R.drawable.ic_lock_24dp); } } diff --git a/app/src/main/res/drawable/ic_lock_24dp.xml b/app/src/main/res/drawable/ic_lock_24dp.xml new file mode 100644 index 00000000..6316164d --- /dev/null +++ b/app/src/main/res/drawable/ic_lock_24dp.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_more_horiz_24dp.xml b/app/src/main/res/drawable/ic_more_horiz_24dp.xml new file mode 100644 index 00000000..cba1e880 --- /dev/null +++ b/app/src/main/res/drawable/ic_more_horiz_24dp.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_repeat_24dp.xml b/app/src/main/res/drawable/ic_repeat_24dp.xml new file mode 100644 index 00000000..4b13abca --- /dev/null +++ b/app/src/main/res/drawable/ic_repeat_24dp.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_reply_24dp.xml b/app/src/main/res/drawable/ic_reply_24dp.xml new file mode 100644 index 00000000..5fcea57d --- /dev/null +++ b/app/src/main/res/drawable/ic_reply_24dp.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_star_24dp.xml b/app/src/main/res/drawable/ic_star_24dp.xml new file mode 100644 index 00000000..47ad2489 --- /dev/null +++ b/app/src/main/res/drawable/ic_star_24dp.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/toggle_small.xml b/app/src/main/res/drawable/toggle_small.xml index 03947856..b6b80bfc 100644 --- a/app/src/main/res/drawable/toggle_small.xml +++ b/app/src/main/res/drawable/toggle_small.xml @@ -1,6 +1,6 @@ - - + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_account.xml b/app/src/main/res/layout/activity_account.xml index 42b67ff8..3ffb121d 100644 --- a/app/src/main/res/layout/activity_account.xml +++ b/app/src/main/res/layout/activity_account.xml @@ -56,6 +56,7 @@ android:layout_width="80dp" android:layout_height="80dp" android:layout_marginRight="10dp" + app:shadow="true" android:id="@+id/account_avatar" /> @@ -85,6 +88,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/account_note" + android:textColor="?android:textColorTertiary" android:padding="16dp" android:paddingTop="10dp"/> @@ -111,6 +115,7 @@ diff --git a/app/src/main/res/layout/item_status.xml b/app/src/main/res/layout/item_status.xml index 853296e5..e4fd8edb 100644 --- a/app/src/main/res/layout/item_status.xml +++ b/app/src/main/res/layout/item_status.xml @@ -3,6 +3,8 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" + android:paddingLeft="16dp" + android:paddingRight="16dp" android:id="@+id/status_container"> + android:paddingRight="10dp" + android:paddingLeft="24dp" + android:tint="?android:textColorTertiary" /> - + android:layout_marginTop="10dp" + android:layout_marginRight="10dp" /> - - + + - + + + android:layout_alignParentRight="true" + android:text="20m ago" + android:textColor="?android:textColorSecondary" /> - + + android:layout_marginBottom="4dp"> + android:padding="3dp" + android:textSize="12sp" + android:background="?attr/content_warning_button" /> @@ -104,6 +125,7 @@ android:id="@+id/status_content" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:textColor="?android:textColorPrimary" android:layout_toRightOf="@+id/status_avatar" android:layout_toEndOf="@+id/status_avatar" android:layout_below="@+id/status_content_warning_bar" /> @@ -195,10 +217,10 @@ android:layout_below="@id/status_media_preview_container" android:layout_toRightOf="@+id/status_avatar" android:paddingBottom="8dp" - android:paddingTop="8dp"> + android:paddingTop="10dp"> #4F4F4F #000000 - #44A673 - #2C996E - #3F8A65 - #3F8A65 - #3C4945 - #191E1E + #4c5368 + #363c4b + #2b90d9 + #2b90d9 + #1a1c23 + #282c37 #FFFFFF #FFFFFF - #FFFFFF - #FFFFFF + #d9e1e8 + #9baec8 #000000 #000000 #000000 - #44A673 - #FFFFFF - #CFCFCF - #CFCFCF - #00DFAF - #6F6F6F - #CFCFCF - #DFCF00 + #4c5368 + #d9e1e8 + #68738f + #68738f + #2b90d9 + #363c4b + #68738f + #ca8f04 #303030 #2F2F2F #A4B4BC - #000000 + #2f3441 #4C534B #000000 #FFFFFF diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 97409792..249a40ae 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -16,7 +16,7 @@ @color/color_accent_dark @color/button_dark - @color/color_background_dark + @color/color_primary_dark_dark @color/window_background_dark @color/edit_text_color_dark @color/text_color_primary_dark @@ -38,7 +38,6 @@ @color/status_favourite_button_marked_dark @drawable/toggle_small @color/sensitive_media_warning_background_dark - @color/status_text_secondary_dark @drawable/media_preview_unloaded_dark @drawable/status_divider_dark @drawable/tab_page_margin_dark