forked from nextcloud/android
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Customized navigation view theme with drawer options.
- Loading branch information
1 parent
ceb6cd6
commit 4e51cac
Showing
14 changed files
with
259 additions
and
140 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
app/src/main/java/com/nmc/android/utils/DrawableThemeUtils.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.nmc.android.utils | ||
|
||
import android.graphics.drawable.Drawable | ||
import androidx.annotation.ColorInt | ||
import androidx.core.graphics.BlendModeColorFilterCompat | ||
import androidx.core.graphics.BlendModeCompat | ||
import androidx.core.graphics.drawable.DrawableCompat | ||
|
||
object DrawableThemeUtils { | ||
@JvmStatic | ||
fun tintDrawable(drawable: Drawable, @ColorInt color: Int): Drawable { | ||
val wrap: Drawable = DrawableCompat.wrap(drawable) | ||
wrap.colorFilter = BlendModeColorFilterCompat.createBlendModeColorFilterCompat( | ||
color, BlendModeCompat.SRC_ATOP | ||
) | ||
return wrap | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
app/src/main/res/drawable/ic_magentacloud_product_logo.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:aapt="http://schemas.android.com/aapt" | ||
android:width="40dp" | ||
android:height="40dp" | ||
android:viewportWidth="40" | ||
android:viewportHeight="40"> | ||
<group> | ||
<clip-path | ||
android:pathData="M0,0h40v40h-40z"/> | ||
<path | ||
android:pathData="M2.133,0H37.867A2.133,2.133 0,0 1,40 2.133V37.867A2.133,2.133 0,0 1,37.867 40H2.133A2.133,2.133 0,0 1,0 37.867V2.133A2.133,2.133 0,0 1,2.133 0Z"> | ||
<aapt:attr name="android:fillColor"> | ||
<gradient | ||
android:startX="20" | ||
android:startY="0" | ||
android:endX="20" | ||
android:endY="40" | ||
android:type="linear"> | ||
<item android:offset="0" android:color="#FFFE319A"/> | ||
<item android:offset="1" android:color="#FFE20074"/> | ||
</gradient> | ||
</aapt:attr> | ||
</path> | ||
<path | ||
android:pathData="M17.63,30.545a9.886,9.886 0,0 1,-6.811 -2.706,5.4 5.4,0 0,1 -1.188,0.132A5.364,5.364 0,0 1,8.467 17.367a5.328,5.328 0,0 1,6.83 -4.8A8.963,8.963 0,0 1,18.367 10.021a8.877,8.877 0,0 1,1.92 -0.706,8.934 8.934,0 0,1 9.855,4.259 8.843,8.843 0,0 1,1.048 2.95,5.688 5.688,0 0,1 1.8,0.72 5.733,5.733 0,0 1,-3 10.623,5.836 5.836,0 0,1 -0.608,-0.032 5.329,5.329 0,0 1,-6.3 1.224L23.082,22.35h4.423L20.786,15.461 14.015,22.35L18.477,22.35v8.16C18.196,30.533 17.911,30.545 17.63,30.545Z" | ||
android:fillColor="#fff"/> | ||
<path | ||
android:pathData="M27.519,23.889L23.096,23.889L23.096,22.349h2.918l1.505,1.54ZM18.476,23.889L13.976,23.889L15.499,22.349L18.476,22.349L18.476,23.889Z" | ||
android:fillColor="#f9cce3"/> | ||
</group> | ||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item android:drawable="@color/nav_selected_bg_color" android:state_checked="true" /> | ||
</selector> |
Oops, something went wrong.