Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -353,11 +353,10 @@
<activity
android:name=".ui.activity.SettingsActivity"
android:exported="false"
android:theme="@style/PreferenceTheme" />
android:theme="@style/Theme.ownCloud" />
<activity
android:name=".ui.preview.PreviewImageActivity"
android:exported="false"
android:theme="@style/Theme.ownCloud.Overlay" />
android:exported="false" />
<activity
android:name=".ui.preview.PreviewMediaActivity"
android:configChanges="orientation|screenLayout|screenSize|keyboardHidden"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ class LogsActivity : ToolbarActivity() {

setupToolbar()
supportActionBar?.setDisplayHomeAsUpEnabled(true)
// NMC Customization: show divider
showHideDefaultToolbarDivider(true)

supportActionBar?.let {
viewThemeUtils.files.themeActionBar(this, it, R.string.logs_title)
Expand Down
18 changes: 18 additions & 0 deletions app/src/main/java/com/nmc/android/utils/DrawableThemeUtils.kt
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
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package com.nmc.android.utils

import android.content.Context
import android.content.res.ColorStateList
import android.graphics.Color
import com.google.android.material.navigation.NavigationView
import com.nextcloud.android.common.ui.util.buildColorStateList
import com.owncloud.android.R

object NavigationViewThemeUtils {
@JvmStatic
@JvmOverloads
fun colorNavigationView(
context: Context,
navigationView: NavigationView,
colorIcons: Boolean = true
) {
if (navigationView.itemBackground != null) {
navigationView.itemBackground?.setTintList(
buildColorStateList(
android.R.attr.state_checked to context.resources.getColor(R.color.nav_selected_bg_color, null),
-android.R.attr.state_checked to Color.TRANSPARENT
)
)
}
navigationView.background.setTintList(
ColorStateList.valueOf(
context.resources.getColor(
R.color.nav_bg_color,
null
)
)
)

val colorStateList =
buildColorStateList(
android.R.attr.state_checked to context.resources.getColor(R.color.nav_txt_selected_color, null),
-android.R.attr.state_checked to context.resources.getColor(R.color.nav_txt_unselected_color, null),
)

navigationView.itemTextColor = colorStateList
if (colorIcons) {
navigationView.itemIconTintList = colorStateList
}
}
}
27 changes: 27 additions & 0 deletions app/src/main/java/com/nmc/android/utils/ToolbarThemeUtils.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.nmc.android.utils

import android.content.Context
import android.graphics.Typeface
import android.text.Spannable
import android.text.style.StyleSpan
import androidx.appcompat.app.ActionBar
import com.owncloud.android.R
import com.owncloud.android.utils.StringUtils

object ToolbarThemeUtils {
@JvmStatic
fun setColoredTitle(context: Context, actionBar: ActionBar?, title: String) {
if (actionBar != null) {
val text: Spannable = StringUtils.getColorSpan(title, context.resources.getColor(R.color.fontAppbar, null))

//bold the magenta from MagentaCLOUD title
if (title.contains(context.resources.getString(R.string.app_name))) {
val textToBold = context.resources.getString(R.string.splashScreenBold)
val indexStart = title.indexOf(textToBold)
val indexEnd = indexStart + textToBold.length
text.setSpan(StyleSpan(Typeface.BOLD), indexStart, indexEnd, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
}
actionBar.title = text
}
}
}
Loading