2023-12-07 01:36:00 +00:00
|
|
|
package one.nem.lacerta;
|
|
|
|
|
|
|
|
import androidx.appcompat.app.AppCompatActivity;
|
2023-12-09 04:38:15 +00:00
|
|
|
import androidx.fragment.app.FragmentManager;
|
|
|
|
import androidx.navigation.NavController;
|
|
|
|
import androidx.navigation.fragment.NavHostFragment;
|
|
|
|
import androidx.navigation.ui.NavigationUI;
|
2023-12-07 01:36:00 +00:00
|
|
|
|
|
|
|
import android.os.Bundle;
|
2023-12-10 08:43:06 +00:00
|
|
|
import android.widget.Toast;
|
2023-12-07 01:36:00 +00:00
|
|
|
|
2023-12-09 04:38:15 +00:00
|
|
|
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
|
|
|
|
2023-12-10 08:43:06 +00:00
|
|
|
import one.nem.lacerta.data.repository.TestData;
|
|
|
|
|
2023-12-10 08:22:05 +00:00
|
|
|
import dagger.hilt.android.AndroidEntryPoint;
|
2023-12-10 08:43:06 +00:00
|
|
|
import javax.inject.Inject;
|
2023-12-10 08:22:05 +00:00
|
|
|
|
|
|
|
@AndroidEntryPoint
|
2023-12-07 01:36:00 +00:00
|
|
|
public class MainActivity extends AppCompatActivity {
|
|
|
|
|
2023-12-10 08:43:06 +00:00
|
|
|
@Inject
|
|
|
|
TestData testData;
|
|
|
|
|
2023-12-07 01:36:00 +00:00
|
|
|
@Override
|
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
|
super.onCreate(savedInstanceState);
|
|
|
|
setContentView(R.layout.activity_main);
|
2023-12-09 04:38:15 +00:00
|
|
|
|
|
|
|
// Debug
|
|
|
|
FragmentManager supportFragmentManager = getSupportFragmentManager();
|
|
|
|
|
|
|
|
NavHostFragment navHostFragment = (NavHostFragment) supportFragmentManager.findFragmentById(R.id.nav_host_fragment);
|
|
|
|
NavController navController = navHostFragment.getNavController();
|
|
|
|
BottomNavigationView bottomNavigationView = findViewById(R.id.bottom_nav);
|
|
|
|
|
|
|
|
NavigationUI.setupWithNavController(bottomNavigationView, navController);
|
2023-12-10 08:43:06 +00:00
|
|
|
|
|
|
|
Toast.makeText(this, testData.getTestData(), Toast.LENGTH_SHORT).show();
|
2023-12-07 01:36:00 +00:00
|
|
|
}
|
|
|
|
}
|