123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- package com.emato.ich.fragment;
- import android.os.Bundle;
- import android.view.LayoutInflater;
- import android.view.View;
- import android.view.ViewGroup;
- import androidx.annotation.NonNull;
- import androidx.annotation.Nullable;
- import androidx.fragment.app.Fragment;
- import androidx.navigation.fragment.NavHostFragment;
- import com.emato.ich.MainActivity;
- import com.emato.ich.R;
- import com.emato.ich.databinding.FragmentSendSuccessBinding;
- import com.emato.ich.local.LocalStorage;
- import org.jetbrains.annotations.NotNull;
- public class SendSuccessFragment extends Fragment {
- private FragmentSendSuccessBinding binding;
- @Nullable
- @org.jetbrains.annotations.Nullable
- @Override
- public View onCreateView(@NonNull @NotNull LayoutInflater inflater, @Nullable @org.jetbrains.annotations.Nullable ViewGroup container, @Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) {
- binding = FragmentSendSuccessBinding.inflate(inflater, container, false);
- return binding.getRoot();
- }
- public void onViewCreated(@NonNull @NotNull View view, @Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) {
- // 继续投递
- binding.continueSendBtn.setOnClickListener(view1 -> {
- NavHostFragment.findNavController(SendSuccessFragment.this)
- .navigate(R.id.action_sendSuccessFragment_to_chooseCabinetFragment);
- });
- // 退出账号
- binding.exitAccountBtn.setOnClickListener(view1 -> {
- // 清空Session
- LocalStorage.getInstance().cleanSession();
- ((MainActivity) getActivity()).getBundleMap().clear();
- NavHostFragment.findNavController(SendSuccessFragment.this)
- .navigate(R.id.action_sendSuccessFragment_to_mainFragment);
- });
- }
- @Override
- public void onDestroy() {
- super.onDestroy();
- binding = null;
- }
- }
|