Search in sources :

Example 6 with GroupMigrationMembershipChange

use of org.thoughtcrime.securesms.groups.GroupMigrationMembershipChange in project Signal-Android by signalapp.

the class GroupsV1MigrationInfoBottomSheetDialogFragment method onViewCreated.

@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
    this.pendingContainer = view.findViewById(R.id.gv1_learn_more_pending_container);
    this.pendingTitle = view.findViewById(R.id.gv1_learn_more_pending_title);
    this.pendingList = view.findViewById(R.id.gv1_learn_more_pending_list);
    this.droppedContainer = view.findViewById(R.id.gv1_learn_more_dropped_container);
    this.droppedTitle = view.findViewById(R.id.gv1_learn_more_dropped_title);
    this.droppedList = view.findViewById(R.id.gv1_learn_more_dropped_list);
    pendingList.initializeAdapter(getViewLifecycleOwner());
    droppedList.initializeAdapter(getViewLifecycleOwner());
    // noinspection ConstantConditions
    GroupMigrationMembershipChange membershipChange = GroupMigrationMembershipChange.deserialize(getArguments().getString(KEY_MEMBERSHIP_CHANGE));
    this.viewModel = ViewModelProviders.of(this, new GroupsV1MigrationInfoViewModel.Factory(membershipChange)).get(GroupsV1MigrationInfoViewModel.class);
    viewModel.getPendingMembers().observe(getViewLifecycleOwner(), this::onPendingMembersChanged);
    viewModel.getDroppedMembers().observe(getViewLifecycleOwner(), this::onDroppedMembersChanged);
    view.findViewById(R.id.gv1_learn_more_ok_button).setOnClickListener(v -> dismiss());
}
Also used : GroupMigrationMembershipChange(org.thoughtcrime.securesms.groups.GroupMigrationMembershipChange)

Aggregations

GroupMigrationMembershipChange (org.thoughtcrime.securesms.groups.GroupMigrationMembershipChange)6 ArrayList (java.util.ArrayList)4 SuppressLint (android.annotation.SuppressLint)2 ContentValues (android.content.ContentValues)2 NonNull (androidx.annotation.NonNull)2 GroupMasterKey (org.signal.zkgroup.groups.GroupMasterKey)2 GroupId (org.thoughtcrime.securesms.groups.GroupId)2 RecipientId (org.thoughtcrime.securesms.recipients.RecipientId)2