From 7b4304224b53ac068ed6e8cd233d0d6ae522a04f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Sun, 10 Dec 2023 17:22:05 +0900 Subject: [PATCH] WIP --- .../java/one/nem/lacerta/LacertaApplication.java | 3 +++ .../main/java/one/nem/lacerta/MainActivity.java | 3 +++ .../one/nem/lacerta/data/repository/TestData.java | 7 +++++++ .../lacerta/feature/debug/DebugMenuFragment.java | 15 +++++++++++++++ .../src/main/res/layout/fragment_debug_menu.xml | 5 +++-- 5 files changed, 31 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/one/nem/lacerta/LacertaApplication.java b/app/src/main/java/one/nem/lacerta/LacertaApplication.java index 2f8d755a..c8a8a7dc 100644 --- a/app/src/main/java/one/nem/lacerta/LacertaApplication.java +++ b/app/src/main/java/one/nem/lacerta/LacertaApplication.java @@ -2,5 +2,8 @@ package one.nem.lacerta; import android.app.Application; +import dagger.hilt.android.HiltAndroidApp; + +@HiltAndroidApp public class LacertaApplication extends Application { } diff --git a/app/src/main/java/one/nem/lacerta/MainActivity.java b/app/src/main/java/one/nem/lacerta/MainActivity.java index a37ab581..cad41ab5 100644 --- a/app/src/main/java/one/nem/lacerta/MainActivity.java +++ b/app/src/main/java/one/nem/lacerta/MainActivity.java @@ -10,6 +10,9 @@ import android.os.Bundle; import com.google.android.material.bottomnavigation.BottomNavigationView; +import dagger.hilt.android.AndroidEntryPoint; + +@AndroidEntryPoint public class MainActivity extends AppCompatActivity { @Override diff --git a/data/repository/src/main/java/one/nem/lacerta/data/repository/TestData.java b/data/repository/src/main/java/one/nem/lacerta/data/repository/TestData.java index 1e392dbc..763de78d 100644 --- a/data/repository/src/main/java/one/nem/lacerta/data/repository/TestData.java +++ b/data/repository/src/main/java/one/nem/lacerta/data/repository/TestData.java @@ -1,6 +1,13 @@ package one.nem.lacerta.data.repository; +import javax.inject.Inject; + public class TestData { + + @Inject + public TestData(){ + } + public String getTestData(){ return "TestData"; } diff --git a/feature/debug/src/main/java/one/nem/lacerta/feature/debug/DebugMenuFragment.java b/feature/debug/src/main/java/one/nem/lacerta/feature/debug/DebugMenuFragment.java index 0d0ff145..4dae3640 100644 --- a/feature/debug/src/main/java/one/nem/lacerta/feature/debug/DebugMenuFragment.java +++ b/feature/debug/src/main/java/one/nem/lacerta/feature/debug/DebugMenuFragment.java @@ -7,6 +7,7 @@ import androidx.fragment.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.widget.Button; /** * A simple {@link Fragment} subclass. @@ -15,6 +16,8 @@ import android.view.ViewGroup; */ public class DebugMenuFragment extends Fragment { + + // TODO: Rename parameter arguments, choose names that match // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER private static final String ARG_PARAM1 = "param1"; @@ -61,4 +64,16 @@ public class DebugMenuFragment extends Fragment { // Inflate the layout for this fragment return inflater.inflate(R.layout.fragment_debug_menu, container, false); } + + @Override + public void onViewCreated(View view, Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + + Button button = view.findViewById(R.id.button_di_test); + // Lambda + button.setOnClickListener(v -> { + + } + + } } \ No newline at end of file diff --git a/feature/debug/src/main/res/layout/fragment_debug_menu.xml b/feature/debug/src/main/res/layout/fragment_debug_menu.xml index 18999717..520e7d38 100644 --- a/feature/debug/src/main/res/layout/fragment_debug_menu.xml +++ b/feature/debug/src/main/res/layout/fragment_debug_menu.xml @@ -14,8 +14,9 @@ android:text="DebugMenu" />