DIテスト

This commit is contained in:
ろむねこ 2023-12-10 17:43:06 +09:00
parent 7e2f97d900
commit 7bcc4dbbad
No known key found for this signature in database
GPG Key ID: FA1F39A1BA37D168
2 changed files with 11 additions and 0 deletions

View File

@ -7,14 +7,21 @@ import androidx.navigation.fragment.NavHostFragment;
import androidx.navigation.ui.NavigationUI; import androidx.navigation.ui.NavigationUI;
import android.os.Bundle; import android.os.Bundle;
import android.widget.Toast;
import com.google.android.material.bottomnavigation.BottomNavigationView; import com.google.android.material.bottomnavigation.BottomNavigationView;
import one.nem.lacerta.data.repository.TestData;
import dagger.hilt.android.AndroidEntryPoint; import dagger.hilt.android.AndroidEntryPoint;
import javax.inject.Inject;
@AndroidEntryPoint @AndroidEntryPoint
public class MainActivity extends AppCompatActivity { public class MainActivity extends AppCompatActivity {
@Inject
TestData testData;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
@ -28,5 +35,7 @@ public class MainActivity extends AppCompatActivity {
BottomNavigationView bottomNavigationView = findViewById(R.id.bottom_nav); BottomNavigationView bottomNavigationView = findViewById(R.id.bottom_nav);
NavigationUI.setupWithNavController(bottomNavigationView, navController); NavigationUI.setupWithNavController(bottomNavigationView, navController);
Toast.makeText(this, testData.getTestData(), Toast.LENGTH_SHORT).show();
} }
} }

View File

@ -10,6 +10,7 @@ import android.view.ViewGroup;
import android.widget.Button; import android.widget.Button;
import android.widget.Toast; import android.widget.Toast;
import dagger.hilt.android.AndroidEntryPoint;
import one.nem.lacerta.data.repository.TestData; import one.nem.lacerta.data.repository.TestData;
import javax.inject.Inject; import javax.inject.Inject;
@ -19,6 +20,7 @@ import javax.inject.Inject;
* Use the {@link DebugMenuFragment#newInstance} factory method to * Use the {@link DebugMenuFragment#newInstance} factory method to
* create an instance of this fragment. * create an instance of this fragment.
*/ */
public class DebugMenuFragment extends Fragment { public class DebugMenuFragment extends Fragment {
@Inject @Inject