1
0
mirror of https://github.com/TeamNewPipe/NewPipe.git synced 2024-11-22 11:02:35 +01:00

Add help text in fragment_choose_tabs.xml, convert to ConstraintLayout

This commit is contained in:
ktprograms 2021-08-27 09:20:23 +08:00
parent 4f5e772157
commit e95637f7b7
2 changed files with 25 additions and 11 deletions

View File

@ -17,7 +17,6 @@ import android.widget.TextView;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.content.res.AppCompatResources; import androidx.appcompat.content.res.AppCompatResources;
import androidx.appcompat.widget.AppCompatImageView; import androidx.appcompat.widget.AppCompatImageView;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
@ -87,9 +86,6 @@ public class ChooseTabsFragment extends Fragment {
selectedTabsAdapter = new SelectedTabsAdapter(requireContext(), itemTouchHelper); selectedTabsAdapter = new SelectedTabsAdapter(requireContext(), itemTouchHelper);
listSelectedTabs.setAdapter(selectedTabsAdapter); listSelectedTabs.setAdapter(selectedTabsAdapter);
((AppCompatActivity) getActivity()).getSupportActionBar()
.setSubtitle(R.string.main_page_content_swipe_remove);
} }
@Override @Override

View File

@ -1,31 +1,49 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout 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:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
<TextView
android:id="@+id/helpTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:gravity="center"
android:paddingStart="8dp"
android:paddingEnd="8dp"
android:text="@string/main_page_content_swipe_remove"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/selectedTabs" android:id="@+id/selectedTabs"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="0dp"
android:layout_marginTop="16dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/helpTextView"
app:layout_constraintVertical_bias="1.0"
tools:listitem="@layout/list_choose_tabs" /> tools:listitem="@layout/list_choose_tabs" />
<com.google.android.material.floatingactionbutton.FloatingActionButton <com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/addTabsButton" android:id="@+id/addTabsButton"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_marginEnd="16dp" android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:layout_marginBottom="16dp" android:layout_marginBottom="16dp"
android:clickable="true" android:clickable="true"
android:focusable="true" android:focusable="true"
app:backgroundTint="?attr/colorPrimary" app:backgroundTint="?attr/colorPrimary"
app:fabSize="auto" app:fabSize="auto"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:srcCompat="@drawable/ic_add" /> app:srcCompat="@drawable/ic_add" />
</RelativeLayout> </androidx.constraintlayout.widget.ConstraintLayout>