Changes the behavior for show accounts
This commit is contained in:
parent
2e3839cbe0
commit
33d8df5835
|
@ -14,10 +14,7 @@
|
|||
* see <http://www.gnu.org/licenses>. */
|
||||
package fr.gouv.etalab.mastodon.activities;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Canvas;
|
||||
|
@ -31,21 +28,19 @@ import android.graphics.drawable.Drawable;
|
|||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.support.design.widget.AppBarLayout;
|
||||
import android.support.design.widget.FloatingActionButton;
|
||||
import android.support.design.widget.TabLayout;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v4.app.FragmentManager;
|
||||
import android.support.v4.app.FragmentStatePagerAdapter;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.v4.content.LocalBroadcastManager;
|
||||
import android.support.v4.view.PagerAdapter;
|
||||
import android.support.v4.view.ViewPager;
|
||||
import android.support.v7.app.ActionBar;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.text.SpannableString;
|
||||
import android.text.method.LinkMovementMethod;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
|
@ -111,15 +106,12 @@ public class ShowAccountActivity extends AppCompatActivity implements OnPostActi
|
|||
private ViewPager mPager;
|
||||
private String accountId;
|
||||
private TabLayout tabLayout;
|
||||
private BroadcastReceiver hide_header;
|
||||
private TextView account_note, account_follow_request;
|
||||
private String userId;
|
||||
private boolean isHiddingShowing = false;
|
||||
private static int instanceValue = 0;
|
||||
private Relationship relationship;
|
||||
private boolean showMediaOnly;
|
||||
private ImageView pp_actionBar;
|
||||
private LinearLayout main_header_container;
|
||||
|
||||
public enum action{
|
||||
FOLLOW,
|
||||
|
@ -146,8 +138,8 @@ public class ShowAccountActivity extends AppCompatActivity implements OnPostActi
|
|||
Bundle b = getIntent().getExtras();
|
||||
account_follow = (FloatingActionButton) findViewById(R.id.account_follow);
|
||||
account_follow_request = (TextView) findViewById(R.id.account_follow_request);
|
||||
|
||||
account_follow.setEnabled(false);
|
||||
main_header_container = (LinearLayout) findViewById(R.id.main_header_container);
|
||||
if(b != null){
|
||||
accountId = b.getString("accountId");
|
||||
new RetrieveRelationshipAsyncTask(getApplicationContext(), accountId,ShowAccountActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||
|
@ -224,41 +216,7 @@ public class ShowAccountActivity extends AppCompatActivity implements OnPostActi
|
|||
}
|
||||
});
|
||||
|
||||
|
||||
account_note = (TextView) findViewById(R.id.account_note);
|
||||
//Register LocalBroadcast to receive selected accounts after search
|
||||
hide_header = new BroadcastReceiver() {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
if( !isHiddingShowing ){
|
||||
isHiddingShowing = true;
|
||||
ImageView account_pp = (ImageView) findViewById(R.id.account_pp);
|
||||
boolean hide = intent.getBooleanExtra("hide", false);
|
||||
if( hide){
|
||||
main_header_container.setVisibility(View.GONE);
|
||||
if( pp_actionBar != null)
|
||||
pp_actionBar.setVisibility(View.VISIBLE);
|
||||
tabLayout.setVisibility(View.GONE);
|
||||
}else {
|
||||
manageButtonVisibility();
|
||||
tabLayout.setVisibility(View.VISIBLE);
|
||||
main_header_container.setVisibility(View.VISIBLE);
|
||||
if( pp_actionBar != null)
|
||||
pp_actionBar.setVisibility(View.GONE);
|
||||
}
|
||||
account_pp.requestLayout();
|
||||
Handler handler = new Handler();
|
||||
handler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
isHiddingShowing = false;
|
||||
}
|
||||
}, 700);
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
LocalBroadcastManager.getInstance(this).registerReceiver(hide_header, new IntentFilter(Helper.HEADER_ACCOUNT+String.valueOf(instanceValue)));
|
||||
|
||||
//Follow button
|
||||
account_follow.setOnClickListener(new View.OnClickListener() {
|
||||
|
@ -386,7 +344,7 @@ public class ShowAccountActivity extends AppCompatActivity implements OnPostActi
|
|||
account_dn.setCompoundDrawables( null, null, null, null);
|
||||
}
|
||||
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
final ActionBar actionBar = getSupportActionBar();
|
||||
LayoutInflater mInflater = LayoutInflater.from(ShowAccountActivity.this);
|
||||
if( actionBar != null && account != null){
|
||||
View show_account_actionbar = mInflater.inflate(R.layout.showaccount_actionbar, null);
|
||||
|
@ -415,6 +373,19 @@ public class ShowAccountActivity extends AppCompatActivity implements OnPostActi
|
|||
public void onLoadingFailed(java.lang.String imageUri, android.view.View view, FailReason failReason){
|
||||
|
||||
}});
|
||||
|
||||
AppBarLayout appBar = (AppBarLayout) findViewById(R.id.appBar);
|
||||
appBar.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() {
|
||||
@Override
|
||||
public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) {
|
||||
if(verticalOffset == 0){
|
||||
pp_actionBar.setVisibility(View.GONE);
|
||||
}else {
|
||||
pp_actionBar.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}else {
|
||||
if( account != null && account.getAcct() != null)
|
||||
setTitle(account.getAcct());
|
||||
|
@ -442,11 +413,6 @@ public class ShowAccountActivity extends AppCompatActivity implements OnPostActi
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy(){
|
||||
super.onDestroy();
|
||||
LocalBroadcastManager.getInstance(this).unregisterReceiver(hide_header);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRetrieveRelationship(Relationship relationship, Error error) {
|
||||
|
|
|
@ -20,9 +20,8 @@ import android.os.AsyncTask;
|
|||
import android.os.Bundle;
|
||||
import android.os.Parcelable;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v4.content.LocalBroadcastManager;
|
||||
import android.support.v4.view.ViewCompat;
|
||||
import android.support.v4.widget.SwipeRefreshLayout;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
@ -109,48 +108,7 @@ public class DisplayAccountsFragment extends Fragment implements OnRetrieveAccou
|
|||
if( !comesFromSearch) {
|
||||
//Hide account header when scrolling for ShowAccountActivity
|
||||
if (hideHeader) {
|
||||
lv_accounts.setOnScrollListener(new AbsListView.OnScrollListener() {
|
||||
int lastFirstVisibleItem = 0;
|
||||
|
||||
@Override
|
||||
public void onScrollStateChanged(AbsListView view, int scrollState) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
|
||||
|
||||
if(firstVisibleItem == 0 && Helper.listIsAtTop(lv_accounts)){
|
||||
Intent intent = new Intent(Helper.HEADER_ACCOUNT+instanceValue);
|
||||
intent.putExtra("hide", false);
|
||||
LocalBroadcastManager.getInstance(context).sendBroadcast(intent);
|
||||
}else if (view.getId() == lv_accounts.getId() && totalItemCount > visibleItemCount) {
|
||||
final int currentFirstVisibleItem = lv_accounts.getFirstVisiblePosition();
|
||||
|
||||
if (currentFirstVisibleItem > lastFirstVisibleItem) {
|
||||
Intent intent = new Intent(Helper.HEADER_ACCOUNT + instanceValue);
|
||||
intent.putExtra("hide", true);
|
||||
LocalBroadcastManager.getInstance(context).sendBroadcast(intent);
|
||||
} else if (currentFirstVisibleItem < lastFirstVisibleItem) {
|
||||
Intent intent = new Intent(Helper.HEADER_ACCOUNT + instanceValue);
|
||||
intent.putExtra("hide", false);
|
||||
LocalBroadcastManager.getInstance(context).sendBroadcast(intent);
|
||||
}
|
||||
lastFirstVisibleItem = currentFirstVisibleItem;
|
||||
}
|
||||
if (firstVisibleItem + visibleItemCount == totalItemCount) {
|
||||
if (!flag_loading) {
|
||||
flag_loading = true;
|
||||
if (type != RetrieveAccountsAsyncTask.Type.FOLLOWERS && type != RetrieveAccountsAsyncTask.Type.FOLLOWING)
|
||||
asyncTask = new RetrieveAccountsAsyncTask(context, type, max_id, DisplayAccountsFragment.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||
else
|
||||
asyncTask = new RetrieveAccountsAsyncTask(context, type, targetedId, max_id, DisplayAccountsFragment.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||
nextElementLoader.setVisibility(View.VISIBLE);
|
||||
}
|
||||
} else {
|
||||
nextElementLoader.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
});
|
||||
ViewCompat.setNestedScrollingEnabled(lv_accounts,true);
|
||||
}else{
|
||||
lv_accounts.setOnScrollListener(new AbsListView.OnScrollListener() {
|
||||
@Override
|
||||
|
|
|
@ -21,9 +21,8 @@ import android.os.AsyncTask;
|
|||
import android.os.Bundle;
|
||||
import android.os.Parcelable;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v4.content.LocalBroadcastManager;
|
||||
import android.support.v4.view.ViewCompat;
|
||||
import android.support.v4.widget.SwipeRefreshLayout;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
@ -125,50 +124,7 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
|
|||
|
||||
//Hide account header when scrolling for ShowAccountActivity
|
||||
if(hideHeader) {
|
||||
lv_status.setOnScrollListener(new AbsListView.OnScrollListener() {
|
||||
int lastFirstVisibleItem = 0;
|
||||
|
||||
@Override
|
||||
public void onScrollStateChanged(AbsListView view, int scrollState) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
|
||||
|
||||
if(firstVisibleItem == 0 && Helper.listIsAtTop(lv_status)){
|
||||
Intent intent = new Intent(Helper.HEADER_ACCOUNT+instanceValue);
|
||||
intent.putExtra("hide", false);
|
||||
LocalBroadcastManager.getInstance(context).sendBroadcast(intent);
|
||||
}else if (view.getId() == lv_status.getId() && totalItemCount > visibleItemCount) {
|
||||
final int currentFirstVisibleItem = lv_status.getFirstVisiblePosition();
|
||||
if (currentFirstVisibleItem > lastFirstVisibleItem) {
|
||||
Intent intent = new Intent(Helper.HEADER_ACCOUNT+instanceValue);
|
||||
intent.putExtra("hide", true);
|
||||
LocalBroadcastManager.getInstance(context).sendBroadcast(intent);
|
||||
} else if (currentFirstVisibleItem < lastFirstVisibleItem) {
|
||||
Intent intent = new Intent(Helper.HEADER_ACCOUNT+instanceValue);
|
||||
intent.putExtra("hide", false);
|
||||
LocalBroadcastManager.getInstance(context).sendBroadcast(intent);
|
||||
}
|
||||
lastFirstVisibleItem = currentFirstVisibleItem;
|
||||
}
|
||||
if(firstVisibleItem + visibleItemCount == totalItemCount ) {
|
||||
if(!flag_loading ) {
|
||||
flag_loading = true;
|
||||
if( type == RetrieveFeedsAsyncTask.Type.USER)
|
||||
asyncTask = new RetrieveFeedsAsyncTask(context, type, targetedId, max_id, showMediaOnly, DisplayStatusFragment.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||
else if( type == RetrieveFeedsAsyncTask.Type.TAG)
|
||||
asyncTask = new RetrieveFeedsAsyncTask(context, type, tag, targetedId, max_id, DisplayStatusFragment.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||
else
|
||||
asyncTask = new RetrieveFeedsAsyncTask(context, type, max_id, DisplayStatusFragment.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||
|
||||
nextElementLoader.setVisibility(View.VISIBLE);
|
||||
}
|
||||
} else {
|
||||
nextElementLoader.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
});
|
||||
ViewCompat.setNestedScrollingEnabled(lv_status,true);
|
||||
}else{
|
||||
lv_status.setOnScrollListener(new AbsListView.OnScrollListener() {
|
||||
@Override
|
||||
|
|
|
@ -15,125 +15,123 @@
|
|||
You should have received a copy of the GNU General Public License along with Mastalab; if not,
|
||||
see <http://www.gnu.org/licenses>.
|
||||
-->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
<android.support.design.widget.CoordinatorLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/drawer_layout"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:animateLayoutChanges="true"
|
||||
android:orientation="vertical">
|
||||
<LinearLayout
|
||||
android:id="@+id/main_header_container"
|
||||
android:layout_marginTop="5dp"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:context="fr.gouv.etalab.mastodon.activities.ShowAccountActivity">
|
||||
<android.support.design.widget.AppBarLayout
|
||||
android:id="@+id/appBar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:background="@color/mastodonC1"
|
||||
android:orientation="vertical"
|
||||
android:layout_height="300dp"
|
||||
>
|
||||
<LinearLayout
|
||||
android:id="@+id/header_container"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:fitsSystemWindows="true"
|
||||
android:theme="@style/AppTheme.AppBarOverlay">
|
||||
<android.support.design.widget.CollapsingToolbarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
<ImageView
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:padding="10dp"
|
||||
android:id="@+id/account_pp"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
tools:ignore="ContentDescription" />
|
||||
android:fitsSystemWindows="true"
|
||||
app:layout_scrollFlags="scroll|exitUntilCollapsed">
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:id="@+id/account_dn"
|
||||
android:textColor="@color/mastodonC4"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:textSize="18sp"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
|
||||
<TextView
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:textColor="?attr/color_in_account_header"
|
||||
android:id="@+id/account_un"
|
||||
android:maxLines="1"
|
||||
android:layout_width="wrap_content"
|
||||
android:textSize="16sp"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
android:id="@+id/main_header_container"
|
||||
android:background="@color/mastodonC1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="250dp"
|
||||
android:orientation="vertical">
|
||||
<LinearLayout
|
||||
android:id="@+id/header_container"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_width="match_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
<TextView
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
>
|
||||
<ImageView
|
||||
android:padding="10dp"
|
||||
android:id="@+id/account_pp"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
tools:ignore="ContentDescription" />
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:id="@+id/account_dn"
|
||||
android:textColor="@color/mastodonC4"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:textSize="16sp"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
|
||||
<TextView
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:textColor="?attr/color_in_account_header"
|
||||
android:id="@+id/account_un"
|
||||
android:maxLines="1"
|
||||
android:layout_width="wrap_content"
|
||||
android:textSize="14sp"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
<TextView
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:visibility="gone"
|
||||
android:id="@+id/account_followed_by"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:gravity="center_vertical"
|
||||
android:textColor="?attr/colorAccent"
|
||||
android:text="@string/followed_by"
|
||||
android:maxLines="1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
<TextView
|
||||
android:id="@+id/account_follow_request"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:visibility="gone"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:gravity="center_vertical"
|
||||
android:textColor="?attr/colorAccent"
|
||||
android:text="@string/request_sent"
|
||||
android:maxLines="1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:layout_gravity="center"
|
||||
android:visibility="gone"
|
||||
android:id="@+id/account_followed_by"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:gravity="center_vertical"
|
||||
android:textColor="?attr/colorAccent"
|
||||
android:text="@string/followed_by"
|
||||
android:maxLines="1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
<TextView
|
||||
android:id="@+id/account_follow_request"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:visibility="gone"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:gravity="center_vertical"
|
||||
android:textColor="?attr/colorAccent"
|
||||
android:text="@string/request_sent"
|
||||
android:maxLines="1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:fabSize="mini"
|
||||
android:id="@+id/account_follow"
|
||||
android:textAllCaps="false"
|
||||
android:gravity="center"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
/>
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
android:id="@+id/account_note"
|
||||
android:padding="10dp"
|
||||
android:gravity="center"
|
||||
android:textColor="?attr/color_in_account_header"
|
||||
android:layout_width="match_parent"
|
||||
android:maxLines="4"
|
||||
android:autoLink="web"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:layout_gravity="center"
|
||||
android:visibility="gone"
|
||||
app:fabSize="mini"
|
||||
android:id="@+id/account_follow"
|
||||
android:textAllCaps="false"
|
||||
android:gravity="center"
|
||||
android:layout_marginRight="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
/>
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
android:id="@+id/account_note"
|
||||
android:padding="5dp"
|
||||
android:textColor="?attr/color_in_account_header"
|
||||
android:gravity="center"
|
||||
android:layout_width="match_parent"
|
||||
android:maxLines="3"
|
||||
android:autoLink="web"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
|
||||
<android.support.design.widget.AppBarLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_width="match_parent"
|
||||
android:background="@null"
|
||||
android:layout_height="wrap_content">
|
||||
</android.support.design.widget.CollapsingToolbarLayout>
|
||||
|
||||
<android.support.design.widget.TabLayout
|
||||
android:id="@+id/account_tabLayout"
|
||||
|
@ -143,11 +141,12 @@
|
|||
app:tabMode="fixed"
|
||||
app:tabGravity="fill"
|
||||
/>
|
||||
<android.support.v4.view.ViewPager
|
||||
android:id="@+id/account_viewpager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
|
||||
</android.support.design.widget.AppBarLayout>
|
||||
</LinearLayout>
|
||||
<android.support.v4.view.ViewPager
|
||||
android:id="@+id/account_viewpager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||
/>
|
||||
|
||||
</android.support.design.widget.CoordinatorLayout>
|
|
@ -15,133 +15,138 @@
|
|||
You should have received a copy of the GNU General Public License along with Mastalab; if not,
|
||||
see <http://www.gnu.org/licenses>.
|
||||
-->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
<android.support.design.widget.CoordinatorLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/drawer_layout"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:animateLayoutChanges="true"
|
||||
android:orientation="vertical">
|
||||
<LinearLayout
|
||||
android:id="@+id/main_header_container"
|
||||
android:background="@color/mastodonC1"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:context="fr.gouv.etalab.mastodon.activities.ShowAccountActivity">
|
||||
<android.support.design.widget.AppBarLayout
|
||||
android:id="@+id/appBar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
<LinearLayout
|
||||
android:id="@+id/header_container"
|
||||
android:layout_marginTop="5dp"
|
||||
android:fitsSystemWindows="true"
|
||||
android:theme="@style/AppTheme.AppBarOverlay">
|
||||
<android.support.design.widget.CollapsingToolbarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
<ImageView
|
||||
android:padding="10dp"
|
||||
android:id="@+id/account_pp"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
tools:ignore="ContentDescription" />
|
||||
android:fitsSystemWindows="true"
|
||||
app:layout_scrollFlags="scroll|exitUntilCollapsed">
|
||||
<LinearLayout
|
||||
android:id="@+id/main_header_container"
|
||||
android:background="@color/mastodonC1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="250dp"
|
||||
android:orientation="vertical">
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:id="@+id/account_dn"
|
||||
android:textColor="@color/mastodonC4"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:textSize="16sp"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
|
||||
<TextView
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:textColor="?attr/color_in_account_header"
|
||||
android:id="@+id/account_un"
|
||||
android:maxLines="1"
|
||||
android:layout_width="wrap_content"
|
||||
android:textSize="14sp"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
android:id="@+id/header_container"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_width="match_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
<ImageView
|
||||
android:padding="10dp"
|
||||
android:id="@+id/account_pp"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
tools:ignore="ContentDescription" />
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:visibility="gone"
|
||||
android:id="@+id/account_followed_by"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:gravity="center_vertical"
|
||||
android:textColor="?attr/colorAccent"
|
||||
android:text="@string/followed_by"
|
||||
android:id="@+id/account_dn"
|
||||
android:textColor="@color/mastodonC4"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
android:textSize="16sp"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
|
||||
<TextView
|
||||
android:id="@+id/account_follow_request"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:visibility="gone"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:gravity="center_vertical"
|
||||
android:textColor="?attr/colorAccent"
|
||||
android:text="@string/request_sent"
|
||||
android:layout_marginStart="10dp"
|
||||
android:textColor="?attr/color_in_account_header"
|
||||
android:id="@+id/account_un"
|
||||
android:maxLines="1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:textSize="14sp"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
<TextView
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:visibility="gone"
|
||||
android:id="@+id/account_followed_by"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:gravity="center_vertical"
|
||||
android:textColor="?attr/colorAccent"
|
||||
android:text="@string/followed_by"
|
||||
android:maxLines="1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
<TextView
|
||||
android:id="@+id/account_follow_request"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:visibility="gone"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:gravity="center_vertical"
|
||||
android:textColor="?attr/colorAccent"
|
||||
android:text="@string/request_sent"
|
||||
android:maxLines="1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:layout_gravity="center"
|
||||
android:visibility="gone"
|
||||
app:fabSize="mini"
|
||||
android:id="@+id/account_follow"
|
||||
android:textAllCaps="false"
|
||||
android:gravity="center"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
/>
|
||||
</LinearLayout>
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:layout_gravity="center"
|
||||
android:visibility="gone"
|
||||
app:fabSize="mini"
|
||||
android:id="@+id/account_follow"
|
||||
android:textAllCaps="false"
|
||||
<TextView
|
||||
android:id="@+id/account_note"
|
||||
android:padding="10dp"
|
||||
android:gravity="center"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
/>
|
||||
android:textColor="?attr/color_in_account_header"
|
||||
android:layout_width="match_parent"
|
||||
android:maxLines="4"
|
||||
android:autoLink="web"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
android:id="@+id/account_note"
|
||||
android:padding="10dp"
|
||||
android:gravity="center"
|
||||
android:textColor="?attr/color_in_account_header"
|
||||
android:layout_width="match_parent"
|
||||
android:maxLines="4"
|
||||
android:autoLink="web"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
</android.support.design.widget.CollapsingToolbarLayout>
|
||||
|
||||
<android.support.design.widget.AppBarLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="@null"
|
||||
<android.support.design.widget.TabLayout
|
||||
android:id="@+id/account_tabLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<android.support.design.widget.TabLayout
|
||||
android:id="@+id/account_tabLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:tabTextAppearance="@android:style/TextAppearance.Widget.TabWidget"
|
||||
app:tabMode="fixed"
|
||||
app:tabGravity="fill"
|
||||
/>
|
||||
<android.support.v4.view.ViewPager
|
||||
android:id="@+id/account_viewpager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
|
||||
android:layout_height="wrap_content"
|
||||
app:tabTextAppearance="@android:style/TextAppearance.Widget.TabWidget"
|
||||
app:tabMode="fixed"
|
||||
app:tabGravity="fill"
|
||||
/>
|
||||
</android.support.design.widget.AppBarLayout>
|
||||
</LinearLayout>
|
||||
<android.support.v4.view.ViewPager
|
||||
android:id="@+id/account_viewpager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||
/>
|
||||
|
||||
</android.support.design.widget.CoordinatorLayout>
|
Loading…
Reference in New Issue