Switch dark color scheme to official Mastodon colors

Switch status icons to Material ones
Fix layouts on statuses
main
Eugen Rochko 8 years ago
parent 7a752be83f
commit b5c4339894
  1. 10
      app/src/main/java/com/keylesspalace/tusky/AccountActivity.java
  2. 19
      app/src/main/java/com/keylesspalace/tusky/StatusViewHolder.java
  3. 9
      app/src/main/res/drawable/ic_lock_24dp.xml
  4. 9
      app/src/main/res/drawable/ic_more_horiz_24dp.xml
  5. 9
      app/src/main/res/drawable/ic_repeat_24dp.xml
  6. 9
      app/src/main/res/drawable/ic_reply_24dp.xml
  7. 9
      app/src/main/res/drawable/ic_star_24dp.xml
  8. 4
      app/src/main/res/drawable/toggle_small.xml
  9. 5
      app/src/main/res/layout/activity_account.xml
  10. 66
      app/src/main/res/layout/item_status.xml
  11. 34
      app/src/main/res/values/colors.xml
  12. 3
      app/src/main/res/values/styles.xml

@ -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.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
follow(accountId);
}
});
} else if(!isSelf && blocking) {
// TODO: floating button becomes unblock
}
}

@ -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);
}
}

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="@color/toolbar_icon_dark"
android:pathData="M18,8h-1L17,6c0,-2.76 -2.24,-5 -5,-5S7,3.24 7,6v2L6,8c-1.1,0 -2,0.9 -2,2v10c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L20,10c0,-1.1 -0.9,-2 -2,-2zM12,17c-1.1,0 -2,-0.9 -2,-2s0.9,-2 2,-2 2,0.9 2,2 -0.9,2 -2,2zM15.1,8L8.9,8L8.9,6c0,-1.71 1.39,-3.1 3.1,-3.1 1.71,0 3.1,1.39 3.1,3.1v2z"/>
</vector>

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="@color/toolbar_icon_dark"
android:pathData="M6,10c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM18,10c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM12,10c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2z"/>
</vector>

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="@color/toolbar_icon_dark"
android:pathData="M7,7h10v3l4,-4 -4,-4v3L5,5v6h2L7,7zM17,17L7,17v-3l-4,4 4,4v-3h12v-6h-2v4z"/>
</vector>

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="@color/toolbar_icon_dark"
android:pathData="M10,9V5l-7,7 7,7v-4.1c5,0 8.5,1.6 11,5.1 -1,-5 -4,-10 -11,-11z"/>
</vector>

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="@color/toolbar_icon_dark"
android:pathData="M12,17.27L18.18,21l-1.64,-7.03L22,9.24l-7.19,-0.61L12,2 9.19,8.63 2,9.24l5.46,4.73L5.82,21z"/>
</vector>

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#ff4f575f" />
<corners android:radius="2dp" />
<solid android:color="@color/color_background_dark" />
<corners android:radius="3dp" />
</shape>

@ -56,6 +56,7 @@
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_marginRight="10dp"
app:shadow="true"
android:id="@+id/account_avatar" />
<LinearLayout
@ -70,11 +71,13 @@
android:layout_height="wrap_content"
android:id="@+id/account_display_name"
android:textStyle="normal|bold"
android:textColor="?android:textColorPrimary"
android:textSize="18sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="?android:textColorSecondary"
android:id="@+id/account_username" />
</LinearLayout>
@ -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"/>
</LinearLayout>
@ -111,6 +115,7 @@
<android.support.design.widget.TabLayout
android:id="@+id/tab_layout"
app:tabBackground="?android:colorBackground"
android:layout_width="match_parent"
android:layout_height="wrap_content">

