added floating button to profile and search layout, bug fix

This commit is contained in:
nuclearfog 2023-07-24 20:56:39 +02:00
parent b75b6649bc
commit bb3c9567f4
No known key found for this signature in database
GPG Key ID: 03488A185C476379
11 changed files with 375 additions and 390 deletions

View File

@ -36,7 +36,7 @@ import com.google.android.material.navigation.NavigationView.OnNavigationItemSel
import com.squareup.picasso.Picasso; import com.squareup.picasso.Picasso;
import org.nuclearfog.twidda.R; import org.nuclearfog.twidda.R;
import org.nuclearfog.twidda.backend.async.AsyncExecutor; import org.nuclearfog.twidda.backend.async.AsyncExecutor.AsyncCallback;
import org.nuclearfog.twidda.backend.async.UserLoader; import org.nuclearfog.twidda.backend.async.UserLoader;
import org.nuclearfog.twidda.backend.async.UserLoader.UserParam; import org.nuclearfog.twidda.backend.async.UserLoader.UserParam;
import org.nuclearfog.twidda.backend.async.UserLoader.UserResult; import org.nuclearfog.twidda.backend.async.UserLoader.UserResult;
@ -57,7 +57,7 @@ import org.nuclearfog.twidda.ui.views.TabSelector.OnTabSelectedListener;
* @author nuclearfog * @author nuclearfog
*/ */
public class MainActivity extends AppCompatActivity implements ActivityResultCallback<ActivityResult>, OnTabSelectedListener, public class MainActivity extends AppCompatActivity implements ActivityResultCallback<ActivityResult>, OnTabSelectedListener,
OnQueryTextListener, OnNavigationItemSelectedListener, OnClickListener, AsyncExecutor.AsyncCallback<UserLoader.UserResult> { OnQueryTextListener, OnNavigationItemSelectedListener, OnClickListener, AsyncCallback<UserResult> {
public static final String KEY_SELECT_NOTIFICATION = "main_notification"; public static final String KEY_SELECT_NOTIFICATION = "main_notification";
@ -119,9 +119,15 @@ public class MainActivity extends AppCompatActivity implements ActivityResultCal
picasso = PicassoBuilder.get(this); picasso = PicassoBuilder.get(this);
tabSelector.addViewPager(viewPager); tabSelector.addViewPager(viewPager);
viewPager.setOffscreenPageLimit(4); viewPager.setOffscreenPageLimit(4);
if (navigationView.getLayoutParams() != null) {
navigationView.getLayoutParams().width = Math.round(getResources().getDisplayMetrics().widthPixels / 2.0f);
}
if (!settings.floatingButtonEnabled()) { if (!settings.floatingButtonEnabled()) {
floatingButton.setVisibility(View.INVISIBLE); floatingButton.setVisibility(View.INVISIBLE);
} }
if (!settings.getLogin().getConfiguration().isFilterSupported()) {
navigationView.getMenu().findItem(R.id.menu_navigator_filter).setVisible(false);
}
toolbar.setTitle(""); toolbar.setTitle("");
toolbar.setNavigationIcon(R.drawable.menu); toolbar.setNavigationIcon(R.drawable.menu);
@ -378,6 +384,7 @@ public class MainActivity extends AppCompatActivity implements ActivityResultCal
else else
intent.putExtra(ProfileActivity.KEY_ID, settings.getLogin().getId()); intent.putExtra(ProfileActivity.KEY_ID, settings.getLogin().getId());
activityResultLauncher.launch(intent); activityResultLauncher.launch(intent);
drawerLayout.close();
} else if (v.getId() == R.id.home_post) { } else if (v.getId() == R.id.home_post) {
Intent intent = new Intent(this, StatusEditor.class); Intent intent = new Intent(this, StatusEditor.class);
startActivity(intent); startActivity(intent);

View File

@ -14,6 +14,7 @@ import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.view.View.OnClickListener; import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.view.ViewTreeObserver.OnPreDrawListener; import android.view.ViewTreeObserver.OnPreDrawListener;
import android.widget.Button; import android.widget.Button;
import android.widget.ImageView; import android.widget.ImageView;
@ -65,8 +66,8 @@ import org.nuclearfog.twidda.model.User;
import org.nuclearfog.twidda.ui.adapter.viewpager.ProfileAdapter; import org.nuclearfog.twidda.ui.adapter.viewpager.ProfileAdapter;
import org.nuclearfog.twidda.ui.dialogs.ConfirmDialog; import org.nuclearfog.twidda.ui.dialogs.ConfirmDialog;
import org.nuclearfog.twidda.ui.dialogs.ConfirmDialog.OnConfirmListener; import org.nuclearfog.twidda.ui.dialogs.ConfirmDialog.OnConfirmListener;
import org.nuclearfog.twidda.ui.views.LockableLinearLayout; import org.nuclearfog.twidda.ui.views.LockableConstraintLayout;
import org.nuclearfog.twidda.ui.views.LockableLinearLayout.LockCallback; import org.nuclearfog.twidda.ui.views.LockableConstraintLayout.LockCallback;
import org.nuclearfog.twidda.ui.views.TabSelector; import org.nuclearfog.twidda.ui.views.TabSelector;
import org.nuclearfog.twidda.ui.views.TabSelector.OnTabSelectedListener; import org.nuclearfog.twidda.ui.views.TabSelector.OnTabSelectedListener;
@ -142,9 +143,9 @@ public class ProfileActivity extends AppCompatActivity implements OnScrollChange
private UserLoader userLoader; private UserLoader userLoader;
private TextEmojiLoader emojiLoader; private TextEmojiLoader emojiLoader;
private NestedScrollView root; private NestedScrollView scroll;
private ConstraintLayout header; private ConstraintLayout header;
private LockableLinearLayout body; private LockableConstraintLayout body;
private TextView user_location, user_createdAt, user_website, description, follow_back, username, screenName; private TextView user_location, user_createdAt, user_website, description, follow_back, username, screenName;
private ImageView profileImage, bannerImage, toolbarBackground; private ImageView profileImage, bannerImage, toolbarBackground;
private Button following, follower; private Button following, follower;
@ -168,9 +169,11 @@ public class ProfileActivity extends AppCompatActivity implements OnScrollChange
protected void onCreate(@Nullable Bundle savedInstanceState) { protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.page_profile); setContentView(R.layout.page_profile);
ViewGroup root = findViewById(R.id.page_profile_root);
View floatingButton = findViewById(R.id.page_profile_post_button);
header = findViewById(R.id.page_profile_header); header = findViewById(R.id.page_profile_header);
body = findViewById(R.id.page_profile_body); body = findViewById(R.id.page_profile_body);
root = findViewById(R.id.user_view); scroll = findViewById(R.id.page_profile_scroll);
toolbar = findViewById(R.id.profile_toolbar); toolbar = findViewById(R.id.profile_toolbar);
description = findViewById(R.id.bio); description = findViewById(R.id.bio);
following = findViewById(R.id.following); following = findViewById(R.id.following);
@ -201,6 +204,9 @@ public class ProfileActivity extends AppCompatActivity implements OnScrollChange
constraints.connect(R.id.profile_banner, ConstraintSet.TOP, R.id.profile_toolbar, ConstraintSet.BOTTOM); constraints.connect(R.id.profile_banner, ConstraintSet.TOP, R.id.profile_toolbar, ConstraintSet.BOTTOM);
constraints.applyTo(header); constraints.applyTo(header);
} }
if (!settings.floatingButtonEnabled()) {
floatingButton.setVisibility(View.INVISIBLE);
}
following.setCompoundDrawablesWithIntrinsicBounds(R.drawable.following, 0, 0, 0); following.setCompoundDrawablesWithIntrinsicBounds(R.drawable.following, 0, 0, 0);
follower.setCompoundDrawablesWithIntrinsicBounds(R.drawable.follower, 0, 0, 0); follower.setCompoundDrawablesWithIntrinsicBounds(R.drawable.follower, 0, 0, 0);
user_createdAt.setCompoundDrawablesWithIntrinsicBounds(R.drawable.date, 0, 0, 0); user_createdAt.setCompoundDrawablesWithIntrinsicBounds(R.drawable.date, 0, 0, 0);
@ -270,8 +276,9 @@ public class ProfileActivity extends AppCompatActivity implements OnScrollChange
profileImage.setOnClickListener(this); profileImage.setOnClickListener(this);
bannerImage.setOnClickListener(this); bannerImage.setOnClickListener(this);
user_website.setOnClickListener(this); user_website.setOnClickListener(this);
root.setOnScrollChangeListener(this); floatingButton.setOnClickListener(this);
root.getViewTreeObserver().addOnPreDrawListener(this); scroll.setOnScrollChangeListener(this);
scroll.getViewTreeObserver().addOnPreDrawListener(this);
body.addLockCallback(this); body.addLockCallback(this);
} }
@ -295,9 +302,9 @@ public class ProfileActivity extends AppCompatActivity implements OnScrollChange
@Override @Override
public boolean onPreDraw() { public boolean onPreDraw() {
root.getViewTreeObserver().removeOnPreDrawListener(this); scroll.getViewTreeObserver().removeOnPreDrawListener(this);
body.getLayoutParams().height = root.getMeasuredHeight(); body.getLayoutParams().height = scroll.getMeasuredHeight();
root.scrollTo(0, 0); scroll.scrollTo(0, 0);
return true; return true;
} }
@ -555,6 +562,16 @@ public class ProfileActivity extends AppCompatActivity implements OnScrollChange
startActivity(intent); startActivity(intent);
} }
} }
// open status editor
else if (v.getId() == R.id.page_profile_post_button) {
Intent intent = new Intent(this, StatusEditor.class);
if (user != null && !user.isCurrentUser()) {
// add username to status
String prefix = user.getScreenname() + " ";
intent.putExtra(StatusEditor.KEY_TEXT, prefix);
}
startActivity(intent);
}
} }
@ -600,7 +617,7 @@ public class ProfileActivity extends AppCompatActivity implements OnScrollChange
@Override @Override
public boolean aquireLock() { public boolean aquireLock() {
return root.getScrollY() < header.getMeasuredHeight() - SCROLL_THRESHOLD; return scroll.getScrollY() < header.getMeasuredHeight() - SCROLL_THRESHOLD;
} }

