content: package com.pxs.terminal.ui.slideshow;
  
  import android.os.Bundle;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.TextView;
  
  import androidx.annotation.NonNull;
  import androidx.annotation.Nullable;
  import androidx.fragment.app.Fragment;
  import androidx.lifecycle.Observer;
  import androidx.lifecycle.ViewModelProvider;
  
  import com.pxs.terminal.R;
  import com.pxs.terminal.databinding.FragmentSlideshowBinding;
  
  public class SlideshowFragment extends Fragment {
  
      private SlideshowViewModel slideshowViewModel;
      private FragmentSlideshowBinding binding;
  
      public View onCreateView(@NonNull LayoutInflater inflater,
                               ViewGroup container, Bundle savedInstanceState) {
          slideshowViewModel =
                  new ViewModelProvider(this).get(SlideshowViewModel.class);
  
          binding = FragmentSlideshowBinding.inflate(inflater, container, false);
          View root = binding.getRoot();
  
          final TextView textView = binding.textSlideshow;
          slideshowViewModel.getText().observe(getViewLifecycleOwner(), new Observer<String>() {
              @Override
              public void onChanged(@Nullable String s) {
                  textView.setText(s);
              }
          });
          return root;
      }
  
      @Override
      public void onDestroyView() {
          super.onDestroyView();
          binding = null;
      }
  }