Some layout changes

This commit is contained in:
Thomas 2023-01-26 15:19:44 +01:00
parent 6a359bbbf8
commit bebe315b08
3 changed files with 87 additions and 104 deletions

View file

@ -29,7 +29,6 @@ import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.widget.EditText; import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
@ -48,6 +47,7 @@ import com.google.android.material.tabs.TabLayout;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import app.fedilab.android.R; import app.fedilab.android.R;
import app.fedilab.android.databinding.ActivityShowAccountPeertubeBinding;
import app.fedilab.android.mastodon.activities.BaseBarActivity; import app.fedilab.android.mastodon.activities.BaseBarActivity;
import app.fedilab.android.peertube.client.APIResponse; import app.fedilab.android.peertube.client.APIResponse;
import app.fedilab.android.peertube.client.RetrofitPeertubeAPI; import app.fedilab.android.peertube.client.RetrofitPeertubeAPI;
@ -64,25 +64,18 @@ import es.dmoral.toasty.Toasty;
public class ShowAccountActivity extends BaseBarActivity { public class ShowAccountActivity extends BaseBarActivity {
private ViewPager mPager;
private TabLayout tabLayout;
private TextView account_note, subscriber_count;
private ImageView account_pp;
private TextView account_dn;
private AccountData.PeertubeAccount account; private AccountData.PeertubeAccount account;
private String accountAcct; private String accountAcct;
private ActivityShowAccountPeertubeBinding binding;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_show_account_peertube); binding = ActivityShowAccountPeertubeBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
setTitle(""); setTitle("");
Bundle b = getIntent().getExtras(); Bundle b = getIntent().getExtras();
subscriber_count = findViewById(R.id.subscriber_count); binding.accountPp.setBackgroundResource(R.drawable.account_pp_border);
account_pp = findViewById(R.id.account_pp);
account_dn = findViewById(R.id.account_dn);
account_pp.setBackgroundResource(R.drawable.account_pp_border);
if (b != null) { if (b != null) {
account = (AccountData.PeertubeAccount) b.getSerializable("account"); account = (AccountData.PeertubeAccount) b.getSerializable("account");
accountAcct = b.getString("accountAcct"); accountAcct = b.getString("accountAcct");
@ -94,8 +87,7 @@ public class ShowAccountActivity extends BaseBarActivity {
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true);
} }
tabLayout = findViewById(R.id.account_tabLayout);
account_note = findViewById(R.id.account_note);
manageAccount(); manageAccount();
AccountsVM viewModel = new ViewModelProvider(ShowAccountActivity.this).get(AccountsVM.class); AccountsVM viewModel = new ViewModelProvider(ShowAccountActivity.this).get(AccountsVM.class);
@ -158,14 +150,13 @@ public class ShowAccountActivity extends BaseBarActivity {
setTitle(account.getAcct()); setTitle(account.getAcct());
mPager = findViewById(R.id.account_viewpager); binding.accountTabLayout.addTab(binding.accountTabLayout.newTab().setText(getString(R.string.channels)));
tabLayout.addTab(tabLayout.newTab().setText(getString(R.string.channels))); binding.accountTabLayout.addTab(binding.accountTabLayout.newTab().setText(getString(R.string.videos)));
tabLayout.addTab(tabLayout.newTab().setText(getString(R.string.videos))); binding.accountViewpager.setOffscreenPageLimit(2);
mPager.setOffscreenPageLimit(2);
PagerAdapter mPagerAdapter = new ScreenSlidePagerAdapter(getSupportFragmentManager()); PagerAdapter mPagerAdapter = new ScreenSlidePagerAdapter(getSupportFragmentManager());
mPager.setAdapter(mPagerAdapter); binding.accountViewpager.setAdapter(mPagerAdapter);
mPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() { binding.accountViewpager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@Override @Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
@ -173,7 +164,7 @@ public class ShowAccountActivity extends BaseBarActivity {
@Override @Override
public void onPageSelected(int position) { public void onPageSelected(int position) {
TabLayout.Tab tab = tabLayout.getTabAt(position); TabLayout.Tab tab = binding.accountTabLayout.getTabAt(position);
if (tab != null) if (tab != null)
tab.select(); tab.select();
} }
@ -184,10 +175,10 @@ public class ShowAccountActivity extends BaseBarActivity {
} }
}); });
tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() { binding.accountTabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
@Override @Override
public void onTabSelected(TabLayout.Tab tab) { public void onTabSelected(TabLayout.Tab tab) {
mPager.setCurrentItem(tab.getPosition()); binding.accountViewpager.setCurrentItem(tab.getPosition());
} }
@Override @Override
@ -198,8 +189,8 @@ public class ShowAccountActivity extends BaseBarActivity {
@Override @Override
public void onTabReselected(TabLayout.Tab tab) { public void onTabReselected(TabLayout.Tab tab) {
Fragment fragment = null; Fragment fragment = null;
if (mPager.getAdapter() != null) if (binding.accountViewpager.getAdapter() != null)
fragment = (Fragment) mPager.getAdapter().instantiateItem(mPager, tab.getPosition()); fragment = (Fragment) binding.accountViewpager.getAdapter().instantiateItem(binding.accountViewpager, tab.getPosition());
switch (tab.getPosition()) { switch (tab.getPosition()) {
case 0: case 0:
if (fragment != null) { if (fragment != null) {
@ -217,10 +208,10 @@ public class ShowAccountActivity extends BaseBarActivity {
} }
}); });
account_dn.setText(account.getDisplayName()); binding.accountDn.setText(account.getDisplayName());
manageNotes(account); manageNotes(account);
Helper.loadAvatar(ShowAccountActivity.this, account, account_pp); Helper.loadAvatar(ShowAccountActivity.this, account, binding.accountPp);
} }
@Override @Override
@ -252,8 +243,8 @@ public class ShowAccountActivity extends BaseBarActivity {
this.account = account; this.account = account;
manageAccount(); manageAccount();
} }
subscriber_count.setText(getString(R.string.followers_count, Helper.withSuffix(account.getFollowersCount()))); binding.subscriberCount.setText(getString(R.string.followers_count, Helper.withSuffix(account.getFollowersCount())));
subscriber_count.setVisibility(View.VISIBLE); binding.subscriberCount.setVisibility(View.VISIBLE);
manageNotes(account); manageNotes(account);
} }
} }
@ -266,11 +257,11 @@ public class ShowAccountActivity extends BaseBarActivity {
else else
spannableString = new SpannableString(Html.fromHtml(account.getDescription())); spannableString = new SpannableString(Html.fromHtml(account.getDescription()));
account_note.setText(spannableString, TextView.BufferType.SPANNABLE); binding.accountNote.setText(spannableString, TextView.BufferType.SPANNABLE);
account_note.setMovementMethod(LinkMovementMethod.getInstance()); binding.accountNote.setMovementMethod(LinkMovementMethod.getInstance());
account_note.setVisibility(View.VISIBLE); binding.accountNote.setVisibility(View.VISIBLE);
} else { } else {
account_note.setVisibility(View.GONE); binding.accountNote.setVisibility(View.GONE);
} }
} }

