mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-26 09:43:15 +00:00
commit
4101f75685
|
@ -59,30 +59,6 @@ dependencies {
|
||||||
androidTestImplementation libs.androidx.test.ext.junit
|
androidTestImplementation libs.androidx.test.ext.junit
|
||||||
androidTestImplementation libs.androidx.test.espresso.core
|
androidTestImplementation libs.androidx.test.espresso.core
|
||||||
|
|
||||||
// 内部モジュール
|
|
||||||
// Feature
|
|
||||||
implementation project(':feature:home')
|
|
||||||
implementation project(':feature:search')
|
|
||||||
implementation project(':feature:library')
|
|
||||||
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')
|
|
||||||
//
|
|
||||||
implementation project(':data')
|
|
||||||
|
|
||||||
implementation project(':shared:ui')
|
|
||||||
|
|
||||||
// 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
|
||||||
|
@ -92,4 +68,13 @@ dependencies {
|
||||||
implementation libs.navigation.ui
|
implementation libs.navigation.ui
|
||||||
implementation libs.navigation.dynamic.features.fragment
|
implementation libs.navigation.dynamic.features.fragment
|
||||||
|
|
||||||
|
// Feature
|
||||||
|
implementation project(':feature:home')
|
||||||
|
implementation project(':feature:search')
|
||||||
|
implementation project(':feature:library')
|
||||||
|
implementation project(':feature:scan')
|
||||||
|
implementation project(':feature:debug') // デバッグメニュー
|
||||||
|
|
||||||
|
implementation project(':data')
|
||||||
|
implementation project(':shared:ui')
|
||||||
}
|
}
|
|
@ -1,6 +1,7 @@
|
||||||
package one.nem.lacerta;
|
package one.nem.lacerta;
|
||||||
|
|
||||||
import android.app.Application;
|
import android.app.Application;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
import com.google.android.material.color.DynamicColors;
|
import com.google.android.material.color.DynamicColors;
|
||||||
|
|
||||||
|
@ -12,8 +13,12 @@ public class LacertaApplication extends Application {
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
|
|
||||||
// DynamicColorを有効化
|
if (DynamicColors.isDynamicColorAvailable()) {
|
||||||
|
Log.d("DynamicColors", "DynamicColors is available. Applying to activities...");
|
||||||
DynamicColors.applyToActivitiesIfAvailable(this);
|
DynamicColors.applyToActivitiesIfAvailable(this);
|
||||||
|
} else {
|
||||||
|
Log.d("DynamicColors", "DynamicColors is not available.");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@ import androidx.navigation.ui.NavigationUI;
|
||||||
|
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.util.Log;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
||||||
|
@ -27,20 +28,23 @@ public class MainActivity extends AppCompatActivity {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_main);
|
setContentView(R.layout.activity_main);
|
||||||
|
|
||||||
// Debug
|
// Init navigation
|
||||||
|
try {
|
||||||
FragmentManager supportFragmentManager = getSupportFragmentManager();
|
FragmentManager supportFragmentManager = getSupportFragmentManager();
|
||||||
|
|
||||||
NavHostFragment navHostFragment = (NavHostFragment) supportFragmentManager.findFragmentById(R.id.nav_host_fragment);
|
NavHostFragment navHostFragment = (NavHostFragment) supportFragmentManager.findFragmentById(R.id.nav_host_fragment);
|
||||||
|
assert navHostFragment != null;
|
||||||
NavController navController = navHostFragment.getNavController();
|
NavController navController = navHostFragment.getNavController();
|
||||||
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, "testMessage", Toast.LENGTH_SHORT).show();
|
catch (Exception e) {
|
||||||
|
Log.e("Init", "Failed to init navigation");
|
||||||
getWindow().setNavigationBarColor(ContextCompat.getColor(this, one.nem.lacerta.shared.ui.R.color.colorSurfaceVariant));
|
Log.e("Init", "Searchable Error code: " + "894b5941-3bc0-46fe-b752-0dbc88be29a8");
|
||||||
|
Toast.makeText(this, "Failed to init navigation", Toast.LENGTH_LONG).show();
|
||||||
|
finish(); // Exit app
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set navigation bar color
|
||||||
|
getWindow().setNavigationBarColor(ContextCompat.getColor(this, one.nem.lacerta.shared.ui.R.color.colorSurfaceVariant));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,20 +6,19 @@
|
||||||
android:icon="@drawable/home_24px"
|
android:icon="@drawable/home_24px"
|
||||||
android:title="Home"/>
|
android:title="Home"/>
|
||||||
|
|
||||||
<item
|
|
||||||
android:id="@id/feature_library_navigation"
|
|
||||||
android:icon="@drawable/folder_24px"
|
|
||||||
android:title="Library"/>
|
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@id/feature_search_navigation"
|
android:id="@id/feature_search_navigation"
|
||||||
android:icon="@drawable/search_24px"
|
android:icon="@drawable/search_24px"
|
||||||
android:title="Search"/>
|
android:title="Search"/>
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:id="@id/feature_library_navigation"
|
||||||
|
android:icon="@drawable/folder_24px"
|
||||||
|
android:title="Library"/>
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@id/feature_debug_navigation"
|
android:id="@id/feature_debug_navigation"
|
||||||
android:icon="@drawable/developer_mode_24px"
|
android:icon="@drawable/developer_mode_24px"
|
||||||
android:title="Debug menu"/>
|
android:title="Debug menu"/>
|
||||||
|
|
||||||
|
|
||||||
</menu>
|
</menu>
|
4
shared/ui/src/main/res/values-ja/strings.xml
Normal file
4
shared/ui/src/main/res/values-ja/strings.xml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
|
||||||
|
</resources>
|
Loading…
Reference in New Issue
Block a user