From 8ca747d733dc466090453f93c9bb0acf99b29222 Mon Sep 17 00:00:00 2001 From: Apostolof Date: Thu, 2 Aug 2018 16:02:21 +0300 Subject: [PATCH] Move edit above delete, Vector icons fix for Android <21 --- .../mthmmy/activities/profile/ProfileActivity.java | 9 +++++++++ .../main/res/layout/activity_topic_overflow_menu.xml | 10 +++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/gr/thmmy/mthmmy/activities/profile/ProfileActivity.java b/app/src/main/java/gr/thmmy/mthmmy/activities/profile/ProfileActivity.java index 2be05a74..19680329 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/activities/profile/ProfileActivity.java +++ b/app/src/main/java/gr/thmmy/mthmmy/activities/profile/ProfileActivity.java @@ -5,6 +5,7 @@ import android.graphics.Color; import android.graphics.Typeface; import android.net.Uri; import android.os.AsyncTask; +import android.os.Build; import android.os.Bundle; import android.support.design.widget.FloatingActionButton; import android.support.design.widget.TabLayout; @@ -13,6 +14,7 @@ import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter; import android.support.v4.content.res.ResourcesCompat; import android.support.v4.view.ViewPager; +import android.support.v7.app.AppCompatDelegate; import android.text.Spannable; import android.text.SpannableString; import android.text.Spanned; @@ -92,6 +94,13 @@ public class ProfileActivity extends BaseActivity implements LatestPostsFragment private String username; private int tabSelect; + //Fix for vector drawables on android <21 + static { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { + AppCompatDelegate.setCompatVectorFromResourcesEnabled(true); + } + } + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); diff --git a/app/src/main/res/layout/activity_topic_overflow_menu.xml b/app/src/main/res/layout/activity_topic_overflow_menu.xml index 192e3e58..3341d45f 100644 --- a/app/src/main/res/layout/activity_topic_overflow_menu.xml +++ b/app/src/main/res/layout/activity_topic_overflow_menu.xml @@ -19,7 +19,7 @@ android:textColor="@color/primary_text" /> + android:text="@string/post_delete_button" + android:textColor="@color/primary_text" /> \ No newline at end of file