Improve remote wipe display fragment

This commit is contained in:
ameba23
2022-03-01 11:45:08 +01:00
parent d463d69971
commit 7be5cba64a
2 changed files with 38 additions and 21 deletions

View File

@@ -4,6 +4,7 @@ import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import org.briarproject.briar.R;
import org.briarproject.briar.android.activity.ActivityComponent;
@@ -46,10 +47,13 @@ public class RemoteWipeDisplayFragment extends BaseFragment
@Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
View contentView = inflater.inflate(R.layout.list, container, false);
// change toolbar text (relevant when navigating back to this fragment)
requireActivity().setTitle(R.string.assigned_wipers);
View contentView = inflater.inflate(R.layout.fragment_remote_wipe_display, container, false);
viewModel.getWiperContactIds();
list = contentView.findViewById(R.id.list);
list = contentView.findViewById(R.id.wiperList);
list.setLayoutManager(new LinearLayoutManager(getActivity()));
list.setAdapter(adapter);
list.setEmptyText(R.string.no_contacts);
@@ -59,24 +63,11 @@ public class RemoteWipeDisplayFragment extends BaseFragment
.onSuccess(adapter::submitList)
);
Button button = contentView.findViewById(R.id.button_change);
button.setOnClickListener(e -> viewModel.onModifyWipers());
return contentView;
}
// View view = inflater.inflate(R.layout.fragment_display_remote_wipe,
// container, false);
// List<String> wiperNames = viewModel.getWiperNames();
// StringBuilder custodianNamesString = new StringBuilder();
// for (String custodianName : wiperNames) {
// custodianNamesString
// .append("• ")
// .append(custodianName)
// .append("\n");
// }
// TextView textViewThreshold = view.findViewById(R.id.textViewWipers);
// textViewThreshold.setText(custodianNamesString.toString());
//
// Button button = view.findViewById(R.id.button);
// button.setOnClickListener(e -> viewModel.onModifyWipers());
// return view;
@Override
public String getUniqueTag() {
@@ -85,7 +76,6 @@ public class RemoteWipeDisplayFragment extends BaseFragment
@Override
public void onItemClick(View view, ContactListItem item) {
}
@Override

View File

@@ -1,6 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/margin_large"
android:paddingTop="@dimen/margin_medium"
android:paddingRight="@dimen/margin_large"
android:paddingBottom="@dimen/margin_medium"
tools:ignore="VectorDrawableCompat">
<org.briarproject.briar.android.view.BriarRecyclerView
android:id="@+id/wiperList"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@+id/button_change"
app:scrollToEnd="false" />
<Button
android:id="@+id/button_change"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:text="@string/remote_wipe_modify_contacts"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/wiperList"
/>
</androidx.constraintlayout.widget.ConstraintLayout>