Fix #929 - Scrollable bio when editing profiles

This commit is contained in:
Thomas 2023-08-12 09:56:11 +02:00
parent e07cb78d65
commit ac24e25da0
2 changed files with 18 additions and 0 deletions

View file

@ -17,6 +17,7 @@ package app.fedilab.android.mastodon.activities;
import static app.fedilab.android.BaseMainActivity.currentAccount;
import static app.fedilab.android.BaseMainActivity.instanceInfo;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
@ -60,6 +61,7 @@ public class EditProfileActivity extends BaseBarActivity {
private ActivityEditProfileBinding binding;
private AccountsVM accountsVM;
@SuppressLint("ClickableViewAccessibility")
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@ -70,6 +72,20 @@ public class EditProfileActivity extends BaseBarActivity {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
binding.scrollContainer.setOnTouchListener((v, event) -> {
binding.bio.getParent().requestDisallowInterceptTouchEvent(false);
return false;
});
binding.bio.setOnTouchListener((v, event) -> {
binding.bio.getParent().requestDisallowInterceptTouchEvent(true);
return false;
});
new ViewModelProvider(EditProfileActivity.this).get(AccountsVM.class).getConnectedAccount(BaseMainActivity.currentInstance, BaseMainActivity.currentToken)
.observe(EditProfileActivity.this, account -> {
if (account != null) {

View file

@ -23,6 +23,7 @@
tools:context=".mastodon.activities.ProfileActivity">
<ScrollView
android:id="@+id/scroll_container"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
@ -154,6 +155,7 @@
android:layout_marginTop="12dp"
android:lines="4"
android:textSize="18sp"
android:scrollbars="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/acct"