mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 00:59:49 +01:00
Remove SLE from EditProxyViewModel.
This commit is contained in:
committed by
Cody Henthorne
parent
c5b4f44ab8
commit
5f0d37739a
@@ -1,6 +1,5 @@
|
||||
package org.thoughtcrime.securesms.proxy;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@@ -21,6 +20,7 @@ import org.signal.core.util.logging.Log;
|
||||
import org.thoughtcrime.securesms.R;
|
||||
import org.thoughtcrime.securesms.preferences.EditProxyViewModel;
|
||||
import org.thoughtcrime.securesms.util.BottomSheetUtil;
|
||||
import org.thoughtcrime.securesms.util.LifecycleDisposable;
|
||||
import org.thoughtcrime.securesms.util.ThemeUtil;
|
||||
import org.thoughtcrime.securesms.util.views.CircularProgressMaterialButton;
|
||||
|
||||
@@ -37,6 +37,7 @@ public final class ProxyBottomSheetFragment extends BottomSheetDialogFragment {
|
||||
private View cancelButton;
|
||||
private CircularProgressMaterialButton useProxyButton;
|
||||
private EditProxyViewModel viewModel;
|
||||
private LifecycleDisposable lifecycleDisposable;
|
||||
|
||||
public static void showForProxy(@NonNull FragmentManager manager, @NonNull String proxyLink) {
|
||||
ProxyBottomSheetFragment fragment = new ProxyBottomSheetFragment();
|
||||
@@ -68,6 +69,9 @@ public final class ProxyBottomSheetFragment extends BottomSheetDialogFragment {
|
||||
this.useProxyButton = view.findViewById(R.id.proxy_sheet_use_proxy);
|
||||
this.cancelButton = view.findViewById(R.id.proxy_sheet_cancel);
|
||||
|
||||
lifecycleDisposable = new LifecycleDisposable();
|
||||
lifecycleDisposable.bindTo(getViewLifecycleOwner());
|
||||
|
||||
String host = getArguments().getString(ARG_PROXY_LINK);
|
||||
proxyText.setText(host);
|
||||
|
||||
@@ -80,8 +84,10 @@ public final class ProxyBottomSheetFragment extends BottomSheetDialogFragment {
|
||||
private void initViewModel() {
|
||||
this.viewModel = new ViewModelProvider(this).get(EditProxyViewModel.class);
|
||||
|
||||
viewModel.getSaveState().observe(getViewLifecycleOwner(), this::presentSaveState);
|
||||
viewModel.getEvents().observe(getViewLifecycleOwner(), this::presentEvents);
|
||||
lifecycleDisposable.addAll(
|
||||
viewModel.getSaveState().subscribe(this::presentSaveState),
|
||||
viewModel.getEvents().subscribe(this::presentEvents)
|
||||
);
|
||||
}
|
||||
|
||||
private void presentSaveState(@NonNull EditProxyViewModel.SaveState state) {
|
||||
|
||||
Reference in New Issue
Block a user