62 lines
1.8 KiB
Java
62 lines
1.8 KiB
Java
|
|
package com.example.livestreaming;
|
||
|
|
|
||
|
|
import android.content.Context;
|
||
|
|
import android.content.Intent;
|
||
|
|
import android.os.Bundle;
|
||
|
|
|
||
|
|
import androidx.appcompat.app.AppCompatActivity;
|
||
|
|
|
||
|
|
import com.example.livestreaming.databinding.ActivityFindGameBinding;
|
||
|
|
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
||
|
|
|
||
|
|
public class FindGameActivity extends AppCompatActivity {
|
||
|
|
|
||
|
|
private ActivityFindGameBinding binding;
|
||
|
|
|
||
|
|
public static void start(Context context) {
|
||
|
|
Intent intent = new Intent(context, FindGameActivity.class);
|
||
|
|
context.startActivity(intent);
|
||
|
|
}
|
||
|
|
|
||
|
|
@Override
|
||
|
|
protected void onCreate(Bundle savedInstanceState) {
|
||
|
|
super.onCreate(savedInstanceState);
|
||
|
|
binding = ActivityFindGameBinding.inflate(getLayoutInflater());
|
||
|
|
setContentView(binding.getRoot());
|
||
|
|
|
||
|
|
setupUI();
|
||
|
|
}
|
||
|
|
|
||
|
|
private void setupUI() {
|
||
|
|
binding.backButton.setOnClickListener(v -> finish());
|
||
|
|
|
||
|
|
BottomNavigationView bottomNavigation = binding.bottomNavInclude.bottomNavigation;
|
||
|
|
bottomNavigation.setSelectedItemId(R.id.nav_friends);
|
||
|
|
bottomNavigation.setOnItemSelectedListener(item -> {
|
||
|
|
int id = item.getItemId();
|
||
|
|
if (id == R.id.nav_home) {
|
||
|
|
startActivity(new Intent(this, MainActivity.class));
|
||
|
|
finish();
|
||
|
|
return true;
|
||
|
|
}
|
||
|
|
if (id == R.id.nav_wish_tree) {
|
||
|
|
WishTreeActivity.start(this);
|
||
|
|
finish();
|
||
|
|
return true;
|
||
|
|
}
|
||
|
|
if (id == R.id.nav_messages) {
|
||
|
|
MessagesActivity.start(this);
|
||
|
|
finish();
|
||
|
|
return true;
|
||
|
|
}
|
||
|
|
if (id == R.id.nav_profile) {
|
||
|
|
ProfileActivity.start(this);
|
||
|
|
finish();
|
||
|
|
return true;
|
||
|
|
}
|
||
|
|
return true;
|
||
|
|
});
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|