update the top menu colors depending on the primary color B/W

This commit is contained in:
tibbi 2019-08-11 17:32:49 +02:00
parent 6033d6a812
commit bb109fce95
12 changed files with 36 additions and 17 deletions

View file

@ -62,7 +62,7 @@ android {
}
dependencies {
implementation 'com.simplemobiletools:commons:5.15.33'
implementation 'com.simplemobiletools:commons:5.16.5'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'it.sephiroth.android.exif:library:1.0.1'

View file

@ -122,6 +122,7 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener
override fun onCreateOptionsMenu(menu: Menu): Boolean {
menuInflater.inflate(R.menu.menu_editor, menu)
updateMenuItemColors(menu)
return true
}

View file

@ -31,8 +31,9 @@ class ExcludedFoldersActivity : SimpleActivity(), RefreshRecyclerViewListener {
manage_folders_list.adapter = adapter
}
override fun onCreateOptionsMenu(menu: Menu?): Boolean {
override fun onCreateOptionsMenu(menu: Menu): Boolean {
menuInflater.inflate(R.menu.menu_add_folder, menu)
updateMenuItemColors(menu)
return true
}

View file

@ -36,8 +36,9 @@ class HiddenFoldersActivity : SimpleActivity(), RefreshRecyclerViewListener {
}
}
override fun onCreateOptionsMenu(menu: Menu?): Boolean {
override fun onCreateOptionsMenu(menu: Menu): Boolean {
menuInflater.inflate(R.menu.menu_add_folder, menu)
updateMenuItemColors(menu)
return true
}

View file

@ -30,8 +30,9 @@ class IncludedFoldersActivity : SimpleActivity(), RefreshRecyclerViewListener {
manage_folders_list.adapter = adapter
}
override fun onCreateOptionsMenu(menu: Menu?): Boolean {
override fun onCreateOptionsMenu(menu: Menu): Boolean {
menuInflater.inflate(R.menu.menu_add_folder, menu)
updateMenuItemColors(menu)
return true
}

View file

@ -289,6 +289,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
menu.findItem(R.id.temporarily_show_hidden).isVisible = !config.shouldShowHidden
menu.findItem(R.id.stop_showing_hidden).isVisible = config.temporarilyShowHidden
updateMenuItemColors(menu)
return true
}

View file

@ -234,6 +234,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
}
setupSearch(menu)
updateMenuItemColors(menu)
return true
}

View file

@ -249,6 +249,7 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList
findItem(R.id.menu_show_on_map).isVisible = visibleBottomActions and BOTTOM_ACTION_SHOW_ON_MAP == 0
}
updateMenuItemColors(menu)
return true
}

View file

@ -51,6 +51,7 @@ class SearchActivity : SimpleActivity(), MediaOperationsListener {
override fun onCreateOptionsMenu(menu: Menu): Boolean {
menuInflater.inflate(R.menu.menu_search, menu)
setupSearch(menu)
updateMenuItemColors(menu)
return true
}

View file

@ -48,6 +48,20 @@ class SetWallpaperActivity : SimpleActivity(), CropImageView.OnCropImageComplete
setupBottomActions()
}
override fun onCreateOptionsMenu(menu: Menu): Boolean {
menuInflater.inflate(R.menu.menu_set_wallpaper, menu)
updateMenuItemColors(menu)
return true
}
override fun onOptionsItemSelected(item: MenuItem): Boolean {
when (item.itemId) {
R.id.save -> confirmWallpaper()
else -> return super.onOptionsItemSelected(item)
}
return true
}
private fun handleImage(intent: Intent) {
uri = intent.data
if (uri.scheme != "file" && uri.scheme != "content") {
@ -81,19 +95,6 @@ class SetWallpaperActivity : SimpleActivity(), CropImageView.OnCropImageComplete
bottom_set_wallpaper_aspect_ratio.setImageResource(if (isLandscapeRatio) R.drawable.ic_minimize else R.drawable.ic_maximize)
}
override fun onCreateOptionsMenu(menu: Menu): Boolean {
menuInflater.inflate(R.menu.menu_set_wallpaper, menu)
return true
}
override fun onOptionsItemSelected(item: MenuItem): Boolean {
when (item.itemId) {
R.id.save -> confirmWallpaper()
else -> return super.onOptionsItemSelected(item)
}
return true
}
private fun changeAspectRatio(isLandscape: Boolean) {
isLandscapeRatio = isLandscape
setupAspectRatio()

View file

@ -3,6 +3,7 @@ package com.simplemobiletools.gallery.pro.activities
import android.content.Intent
import android.os.Bundle
import android.text.TextUtils
import android.view.Menu
import com.simplemobiletools.commons.dialogs.*
import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.helpers.*
@ -86,6 +87,11 @@ class SettingsActivity : SimpleActivity() {
setupImportSettings()
}
override fun onCreateOptionsMenu(menu: Menu): Boolean {
updateMenuItemColors(menu)
return super.onCreateOptionsMenu(menu)
}
private fun setupSectionColors() {
val adjustedPrimaryColor = getAdjustedPrimaryColor()
arrayListOf(visibility_label, videos_label, thumbnails_label, scrolling_label, fullscreen_media_label, security_label,

View file

@ -19,6 +19,7 @@ import android.net.Uri
import android.os.Bundle
import android.os.Handler
import android.provider.MediaStore
import android.text.Html
import android.view.Menu
import android.view.MenuItem
import android.view.View
@ -126,6 +127,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
invalidateOptionsMenu()
supportActionBar?.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
supportActionBar?.title = Html.fromHtml("<font color=#FFFFFF'>${mPath.getFilenameFromPath()}</font>")
window.statusBarColor = Color.TRANSPARENT
}
@ -189,6 +191,8 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
if (visibleBottomActions != 0) {
updateBottomActionIcons(currentMedium)
}
updateMenuItemColors(menu, baseColor = Color.BLACK)
return true
}