From 42734c4f5712ce37a54ddd896fb1d501371959e7 Mon Sep 17 00:00:00 2001
From: Conny Duck <k.pozniak@gmx.at>
Date: Thu, 3 Aug 2017 16:24:14 +0200
Subject: [PATCH 1/7] improve layout of AccountActivity tabs

---
 app/src/main/res/color/account_tab_font_color.xml |  5 +++++
 app/src/main/res/layout/activity_account.xml      |  3 ++-
 app/src/main/res/layout/tab_account.xml           | 15 ++++++++-------
 3 files changed, 15 insertions(+), 8 deletions(-)
 create mode 100644 app/src/main/res/color/account_tab_font_color.xml

diff --git a/app/src/main/res/color/account_tab_font_color.xml b/app/src/main/res/color/account_tab_font_color.xml
new file mode 100644
index 00000000..accc21cb
--- /dev/null
+++ b/app/src/main/res/color/account_tab_font_color.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:state_selected="false" android:color="?android:attr/textColorTertiary"/>
+    <item android:state_selected="true" android:color="?attr/colorAccent"/>
+</selector>
\ 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 ee853c1e..8abfa16c 100644
--- a/app/src/main/res/layout/activity_account.xml
+++ b/app/src/main/res/layout/activity_account.xml
@@ -150,7 +150,8 @@
             android:id="@+id/tab_layout"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            app:tabBackground="?android:colorBackground">
+            app:tabBackground="?android:colorBackground"
+            app:tabGravity="fill">
 
             <android.support.design.widget.TabItem
                 android:layout_width="wrap_content"
diff --git a/app/src/main/res/layout/tab_account.xml b/app/src/main/res/layout/tab_account.xml
index 957bbe3c..1dbe6c70 100644
--- a/app/src/main/res/layout/tab_account.xml
+++ b/app/src/main/res/layout/tab_account.xml
@@ -1,25 +1,26 @@
 <?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout
-    xmlns:android="http://schemas.android.com/apk/res/android"
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:layout_centerInParent="true">
 
     <TextView
+        android:id="@+id/title"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:id="@+id/title"
-        android:layout_marginTop="8dp"
         android:layout_centerHorizontal="true"
+        android:layout_marginTop="6dp"
         android:textAllCaps="true"
+        android:textColor="@color/account_tab_font_color"
         android:textStyle="normal|bold" />
 
     <TextView
+        android:id="@+id/total"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:id="@+id/total"
-        android:layout_centerHorizontal="true"
         android:layout_below="@id/title"
-        android:textSize="10sp" />
+        android:layout_centerHorizontal="true"
+        android:textColor="@color/account_tab_font_color"
+        android:textSize="12sp" />
 
 </RelativeLayout>
\ No newline at end of file

From e4c9b229d707f22202952cf564de5ebddc8cbc14 Mon Sep 17 00:00:00 2001
From: Conny Duck <k.pozniak@gmx.at>
Date: Fri, 4 Aug 2017 10:53:38 +0200
Subject: [PATCH 2/7] change floating action button to "mention", create new
 follow button in AccountActivity

---
 .../keylesspalace/tusky/AccountActivity.java  | 50 ++++++++++++-------
 app/src/main/res/layout/activity_account.xml  | 23 ++++++---
 2 files changed, 46 insertions(+), 27 deletions(-)

diff --git a/app/src/main/java/com/keylesspalace/tusky/AccountActivity.java b/app/src/main/java/com/keylesspalace/tusky/AccountActivity.java
index bc3a0233..53d723b8 100644
--- a/app/src/main/java/com/keylesspalace/tusky/AccountActivity.java
+++ b/app/src/main/java/com/keylesspalace/tusky/AccountActivity.java
@@ -41,6 +41,7 @@ import android.util.Log;
 import android.view.Menu;
 import android.view.MenuItem;
 import android.view.View;
+import android.widget.Button;
 import android.widget.ImageView;
 import android.widget.TextView;
 
