Merge branch 'account-activity-improvements' of https://github.com/connyduck/Tusky into connyduck-account-activity-improvements
This commit is contained in:
commit
cd6a3a32f1
@ -41,11 +41,13 @@ 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;
|
||||
|
||||
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;
|
||||
@ -63,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 {
|
||||
@ -81,9 +83,13 @@ public class AccountActivity extends BaseActivity {
|
||||
private CircularImageView avatar;
|
||||
private ImageView header;
|
||||
private FloatingActionButton floatingBtn;
|
||||
private Button followBtn;
|
||||
private TextView followsYouView;
|
||||
private TabLayout tabLayout;
|
||||
private ImageView accountLockedView;
|
||||
private View container;
|
||||
private boolean hideFab;
|
||||
private int oldOffset;
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
@ -93,6 +99,8 @@ 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);
|
||||
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);
|
||||
@ -124,6 +132,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 =
|
||||
@ -155,11 +165,23 @@ public class AccountActivity extends BaseActivity {
|
||||
ThemeUtils.setDrawableTint(context, toolbar.getNavigationIcon(), attribute);
|
||||
ThemeUtils.setDrawableTint(context, toolbar.getOverflowIcon(), attribute);
|
||||
}
|
||||
|
||||
if(floatingBtn != null && hideFab && !isSelf && !blocking) {
|
||||
if (verticalOffset > oldOffset) {
|
||||
floatingBtn.show();
|
||||
}
|
||||
if (verticalOffset < oldOffset) {
|
||||
floatingBtn.hide();
|
||||
}
|
||||
}
|
||||
oldOffset = verticalOffset;
|
||||
}
|
||||
});
|
||||
|
||||
// Initialise the default UI states.
|
||||
floatingBtn.hide();
|
||||
followBtn.setVisibility(View.GONE);
|
||||
followsYouView.setVisibility(View.GONE);
|
||||
|
||||
// Obtain information to fill out the profile.
|
||||
obtainAccount();
|
||||
@ -321,8 +343,7 @@ public class AccountActivity extends BaseActivity {
|
||||
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()));
|
||||
}
|
||||
@ -335,40 +356,38 @@ public class AccountActivity extends BaseActivity {
|
||||
});
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
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,20 +398,31 @@ 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);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
floatingBtn.hide();
|
||||
followBtn.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
@ -543,7 +573,6 @@ public class AccountActivity extends BaseActivity {
|
||||
.show();
|
||||
}
|
||||
|
||||
|
||||
private void mute(final String id) {
|
||||
Callback<Relationship> cb = new Callback<Relationship>() {
|
||||
@Override
|
||||
@ -582,6 +611,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 +636,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) {
|
||||
@ -630,4 +663,14 @@ public class AccountActivity extends BaseActivity {
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public FloatingActionButton getActionButton() {
|
||||
if(!isSelf && !blocking) {
|
||||
return floatingBtn;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
@ -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,56 @@ 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. */
|
||||
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()) {
|
||||
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()) {
|
||||
|
@ -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.composeButton;
|
||||
final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(
|
||||
activity);
|
||||
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(activity);
|
||||
preferences.registerOnSharedPreferenceChangeListener(this);
|
||||
hideFab = preferences.getBoolean("fabHide", false);
|
||||
scrollListener = new EndlessOnScrollListener(layoutManager) {
|
||||
@ -182,14 +181,19 @@ 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
|
||||
ActionButtonActivity activity = (ActionButtonActivity) getActivity();
|
||||
FloatingActionButton composeButton = activity.getActionButton();
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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,30 @@ 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);
|
||||
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
|
||||
ActionButtonActivity activity = (ActionButtonActivity) getActivity();
|
||||
FloatingActionButton composeButton = activity.getActionButton();
|
||||
|
||||
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 +440,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() {
|
||||
|
@ -0,0 +1,26 @@
|
||||
/* 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 {
|
||||
|
||||
/* return the ActionButton of the Activity to hide or show it on scroll */
|
||||
@Nullable
|
||||
FloatingActionButton getActionButton();
|
||||
}
|
5
app/src/main/res/color/account_tab_font_color.xml
Normal file
5
app/src/main/res/color/account_tab_font_color.xml
Normal file
@ -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>
|
@ -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>
|
@ -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>
|
@ -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,90 +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:paddingTop="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_marginEnd="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
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" />
|
||||
|
||||
<LinearLayout
|
||||
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:orientation="vertical">
|
||||
|
||||
<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" />
|
||||
|
||||
<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>
|
||||
|
||||
</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>
|
||||
|
||||
@ -150,7 +158,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"
|
||||
@ -168,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"
|
||||
@ -188,7 +192,12 @@
|
||||
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" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/overlay_fragment_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</android.support.design.widget.CoordinatorLayout>
|
||||
|
@ -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>
|
@ -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>
|
||||
|
@ -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>
|
||||
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user