Browse Source

Move edit above delete, Vector icons fix for Android <21

pull/44/head
Apostolos Fanakis 6 years ago
parent
commit
8ca747d733
  1. 9
      app/src/main/java/gr/thmmy/mthmmy/activities/profile/ProfileActivity.java
  2. 10
      app/src/main/res/layout/activity_topic_overflow_menu.xml

9
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);

10
app/src/main/res/layout/activity_topic_overflow_menu.xml

@ -19,7 +19,7 @@
android:textColor="@color/primary_text" />
<TextView
android:id="@+id/delete_post"
android:id="@+id/edit_post"
android:layout_width="wrap_content"
android:layout_height="35dp"
android:background="?android:attr/selectableItemBackground"
@ -29,11 +29,11 @@
android:paddingEnd="12dp"
android:paddingStart="12dp"
android:paddingTop="6dp"
android:text="@string/post_delete_button"
android:text="@string/post_edit_button"
android:textColor="@color/primary_text" />
<TextView
android:id="@+id/edit_post"
android:id="@+id/delete_post"
android:layout_width="wrap_content"
android:layout_height="35dp"
android:background="?android:attr/selectableItemBackground"
@ -43,7 +43,7 @@
android:paddingEnd="12dp"
android:paddingStart="12dp"
android:paddingTop="6dp"
android:text="@string/post_edit_button"
android:textColor="@color/primary_text"/>
android:text="@string/post_delete_button"
android:textColor="@color/primary_text" />
</LinearLayout>
Loading…
Cancel
Save