diff --git a/app/src/main/java/com/nextcloud/client/editimage/EditImageActivity.kt b/app/src/main/java/com/nextcloud/client/editimage/EditImageActivity.kt index 386c1bbe8e05..665f0dc0a0b7 100644 --- a/app/src/main/java/com/nextcloud/client/editimage/EditImageActivity.kt +++ b/app/src/main/java/com/nextcloud/client/editimage/EditImageActivity.kt @@ -8,6 +8,7 @@ package com.nextcloud.client.editimage import android.graphics.Bitmap +import android.graphics.drawable.ColorDrawable import android.net.Uri import android.os.Build import android.os.Bundle @@ -16,9 +17,6 @@ import android.view.MenuItem import android.view.View import androidx.appcompat.content.res.AppCompatResources import androidx.core.content.ContextCompat -import androidx.core.graphics.drawable.DrawableCompat -import androidx.core.view.WindowCompat -import androidx.core.view.WindowInsetsCompat import com.canhub.cropper.CropImageView import com.nextcloud.client.di.Injectable import com.nextcloud.client.jobs.upload.FileUploadHelper @@ -73,21 +71,25 @@ class EditImageActivity : file = intent.extras?.getParcelableArgument(EXTRA_FILE, OCFile::class.java) ?: throw IllegalArgumentException("Missing file argument") - setSupportActionBar(binding.toolbar) - supportActionBar?.apply { - title = file.fileName - setDisplayHomeAsUpEnabled(true) - } - - val windowInsetsController = WindowCompat.getInsetsController(window, window.decorView) - windowInsetsController.hide(WindowInsetsCompat.Type.statusBars()) - - window.statusBarColor = ContextCompat.getColor(this, R.color.black) - window.navigationBarColor = getColor(R.color.black) + //NMC Customization + setupToolbar() + setupActionBar() setupCropper() } + //NMC Customization + private fun setupActionBar() { + supportActionBar?.let { + viewThemeUtils.platform.themeStatusBar(this) + it.setDisplayHomeAsUpEnabled(true) + it.setDisplayShowTitleEnabled(true) + //custom color for back arrow for NMC + viewThemeUtils.files.themeActionBar(this, it, file.fileName) + it.setBackgroundDrawable(ColorDrawable(resources.getColor(R.color.bg_default, null))) + } + } + override fun onCropImageComplete(view: CropImageView, result: CropImageView.CropResult) { if (!result.isSuccessful) { DisplayUtils.showSnackMessage(this, getString(R.string.image_editor_unable_to_edit_image)) @@ -124,14 +126,20 @@ class EditImageActivity : override fun onCreateOptionsMenu(menu: Menu?): Boolean { // add save button to action bar menuInflater.inflate(R.menu.custom_menu_placeholder, menu) - val saveIcon = AppCompatResources.getDrawable(this, R.drawable.ic_check)?.also { - DrawableCompat.setTint(it, resources.getColor(R.color.white, theme)) - } + //No need to apply NC tint here as we will be doing it later in code + val saveIcon = AppCompatResources.getDrawable(this, R.drawable.ic_tick) menu?.findItem(R.id.custom_menu_placeholder_item)?.apply { icon = saveIcon if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { contentDescription = getString(R.string.common_save) } + //NMC customization + icon = icon?.let { + viewThemeUtils.platform.colorDrawable( + it, + ContextCompat.getColor(this@EditImageActivity, R.color.fontAppbar) + ) + } } return true } diff --git a/app/src/main/res/layout/activity_edit_image.xml b/app/src/main/res/layout/activity_edit_image.xml index 4b11869ee501..257ba56fa732 100644 --- a/app/src/main/res/layout/activity_edit_image.xml +++ b/app/src/main/res/layout/activity_edit_image.xml @@ -12,15 +12,10 @@ android:layout_height="match_parent" android:background="@color/black"> - + + + app:layout_constraintTop_toBottomOf="@+id/appbar" />