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:scan')
implementation project(':feature:debug') // implementation project(':feature:debug') //
// Component // // Component
implementation project(':component:common') // implementation project(':component:common')
implementation project(':component:scanner') // implementation project(':component:scanner')
implementation project(':component:viewer') // implementation project(':component:viewer')
// Data // // Data
implementation project(':data:repository') // implementation project(':data:repository')
//
// Source // // Source
implementation project(':data:source:database') // implementation project(':data:source:database')
implementation project(':data:source:preference') // implementation project(':data:source:preference')
//
// Hilt (DI) // Hilt (DI)
implementation libs.com.google.dagger.hilt.android implementation libs.com.google.dagger.hilt.android
annotationProcessor libs.com.google.dagger.hilt.compiler 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 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; import javax.inject.Inject;
@ -19,9 +18,6 @@ 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);
@ -36,6 +32,6 @@ public class MainActivity extends AppCompatActivity {
NavigationUI.setupWithNavController(bottomNavigationView, navController); 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 { plugins {
alias(libs.plugins.com.android.library) alias(libs.plugins.com.android.library)
id 'com.google.dagger.hilt.android'
} }
android { android {

View File

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