View file

@ -8,7 +8,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<ImageView <androidx.appcompat.widget.AppCompatImageView
android:id="@+id/profile_picture" android:id="@+id/profile_picture"
android:layout_width="80dp" android:layout_width="80dp"
android:layout_height="80dp" android:layout_height="80dp"
@ -18,15 +18,14 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<Button <com.google.android.material.button.MaterialButton
android:id="@+id/select_file" android:id="@+id/select_file"
style="@style/Widget.AppCompat.Button.Borderless" style="@style/Widget.Material3.Button.OutlinedButton"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="20dp" android:layout_marginStart="20dp"
android:singleLine="true" android:singleLine="true"
android:text="@string/change_profile_picture" android:text="@string/change_profile_picture"
android:textColor="?attr/colorAccent"
app:layout_constraintBottom_toBottomOf="@id/profile_picture" app:layout_constraintBottom_toBottomOf="@id/profile_picture"
app:layout_constraintStart_toEndOf="@+id/profile_picture" /> app:layout_constraintStart_toEndOf="@+id/profile_picture" />
@ -76,7 +75,7 @@
android:singleLine="false" /> android:singleLine="false" />
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
<TextView <androidx.appcompat.widget.AppCompatTextView
android:id="@+id/notification_title" android:id="@+id/notification_title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -84,12 +83,12 @@
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
android:text="@string/title_notifications" android:text="@string/title_notifications"
android:textAllCaps="true" android:textAllCaps="true"
android:textColor="?attr/colorAccent" android:textColor="?attr/colorPrimary"
android:textSize="18sp" android:textSize="18sp"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/description_container" /> app:layout_constraintTop_toBottomOf="@+id/description_container" />
<TextView <androidx.appcompat.widget.AppCompatTextView
android:id="@+id/spinner_indication" android:id="@+id/spinner_indication"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -112,7 +111,7 @@
app:layout_constraintStart_toEndOf="@+id/spinner_indication" app:layout_constraintStart_toEndOf="@+id/spinner_indication"
app:layout_constraintTop_toBottomOf="@+id/notification_title" /> app:layout_constraintTop_toBottomOf="@+id/notification_title" />
<LinearLayout <androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="20dp" android:layout_margin="20dp"
@ -121,248 +120,248 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/refresh_time"> app:layout_constraintTop_toBottomOf="@+id/refresh_time">
<LinearLayout <androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="10" android:layout_weight="10"
android:text="@string/activity" android:text="@string/activity"
android:textStyle="bold" /> android:textStyle="bold" />
<TextView <androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:text="@string/app" android:text="@string/app"
android:textStyle="bold" /> android:textStyle="bold" />
<TextView <androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:text="@string/email" android:text="@string/email"
android:textStyle="bold" /> android:textStyle="bold" />
</LinearLayout> </androidx.appcompat.widget.LinearLayoutCompat>
<LinearLayout <androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <androidx.appcompat.widget.AppCompatTextView
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="10" android:layout_weight="10"
android:text="@string/notif_new_video" /> android:text="@string/notif_new_video" />
<androidx.appcompat.widget.SwitchCompat <com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/notif_new_video_app" android:id="@+id/notif_new_video_app"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" /> android:layout_weight="1" />
<androidx.appcompat.widget.SwitchCompat <com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/notif_new_video_mail" android:id="@+id/notif_new_video_mail"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" /> android:layout_weight="1" />
</LinearLayout> </androidx.appcompat.widget.LinearLayoutCompat>
<LinearLayout <androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <androidx.appcompat.widget.AppCompatTextView
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="10" android:layout_weight="10"
android:text="@string/notif_new_comment" /> android:text="@string/notif_new_comment" />
<androidx.appcompat.widget.SwitchCompat <com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/notif_new_comment_app" android:id="@+id/notif_new_comment_app"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" /> android:layout_weight="1" />
<androidx.appcompat.widget.SwitchCompat <com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/notif_new_comment_mail" android:id="@+id/notif_new_comment_mail"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" /> android:layout_weight="1" />
</LinearLayout> </androidx.appcompat.widget.LinearLayoutCompat>
<LinearLayout <androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <androidx.appcompat.widget.AppCompatTextView
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="10" android:layout_weight="10"
android:text="@string/notif_blocked" /> android:text="@string/notif_blocked" />
<androidx.appcompat.widget.SwitchCompat <com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/notif_blocked_app" android:id="@+id/notif_blocked_app"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" /> android:layout_weight="1" />
<androidx.appcompat.widget.SwitchCompat <com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/notif_blocked_mail" android:id="@+id/notif_blocked_mail"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" /> android:layout_weight="1" />
</LinearLayout> </androidx.appcompat.widget.LinearLayoutCompat>
<LinearLayout <androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <androidx.appcompat.widget.AppCompatTextView
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="10" android:layout_weight="10"
android:text="@string/notif_video_published" /> android:text="@string/notif_video_published" />
<androidx.appcompat.widget.SwitchCompat <com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/notif_video_published_app" android:id="@+id/notif_video_published_app"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" /> android:layout_weight="1" />
<androidx.appcompat.widget.SwitchCompat <com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/notif_video_published_mail" android:id="@+id/notif_video_published_mail"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" /> android:layout_weight="1" />
</LinearLayout> </androidx.appcompat.widget.LinearLayoutCompat>
<LinearLayout <androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <androidx.appcompat.widget.AppCompatTextView
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="10" android:layout_weight="10"
android:text="@string/notif_video_imported" /> android:text="@string/notif_video_imported" />
<androidx.appcompat.widget.SwitchCompat <com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/notif_video_imported_app" android:id="@+id/notif_video_imported_app"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" /> android:layout_weight="1" />
<androidx.appcompat.widget.SwitchCompat <com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/notif_video_imported_mail" android:id="@+id/notif_video_imported_mail"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" /> android:layout_weight="1" />
</LinearLayout> </androidx.appcompat.widget.LinearLayoutCompat>
<LinearLayout <androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <androidx.appcompat.widget.AppCompatTextView
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="10" android:layout_weight="10"
android:text="@string/notif_new_followers" /> android:text="@string/notif_new_followers" />
<androidx.appcompat.widget.SwitchCompat <com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/notif_new_followers_app" android:id="@+id/notif_new_followers_app"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" /> android:layout_weight="1" />
<androidx.appcompat.widget.SwitchCompat <com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/notif_new_followers_mail" android:id="@+id/notif_new_followers_mail"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" /> android:layout_weight="1" />
</LinearLayout> </androidx.appcompat.widget.LinearLayoutCompat>
<LinearLayout <androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <androidx.appcompat.widget.AppCompatTextView
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="10" android:layout_weight="10"
android:text="@string/notif_video_mention" /> android:text="@string/notif_video_mention" />
<androidx.appcompat.widget.SwitchCompat <com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/notif_video_mention_app" android:id="@+id/notif_video_mention_app"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" /> android:layout_weight="1" />
<androidx.appcompat.widget.SwitchCompat <com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/notif_video_mention_mail" android:id="@+id/notif_video_mention_mail"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" /> android:layout_weight="1" />
</LinearLayout> </androidx.appcompat.widget.LinearLayoutCompat>
<LinearLayout <androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <androidx.appcompat.widget.AppCompatTextView
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="10" android:layout_weight="10"
android:text="@string/notif_abuse_received" /> android:text="@string/notif_abuse_received" />
<androidx.appcompat.widget.SwitchCompat <com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/notif_abuse_received_app" android:id="@+id/notif_abuse_received_app"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" /> android:layout_weight="1" />
<androidx.appcompat.widget.SwitchCompat <com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/notif_abuse_received_mail" android:id="@+id/notif_abuse_received_mail"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" /> android:layout_weight="1" />
</LinearLayout> </androidx.appcompat.widget.LinearLayoutCompat>
<LinearLayout <androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <androidx.appcompat.widget.AppCompatTextView
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="10" android:layout_weight="10"
android:text="@string/notif_abuse_accepted" /> android:text="@string/notif_abuse_accepted" />
<androidx.appcompat.widget.SwitchCompat <com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/notif_abuse_accepted_app" android:id="@+id/notif_abuse_accepted_app"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" /> android:layout_weight="1" />
<androidx.appcompat.widget.SwitchCompat <com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/notif_abuse_accepted_mail" android:id="@+id/notif_abuse_accepted_mail"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" /> android:layout_weight="1" />
</LinearLayout> </androidx.appcompat.widget.LinearLayoutCompat>
</LinearLayout> </androidx.appcompat.widget.LinearLayoutCompat>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView> </ScrollView>