View File

@ -6,6 +6,8 @@ import android.graphics.Color;
import android.os.Bundle; import android.os.Bundle;
import android.view.Menu; import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.Toast; import android.widget.Toast;
@ -37,7 +39,7 @@ import java.io.Serializable;
* *
* @author nuclearfog * @author nuclearfog
*/ */
public class SearchActivity extends AppCompatActivity implements OnTabSelectedListener, OnQueryTextListener, AsyncCallback<HashtagResult> { public class SearchActivity extends AppCompatActivity implements OnClickListener, OnTabSelectedListener, OnQueryTextListener, AsyncCallback<HashtagResult> {
/** /**
* Key for the search query, required * Key for the search query, required
@ -79,6 +81,7 @@ public class SearchActivity extends AppCompatActivity implements OnTabSelectedLi
setContentView(R.layout.page_search); setContentView(R.layout.page_search);
ViewGroup root = findViewById(R.id.search_layout); ViewGroup root = findViewById(R.id.search_layout);
TabSelector tabSelector = findViewById(R.id.search_tab); TabSelector tabSelector = findViewById(R.id.search_tab);
View floatingButton = findViewById(R.id.search_post_button);
toolbar = findViewById(R.id.search_toolbar); toolbar = findViewById(R.id.search_toolbar);
viewPager = findViewById(R.id.search_pager); viewPager = findViewById(R.id.search_pager);
@ -97,6 +100,9 @@ public class SearchActivity extends AppCompatActivity implements OnTabSelectedLi
hashtagAction.execute(param, this); hashtagAction.execute(param, this);
} }
} }
if (!settings.floatingButtonEnabled()) {
floatingButton.setVisibility(View.INVISIBLE);
}
toolbar.setTitle(""); toolbar.setTitle("");
setSupportActionBar(toolbar); setSupportActionBar(toolbar);
viewPager.setOffscreenPageLimit(3); viewPager.setOffscreenPageLimit(3);
@ -107,6 +113,7 @@ public class SearchActivity extends AppCompatActivity implements OnTabSelectedLi
AppStyles.setTheme(root); AppStyles.setTheme(root);
tabSelector.addOnTabSelectedListener(this); tabSelector.addOnTabSelectedListener(this);
floatingButton.setOnClickListener(this);
} }
@ -230,6 +237,17 @@ public class SearchActivity extends AppCompatActivity implements OnTabSelectedLi
} }
@Override
public void onClick(View v) {
if (v.getId() == R.id.search_post_button) {
Intent intent = new Intent(this, StatusEditor.class);
if (search.startsWith("#"))
intent.putExtra(StatusEditor.KEY_TEXT, search + " ");
startActivity(intent);
}
}
@Override @Override
public void onTabSelected(int oldPosition) { public void onTabSelected(int oldPosition) {
invalidateOptionsMenu(); invalidateOptionsMenu();

View File

@ -16,8 +16,10 @@ public class LockableConstraintLayout extends ConstraintLayout {
@Nullable @Nullable
private LockCallback callback; private LockCallback callback;
private boolean lock = false; private boolean xLock = false;
private boolean yLock = false;
private float yPos = 0.0f; private float yPos = 0.0f;
private float xPos = 0.0f;
/** /**
* @inheritDoc * @inheritDoc
@ -37,20 +39,28 @@ public class LockableConstraintLayout extends ConstraintLayout {
@Override @Override
public boolean onInterceptTouchEvent(MotionEvent ev) { public boolean onInterceptTouchEvent(MotionEvent ev) {
switch (ev.getAction()) { switch (ev.getAction()) {
case MotionEvent.ACTION_MOVE:
float deltaX = ev.getX() - xPos;
float deltaY = ev.getY() - yPos;
// detect scroll down, then aquire scroll lock
if (!xLock && Math.abs(deltaY) > Math.abs(deltaX) * 3.0f) {
xLock = true;
}
if (xLock && deltaY < 0.0f && callback != null) {
yLock = callback.aquireLock();
}
// fall through
case MotionEvent.ACTION_DOWN: case MotionEvent.ACTION_DOWN:
xPos = ev.getX();
yPos = ev.getY(); yPos = ev.getY();
break; break;
case MotionEvent.ACTION_MOVE: case MotionEvent.ACTION_UP:
// detect scroll down, then aquire scroll lock xLock = false;
float deltaY = ev.getY() - yPos;
if (deltaY < 0.0f && callback != null) {
lock = callback.aquireLock();
}
yPos = ev.getY();
break; break;
} }
return lock; return yLock;
} }
/** /**
@ -59,7 +69,7 @@ public class LockableConstraintLayout extends ConstraintLayout {
* @param lock true to prevent child views to be scrolled * @param lock true to prevent child views to be scrolled
*/ */
public void lock(boolean lock) { public void lock(boolean lock) {
this.lock = lock; this.yLock = lock;
} }
/** /**

View File

@ -1,111 +0,0 @@
package org.nuclearfog.twidda.ui.views;
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.LinearLayout;
import androidx.annotation.Nullable;
/**
* Vertical {@link LinearLayout} implementation with child scroll lock
*
* @author nuclearfog
*/
public class LockableLinearLayout extends LinearLayout {
/**
* minimum X-Y ratio of a swipe to determine if it's a left right swipe
*/
private static final float LEFT_RIGHT_SWIPE_RATIO = 2.0f;
@Nullable
private LockCallback callback;
private boolean lock = false;
private float xPos = 0.0f;
private float yPos = 0.0f;
/**
* @inheritDoc
*/
public LockableLinearLayout(Context context) {
this(context, null);
}
/**
* @inheritDoc
*/
public LockableLinearLayout(Context context, @Nullable AttributeSet attrs) {
this(context, attrs, 0);
}
/**
* @inheritDoc
*/
public LockableLinearLayout(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
this(context, attrs, defStyleAttr, 0);
}
/**
* @inheritDoc
*/
public LockableLinearLayout(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
setOrientation(VERTICAL);
}
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
switch (ev.getAction()) {
case MotionEvent.ACTION_DOWN:
yPos = ev.getY();
break;
case MotionEvent.ACTION_MOVE:
float deltaX = ev.getX() - xPos;
float deltaY = ev.getY() - yPos;
// detect up/down swipe
if (deltaY < 0.0f && Math.abs(deltaX * LEFT_RIGHT_SWIPE_RATIO) < Math.abs(deltaY)) {
if (callback != null) {
lock = callback.aquireLock();
}
}
// detect left/right swipe
else {
lock = false;
}
xPos = ev.getX();
yPos = ev.getY();
break;
}
return lock;
}
/**
* lock/unlock child scrolling
*
* @param lock true to prevent child views to be scrolled
*/
public void lock(boolean lock) {
this.lock = lock;
}
/**
* add callback to aquire child scroll lock
*/
public void addLockCallback(LockCallback callback) {
this.callback = callback;
}
/**
* Callback to aquire child view scoll lock from activity
*/
public interface LockCallback {
/**
* @return true to lock child scroll
*/
boolean aquireLock();
}
}

View File

@ -16,7 +16,8 @@
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/fragment_list_recyclerview" android:id="@+id/fragment_list_recyclerview"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" /> android:layout_height="match_parent"
android:overScrollMode="never" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout> </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

View File

@ -58,7 +58,6 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:fitsSystemWindows="false" android:fitsSystemWindows="false"
android:layout_gravity="start" android:layout_gravity="start"
android:maxWidth="@dimen/mainpage_navigation_max_width"
app:headerLayout="@layout/navigation_header" app:headerLayout="@layout/navigation_header"
app:menu="@menu/main_navigation" /> app:menu="@menu/main_navigation" />

View File

@ -1,14 +1,19 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/user_view" android:id="@+id/page_profile_root"
android:fitsSystemWindows="true" android:fitsSystemWindows="true"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:overScrollMode="never"
tools:context=".ui.activities.ProfileActivity"> tools:context=".ui.activities.ProfileActivity">
<androidx.core.widget.NestedScrollView
android:id="@+id/page_profile_scroll"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:overScrollMode="never">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -219,23 +224,43 @@
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
<org.nuclearfog.twidda.ui.views.LockableLinearLayout <org.nuclearfog.twidda.ui.views.LockableConstraintLayout
android:id="@+id/page_profile_body" android:id="@+id/page_profile_body"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<org.nuclearfog.twidda.ui.views.TabSelector <org.nuclearfog.twidda.ui.views.TabSelector
android:id="@+id/profile_tab" android:id="@+id/profile_tab"
android:layout_width="match_parent" android:layout_width="0dp"
android:layout_height="@dimen/profile_tabselector_height" /> android:layout_height="@dimen/profile_tabselector_height"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
<androidx.viewpager2.widget.ViewPager2 <androidx.viewpager2.widget.ViewPager2
android:id="@+id/profile_pager" android:id="@+id/profile_pager"
android:layout_width="match_parent" android:layout_width="0dp"
android:layout_height="match_parent" /> android:layout_height="0dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/profile_tab"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</org.nuclearfog.twidda.ui.views.LockableLinearLayout> </org.nuclearfog.twidda.ui.views.LockableConstraintLayout>
</LinearLayout> </LinearLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/page_profile_post_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
android:src="@drawable/post"
android:contentDescription="@string/menu_status"
android:layout_margin="@dimen/profile_floating_button_margin"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</FrameLayout>

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/search_layout" android:id="@+id/search_layout"
android:fitsSystemWindows="true" android:fitsSystemWindows="true"
android:orientation="vertical" android:orientation="vertical"
@ -10,17 +11,38 @@
<androidx.appcompat.widget.Toolbar <androidx.appcompat.widget.Toolbar
android:id="@+id/search_toolbar" android:id="@+id/search_toolbar"
android:layout_width="match_parent" android:layout_width="0dp"
android:layout_height="@dimen/searchpage_toolbar_height" /> android:layout_height="@dimen/searchpage_toolbar_height"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
<org.nuclearfog.twidda.ui.views.TabSelector <org.nuclearfog.twidda.ui.views.TabSelector
android:id="@+id/search_tab" android:id="@+id/search_tab"
android:layout_width="match_parent" android:layout_width="0dp"
android:layout_height="@dimen/tabselector_height" /> android:layout_height="@dimen/tabselector_height"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/search_toolbar"
app:layout_constraintEnd_toEndOf="parent" />
<androidx.viewpager2.widget.ViewPager2 <androidx.viewpager2.widget.ViewPager2
android:id="@+id/search_pager" android:id="@+id/search_pager"
android:layout_width="match_parent" android:layout_width="0dp"
android:layout_height="match_parent" /> android:layout_height="0dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/search_tab"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</LinearLayout> <com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/search_post_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
android:src="@drawable/post"
android:contentDescription="@string/menu_status"
android:layout_margin="@dimen/searchpage_floating_button_margin"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -2,18 +2,21 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android" <menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"> xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/profile_post"
android:icon="@drawable/post"
android:title="@string/menu_status"
app:showAsAction="always" />
<item <item
android:id="@+id/profile_follow" android:id="@+id/profile_follow"
android:icon="@drawable/add_user" android:icon="@drawable/add_user"
android:title="@string/menu_follow_user" android:title="@string/menu_follow_user"
android:visible="false" android:visible="false"
app:showAsAction="ifRoom" /> app:showAsAction="always" />
<item
android:id="@+id/profile_post"
android:title="@string/menu_status" />
<item
android:id="@+id/profile_message"
android:title="@string/menu_message"
android:visible="false" />
<item <item
android:id="@+id/profile_block" android:id="@+id/profile_block"
@ -30,13 +33,6 @@
android:title="@string/menu_mute_user" android:title="@string/menu_mute_user"
android:visible="false" /> android:visible="false" />
<item
android:id="@+id/profile_message"
android:icon="@drawable/message"
android:title="@string/menu_message"
android:visible="false"
app:showAsAction="ifRoom" />
<item <item
android:id="@+id/profile_lists" android:id="@+id/profile_lists"
android:visible="false" android:visible="false"

View File

@ -59,6 +59,7 @@
<dimen name="profile_textsize_small">12sp</dimen> <dimen name="profile_textsize_small">12sp</dimen>
<dimen name="profile_icon_size">14sp</dimen> <dimen name="profile_icon_size">14sp</dimen>
<dimen name="profile_tabselector_height">52dp</dimen> <dimen name="profile_tabselector_height">52dp</dimen>
<dimen name="profile_floating_button_margin">20dp</dimen>
<integer name="profile_text_bio_lines">6</integer> <integer name="profile_text_bio_lines">6</integer>
<!--dimens of page_editprofile.xml--> <!--dimens of page_editprofile.xml-->
@ -197,11 +198,11 @@
<!--dimens of page_search.xml--> <!--dimens of page_search.xml-->
<dimen name="searchpage_toolbar_height">@dimen/toolbar_height</dimen> <dimen name="searchpage_toolbar_height">@dimen/toolbar_height</dimen>
<dimen name="searchpage_floating_button_margin">20dp</dimen>
<!--dimens of page_main.xml--> <!--dimens of page_main.xml-->
<dimen name="mainpage_toolbar_height">@dimen/toolbar_height</dimen> <dimen name="mainpage_toolbar_height">@dimen/toolbar_height</dimen>
<dimen name="mainpage_floating_button_margin">20dp</dimen> <dimen name="mainpage_floating_button_margin">20dp</dimen>
<dimen name="mainpage_navigation_max_width">220sp</dimen>
<!--dimens of page_list.xml--> <!--dimens of page_list.xml-->
<dimen name="listpage_toolbar_height">@dimen/toolbar_height</dimen> <dimen name="listpage_toolbar_height">@dimen/toolbar_height</dimen>