content: package com.androidgames.tictactoe.ui;
  
  import androidx.appcompat.app.AppCompatActivity;
  import android.os.Bundle;
  import android.view.View;
  import android.widget.Button;
  import android.widget.ProgressBar;
  import android.widget.ScrollView;
  import android.widget.TextView;
  
  import com.androidgames.tictactoe.R;
  import com.google.firebase.auth.FirebaseAuth;
  import com.google.firebase.auth.FirebaseUser;
  import com.google.firebase.firestore.FirebaseFirestore;
  
  public class FindGameActivity extends AppCompatActivity {
      private TextView tvLoadingMessage;
      private ProgressBar progressBar;
      private ScrollView layoutProgressBar, layoutMenuJuego;
      private Button btnJugar, btnRanking;
      private FirebaseAuth firebaseAuth;
      private FirebaseFirestore db;
      private FirebaseUser firebaseUser;
      private String uid;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_find_game);
  
          layoutProgressBar = findViewById(R.id.layoutprogressBar);
          layoutMenuJuego = findViewById(R.id.menuJuego);
          btnJugar = findViewById(R.id.buttonJugar);
          btnRanking = findViewById(R.id.buttonRanking);
  
          initProgressBar();
          initFirebase();
          eventos();
      }
  
      private void initFirebase() {
          firebaseAuth = FirebaseAuth.getInstance();
          db = FirebaseFirestore.getInstance();
          firebaseUser = firebaseAuth.getCurrentUser();
          uid = firebaseUser.getUid();
      }
  
      private void eventos() {
          btnJugar.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  changeMenuVisibility(false);
              }
          });
  
          btnRanking.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
  
              }
          });
      }
  
      private void initProgressBar() {
          tvLoadingMessage = findViewById(R.id.textViewLoading);
          progressBar = findViewById(R.id.progressBarJugadas);
  
          progressBar.setIndeterminate(true);
          tvLoadingMessage.setText("Cargando...");
  
          changeMenuVisibility(true);
      }
  
      private void changeMenuVisibility(boolean showMenu) {
          layoutProgressBar.setVisibility(showMenu ? View.GONE : View.VISIBLE);
          layoutMenuJuego.setVisibility(showMenu ? View.VISIBLE : View.GONE);
      }
  
      @Override
      protected void onResume() {
          super.onResume();
          changeMenuVisibility(true);
      }
  }
  