View file

@ -25,14 +25,12 @@
<com.google.android.material.appbar.AppBarLayout <com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:fitsSystemWindows="true" android:fitsSystemWindows="true">
app:theme="@style/ThemeOverlay.AppCompat.ActionBar">
<com.google.android.material.appbar.CollapsingToolbarLayout <com.google.android.material.appbar.CollapsingToolbarLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:fitsSystemWindows="true" android:fitsSystemWindows="true"
app:contentScrim="?attr/colorPrimary"
app:expandedTitleMarginEnd="64dp" app:expandedTitleMarginEnd="64dp"
app:expandedTitleMarginStart="48dp" app:expandedTitleMarginStart="48dp"
app:layout_scrollFlags="scroll|exitUntilCollapsed"> app:layout_scrollFlags="scroll|exitUntilCollapsed">
@ -66,7 +64,6 @@
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
android:singleLine="true" android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Body1" android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textColor="@android:color/white"
android:textSize="18sp" android:textSize="18sp"
app:layout_constraintBottom_toTopOf="@+id/subscriber_count" app:layout_constraintBottom_toTopOf="@+id/subscriber_count"
app:layout_constraintStart_toEndOf="@+id/account_pp" app:layout_constraintStart_toEndOf="@+id/account_pp"
@ -81,7 +78,6 @@
android:gravity="center_vertical" android:gravity="center_vertical"
android:singleLine="true" android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Body1" android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textColor="@android:color/white"
android:visibility="invisible" android:visibility="invisible"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/account_pp" app:layout_constraintStart_toEndOf="@+id/account_pp"
@ -90,7 +86,7 @@
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
<LinearLayout <androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/top_banner" android:layout_below="@+id/top_banner"
@ -99,17 +95,16 @@
android:paddingTop="8dp" android:paddingTop="8dp"
app:layout_scrollFlags="scroll|enterAlways"> app:layout_scrollFlags="scroll|enterAlways">
<TextView <androidx.appcompat.widget.AppCompatTextView
android:id="@+id/account_note" android:id="@+id/account_note"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:gravity="center" android:gravity="center"
android:padding="10dp" android:padding="10dp"
android:textColor="@android:color/white"
android:textIsSelectable="true" android:textIsSelectable="true"
android:visibility="gone" /> android:visibility="gone" />
</LinearLayout> </androidx.appcompat.widget.LinearLayoutCompat>
</RelativeLayout> </RelativeLayout>
</com.google.android.material.appbar.CollapsingToolbarLayout> </com.google.android.material.appbar.CollapsingToolbarLayout>
@ -118,9 +113,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:tabGravity="fill" app:tabGravity="fill"
app:tabMode="fixed" app:tabMode="fixed" />
app:tabSelectedTextColor="?colorAccent"
app:tabTextColor="@android:color/white" />
</com.google.android.material.appbar.AppBarLayout> </com.google.android.material.appbar.AppBarLayout>
<androidx.viewpager.widget.ViewPager <androidx.viewpager.widget.ViewPager