Changes some layouts in header
This commit is contained in:
parent
5a0e4c8131
commit
3abe414d53
|
@ -380,18 +380,18 @@ public class MainActivity extends AppCompatActivity
|
|||
public void onClick(View v) {
|
||||
FragmentManager fragmentManager = getSupportFragmentManager();
|
||||
|
||||
if( navigationView.getMenu().findItem(R.id.nav_favorites).isChecked()){
|
||||
if( navigationView.getMenu().findItem(R.id.nav_favorites) != null && navigationView.getMenu().findItem(R.id.nav_favorites).isChecked()){
|
||||
DisplayStatusFragment faveFrag = (DisplayStatusFragment) fragmentManager.findFragmentByTag("FAVOURITES");
|
||||
if (faveFrag != null && faveFrag.isVisible()) {
|
||||
faveFrag.scrollToTop();
|
||||
}
|
||||
} else if (navigationView.getMenu().findItem(R.id.nav_blocked).isChecked()) {
|
||||
} else if (navigationView.getMenu().findItem(R.id.nav_blocked) != null && navigationView.getMenu().findItem(R.id.nav_blocked).isChecked()) {
|
||||
DisplayAccountsFragment blockFrag = (DisplayAccountsFragment) fragmentManager.findFragmentByTag("BLOCKS");
|
||||
|
||||
if (blockFrag != null && blockFrag.isVisible()) {
|
||||
blockFrag.scrollToTop();
|
||||
}
|
||||
} else if (navigationView.getMenu().findItem(R.id.nav_muted).isChecked()) {
|
||||
} else if (navigationView.getMenu().findItem(R.id.nav_muted) != null && navigationView.getMenu().findItem(R.id.nav_muted).isChecked()) {
|
||||
DisplayAccountsFragment muteFrag = (DisplayAccountsFragment) fragmentManager.findFragmentByTag("MUTED");
|
||||
|
||||
if (muteFrag != null && muteFrag.isVisible()) {
|
||||
|
@ -517,7 +517,7 @@ public class MainActivity extends AppCompatActivity
|
|||
navigationView.getMenu().findItem(R.id.nav_follow_request).setVisible(false);
|
||||
}
|
||||
|
||||
LinearLayout owner_container = (LinearLayout) headerLayout.findViewById(R.id.owner_container);
|
||||
LinearLayout owner_container = (LinearLayout) headerLayout.findViewById(R.id.main_header_container);
|
||||
owner_container.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
|
|
@ -1014,9 +1014,6 @@ public class Helper {
|
|||
|
||||
TextView username = (TextView) headerLayout.findViewById(R.id.username);
|
||||
TextView displayedName = (TextView) headerLayout.findViewById(R.id.displayedName);
|
||||
TextView ownerStatus = (TextView) headerLayout.findViewById(R.id.owner_status);
|
||||
TextView ownerFollowing = (TextView) headerLayout.findViewById(R.id.owner_following);
|
||||
TextView ownerFollowers = (TextView) headerLayout.findViewById(R.id.owner_followers);
|
||||
ImageView header_edit_profile = (ImageView) headerLayout.findViewById(R.id.header_edit_profile);
|
||||
header_edit_profile.setOnClickListener(null);
|
||||
if( account == null ) {
|
||||
|
@ -1026,9 +1023,6 @@ public class Helper {
|
|||
activity.startActivity(myIntent);
|
||||
activity.finish(); //User is logged out to get a new token
|
||||
}else {
|
||||
ownerStatus.setText(String.valueOf(account.getStatuses_count()));
|
||||
ownerFollowers.setText(String.valueOf(account.getFollowers_count()));
|
||||
ownerFollowing.setText(String.valueOf(account.getFollowing_count()));
|
||||
username.setText(String.format("@%s",account.getUsername()));
|
||||
displayedName.setText(account.getDisplay_name());
|
||||
String url = account.getAvatar();
|
||||
|
|
|
@ -134,7 +134,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="start"
|
||||
android:fitsSystemWindows="true"
|
||||
android:fitsSystemWindows="false"
|
||||
app:headerLayout="@layout/nav_header_main"
|
||||
app:menu="@menu/activity_main_drawer" />
|
||||
|
||||
|
|
|
@ -123,7 +123,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="start"
|
||||
android:fitsSystemWindows="true"
|
||||
android:fitsSystemWindows="false"
|
||||
app:headerLayout="@layout/nav_header_main"
|
||||
app:menu="@menu/activity_main_drawer" />
|
||||
|
||||
|
|
|
@ -18,21 +18,13 @@
|
|||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/nav_header_height"
|
||||
android:layout_height="wrap_content"
|
||||
style="?attr/headerbg"
|
||||
android:id="@+id/main_header_container"
|
||||
android:gravity="bottom"
|
||||
android:orientation="horizontal"
|
||||
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||
android:paddingTop="@dimen/activity_vertical_margin"
|
||||
android:theme="@style/ThemeOverlay.AppCompat.Dark">
|
||||
<LinearLayout
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content">
|
||||
android:padding="@dimen/activity_horizontal_margin"
|
||||
android:theme="@style/ThemeOverlay.AppCompat.Dark">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -44,18 +36,26 @@
|
|||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
tools:ignore="ContentDescription" />
|
||||
<ImageView
|
||||
android:layout_marginStart="30dp"
|
||||
android:layout_marginLeft="30dp"
|
||||
android:gravity="center_vertical"
|
||||
android:src="@drawable/ic_action_edit"
|
||||
android:id="@+id/header_edit_profile"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
tools:ignore="ContentDescription" />
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
tools:ignore="UseCompoundDrawables">
|
||||
<TextView
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/owner_container"
|
||||
android:orientation="vertical">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
<TextView
|
||||
android:id="@+id/displayedName"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
|
@ -63,6 +63,7 @@
|
|||
android:textSize="18sp"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
|
||||
<ImageView
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:id="@+id/owner_accounts"
|
||||
|
@ -72,80 +73,11 @@
|
|||
tools:ignore="ContentDescription" />
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:id="@+id/username"
|
||||
android:layout_width="wrap_content"
|
||||
android:textSize="14sp"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:baselineAligned="false">
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:padding="2dp"
|
||||
android:orientation="vertical"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:text="@string/toots"
|
||||
android:textSize="12sp"
|
||||
android:maxLines="1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
<TextView
|
||||
android:textSize="12sp"
|
||||
android:id="@+id/owner_status"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:padding="2dp"
|
||||
android:orientation="vertical"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:textSize="12sp"
|
||||
android:maxLines="1"
|
||||
android:text="@string/following"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
<TextView
|
||||
android:textSize="12sp"
|
||||
android:id="@+id/owner_following"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:padding="2dp"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:maxLines="1"
|
||||
android:textSize="12sp"
|
||||
android:text="@string/followers"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
<TextView
|
||||
android:textSize="12sp"
|
||||
android:id="@+id/owner_followers"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:gravity="center_horizontal|bottom"
|
||||
android:src="@drawable/ic_action_edit"
|
||||
android:id="@+id/header_edit_profile"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
tools:ignore="ContentDescription" />
|
||||
</LinearLayout>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<dimen name="activity_vertical_margin">16dp</dimen>
|
||||
<dimen name="activity_padding_header">10dp</dimen>
|
||||
<dimen name="nav_header_vertical_spacing">16dp</dimen>
|
||||
<dimen name="nav_header_height">160dp</dimen>
|
||||
<dimen name="nav_header_height">170dp</dimen>
|
||||
<dimen name="fab_margin">5dp</dimen>
|
||||
<dimen name="drawer_padding">2dp</dimen>
|
||||
<dimen name="toot_padding">20dp</dimen>
|
||||
|
|
Loading…
Reference in New Issue