DIテスト

This commit is contained in:
ろむねこ 2023-12-10 17:49:08 +09:00
parent 7bcc4dbbad
commit bc0370303f
No known key found for this signature in database
GPG Key ID: FA1F39A1BA37D168
4 changed files with 14 additions and 16 deletions

View File

@ -45,18 +45,18 @@ dependencies {
implementation project(':feature:scan')
implementation project(':feature:debug') //
// Component
implementation project(':component:common')
implementation project(':component:scanner')
implementation project(':component:viewer')
// Data
implementation project(':data:repository')
// Source
implementation project(':data:source:database')
implementation project(':data:source:preference')
// // Component
// implementation project(':component:common')
// implementation project(':component:scanner')
// implementation project(':component:viewer')
// // Data
// implementation project(':data:repository')
//
// // Source
// implementation project(':data:source:database')
// implementation project(':data:source:preference')
//
// Hilt (DI)
implementation libs.com.google.dagger.hilt.android
annotationProcessor libs.com.google.dagger.hilt.compiler

View File

@ -11,7 +11,6 @@ import android.widget.Toast;
import com.google.android.material.bottomnavigation.BottomNavigationView;
import one.nem.lacerta.data.repository.TestData;
import dagger.hilt.android.AndroidEntryPoint;
import javax.inject.Inject;
@ -19,9 +18,6 @@ import javax.inject.Inject;
@AndroidEntryPoint
public class MainActivity extends AppCompatActivity {
@Inject
TestData testData;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@ -36,6 +32,6 @@ public class MainActivity extends AppCompatActivity {
NavigationUI.setupWithNavController(bottomNavigationView, navController);
Toast.makeText(this, testData.getTestData(), Toast.LENGTH_SHORT).show();
Toast.makeText(this, "testMessage", Toast.LENGTH_SHORT).show();
}
}

View File

@ -1,5 +1,6 @@
plugins {
alias(libs.plugins.com.android.library)
id 'com.google.dagger.hilt.android'
}
android {

View File

@ -21,6 +21,7 @@ import javax.inject.Inject;
* create an instance of this fragment.
*/
@AndroidEntryPoint
public class DebugMenuFragment extends Fragment {
@Inject