@ -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">
<RelativeLayout
@ -16,60 +18,76 @@
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/ic_reblogged"
app:srcCompat="@drawable/ic_repeat_24dp"
android:id="@+id/status_reblogged_icon"
android:paddingRight="@dimen/status_avatar_padding"
android:paddingLeft="@dimen/status_reblogged_icon_left_padding"
android:tint="?attr/notification_icon_tint" />
android:paddingRight="10dp"
android:paddingLeft="24dp"
android:tint="?android:textColorTertiary" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/status_reblogged"
android:textColor="?android:textColorTertiary"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/status_reblogged_icon" />
</RelativeLayout>
<com.android.volley.toolbox.NetworkImageView
android:layout_width="64dp"
android:layout_height="64dp"
<ImageView
android:layout_width="48dp"
android:layout_height="48dp"
android:scaleType="fitCenter"
android:id="@+id/status_avatar"
android:layout_below="@+id/status_reblogged_bar"
android:padding="@dimen/status_avatar_padding" />
android:layout_marginTop="10dp"
android:layout_marginRight="10dp" />
<com.keylesspalace.tusky.FlowLayout
<RelativeLayout
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/status_avatar"
android:layout_toEndOf="@+id/status_avatar"
android:id="@+id/status_name_bar"
android:layout_below="@+id/status_reblogged_bar"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:paddingBottom="4dp"
android:paddingTop="@dimen/status_avatar_padding">
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/status_display_name"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:textAppearance="@android:style/TextAppearance.DeviceDefault.Small"
android:textColor="?android:textColorPrimary"
android:textStyle="normal|bold"
android:ellipsize="end"
android:maxLines="1"
android:text="Name"
android:paddingRight="@dimen/status_display_name_right_padding" />
<TextView
android:id="@+id/status_username"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="?attr/status_text_color_secondary"
android:paddingRight="@dimen/status_username_right_padding" />
android:textColor="?android:textColorSecondary"
android:maxLines="1"
android:ellipsize="end"
android:text="Username is the slongest thing ever i am totally going" />
</LinearLayout>
<TextView
android:id="@+id/status_since_created"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="?attr/status_text_color_secondary" />
android:layout_alignParentRight="true"
android:text="20m ago"
android:textColor="?android:textColorSecondary" />
</com.keylesspalace.tusky.FlowLayout>
</RelativeLayout>
<com.keylesspalace.tusky.FlowLayout
android:layout_width="wrap_content"
@ -79,12 +97,14 @@
android:layout_toRightOf="@+id/status_avatar"
android:layout_toEndOf="@+id/status_avatar"
android:layout_below="@+id/status_name_bar"
android:layout_marginBottom="8dp">
android:layout_marginBottom="4dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/status_content_warning_description"
android:text="Hello world"
android:textColor="?android:textColorPrimary"
android:paddingRight="8dp"/>
<ToggleButton
@ -95,8 +115,9 @@
android:id="@+id/status_content_warning_button"
android:textOn="@string/status_content_warning_show_less"
android:textOff="@string/status_content_warning_show_more"
android:background="?attr/content_warning_button"
android:padding="4dp" />
android:padding="3dp"
android:textSize="12sp"
android:background="?attr/content_warning_button" />
</com.keylesspalace.tusky.FlowLayout>
@ -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">
<ImageButton
app:srcCompat="@drawable/ic_reply"
app:srcCompat="@drawable/ic_reply_24dp"
android:id="@+id/status_reply"
android:layout_width="32dp"
android:layout_height="32dp"
@ -210,7 +232,7 @@
android:layout_weight="1" />
<ImageButton
app:srcCompat="@drawable/ic_reblog"
app:srcCompat="@drawable/ic_repeat_24dp"
android:id="@+id/status_reblog"
style="?attr/image_button_style"
android:layout_width="32dp"
@ -225,7 +247,7 @@
android:layout_width="32dp"
android:layout_height="32dp"
style="?attr/image_button_style"
app:srcCompat="@drawable/ic_favourite"
app:srcCompat="@drawable/ic_star_24dp"
android:id="@+id/status_favourite" />
<Space
@ -234,7 +256,7 @@
android:layout_weight="1" />
<ImageButton
app:srcCompat="@drawable/ic_extra"
app:srcCompat="@drawable/ic_more_horiz_24dp"
android:id="@+id/status_more"
style="?attr/image_button_style"
android:layout_width="32dp"