@@ -81,6 +82,7 @@ public class AccountActivity extends BaseActivity {
     private CircularImageView avatar;
     private ImageView header;
     private FloatingActionButton floatingBtn;
+    private Button followBtn;
     private TabLayout tabLayout;
     private ImageView accountLockedView;
     private View container;
@@ -93,6 +95,7 @@ public class AccountActivity extends BaseActivity {
         avatar = (CircularImageView) findViewById(R.id.account_avatar);
         header = (ImageView) findViewById(R.id.account_header);
         floatingBtn = (FloatingActionButton) findViewById(R.id.floating_btn);
+        followBtn = (Button) findViewById(R.id.follow_btn);
         tabLayout = (TabLayout) findViewById(R.id.tab_layout);
         accountLockedView = (ImageView) findViewById(R.id.account_locked);
         container = findViewById(R.id.activity_account);
@@ -160,6 +163,7 @@ public class AccountActivity extends BaseActivity {
 
         // Initialise the default UI states.
         floatingBtn.hide();
+        followBtn.setVisibility(View.GONE);
 
         // Obtain information to fill out the profile.
         obtainAccount();
@@ -354,21 +358,18 @@ public class AccountActivity extends BaseActivity {
         updateButtons();
     }
 
-    private void updateFollowButton(FloatingActionButton button) {
+    private void updateFollowButton(Button button) {
         switch (followState) {
             case NOT_FOLLOWING: {
-                button.setImageResource(R.drawable.ic_person_add_24dp);
-                button.setContentDescription(getString(R.string.action_follow));
+                button.setText(getString(R.string.action_follow));
                 break;
             }
             case REQUESTED: {
-                button.setImageResource(R.drawable.ic_hourglass_24dp);
-                button.setContentDescription(getString(R.string.state_follow_requested));
+                button.setText(getString(R.string.state_follow_requested));
                 break;
             }
             case FOLLOWING: {
-                button.setImageResource(R.drawable.ic_person_minus_24px);
-                button.setContentDescription(getString(R.string.action_unfollow));
+                button.setText(getString(R.string.action_unfollow));
                 break;
             }
         }
@@ -379,18 +380,26 @@ public class AccountActivity extends BaseActivity {
 
         if(!isSelf && !blocking) {
             floatingBtn.show();
+            followBtn.setVisibility(View.VISIBLE);
 
-            updateFollowButton(floatingBtn);
+            updateFollowButton(followBtn);
 
             floatingBtn.setOnClickListener(new View.OnClickListener() {
                 @Override
                 public void onClick(View v) {
-                    if (followState != FollowState.REQUESTED) {
+                    mention();
+                }
+            });
+
+            followBtn.setOnClickListener(new View.OnClickListener() {
+                @Override
+                public void onClick(View v) {
+                     if (followState != FollowState.REQUESTED) {
                         follow(accountId);
                     } else {
                         showFollowRequestPendingDialog(accountId);
                     }
-                    updateFollowButton(floatingBtn);
+                    updateFollowButton(followBtn);
                 }
             });
         }
@@ -543,7 +552,6 @@ public class AccountActivity extends BaseActivity {
                 .show();
     }
 
-
     private void mute(final String id) {
         Callback<Relationship> cb = new Callback<Relationship>() {
             @Override
@@ -582,6 +590,17 @@ public class AccountActivity extends BaseActivity {
                 .show();
     }
 
+    private boolean mention() {
+        if (loadedAccount == null) {
+            // If the account isn't loaded yet, eat the input.
+            return false;
+        }
+        Intent intent = new Intent(this, ComposeActivity.class);
+        intent.putExtra("mentioned_usernames", new String[] { loadedAccount.username });
+        startActivity(intent);
+        return true;
+    }
+
     private void broadcast(String action, String id) {
         Intent intent = new Intent(action);
         intent.putExtra("id", id);
@@ -596,14 +615,7 @@ public class AccountActivity extends BaseActivity {
                 return true;
             }
             case R.id.action_mention: {
-                if (loadedAccount == null) {
-                    // If the account isn't loaded yet, eat the input.
-                    return false;
-                }
-                Intent intent = new Intent(this, ComposeActivity.class);
-                intent.putExtra("mentioned_usernames", new String[] { loadedAccount.username });
-                startActivity(intent);
-                return true;
+                return mention();
             }
             case R.id.action_open_in_web: {
                 if (loadedAccount == null) {
diff --git a/app/src/main/res/layout/activity_account.xml b/app/src/main/res/layout/activity_account.xml
index 8abfa16c..ca81039a 100644
--- a/app/src/main/res/layout/activity_account.xml
+++ b/app/src/main/res/layout/activity_account.xml
@@ -52,8 +52,7 @@
                         android:layout_width="match_parent"
                         android:layout_height="wrap_content"
                         android:paddingLeft="16dp"
-                        android:paddingRight="16dp"
-                        android:paddingTop="16dp">
+                        android:paddingRight="16dp">
 
                         <com.pkmmte.view.CircularImageView
                             android:id="@+id/account_avatar"
@@ -62,16 +61,24 @@
                             android:layout_marginEnd="10dp"
                             android:layout_marginRight="10dp"
                             android:src="@drawable/avatar_default"
+                            android:layout_alignParentStart="true"
+                            android:layout_alignParentLeft="true"
+                            android:layout_toLeftOf="@+id/follow_btn"
+                            android:layout_toStartOf="@+id/follow_btn"
                             app:shadow="true" />
 
-                        <LinearLayout
+                        <Button
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"
                             android:layout_alignParentEnd="true"
                             android:layout_alignParentRight="true"
-                            android:layout_centerVertical="true"
-                            android:layout_toEndOf="@id/account_avatar"
-                            android:layout_toRightOf="@id/account_avatar"
+                            android:layout_marginTop="6dp"
+                            android:id="@+id/follow_btn"/>
+
+                        <LinearLayout
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:layout_below="@id/account_avatar"
                             android:orientation="vertical">
 
                             <TextView
@@ -189,7 +196,7 @@
         android:layout_height="wrap_content"
         android:layout_gravity="bottom|end"
         android:layout_margin="16dp"
-        android:contentDescription="@string/action_follow"
-        app:srcCompat="@drawable/ic_person_add_24dp" />
+        android:contentDescription="@string/action_mention"
+        app:srcCompat="@drawable/ic_create_24dp" />
 
 </android.support.design.widget.CoordinatorLayout>

From 099d76d9197b01f85ef557fc8ce0bbae8696c583 Mon Sep 17 00:00:00 2001
From: Conny Duck <k.pozniak@gmx.at>
Date: Fri, 4 Aug 2017 11:44:10 +0200
Subject: [PATCH 3/7] make FAB hide on scroll in AccountActivity as well

---
 .../keylesspalace/tusky/AccountActivity.java  | 24 +++++++-
 .../com/keylesspalace/tusky/MainActivity.java | 13 ++++-
 .../tusky/fragment/AccountListFragment.java   | 57 +++++++++++++++++--
 .../tusky/fragment/NotificationsFragment.java | 18 +++---
 .../tusky/fragment/TimelineFragment.java      | 33 +++++------
 .../interfaces/ActionButtonActivity.java      | 24 ++++++++
 6 files changed, 136 insertions(+), 33 deletions(-)
 create mode 100644 app/src/main/java/com/keylesspalace/tusky/interfaces/ActionButtonActivity.java

diff --git a/app/src/main/java/com/keylesspalace/tusky/AccountActivity.java b/app/src/main/java/com/keylesspalace/tusky/AccountActivity.java
index 53d723b8..c0287e04 100644
--- a/app/src/main/java/com/keylesspalace/tusky/AccountActivity.java
+++ b/app/src/main/java/com/keylesspalace/tusky/AccountActivity.java
@@ -47,6 +47,7 @@ import android.widget.TextView;
 
 import com.keylesspalace.tusky.entity.Account;
 import com.keylesspalace.tusky.entity.Relationship;
+import com.keylesspalace.tusky.interfaces.ActionButtonActivity;
 import com.keylesspalace.tusky.interfaces.LinkListener;
 import com.keylesspalace.tusky.pager.AccountPagerAdapter;
 import com.keylesspalace.tusky.receiver.TimelineReceiver;
@@ -64,7 +65,7 @@ import retrofit2.Call;
 import retrofit2.Callback;
 import retrofit2.Response;
 
-public class AccountActivity extends BaseActivity {
+public class AccountActivity extends BaseActivity implements ActionButtonActivity {
     private static final String TAG = "AccountActivity"; // logging tag
 
     private enum FollowState {
@@ -86,6 +87,8 @@ public class AccountActivity extends BaseActivity {
     private TabLayout tabLayout;
     private ImageView accountLockedView;
     private View container;
+    private boolean hideFab;
+    private int oldOffset;
 
     @Override
     protected void onCreate(@Nullable Bundle savedInstanceState) {
@@ -127,6 +130,8 @@ public class AccountActivity extends BaseActivity {
             actionBar.setDisplayShowHomeEnabled(true);
         }
 
+        hideFab = PreferenceManager.getDefaultSharedPreferences(this).getBoolean("fabHide", false);
+
         // Add a listener to change the toolbar icon color when it enters/exits its collapsed state.
         AppBarLayout appBarLayout = (AppBarLayout) findViewById(R.id.account_app_bar_layout);
         final CollapsingToolbarLayout collapsingToolbar =
@@ -158,6 +163,16 @@ public class AccountActivity extends BaseActivity {
                     ThemeUtils.setDrawableTint(context, toolbar.getNavigationIcon(), attribute);
                     ThemeUtils.setDrawableTint(context, toolbar.getOverflowIcon(), attribute);
                 }
+
+                if(floatingBtn != null && hideFab) {
+                    if (verticalOffset > oldOffset) {
+                        floatingBtn.show();
+                    }
+                    if (verticalOffset < oldOffset) {
+                        floatingBtn.hide();
+                    }
+                }
+                oldOffset = verticalOffset;
             }
         });
 
@@ -642,4 +657,11 @@ public class AccountActivity extends BaseActivity {
         }
         return super.onOptionsItemSelected(item);
     }
+
+    @Nullable
+    @Override
+    public FloatingActionButton getActionButton() {
+        return floatingBtn;
+    }
+
 }
diff --git a/app/src/main/java/com/keylesspalace/tusky/MainActivity.java b/app/src/main/java/com/keylesspalace/tusky/MainActivity.java
index 1e034837..7a3a64d5 100644
--- a/app/src/main/java/com/keylesspalace/tusky/MainActivity.java
+++ b/app/src/main/java/com/keylesspalace/tusky/MainActivity.java
@@ -23,6 +23,7 @@ import android.graphics.drawable.Drawable;
 import android.net.Uri;
 import android.os.Bundle;
 import android.os.PersistableBundle;
+import android.support.annotation.Nullable;
 import android.support.design.widget.FloatingActionButton;
 import android.support.design.widget.TabLayout;
 import android.support.graphics.drawable.VectorDrawableCompat;
@@ -37,6 +38,7 @@ import android.widget.ImageButton;
 import android.widget.ImageView;
 
 import com.keylesspalace.tusky.entity.Account;
+import com.keylesspalace.tusky.interfaces.ActionButtonActivity;
 import com.keylesspalace.tusky.pager.TimelinePagerAdapter;
 import com.keylesspalace.tusky.receiver.TimelineReceiver;
 import com.keylesspalace.tusky.util.ThemeUtils;
@@ -63,7 +65,7 @@ import retrofit2.Call;
 import retrofit2.Callback;
 import retrofit2.Response;
 
-public class MainActivity extends BaseActivity {
+public class MainActivity extends BaseActivity implements ActionButtonActivity {
     private static final String TAG = "MainActivity"; // logging tag
     private static final long DRAWER_ITEM_EDIT_PROFILE = 0;
     private static final long DRAWER_ITEM_FAVOURITES = 1;
@@ -77,7 +79,8 @@ public class MainActivity extends BaseActivity {
     private static final long DRAWER_ITEM_SAVED_TOOT = 9;
 
     protected static int COMPOSE_RESULT = 1;
-    public FloatingActionButton composeButton;
+
+    private FloatingActionButton composeButton;
     private String loggedInAccountId;
     private String loggedInAccountUsername;
     private Stack<Integer> pageHistory;
@@ -493,4 +496,10 @@ public class MainActivity extends BaseActivity {
     private void onFetchUserInfoFailure(Exception exception) {
         Log.e(TAG, "Failed to fetch user info. " + exception.getMessage());
     }
+
+    @Nullable
+    @Override
+    public FloatingActionButton getActionButton() {
+        return composeButton;
+    }
 }
\ No newline at end of file
diff --git a/app/src/main/java/com/keylesspalace/tusky/fragment/AccountListFragment.java b/app/src/main/java/com/keylesspalace/tusky/fragment/AccountListFragment.java
index e37cbd57..996c4206 100644
--- a/app/src/main/java/com/keylesspalace/tusky/fragment/AccountListFragment.java
+++ b/app/src/main/java/com/keylesspalace/tusky/fragment/AccountListFragment.java
@@ -17,9 +17,12 @@ package com.keylesspalace.tusky.fragment;
 
 import android.content.Context;
 import android.content.Intent;
+import android.content.SharedPreferences;
 import android.graphics.drawable.Drawable;
 import android.os.Bundle;
+import android.preference.PreferenceManager;
 import android.support.annotation.Nullable;
+import android.support.design.widget.FloatingActionButton;
 import android.support.design.widget.Snackbar;
 import android.support.design.widget.TabLayout;
 import android.support.v7.widget.DividerItemDecoration;
@@ -42,6 +45,7 @@ import com.keylesspalace.tusky.BaseActivity;
 import com.keylesspalace.tusky.entity.Account;
 import com.keylesspalace.tusky.entity.Relationship;
 import com.keylesspalace.tusky.interfaces.AccountActionListener;
+import com.keylesspalace.tusky.interfaces.ActionButtonActivity;
 import com.keylesspalace.tusky.network.MastodonApi;
 import com.keylesspalace.tusky.R;
 import com.keylesspalace.tusky.util.HttpHeaderLink;
@@ -77,6 +81,7 @@ public class AccountListFragment extends BaseFragment implements AccountActionLi
     private int bottomFetches;
     private boolean topLoading;
     private int topFetches;
+    private boolean hideFab;
 
     public static AccountListFragment newInstance(Type type) {
         Bundle arguments = new Bundle();
@@ -168,15 +173,55 @@ public class AccountListFragment extends BaseFragment implements AccountActionLi
          * activity is created, so everything needing to access the api object has to be delayed
          * until here. */
         api = activity.mastodonApi;
-        scrollListener = new EndlessOnScrollListener(layoutManager) {
-            @Override
-            public void onLoadMore(int page, int totalItemsCount, RecyclerView view) {
-                AccountListFragment.this.onLoadMore(view);
-            }
-        };
+
+
+        if (actionButtonPresent()) {
+            /* Use a modified scroll listener that both loads more statuses as it goes, and hides
+             * the follow button on down-scroll. */
+            ActionButtonActivity actionButtonActivity = (ActionButtonActivity) getActivity();
+            final FloatingActionButton composeButton = actionButtonActivity.getActionButton();
+            final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(getContext());
+            hideFab = preferences.getBoolean("fabHide", false);
+            scrollListener = new EndlessOnScrollListener(layoutManager) {
+                @Override
+                public void onScrolled(RecyclerView view, int dx, int dy) {
+                    super.onScrolled(view, dx, dy);
+
+                    if (composeButton != null) {
+                        if (hideFab) {
+                            if (dy > 0 && composeButton.isShown()) {
+                                composeButton.hide(); // hides the button if we're scrolling down
+                            } else if (dy < 0 && !composeButton.isShown()) {
+                                composeButton.show(); // shows it if we are scrolling up
+                            }
+                        } else if (!composeButton.isShown()) {
+                            composeButton.show();
+                        }
+                    }
+                }
+
+                @Override
+                public void onLoadMore(int page, int totalItemsCount, RecyclerView view) {
+                    AccountListFragment.this.onLoadMore(view);
+                }
+            };
+        } else {
+            // Just use the basic scroll listener to load more accounts.
+            scrollListener = new EndlessOnScrollListener(layoutManager) {
+                @Override
+                public void onLoadMore(int page, int totalItemsCount, RecyclerView view) {
+                    AccountListFragment.this.onLoadMore(view);
+                }
+            };
+        }
+
         recyclerView.addOnScrollListener(scrollListener);
     }
 
+    private boolean actionButtonPresent() {
+        return type == Type.FOLLOWS || type == Type.FOLLOWERS;
+    }
+
     @Override
     public void onDestroyView() {
         if (jumpToTopAllowed()) {
diff --git a/app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java b/app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java
index 91f20654..8375bf86 100644
--- a/app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java
+++ b/app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java
@@ -172,7 +172,7 @@ public class NotificationsFragment extends SFragment implements
          * guaranteed to be set until then.
          * Use a modified scroll listener that both loads more notifications as it goes, and hides
          * the compose button on down-scroll. */
-        final FloatingActionButton composeButton = activity.composeButton;
+        final FloatingActionButton composeButton = activity.getActionButton();
         final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(
                 activity);
         preferences.registerOnSharedPreferenceChangeListener(this);
@@ -182,14 +182,16 @@ public class NotificationsFragment extends SFragment implements
             public void onScrolled(RecyclerView view, int dx, int dy) {
                 super.onScrolled(view, dx, dy);
 
-                if (hideFab) {
-                    if (dy > 0 && composeButton.isShown()) {
-                        composeButton.hide(); // hides the button if we're scrolling down
-                    } else if (dy < 0 && !composeButton.isShown()) {
-                        composeButton.show(); // shows it if we are scrolling up
+                if(composeButton != null) {
+                    if (hideFab) {
+                        if (dy > 0 && composeButton.isShown()) {
+                            composeButton.hide(); // hides the button if we're scrolling down
+                        } else if (dy < 0 && !composeButton.isShown()) {
+                            composeButton.show(); // shows it if we are scrolling up
+                        }
+                    } else if (!composeButton.isShown()) {
+                        composeButton.show();
                     }
-                } else if (!composeButton.isShown()) {
-                    composeButton.show();
                 }
             }
 
diff --git a/app/src/main/java/com/keylesspalace/tusky/fragment/TimelineFragment.java b/app/src/main/java/com/keylesspalace/tusky/fragment/TimelineFragment.java
index 0141dd37..379b9c42 100644
--- a/app/src/main/java/com/keylesspalace/tusky/fragment/TimelineFragment.java
+++ b/app/src/main/java/com/keylesspalace/tusky/fragment/TimelineFragment.java
@@ -34,11 +34,11 @@ import android.view.View;
 import android.view.ViewGroup;
 
 import com.keylesspalace.tusky.BuildConfig;
-import com.keylesspalace.tusky.MainActivity;
 import com.keylesspalace.tusky.R;
 import com.keylesspalace.tusky.adapter.FooterViewHolder;
 import com.keylesspalace.tusky.adapter.TimelineAdapter;
 import com.keylesspalace.tusky.entity.Status;
+import com.keylesspalace.tusky.interfaces.ActionButtonActivity;
 import com.keylesspalace.tusky.interfaces.StatusActionListener;
 import com.keylesspalace.tusky.network.MastodonApi;
 import com.keylesspalace.tusky.receiver.TimelineReceiver;
@@ -195,28 +195,29 @@ public class TimelineFragment extends SFragment implements
 
         /* This is delayed until onActivityCreated solely because MainActivity.composeButton isn't
          * guaranteed to be set until then. */
-        if (composeButtonPresent()) {
+        if (actionButtonPresent()) {
             /* Use a modified scroll listener that both loads more statuses as it goes, and hides
              * the follow button on down-scroll. */
-            MainActivity activity = (MainActivity) getActivity();
-            final FloatingActionButton composeButton = activity.composeButton;
-            final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(
-                    activity);
+            ActionButtonActivity activity = (ActionButtonActivity) getActivity();
+            final FloatingActionButton composeButton = activity.getActionButton();
+            final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(getContext());
             hideFab = preferences.getBoolean("fabHide", false);
             scrollListener = new EndlessOnScrollListener(layoutManager) {
                 @Override
                 public void onScrolled(RecyclerView view, int dx, int dy) {
                     super.onScrolled(view, dx, dy);
 
-                    if (hideFab) {
-                        if (dy > 0 && composeButton.isShown()) {
-                            composeButton.hide(); // hides the button if we're scrolling down
-                        } else if (dy < 0 && !composeButton.isShown()) {
-                            composeButton.show(); // shows it if we are scrolling up
+                    if (composeButton != null) {
+                        if (hideFab) {
+                            if (dy > 0 && composeButton.isShown()) {
+                                composeButton.hide(); // hides the button if we're scrolling down
+                            } else if (dy < 0 && !composeButton.isShown()) {
+                                composeButton.show(); // shows it if we are scrolling up
+                            }
+                        } else if (!composeButton.isShown()) {
+                            composeButton.show();
                         }
-                    } else if (!composeButton.isShown()) {
-                        composeButton.show();
-                    }
+                }
                 }
 
                 @Override
@@ -438,8 +439,8 @@ public class TimelineFragment extends SFragment implements
         return kind != Kind.TAG && kind != Kind.FAVOURITES;
     }
 
-    private boolean composeButtonPresent() {
-        return kind != Kind.TAG && kind != Kind.FAVOURITES && kind != Kind.USER;
+    private boolean actionButtonPresent() {
+        return kind != Kind.TAG && kind != Kind.FAVOURITES;
     }
 
     private void jumpToTop() {
diff --git a/app/src/main/java/com/keylesspalace/tusky/interfaces/ActionButtonActivity.java b/app/src/main/java/com/keylesspalace/tusky/interfaces/ActionButtonActivity.java
new file mode 100644
index 00000000..35d2b9c0
--- /dev/null
+++ b/app/src/main/java/com/keylesspalace/tusky/interfaces/ActionButtonActivity.java
@@ -0,0 +1,24 @@
+/* Copyright 2017 Andrew Dawson
+ *
+ * This file is a part of Tusky.
+ *
+ * This program is free software; you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software Foundation; either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * Tusky is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
+ * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with Tusky; if not,
+ * see <http://www.gnu.org/licenses>. */
+
+package com.keylesspalace.tusky.interfaces;
+
+import android.support.annotation.Nullable;
+import android.support.design.widget.FloatingActionButton;
+
+public interface ActionButtonActivity {
+    @Nullable
+    FloatingActionButton getActionButton();
+}

From 848189d6700693cde19daae8fe11a92652b2616b Mon Sep 17 00:00:00 2001
From: Conny Duck <k.pozniak@gmx.at>
Date: Sat, 5 Aug 2017 10:09:17 +0200
Subject: [PATCH 4/7] show if an account follows you back in AccountActivity

---
 .../keylesspalace/tusky/AccountActivity.java  | 23 ++++++++++++-------
 app/src/main/res/layout/activity_account.xml  | 22 ++++++++++++++----
 app/src/main/res/values-de/strings.xml        |  3 +++
 app/src/main/res/values/strings.xml           |  3 +++
 4 files changed, 38 insertions(+), 13 deletions(-)

diff --git a/app/src/main/java/com/keylesspalace/tusky/AccountActivity.java b/app/src/main/java/com/keylesspalace/tusky/AccountActivity.java
index c0287e04..3c2fec8b 100644
--- a/app/src/main/java/com/keylesspalace/tusky/AccountActivity.java
+++ b/app/src/main/java/com/keylesspalace/tusky/AccountActivity.java
@@ -84,6 +84,7 @@ public class AccountActivity extends BaseActivity implements ActionButtonActivit
     private ImageView header;
     private FloatingActionButton floatingBtn;
     private Button followBtn;
+    private TextView followsYouView;
     private TabLayout tabLayout;
     private ImageView accountLockedView;
     private View container;
@@ -99,6 +100,7 @@ public class AccountActivity extends BaseActivity implements ActionButtonActivit
         header = (ImageView) findViewById(R.id.account_header);
         floatingBtn = (FloatingActionButton) findViewById(R.id.floating_btn);
         followBtn = (Button) findViewById(R.id.follow_btn);
+        followsYouView = (TextView) findViewById(R.id.account_follows_you);
         tabLayout = (TabLayout) findViewById(R.id.tab_layout);
         accountLockedView = (ImageView) findViewById(R.id.account_locked);
         container = findViewById(R.id.activity_account);
@@ -179,6 +181,7 @@ public class AccountActivity extends BaseActivity implements ActionButtonActivit
         // Initialise the default UI states.
         floatingBtn.hide();
         followBtn.setVisibility(View.GONE);
+        followsYouView.setVisibility(View.GONE);
 
         // Obtain information to fill out the profile.
         obtainAccount();
@@ -340,8 +343,7 @@ public class AccountActivity extends BaseActivity implements ActionButtonActivit
                                    Response<List<Relationship>> response) {
                 if (response.isSuccessful()) {
                     Relationship relationship = response.body().get(0);
-                    onObtainRelationshipsSuccess(relationship.requested, relationship.following,
-                            relationship.blocking, relationship.muting);
+                    onObtainRelationshipsSuccess(relationship);
                 } else {
                     onObtainRelationshipsFailure(new Exception(response.message()));
                 }
@@ -354,22 +356,27 @@ public class AccountActivity extends BaseActivity implements ActionButtonActivit
         });
     }
 
-    private void onObtainRelationshipsSuccess(boolean followRequested, boolean following,
-                                              boolean blocking, boolean muting) {
-        if (following) {
+    private void onObtainRelationshipsSuccess(Relationship relation) {
+        if (relation.following) {
             followState = FollowState.FOLLOWING;
-        } else if (followRequested) {
+        } else if (relation.requested) {
             followState = FollowState.REQUESTED;
         } else {
             followState = FollowState.NOT_FOLLOWING;
         }
-        this.blocking = blocking;
-        this.muting = muting;
+        this.blocking = relation.blocking;
+        this.muting = relation.muting;
 
         if (followState != FollowState.NOT_FOLLOWING || !blocking || !muting) {
             invalidateOptionsMenu();
         }
 
+        if(relation.followedBy) {
+            followsYouView.setVisibility(View.VISIBLE);
+        } else {
+            followsYouView.setVisibility(View.GONE);
+        }
+
         updateButtons();
     }
 
diff --git a/app/src/main/res/layout/activity_account.xml b/app/src/main/res/layout/activity_account.xml
index ca81039a..e0197e9d 100644
--- a/app/src/main/res/layout/activity_account.xml
+++ b/app/src/main/res/layout/activity_account.xml
@@ -58,22 +58,34 @@
                             android:id="@+id/account_avatar"
                             android:layout_width="80dp"
                             android:layout_height="80dp"
+                            android:layout_alignParentLeft="true"
+                            android:layout_alignParentStart="true"
                             android:layout_marginEnd="10dp"
                             android:layout_marginRight="10dp"
-                            android:src="@drawable/avatar_default"
-                            android:layout_alignParentStart="true"
-                            android:layout_alignParentLeft="true"
                             android:layout_toLeftOf="@+id/follow_btn"
                             android:layout_toStartOf="@+id/follow_btn"
+                            android:src="@drawable/avatar_default"
                             app:shadow="true" />
 
                         <Button
+                            android:id="@+id/follow_btn"
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"
                             android:layout_alignParentEnd="true"
                             android:layout_alignParentRight="true"
-                            android:layout_marginTop="6dp"
-                            android:id="@+id/follow_btn"/>
+                            android:layout_marginTop="6dp" />
+
+                        <TextView
+                            android:id="@+id/account_follows_you"
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:layout_alignParentEnd="true"
+                            android:layout_alignParentRight="true"
+                            android:layout_below="@id/follow_btn"
+                            android:layout_marginEnd="10dp"
+                            android:layout_marginRight="10dp"
+                            android:text="Follows you"
+                            android:textColor="?android:textColorPrimary" />
 
                         <LinearLayout
                             android:layout_width="match_parent"
diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml
index 9f6cb04f..6c2d694e 100644
--- a/app/src/main/res/values-de/strings.xml
+++ b/app/src/main/res/values-de/strings.xml
@@ -192,5 +192,8 @@
     <string name="pref_title_status_filter">Timeline-Filter</string>
     <string name="title_saved_toot">Gespeicherte Tröts</string>
 
+    <string name="follows_you">Folgt dir</string>
+
+
 
 </resources>
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 91e0395d..5651bd2e 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -211,4 +211,7 @@
     <string name="abbreviated_minutes_ago">%dm</string>
     <string name="abbreviated_seconds_ago">%ds</string>
 
+    <string name="follows_you">Follows you</string>
+
+
 </resources>

From 2f66de979715fe5cc106b5eae5deb5b30ce0dcfb Mon Sep 17 00:00:00 2001
From: Conny Duck <k.pozniak@gmx.at>
Date: Sat, 5 Aug 2017 10:29:04 +0200
Subject: [PATCH 5/7] code cleanup, simplify AccountActivityLayout

---
 .../main/res/drawable/ic_hourglass_24dp.xml   |  9 ---
 .../res/drawable/ic_person_minus_24px.xml     | 12 ----
 app/src/main/res/layout/activity_account.xml  | 69 ++++++++-----------
 3 files changed, 30 insertions(+), 60 deletions(-)
 delete mode 100644 app/src/main/res/drawable/ic_hourglass_24dp.xml
 delete mode 100644 app/src/main/res/drawable/ic_person_minus_24px.xml

diff --git a/app/src/main/res/drawable/ic_hourglass_24dp.xml b/app/src/main/res/drawable/ic_hourglass_24dp.xml
deleted file mode 100644
index 22c1f349..00000000
--- a/app/src/main/res/drawable/ic_hourglass_24dp.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<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="#FFFFFFFF"
-        android:pathData="M6,2v6h0.01L6,8.01 10,12l-4,4 0.01,0.01L6,16.01L6,22h12v-5.99h-0.01L18,16l-4,-4 4,-3.99 -0.01,-0.01L18,8L18,2L6,2zM16,16.5L16,20L8,20v-3.5l4,-4 4,4zM12,11.5l-4,-4L8,4h8v3.5l-4,4z"/>
-</vector>
diff --git a/app/src/main/res/drawable/ic_person_minus_24px.xml b/app/src/main/res/drawable/ic_person_minus_24px.xml
deleted file mode 100644
index c8a7ea0b..00000000
--- a/app/src/main/res/drawable/ic_person_minus_24px.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
-    android:width="24dp"
-    android:height="24dp"
-    android:viewportWidth="24"
-    android:viewportHeight="24">
-
-    <path
-        android:fillColor="@color/toolbar_icon_dark"
-        android:pathData="M14.4,12c2.7,0.4,5-1.9,4.6-4.6c-0.3-1.7-1.6-3.1-3.3-3.3c-2.7-0.4-5,1.9-4.6,4.6C11.3,10.3,12.7,11.7,14.4,12z
-M6,12h3v-2H6H4H1v2h3H6z M15,14c-2.7,0-8,1.3-8,4v2h16v-2C23,15.3,17.7,14,15,14z" />
-</vector>
\ 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 e0197e9d..bd1ecce0 100644
--- a/app/src/main/res/layout/activity_account.xml
+++ b/app/src/main/res/layout/activity_account.xml
@@ -84,52 +84,43 @@
                             android:layout_below="@id/follow_btn"
                             android:layout_marginEnd="10dp"
                             android:layout_marginRight="10dp"
-                            android:text="Follows you"
+                            android:text="@string/follows_you"
                             android:textColor="?android:textColorPrimary" />
 
-                        <LinearLayout
+                        <TextView
+                            android:id="@+id/account_display_name"
                             android:layout_width="match_parent"
                             android:layout_height="wrap_content"
                             android:layout_below="@id/account_avatar"
-                            android:orientation="vertical">
+                            android:ellipsize="end"
+                            android:maxLines="1"
+                            android:textColor="?android:textColorPrimary"
+                            android:textSize="18sp"
+                            android:textStyle="normal|bold" />
 
-                            <TextView
-                                android:id="@+id/account_display_name"
-                                android:layout_width="wrap_content"
-                                android:layout_height="wrap_content"
-                                android:ellipsize="end"
-                                android:maxLines="1"
-                                android:textColor="?android:textColorPrimary"
-                                android:textSize="18sp"
-                                android:textStyle="normal|bold" />
+                        <TextView
+                            android:id="@+id/account_username"
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:layout_below="@id/account_display_name"
+                            android:ellipsize="end"
+                            android:maxLines="1"
+                            android:textColor="?android:textColorSecondary" />
 
-                            <RelativeLayout
-                                android:layout_width="match_parent"
-                                android:layout_height="wrap_content">
-
-                                <TextView
-                                    android:id="@+id/account_username"
-                                    android:layout_width="wrap_content"
-                                    android:layout_height="wrap_content"
-                                    android:ellipsize="end"
-                                    android:maxLines="1"
-                                    android:textColor="?android:textColorSecondary" />
-
-                                <ImageView
-                                    android:id="@+id/account_locked"
-                                    android:layout_width="16sp"
-                                    android:layout_height="16sp"
-                                    android:layout_centerVertical="true"
-                                    android:layout_marginLeft="4dp"
-                                    android:layout_marginStart="4dp"
-                                    android:layout_toEndOf="@id/account_username"
-                                    android:layout_toRightOf="@id/account_username"
-                                    android:contentDescription="@string/description_account_locked"
-                                    android:tint="?android:textColorSecondary"
-                                    android:visibility="gone"
-                                    app:srcCompat="@drawable/reblog_disabled_light" />
-                            </RelativeLayout>
-                        </LinearLayout>
+                        <ImageView
+                            android:id="@+id/account_locked"
+                            android:layout_width="16sp"
+                            android:layout_height="16sp"
+                            android:layout_alignBaseline="@+id/account_username"
+                            android:layout_centerVertical="true"
+                            android:layout_marginLeft="4dp"
+                            android:layout_marginStart="4dp"
+                            android:layout_toEndOf="@id/account_username"
+                            android:layout_toRightOf="@id/account_username"
+                            android:contentDescription="@string/description_account_locked"
+                            android:tint="?android:textColorSecondary"
+                            android:visibility="gone"
+                            app:srcCompat="@drawable/reblog_disabled_light" />
 
                     </RelativeLayout>
 

From f696b6e8d35ce3cb62ec7d63632abc59975aa84f Mon Sep 17 00:00:00 2001
From: Conny Duck <k.pozniak@gmx.at>
Date: Sat, 5 Aug 2017 11:34:50 +0200
Subject: [PATCH 6/7] bugfix, layout improvements

---
 .../keylesspalace/tusky/AccountActivity.java  |  14 +-
 .../tusky/fragment/AccountListFragment.java   |   7 +-
 .../tusky/fragment/NotificationsFragment.java |   8 +-
 .../tusky/fragment/TimelineFragment.java      |   7 +-
 .../interfaces/ActionButtonActivity.java      |   2 +
 app/src/main/res/layout/activity_account.xml  | 160 +++++++++---------
 6 files changed, 102 insertions(+), 96 deletions(-)

diff --git a/app/src/main/java/com/keylesspalace/tusky/AccountActivity.java b/app/src/main/java/com/keylesspalace/tusky/AccountActivity.java
index 3c2fec8b..103bfb10 100644
--- a/app/src/main/java/com/keylesspalace/tusky/AccountActivity.java
+++ b/app/src/main/java/com/keylesspalace/tusky/AccountActivity.java
@@ -166,7 +166,7 @@ public class AccountActivity extends BaseActivity implements ActionButtonActivit
                     ThemeUtils.setDrawableTint(context, toolbar.getOverflowIcon(), attribute);
                 }
 
-                if(floatingBtn != null && hideFab) {
+                if(floatingBtn != null && hideFab && !isSelf && !blocking) {
                     if (verticalOffset > oldOffset) {
                         floatingBtn.show();
                     }
@@ -367,10 +367,6 @@ public class AccountActivity extends BaseActivity implements ActionButtonActivit
         this.blocking = relation.blocking;
         this.muting = relation.muting;
 
-        if (followState != FollowState.NOT_FOLLOWING || !blocking || !muting) {
-            invalidateOptionsMenu();
-        }
-
         if(relation.followedBy) {
             followsYouView.setVisibility(View.VISIBLE);
         } else {
@@ -424,6 +420,9 @@ public class AccountActivity extends BaseActivity implements ActionButtonActivit
                     updateFollowButton(followBtn);
                 }
             });
+        } else {
+            floatingBtn.hide();
+            followBtn.setVisibility(View.GONE);
         }
     }
 
@@ -668,7 +667,10 @@ public class AccountActivity extends BaseActivity implements ActionButtonActivit
     @Nullable
     @Override
     public FloatingActionButton getActionButton() {
-        return floatingBtn;
+        if(!isSelf && !blocking) {
+            return floatingBtn;
+        }
+        return null;
     }
 
 }
diff --git a/app/src/main/java/com/keylesspalace/tusky/fragment/AccountListFragment.java b/app/src/main/java/com/keylesspalace/tusky/fragment/AccountListFragment.java
index 996c4206..a3f81c0d 100644
--- a/app/src/main/java/com/keylesspalace/tusky/fragment/AccountListFragment.java
+++ b/app/src/main/java/com/keylesspalace/tusky/fragment/AccountListFragment.java
@@ -178,15 +178,16 @@ public class AccountListFragment extends BaseFragment implements AccountActionLi
         if (actionButtonPresent()) {
             /* Use a modified scroll listener that both loads more statuses as it goes, and hides
              * the follow button on down-scroll. */
-            ActionButtonActivity actionButtonActivity = (ActionButtonActivity) getActivity();
-            final FloatingActionButton composeButton = actionButtonActivity.getActionButton();
-            final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(getContext());
+            SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(getContext());
             hideFab = preferences.getBoolean("fabHide", false);
             scrollListener = new EndlessOnScrollListener(layoutManager) {
                 @Override
                 public void onScrolled(RecyclerView view, int dx, int dy) {
                     super.onScrolled(view, dx, dy);
 
+                    ActionButtonActivity actionButtonActivity = (ActionButtonActivity) getActivity();
+                    FloatingActionButton composeButton = actionButtonActivity.getActionButton();
+
                     if (composeButton != null) {
                         if (hideFab) {
                             if (dy > 0 && composeButton.isShown()) {
diff --git a/app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java b/app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java
index 8375bf86..f4de5665 100644
--- a/app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java
+++ b/app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java
@@ -40,6 +40,7 @@ import com.keylesspalace.tusky.adapter.NotificationsAdapter;
 import com.keylesspalace.tusky.R;
 import com.keylesspalace.tusky.entity.Notification;
 import com.keylesspalace.tusky.entity.Status;
+import com.keylesspalace.tusky.interfaces.ActionButtonActivity;
 import com.keylesspalace.tusky.interfaces.StatusActionListener;
 import com.keylesspalace.tusky.receiver.TimelineReceiver;
 import com.keylesspalace.tusky.util.HttpHeaderLink;
@@ -172,9 +173,7 @@ public class NotificationsFragment extends SFragment implements
          * guaranteed to be set until then.
          * Use a modified scroll listener that both loads more notifications as it goes, and hides
          * the compose button on down-scroll. */
-        final FloatingActionButton composeButton = activity.getActionButton();
-        final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(
-                activity);
+        SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(activity);
         preferences.registerOnSharedPreferenceChangeListener(this);
         hideFab = preferences.getBoolean("fabHide", false);
         scrollListener = new EndlessOnScrollListener(layoutManager) {
@@ -182,6 +181,9 @@ public class NotificationsFragment extends SFragment implements
             public void onScrolled(RecyclerView view, int dx, int dy) {
                 super.onScrolled(view, dx, dy);
 
+                ActionButtonActivity activity = (ActionButtonActivity) getActivity();
+                FloatingActionButton composeButton = activity.getActionButton();
+
                 if(composeButton != null) {
                     if (hideFab) {
                         if (dy > 0 && composeButton.isShown()) {
diff --git a/app/src/main/java/com/keylesspalace/tusky/fragment/TimelineFragment.java b/app/src/main/java/com/keylesspalace/tusky/fragment/TimelineFragment.java
index 379b9c42..103f7e81 100644
--- a/app/src/main/java/com/keylesspalace/tusky/fragment/TimelineFragment.java
+++ b/app/src/main/java/com/keylesspalace/tusky/fragment/TimelineFragment.java
@@ -198,15 +198,16 @@ public class TimelineFragment extends SFragment implements
         if (actionButtonPresent()) {
             /* Use a modified scroll listener that both loads more statuses as it goes, and hides
              * the follow button on down-scroll. */
-            ActionButtonActivity activity = (ActionButtonActivity) getActivity();
-            final FloatingActionButton composeButton = activity.getActionButton();
-            final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(getContext());
+            SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(getContext());
             hideFab = preferences.getBoolean("fabHide", false);
             scrollListener = new EndlessOnScrollListener(layoutManager) {
                 @Override
                 public void onScrolled(RecyclerView view, int dx, int dy) {
                     super.onScrolled(view, dx, dy);
 
+                    ActionButtonActivity activity = (ActionButtonActivity) getActivity();
+                    FloatingActionButton composeButton = activity.getActionButton();
+
                     if (composeButton != null) {
                         if (hideFab) {
                             if (dy > 0 && composeButton.isShown()) {
diff --git a/app/src/main/java/com/keylesspalace/tusky/interfaces/ActionButtonActivity.java b/app/src/main/java/com/keylesspalace/tusky/interfaces/ActionButtonActivity.java
index 35d2b9c0..faf2352d 100644
--- a/app/src/main/java/com/keylesspalace/tusky/interfaces/ActionButtonActivity.java
+++ b/app/src/main/java/com/keylesspalace/tusky/interfaces/ActionButtonActivity.java
@@ -19,6 +19,8 @@ import android.support.annotation.Nullable;
 import android.support.design.widget.FloatingActionButton;
 
 public interface ActionButtonActivity {
+
+    /* return the ActionButton of the Activity to hide or show it on scroll */
     @Nullable
     FloatingActionButton getActionButton();
 }
diff --git a/app/src/main/res/layout/activity_account.xml b/app/src/main/res/layout/activity_account.xml
index bd1ecce0..a1788cb4 100644
--- a/app/src/main/res/layout/activity_account.xml
+++ b/app/src/main/res/layout/activity_account.xml
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
     android:id="@+id/activity_account"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
@@ -39,100 +40,97 @@
                     android:scaleType="centerCrop"
                     app:layout_collapseMode="pin" />
 
-                <LinearLayout
+                <RelativeLayout
                     android:id="@+id/account_header_info"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
                     android:background="@drawable/account_header_gradient"
-                    android:orientation="vertical"
+                    android:paddingLeft="16dp"
+                    android:paddingRight="16dp"
                     android:paddingTop="?attr/actionBarSize"
                     app:layout_collapseMode="parallax">
 
-                    <RelativeLayout
+                    <com.pkmmte.view.CircularImageView
+                        android:id="@+id/account_avatar"
+                        android:layout_width="80dp"
+                        android:layout_height="80dp"
+                        android:layout_alignParentLeft="true"
+                        android:layout_alignParentStart="true"
+                        android:layout_marginEnd="10dp"
+                        android:layout_marginRight="10dp"
+                        android:layout_toLeftOf="@+id/follow_btn"
+                        android:layout_toStartOf="@+id/follow_btn"
+                        android:src="@drawable/avatar_default"
+                        app:shadow="true" />
+
+                    <Button
+                        android:id="@+id/follow_btn"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_alignParentEnd="true"
+                        android:layout_alignParentRight="true"
+                        android:layout_marginTop="6dp" />
+
+                    <TextView
+                        android:id="@+id/account_follows_you"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_alignParentEnd="true"
+                        android:layout_alignParentRight="true"
+                        android:layout_below="@id/follow_btn"
+                        android:layout_marginEnd="10dp"
+                        android:layout_marginRight="10dp"
+                        android:text="@string/follows_you"
+                        android:textColor="?android:textColorPrimary" />
+
+                    <TextView
+                        android:id="@+id/account_display_name"
                         android:layout_width="match_parent"
                         android:layout_height="wrap_content"
-                        android:paddingLeft="16dp"
-                        android:paddingRight="16dp">
+                        android:layout_below="@id/account_avatar"
+                        android:ellipsize="end"
+                        android:maxLines="1"
+                        android:textColor="?android:textColorPrimary"
+                        android:textSize="18sp"
+                        android:textStyle="normal|bold"
+                        tools:text="Tusky Mastodon Client" />
 
-                        <com.pkmmte.view.CircularImageView
-                            android:id="@+id/account_avatar"
-                            android:layout_width="80dp"
-                            android:layout_height="80dp"
-                            android:layout_alignParentLeft="true"
-                            android:layout_alignParentStart="true"
-                            android:layout_marginEnd="10dp"
-                            android:layout_marginRight="10dp"
-                            android:layout_toLeftOf="@+id/follow_btn"
-                            android:layout_toStartOf="@+id/follow_btn"
-                            android:src="@drawable/avatar_default"
-                            app:shadow="true" />
+                    <TextView
+                        android:id="@+id/account_username"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_below="@id/account_display_name"
+                        android:ellipsize="end"
+                        android:maxLines="1"
+                        android:textColor="?android:textColorSecondary"
+                        tools:text="\@Tusky" />
 
-                        <Button
-                            android:id="@+id/follow_btn"
-                            android:layout_width="wrap_content"
-                            android:layout_height="wrap_content"
-                            android:layout_alignParentEnd="true"
-                            android:layout_alignParentRight="true"
-                            android:layout_marginTop="6dp" />
-
-                        <TextView
-                            android:id="@+id/account_follows_you"
-                            android:layout_width="wrap_content"
-                            android:layout_height="wrap_content"
-                            android:layout_alignParentEnd="true"
-                            android:layout_alignParentRight="true"
-                            android:layout_below="@id/follow_btn"
-                            android:layout_marginEnd="10dp"
-                            android:layout_marginRight="10dp"
-                            android:text="@string/follows_you"
-                            android:textColor="?android:textColorPrimary" />
-
-                        <TextView
-                            android:id="@+id/account_display_name"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            android:layout_below="@id/account_avatar"
-                            android:ellipsize="end"
-                            android:maxLines="1"
-                            android:textColor="?android:textColorPrimary"
-                            android:textSize="18sp"
-                            android:textStyle="normal|bold" />
-
-                        <TextView
-                            android:id="@+id/account_username"
-                            android:layout_width="wrap_content"
-                            android:layout_height="wrap_content"
-                            android:layout_below="@id/account_display_name"
-                            android:ellipsize="end"
-                            android:maxLines="1"
-                            android:textColor="?android:textColorSecondary" />
-
-                        <ImageView
-                            android:id="@+id/account_locked"
-                            android:layout_width="16sp"
-                            android:layout_height="16sp"
-                            android:layout_alignBaseline="@+id/account_username"
-                            android:layout_centerVertical="true"
-                            android:layout_marginLeft="4dp"
-                            android:layout_marginStart="4dp"
-                            android:layout_toEndOf="@id/account_username"
-                            android:layout_toRightOf="@id/account_username"
-                            android:contentDescription="@string/description_account_locked"
-                            android:tint="?android:textColorSecondary"
-                            android:visibility="gone"
-                            app:srcCompat="@drawable/reblog_disabled_light" />
-
-                    </RelativeLayout>
+                    <ImageView
+                        android:id="@+id/account_locked"
+                        android:layout_width="16sp"
+                        android:layout_height="16sp"
+                        android:layout_alignBottom="@id/account_username"
+                        android:layout_centerVertical="true"
+                        android:layout_marginLeft="4dp"
+                        android:layout_marginStart="4dp"
+                        android:layout_toEndOf="@id/account_username"
+                        android:layout_toRightOf="@id/account_username"
+                        android:contentDescription="@string/description_account_locked"
+                        android:tint="?android:textColorSecondary"
+                        android:visibility="gone"
+                        app:srcCompat="@drawable/reblog_disabled_light" />
 
                     <TextView
                         android:id="@+id/account_note"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
-                        android:padding="16dp"
+                        android:layout_below="@id/account_username"
+                        android:paddingBottom="16dp"
                         android:paddingTop="10dp"
-                        android:textColor="?android:textColorTertiary" />
+                        android:textColor="?android:textColorTertiary"
+                        tools:text="This is a test description" />
 
-                </LinearLayout>
+                </RelativeLayout>
 
             </RelativeLayout>
 
@@ -179,11 +177,6 @@
 
     </android.support.v4.view.ViewPager>
 
-    <FrameLayout
-        android:id="@+id/overlay_fragment_container"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent" />
-
     <View
         android:id="@+id/tab_bottom_shadow"
         android:layout_width="match_parent"
@@ -202,4 +195,9 @@
         android:contentDescription="@string/action_mention"
         app:srcCompat="@drawable/ic_create_24dp" />
 
+    <FrameLayout
+        android:id="@+id/overlay_fragment_container"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent" />
+
 </android.support.design.widget.CoordinatorLayout>

From 2c1bae80b7808b170443a88cb0d31b96e68e782e Mon Sep 17 00:00:00 2001
From: Conny Duck <k.pozniak@gmx.at>
Date: Sat, 5 Aug 2017 12:04:58 +0200
Subject: [PATCH 7/7] rename setting "follow button" -> "compose button"

---
 app/src/main/res/values/strings.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 5651bd2e..3d13aad6 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -161,7 +161,7 @@
     <string name="pref_title_light_theme">Use the Light Theme</string>
     <string name="pref_title_browser_settings">Browser</string>
     <string name="pref_title_custom_tabs">Use Chrome Custom Tabs</string>
-    <string name="pref_title_hide_follow_button">Hide follow button while scrolling</string>
+    <string name="pref_title_hide_follow_button">Hide compose button while scrolling</string>
     <string name="pref_title_status_filter">Timeline filtering</string>
     <string name="pref_title_status_tabs">Tabs</string>
     <string name="pref_title_show_boosts">Show boosts</string>