new nav header with plugin icons and extend colors for black and white transparence for future extensions

This commit is contained in:
osodebailar 2020-12-17 13:59:06 +01:00
parent 5be36199c8
commit df8616e60b
6 changed files with 71 additions and 3 deletions

View file

@ -200,6 +200,12 @@ class MainActivity : NoSplashAppCompatActivity() {
if (p.isEnabled() && p.hasFragment() && !p.isFragmentVisible() && !p.pluginDescription.neverVisible) {
val menuItem = menu.add(p.name)
menuItem.isCheckable = true
if(p.menuIcon != -1) {
menuItem.setIcon(p.menuIcon)
} else
{
menuItem.setIcon(R.drawable.ic_settings)
}
menuItem.setOnMenuItemClickListener {
val intent = Intent(this, SingleFragmentActivity::class.java)
intent.putExtra("plugin", activePlugin.getPluginsList().indexOf(p))

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/black_alpha_60" android:state_pressed="true" />
<item android:drawable="@color/black_alpha_40" />
</selector>

View file

@ -50,9 +50,12 @@
android:id="@+id/main_navigation_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
app:itemBackground="?selectableItemBackground"
app:itemTextColor="#FFFFFF"
android:layout_gravity="start" />
app:itemBackground="?attr/selectableItemBackground"
app:headerLayout="@layout/navigation_drawer_header"
android:fitsSystemWindows="true"
android:layout_gravity="start"
app:itemIconTint="@android:color/white"
app:itemTextColor="@android:color/white"/>
</androidx.drawerlayout.widget.DrawerLayout>
</LinearLayout>

View file

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="160dp"
xmlns:tools="http://schemas.android.com/tools"
android:scaleType="centerCrop"
android:orientation="vertical">
<FrameLayout
android:id="@+id/navigation_drawer_header_clickable"
android:clickable="true"
android:focusable="true"
android:foreground="@drawable/nav_drawer_header_foreground"
android:layout_width="match_parent"
android:layout_height="160dp">
<ImageView
android:id="@+id/navigation_drawer_user_account_picture_cover"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:background="@drawable/image_nav_drawer_account_background"
tools:ignore="ContentDescription" />
</FrameLayout>
</RelativeLayout>

View file

@ -53,5 +53,29 @@
<color name="toastWarn">#FF8C00</color>
<color name="toastInfo">#03A9F4</color>
<!-- Black and White transparent - glass effect-->
<color name="black_alpha_10">#1A000000</color>
<color name="black_alpha_20">#33000000</color>
<color name="black_alpha_30">#4D000000</color>
<color name="black_alpha_40">#66000000</color>
<color name="black_alpha_50">#80000000</color>
<color name="black_alpha_60">#99000000</color>
<color name="black_alpha_65">#A6000000</color>
<color name="black_alpha_70">#B3000000</color>
<color name="black_alpha_80">#CC000000</color>
<color name="black_alpha_90">#E6000000</color>
<color name="white_alpha_08">#10FFFFFF</color>
<color name="white_alpha_10">#1AFFFFFF</color>
<color name="white_alpha_20">#33FFFFFF</color>
<color name="white_alpha_30">#4DFFFFFF</color>
<color name="white_alpha_40">#66FFFFFF</color>
<color name="white_alpha_50">#80FFFFFF</color>
<color name="white_alpha_60">#99FFFFFF</color>
<color name="white_alpha_65">#A6FFFFFF</color>
<color name="white_alpha_70">#B3FFFFFF</color>
<color name="white_alpha_80">#CCFFFFFF</color>
<color name="white_alpha_90">#E6FFFFFF</color>
</resources>