content: package com.example.spotifyui;
  
  
  import androidx.annotation.NonNull;
  import androidx.annotation.RequiresApi;
  import androidx.appcompat.app.AppCompatActivity;
  import androidx.appcompat.widget.Toolbar;
  import androidx.core.content.ContextCompat;
  import androidx.fragment.app.Fragment;
  import androidx.fragment.app.FragmentManager;
  import androidx.fragment.app.FragmentTransaction;
  
  import android.os.Build;
  import android.os.Bundle;
  import android.view.Menu;
  import android.view.MenuInflater;
  import android.view.MenuItem;
  import android.view.Window;
  import android.view.WindowManager;
  import android.widget.Toast;
  
  import com.google.android.material.bottomnavigation.BottomNavigationView;
  
  public class MainActivity extends BaseActivity {
  
      BottomNavigationView bot_nav;
  
      HomeFragment homeFragment;
  
      @Override
      protected void init() {
          bot_nav = findViewById(R.id.bot_nav);
          bot_nav.setOnNavigationItemSelectedListener(navListener);
          homeFragment = new HomeFragment();
      }
  
  
  
      @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
      @Override
      protected void display() {
          getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container,
                  homeFragment).commit();
  
          //This to make taskbar translucent and adjust color according to application
          Window window = MainActivity.this.getWindow();
          window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
          window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
          window.setStatusBarColor(ContextCompat.getColor(MainActivity.this, R.color.transparent_black));
      }
  
      @Override
      protected void submit() {}
  
      @Override
      protected int getView() {return R.layout.activity_main;}
  
  
      private BottomNavigationView.OnNavigationItemSelectedListener navListener =
              new BottomNavigationView.OnNavigationItemSelectedListener() {
                  @Override
                  public boolean onNavigationItemSelected(@NonNull MenuItem item) {
                      Fragment selectedFragment = null;
  
                      switch (item.getItemId()) {
                          case R.id.menu_home:
                              selectedFragment = new HomeFragment();
                              getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container,
                                      selectedFragment).commit();
                              break;
  
                          case R.id.menu_search:
                              selectedFragment = new SearchFragment();
                              getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container,
                                      selectedFragment).commit();
                              break;
  
                          case R.id.menu_lib:
                              selectedFragment = new LibraryFragment();
                              getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container,
                                      selectedFragment).commit();
                              break;
                      }
                      return true;
                  }
              };
  }
  