@ -4,31 +4,31 @@
<color name="splash_background">#4F4F4F</color>
<color name="view_video_background">#000000</color>
<!--Dark Theme Colors-->
<color name="color_primary_dark">#44A673</color>
<color name="color_primary_dark_dark">#2C996E</color> <!--Dark Dark-->
<color name="color_accent_dark">#3F8A65</color>
<color name="button_dark">#3F8A65</color>
<color name="color_background_dark">#3C4945</color>
<color name="window_background_dark">#191E1E</color>
<color name="color_primary_dark">#4c5368</color>
<color name="color_primary_dark_dark">#363c4b</color> <!--Dark Dark-->
<color name="color_accent_dark">#2b90d9</color>
<color name="button_dark">#2b90d9</color>
<color name="color_background_dark">#1a1c23</color>
<color name="window_background_dark">#282c37</color>
<color name="edit_text_color_dark">#FFFFFF</color>
<color name="text_color_primary_dark">#FFFFFF</color>
<color name="text_color_secondary_dark">#FFFFFF</color>
<color name="text_color_tertiary_dark">#FFFFFF</color>
<color name="text_color_secondary_dark">#d9e1e8</color>
<color name="text_color_tertiary_dark">#9baec8</color>
<color name="text_color_primary_inverse_dark">#000000</color>
<color name="text_color_secondary_inverse_dark">#000000</color>
<color name="text_color_tertiary_inverse_dark">#000000</color>
<color name="toolbar_background_dark">#44A673</color>
<color name="toolbar_icon_dark">#FFFFFF</color>
<color name="image_button_dark">#CFCFCF</color>
<color name="status_reblog_button_dark">#CFCFCF</color>
<color name="status_reblog_button_marked_dark">#00DFAF</color>
<color name="status_reblog_button_disabled_dark">#6F6F6F</color>
<color name="status_favourite_button_dark">#CFCFCF</color>
<color name="status_favourite_button_marked_dark">#DFCF00</color>
<color name="toolbar_background_dark">#4c5368</color>
<color name="toolbar_icon_dark">#d9e1e8</color>
<color name="image_button_dark">#68738f</color>
<color name="status_reblog_button_dark">#68738f</color>
<color name="status_reblog_button_marked_dark">#2b90d9</color>
<color name="status_reblog_button_disabled_dark">#363c4b</color>
<color name="status_favourite_button_dark">#68738f</color>
<color name="status_favourite_button_marked_dark">#ca8f04</color>
<color name="sensitive_media_warning_background_dark">#303030</color>
<color name="media_preview_unloaded_background_dark">#2F2F2F</color>
<color name="status_text_secondary_dark">#A4B4BC</color>
<color name="status_divider_dark">#000000</color>
<color name="status_divider_dark">#2f3441</color>
<color name="tab_page_margin_dark">#4C534B</color>
<color name="account_header_background_dark">#000000</color>
<color name="compose_media_button_dark">#FFFFFF</color>

@ -16,7 +16,7 @@
<item name="colorAccent">@color/color_accent_dark</item>
<item name="colorButtonNormal">@color/button_dark</item>
<item name="android:colorBackground">@color/color_background_dark</item>
<item name="android:colorBackground">@color/color_primary_dark_dark</item>
<item name="android:windowBackground">@color/window_background_dark</item>
<item name="android:editTextColor">@color/edit_text_color_dark</item>
<item name="android:textColorPrimary">@color/text_color_primary_dark</item>
@ -38,7 +38,6 @@
<item name="status_favourite_button_marked_tint">@color/status_favourite_button_marked_dark</item>
<item name="content_warning_button">@drawable/toggle_small</item>
<item name="sensitive_media_warning_background_color">@color/sensitive_media_warning_background_dark</item>
<item name="status_text_color_secondary">@color/status_text_secondary_dark</item>
<item name="media_preview_unloaded_drawable">@drawable/media_preview_unloaded_dark</item>
<item name="status_divider_drawable">@drawable/status_divider_dark</item>
<item name="tab_page_margin_drawable">@drawable/tab_page_margin_dark</item>

Loading…
Cancel
Save