なんかもう全部変えた

This commit is contained in:
ろむねこ 2024-01-19 20:09:26 +09:00
parent eab00983a8
commit c6ddd6fd03
No known key found for this signature in database
GPG Key ID: FA1F39A1BA37D168
11 changed files with 50 additions and 4 deletions

View File

@ -45,6 +45,9 @@ public class MainActivity extends AppCompatActivity {
}
// Set navigation bar color
getWindow().setNavigationBarColor(ContextCompat.getColor(this, one.nem.lacerta.shared.ui.R.color.colorSurfaceVariant));
getWindow().setNavigationBarColor(ContextCompat.getColor(this, one.nem.lacerta.shared.ui.R.color.colorSecondaryContainer));
// Set status bar color
getWindow().setStatusBarColor(ContextCompat.getColor(this, one.nem.lacerta.shared.ui.R.color.colorSurface));
}
}

View File

@ -24,6 +24,11 @@
android:id="@+id/bottom_nav"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@color/colorSecondaryContainer"
app:itemIconTint="@color/colorOnSecondaryContainer"
app:itemTextColor="@color/colorOnSecondaryContainer"
app:itemActiveIndicatorStyle="@style/Lacerta.Custom.Indicator"
app:labelVisibilityMode="selected"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"

View File

@ -12,11 +12,13 @@ import android.view.ViewGroup;
import androidx.appcompat.app.ActionBarDrawerToggle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.core.content.ContextCompat;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.appbar.CollapsingToolbarLayout;
import java.util.ArrayList;
@ -121,6 +123,24 @@ public class HomeTopFragment extends Fragment {
// Set the title of the CollapsingToolbarLayout
collapsingToolbarLayout.setTitle("Lacerta");
AppBarLayout appBarLayout = view.findViewById(R.id.app_bar_layout);
appBarLayout.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() {
@Override
public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) {
if (Math.abs(verticalOffset) == appBarLayout.getTotalScrollRange()) {
// Collapsed
getActivity().getWindow().setStatusBarColor(ContextCompat.getColor(getActivity(), one.nem.lacerta.shared.ui.R.color.colorSecondaryContainer));
} else if (verticalOffset == 0) {
// Expanded
getActivity().getWindow().setStatusBarColor(ContextCompat.getColor(getActivity(), one.nem.lacerta.shared.ui.R.color.colorSurface));
} else {
// Somewhere in between
// Here you can add a color transition if you want
}
}
});
}
String pageTitle;

View File

@ -1,18 +1,22 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:background="@color/colorSurface">
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/app_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
app:contentScrim="@color/colorSecondaryContainer"
android:background="@color/colorSurface"
android:layout_width="match_parent"
android:layout_height="160dp"
android:fitsSystemWindows="true"

View File

@ -30,6 +30,7 @@
<item name="colorOnBackground">@color/colorOnBackground</item>
<item name="android:windowLightNavigationBar">false</item>
<item name="android:windowLightStatusBar">false</item>
</style>
</resources>

View File

@ -25,4 +25,7 @@
<color name="colorSurfaceVariant">@color/material_dynamic_neutral_variant90</color>
<color name="colorOnSurfaceVariant">@color/material_dynamic_neutral_variant30</color>
<color name="colorSurfaceInverse">@color/material_dynamic_neutral20</color>
<!-- indicator icon background -->
<color name="colorIndicator">@color/material_dynamic_secondary70</color>
</resources>

View File

@ -24,4 +24,7 @@
<color name="colorSurfaceVariant">@color/material_dynamic_neutral_variant90</color>
<color name="colorOnSurfaceVariant">@color/material_dynamic_neutral_variant30</color>
<color name="colorSurfaceInverse">@color/material_dynamic_neutral20</color>
<!-- indicator icon background -->
<color name="colorIndicator">@color/material_dynamic_secondary80</color>
</resources>

View File

@ -30,6 +30,7 @@
<item name="colorOnBackground">@color/colorOnBackground</item>
<item name="android:windowLightNavigationBar">true</item>
<item name="android:windowLightStatusBar">true</item>
</style>
</resources>

View File

@ -25,4 +25,6 @@
<color name="colorSurfaceInverse">#31312B</color>
<color name="colorOnSurfaceInverse">#F3F1E8</color>
<color name="colorPrimaryInverse">#B8D321</color>
<!-- indicator icon background -->
<color name="colorIndicator">#d2d4bc</color>
</resources>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Lacerta.Custom.Indicator" parent="Widget.Material3.BottomNavigationView.ActiveIndicator">
<item name="android:color">@color/colorIndicator</item>
</style>
</resources>

View File

@ -28,8 +28,6 @@
<item name="colorOutline">@color/colorOutline</item>
<item name="colorOnBackground">@color/colorOnBackground</item>
<item name="android:windowLightNavigationBar">true</item>
</style>
<style name="Theme.Lacerta" parent="Base.Theme.Lacerta" >