From 563afd487ca5c608cfbb00fa3909d3c27384acc0 Mon Sep 17 00:00:00 2001 From: LucasGGamerM Date: Mon, 5 Dec 2022 13:27:09 -0300 Subject: [PATCH] add new megalodon logo text closes #129 --- .../fragments/HomeTimelineFragment.java | 15 +++++--- mastodon/src/main/res/drawable/logo.xml | 37 ++++++++++++++++--- 2 files changed, 41 insertions(+), 11 deletions(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/HomeTimelineFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/HomeTimelineFragment.java index 492e0b3654..8c1e6e08b3 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/HomeTimelineFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/HomeTimelineFragment.java @@ -5,6 +5,7 @@ import android.animation.AnimatorSet; import android.animation.ObjectAnimator; import android.app.Activity; +import android.content.res.ColorStateList; import android.content.res.Configuration; import android.os.Build; import android.os.Bundle; @@ -17,6 +18,7 @@ import android.widget.Button; import android.widget.FrameLayout; import android.widget.ImageButton; +import android.widget.ImageView; import android.widget.TextView; import android.widget.Toolbar; @@ -56,7 +58,7 @@ public class HomeTimelineFragment extends StatusListFragment{ private ImageButton fab; - private TextView toolbarLogo; + private ImageView toolbarLogo; private Button toolbarShowNewPostsBtn; private boolean newPostsBtnShown; private AnimatorSet currentNewPostsAnim; @@ -315,9 +317,10 @@ public void onRefresh(){ } private void updateToolbarLogo(){ - toolbarLogo =new TextView(getActivity()); - toolbarLogo.setText(getString(R.string.sk_app_name).toLowerCase(Locale.getDefault())); - toolbarLogo.setTextAppearance(R.style.app_title); + toolbarLogo=new ImageView(getActivity()); + toolbarLogo.setScaleType(ImageView.ScaleType.CENTER); + toolbarLogo.setImageResource(R.drawable.logo); + toolbarLogo.setImageTintList(ColorStateList.valueOf(UiUtils.getThemeColor(getActivity(), android.R.attr.textColorPrimary))); toolbarShowNewPostsBtn=new Button(getActivity()); toolbarShowNewPostsBtn.setTextAppearance(R.style.m3_title_medium); @@ -345,7 +348,9 @@ private void updateToolbarLogo(){ } FrameLayout logoWrap=new FrameLayout(getActivity()); - logoWrap.addView(toolbarLogo, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT, Gravity.CENTER)); + FrameLayout.LayoutParams logoParams=new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT, Gravity.CENTER); + logoParams.setMargins(0, V.dp(2), 0, 0); + logoWrap.addView(toolbarLogo, logoParams); logoWrap.addView(toolbarShowNewPostsBtn, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, V.dp(32), Gravity.CENTER)); Toolbar toolbar=getToolbar(); diff --git a/mastodon/src/main/res/drawable/logo.xml b/mastodon/src/main/res/drawable/logo.xml index 42ef5a365e..3420a89f2a 100644 --- a/mastodon/src/main/res/drawable/logo.xml +++ b/mastodon/src/main/res/drawable/logo.xml @@ -1,9 +1,34 @@ + android:width="124.78dp" + android:height="22.75dp" + android:viewportWidth="124.78" + android:viewportHeight="22.75"> + android:pathData="m26.16,17.57q-1.82,0 -3.29,-0.84 -1.46,-0.84 -2.3,-2.3 -0.82,-1.49 -0.82,-3.34 0,-1.75 0.82,-3.24 0.82,-1.51 2.26,-2.4 1.44,-0.89 3.22,-0.89 1.9,0 3.26,0.82 1.37,0.82 2.06,2.23 0.72,1.42 0.72,3.14 0,0.55 -0.07,1.06h-9.19q0.24,1.46 1.15,2.23 0.94,0.74 2.23,0.74 1.08,0 1.85,-0.46 0.79,-0.48 1.25,-1.27l2.54,1.25q-1.87,3.26 -5.69,3.26zM29.07,9.58q-0.05,-0.58 -0.43,-1.13 -0.36,-0.58 -1.03,-0.94 -0.65,-0.38 -1.54,-0.38 -1.13,0 -1.94,0.67 -0.79,0.65 -1.15,1.78z" + android:fillColor="#282c37"/> + + + + + + + +