WIP migrate to material design 3

This commit is contained in:
Julian Raufelder 2022-06-03 14:58:54 +02:00
parent 244dc0f8ba
commit c505f09ce0
No known key found for this signature in database
GPG Key ID: 17EE71F6634E381D
25 changed files with 183 additions and 259 deletions

View File

@ -1,21 +1,22 @@
package org.cryptomator.presentation.ui.adapter package org.cryptomator.presentation.ui.adapter
import android.content.Context
import android.text.Editable import android.text.Editable
import android.text.TextWatcher import android.text.TextWatcher
import android.view.View import android.view.View
import androidx.appcompat.content.res.AppCompatResources
import org.cryptomator.presentation.R import org.cryptomator.presentation.R
import org.cryptomator.presentation.model.SharedFileModel import org.cryptomator.presentation.model.SharedFileModel
import org.cryptomator.presentation.ui.adapter.SharedFilesAdapter.FileViewHolder import org.cryptomator.presentation.ui.adapter.SharedFilesAdapter.FileViewHolder
import org.cryptomator.presentation.util.FileIcon import org.cryptomator.presentation.util.FileIcon
import org.cryptomator.presentation.util.FileUtil import org.cryptomator.presentation.util.FileUtil
import org.cryptomator.util.Comparators import org.cryptomator.util.Comparators
import java.util.HashSet
import javax.inject.Inject import javax.inject.Inject
import kotlinx.android.synthetic.main.item_shared_files.view.fileImage
import kotlinx.android.synthetic.main.item_shared_files.view.fileName import kotlinx.android.synthetic.main.item_shared_files.view.fileName
import kotlinx.android.synthetic.main.item_shared_files.view.til_file_name
class SharedFilesAdapter @Inject class SharedFilesAdapter @Inject
constructor(private val fileUtil: FileUtil) : RecyclerViewBaseAdapter<SharedFileModel, SharedFilesAdapter.Callback, FileViewHolder>(Comparators.naturalOrder()) { constructor(private val fileUtil: FileUtil, private val context: Context) : RecyclerViewBaseAdapter<SharedFileModel, SharedFilesAdapter.Callback, FileViewHolder>(Comparators.naturalOrder()) {
interface Callback { interface Callback {
@ -55,7 +56,7 @@ constructor(private val fileUtil: FileUtil) : RecyclerViewBaseAdapter<SharedFile
itemView.fileName.removeTextChangedListener(et_file_name_watcher) itemView.fileName.removeTextChangedListener(et_file_name_watcher)
} }
val file = getItem(position) val file = getItem(position)
itemView.fileImage.setImageResource(bindFileIcon(file.fileName)) itemView.til_file_name.startIconDrawable = AppCompatResources.getDrawable(context, FileIcon.fileIconFor(file.fileName, fileUtil).iconResource)
itemView.fileName.setText(file.fileName) itemView.fileName.setText(file.fileName)
et_file_name_watcher = object : TextWatcher { et_file_name_watcher = object : TextWatcher {
override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) { override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) {
@ -73,10 +74,6 @@ constructor(private val fileUtil: FileUtil) : RecyclerViewBaseAdapter<SharedFile
} }
itemView.fileName.addTextChangedListener(et_file_name_watcher) itemView.fileName.addTextChangedListener(et_file_name_watcher)
} }
private fun bindFileIcon(fileName: String): Int {
return FileIcon.fileIconFor(fileName, fileUtil).iconResource
}
} }
} }

View File

@ -9,7 +9,7 @@ import androidx.appcompat.app.AlertDialog
import org.cryptomator.generator.Dialog import org.cryptomator.generator.Dialog
import org.cryptomator.presentation.R import org.cryptomator.presentation.R
import org.cryptomator.presentation.util.FileUtil import org.cryptomator.presentation.util.FileUtil
import kotlinx.android.synthetic.main.dialog_file_name.file_name import kotlinx.android.synthetic.main.dialog_file_name.et_file_name
@Dialog(R.layout.dialog_file_name) @Dialog(R.layout.dialog_file_name)
class FileNameDialog : BaseProgressErrorDialog<FileNameDialog.Callback>() { class FileNameDialog : BaseProgressErrorDialog<FileNameDialog.Callback>() {
@ -28,20 +28,20 @@ class FileNameDialog : BaseProgressErrorDialog<FileNameDialog.Callback>() {
createFileButton = dialog.getButton(android.app.Dialog.BUTTON_POSITIVE) createFileButton = dialog.getButton(android.app.Dialog.BUTTON_POSITIVE)
createFileButton?.setOnClickListener { createFileButton?.setOnClickListener {
callback?.onCreateNewTextFileClicked(effectiveTextFileName()) callback?.onCreateNewTextFileClicked(effectiveTextFileName())
onWaitForResponse(file_name) onWaitForResponse(et_file_name)
} }
dialog.setCanceledOnTouchOutside(false) dialog.setCanceledOnTouchOutside(false)
file_name.requestFocus() et_file_name.requestFocus()
createFileButton?.let { button -> createFileButton?.let { button ->
file_name.nextFocusForwardId = button.id et_file_name.nextFocusForwardId = button.id
} }
} }
} }
private fun effectiveTextFileName(): String { private fun effectiveTextFileName(): String {
return if (file_name.text.toString().isEmpty()) // return if (et_file_name.text.toString().isEmpty()) //
requireContext().getString(R.string.dialog_file_name_placeholder) else // requireContext().getString(R.string.dialog_file_name_placeholder) else //
effectiveNewFileName(file_name.text.toString()) effectiveNewFileName(et_file_name.text.toString())
} }
override fun setupDialog(builder: AlertDialog.Builder): android.app.Dialog { override fun setupDialog(builder: AlertDialog.Builder): android.app.Dialog {
@ -60,8 +60,8 @@ class FileNameDialog : BaseProgressErrorDialog<FileNameDialog.Callback>() {
} }
override fun setupView() { override fun setupView() {
createFileButton?.let { registerOnEditorDoneActionAndPerformButtonClick(file_name) { it } } createFileButton?.let { registerOnEditorDoneActionAndPerformButtonClick(et_file_name) { it } }
file_name.addTextChangedListener(object : TextWatcher { et_file_name.addTextChangedListener(object : TextWatcher {
override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) {} override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) {}
override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) {} override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) {}
override fun afterTextChanged(s: Editable) { override fun afterTextChanged(s: Editable) {
@ -75,6 +75,6 @@ class FileNameDialog : BaseProgressErrorDialog<FileNameDialog.Callback>() {
} }
override fun enableViewAfterError(): View { override fun enableViewAfterError(): View {
return file_name return et_file_name
} }
} }

View File

@ -12,7 +12,7 @@ import androidx.core.content.ContextCompat
import androidx.preference.Preference import androidx.preference.Preference
import androidx.preference.PreferenceCategory import androidx.preference.PreferenceCategory
import androidx.preference.PreferenceFragmentCompat import androidx.preference.PreferenceFragmentCompat
import androidx.preference.SwitchPreferenceCompat import androidx.preference.SwitchPreference
import org.cryptomator.presentation.BuildConfig import org.cryptomator.presentation.BuildConfig
import org.cryptomator.presentation.R import org.cryptomator.presentation.R
import org.cryptomator.presentation.service.PhotoContentJob import org.cryptomator.presentation.service.PhotoContentJob
@ -242,17 +242,17 @@ class SettingsFragment : PreferenceFragmentCompat() {
fun deactivateDebugMode() { fun deactivateDebugMode() {
sharedPreferencesHandler.setDebugMode(false) sharedPreferencesHandler.setDebugMode(false)
(findPreference(SharedPreferencesHandler.DEBUG_MODE) as SwitchPreferenceCompat?)?.isChecked = false (findPreference(SharedPreferencesHandler.DEBUG_MODE) as SwitchPreference?)?.isChecked = false
} }
fun disableAppWhenObscured() { fun disableAppWhenObscured() {
sharedPreferencesHandler.setDisableAppWhenObscured(true) sharedPreferencesHandler.setDisableAppWhenObscured(true)
(findPreference(SharedPreferencesHandler.DISABLE_APP_WHEN_OBSCURED) as SwitchPreferenceCompat?)?.isChecked = true (findPreference(SharedPreferencesHandler.DISABLE_APP_WHEN_OBSCURED) as SwitchPreference?)?.isChecked = true
} }
fun secureScreen() { fun secureScreen() {
sharedPreferencesHandler.setSecureScreen(true) sharedPreferencesHandler.setSecureScreen(true)
(findPreference(SharedPreferencesHandler.SECURE_SCREEN) as SwitchPreferenceCompat?)?.isChecked = true (findPreference(SharedPreferencesHandler.SECURE_SCREEN) as SwitchPreference?)?.isChecked = true
} }
private fun onSendErrorReportClicked() { private fun onSendErrorReportClicked() {
@ -289,7 +289,7 @@ class SettingsFragment : PreferenceFragmentCompat() {
} else { } else {
PhotoContentJob.cancelJob(activity().applicationContext) PhotoContentJob.cancelJob(activity().applicationContext)
} }
(findPreference(SharedPreferencesHandler.PHOTO_UPLOAD) as SwitchPreferenceCompat?)?.isChecked = enabled (findPreference(SharedPreferencesHandler.PHOTO_UPLOAD) as SwitchPreference?)?.isChecked = enabled
} }
fun rootView(): View { fun rootView(): View {

View File

@ -31,7 +31,6 @@
<Button <Button
android:id="@+id/createVaultButton" android:id="@+id/createVaultButton"
style="?android:textAppearanceSmall"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="16dp" android:layout_marginTop="16dp"

View File

@ -5,7 +5,6 @@
android:layout_height="match_parent"> android:layout_height="match_parent">
<LinearLayout <LinearLayout
style="@style/BottomSheetBackground"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical"

View File

@ -5,7 +5,6 @@
android:layout_height="match_parent"> android:layout_height="match_parent">
<LinearLayout <LinearLayout
style="@style/BottomSheetBackground"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical"

View File

@ -5,7 +5,6 @@
android:layout_height="match_parent"> android:layout_height="match_parent">
<LinearLayout <LinearLayout
style="@style/BottomSheetBackground"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical"

View File

@ -5,7 +5,6 @@
android:layout_height="match_parent"> android:layout_height="match_parent">
<LinearLayout <LinearLayout
style="@style/BottomSheetBackground"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical"

View File

@ -5,7 +5,6 @@
android:layout_height="match_parent"> android:layout_height="match_parent">
<LinearLayout <LinearLayout
style="@style/BottomSheetBackground"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical"

View File

@ -5,7 +5,6 @@
android:layout_height="match_parent"> android:layout_height="match_parent">
<LinearLayout <LinearLayout
style="@style/BottomSheetBackground"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical"

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android" <androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
@ -8,16 +9,11 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:padding="@dimen/activity_vertical_margin"> android:padding="@dimen/activity_vertical_margin">
<LinearLayout <com.google.android.material.textfield.TextInputLayout
android:id="@+id/ll_folder" android:id="@+id/til_folder"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal"> app:startIconDrawable="@drawable/node_folder">
<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@drawable/node_folder" />
<com.google.android.material.textfield.TextInputEditText <com.google.android.material.textfield.TextInputEditText
android:id="@+id/et_folder_name" android:id="@+id/et_folder_name"
@ -26,20 +22,19 @@
android:imeOptions="actionDone|flagNoPersonalizedLearning" android:imeOptions="actionDone|flagNoPersonalizedLearning"
android:inputType="text" android:inputType="text"
android:maxLines="1" /> android:maxLines="1" />
</LinearLayout> </com.google.android.material.textfield.TextInputLayout>
<include <include
layout="@layout/view_dialog_progress" layout="@layout/view_dialog_progress"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/ll_folder" /> android:layout_below="@id/til_folder" />
<include <include
layout="@layout/view_dialog_error" layout="@layout/view_dialog_error"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/ll_folder" /> android:layout_below="@id/til_folder" />
</RelativeLayout> </RelativeLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<org.cryptomator.presentation.ui.layout.ObscuredAwareDialogCoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" <org.cryptomator.presentation.ui.layout.ObscuredAwareDialogCoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/dssialogRootView" android:id="@+id/dssialogRootView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
@ -20,17 +21,12 @@
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:text="@string/dialog_enter_license_content" /> android:text="@string/dialog_enter_license_content" />
<LinearLayout <com.google.android.material.textfield.TextInputLayout
android:id="@+id/ll_license" android:id="@+id/til_license"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/tv_message" android:layout_below="@id/tv_message"
android:orientation="horizontal"> app:startIconDrawable="@drawable/ic_license_key">
<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@drawable/ic_license_key" />
<com.google.android.material.textfield.TextInputEditText <com.google.android.material.textfield.TextInputEditText
android:id="@+id/et_license" android:id="@+id/et_license"
@ -38,19 +34,19 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:imeOptions="actionDone|flagNoPersonalizedLearning" android:imeOptions="actionDone|flagNoPersonalizedLearning"
android:inputType="text" /> android:inputType="text" />
</LinearLayout> </com.google.android.material.textfield.TextInputLayout>
<include <include
layout="@layout/view_dialog_progress" layout="@layout/view_dialog_progress"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/til_password" /> android:layout_below="@+id/til_license" />
<include <include
layout="@layout/view_dialog_error" layout="@layout/view_dialog_error"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/ll_license" /> android:layout_below="@+id/til_license" />
</RelativeLayout> </RelativeLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>

View File

@ -8,25 +8,32 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="@dimen/global_padding"> android:padding="@dimen/global_padding">
<com.google.android.material.textfield.TextInputEditText <com.google.android.material.textfield.TextInputLayout
android:id="@+id/file_name" android:id="@+id/til_file_name"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content">
android:hint="@string/dialog_file_name_placeholder"
android:imeOptions="flagNoPersonalizedLearning" <com.google.android.material.textfield.TextInputEditText
android:inputType="text" android:id="@+id/et_file_name"
android:maxLines="1" /> android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/dialog_file_name_hint"
android:text="@string/dialog_file_name_placeholder"
android:imeOptions="flagNoPersonalizedLearning"
android:inputType="text"
android:maxLines="1" />
</com.google.android.material.textfield.TextInputLayout>
<include <include
layout="@layout/view_dialog_progress" layout="@layout/view_dialog_progress"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/file_name" /> android:layout_below="@+id/til_file_name" />
<include <include
layout="@layout/view_dialog_error" layout="@layout/view_dialog_error"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/file_name" /> android:layout_below="@+id/til_file_name" />
</RelativeLayout> </RelativeLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>

View File

@ -8,25 +8,31 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:padding="@dimen/activity_vertical_margin"> android:padding="@dimen/activity_vertical_margin">
<com.google.android.material.textfield.TextInputEditText <com.google.android.material.textfield.TextInputLayout
android:id="@+id/et_rename" android:id="@+id/til_rename"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content">
android:imeOptions="flagNoPersonalizedLearning"
android:inputType="text" <com.google.android.material.textfield.TextInputEditText
android:maxLines="1" android:id="@+id/et_rename"
android:selectAllOnFocus="true" /> android:layout_width="match_parent"
android:layout_height="wrap_content"
android:imeOptions="flagNoPersonalizedLearning"
android:inputType="text"
android:maxLines="1"
android:selectAllOnFocus="true" />
</com.google.android.material.textfield.TextInputLayout>
<include <include
layout="@layout/view_dialog_progress" layout="@layout/view_dialog_progress"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/et_rename" /> android:layout_below="@+id/til_rename" />
<include <include
layout="@layout/view_dialog_error" layout="@layout/view_dialog_error"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/et_rename" /> android:layout_below="@+id/til_rename" />
</RelativeLayout> </RelativeLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>

View File

@ -52,7 +52,6 @@
<Button <Button
android:id="@+id/createVaultButton" android:id="@+id/createVaultButton"
style="?android:textAppearanceSmall"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="16dp" android:layout_marginTop="16dp"

View File

@ -110,7 +110,6 @@
<Button <Button
android:id="@+id/createCloudButton" android:id="@+id/createCloudButton"
style="?android:textAppearanceSmall"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="16dp" android:layout_marginTop="16dp"

View File

@ -63,7 +63,6 @@
<Button <Button
android:id="@+id/createCloudButton" android:id="@+id/createCloudButton"
style="?android:textAppearanceSmall"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="16dp" android:layout_marginTop="16dp"

View File

@ -43,7 +43,6 @@
<Button <Button
android:id="@+id/chooseFolderLocation" android:id="@+id/chooseFolderLocation"
style="@style/Widget.AppCompat.Button"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerVertical="true" android:layout_centerVertical="true"

View File

@ -1,35 +1,33 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="48dp"> android:layout_height="64dp">
<ImageView <com.google.android.material.textfield.TextInputLayout
android:id="@+id/fileImage" android:id="@+id/til_file_name"
android:layout_width="@dimen/thumbnail_size"
android:layout_height="@dimen/thumbnail_size"
android:layout_centerVertical="true"
android:layout_marginStart="16dp"
android:src="@drawable/node_file_image" />
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/fileName"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
android:layout_marginEnd="16dp" android:layout_marginEnd="16dp"
android:layout_toEndOf="@+id/fileImage" app:startIconDrawable="@drawable/node_file_image"
android:ellipsize="middle" app:startIconTint="@null">
android:imeOptions="flagNoPersonalizedLearning"
android:inputType="text" <com.google.android.material.textfield.TextInputEditText
android:singleLine="true" /> android:id="@+id/fileName"
<!-- using android:singleLine to fix https://code.google.com/p/android/issues/detail?id=33868 --> android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:ellipsize="middle"
android:imeOptions="flagNoPersonalizedLearning"
android:inputType="text" />
</com.google.android.material.textfield.TextInputLayout>
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="1dp" android:layout_height="1dp"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
android:layout_toEndOf="@+id/fileImage" android:layout_toEndOf="@+id/til_file_name"
android:background="@color/list_divider" /> android:background="@color/list_divider" />
</RelativeLayout> </RelativeLayout>

View File

@ -1,13 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.appcompat.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" <com.google.android.material.appbar.MaterialToolbar xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar" android:id="@+id/toolbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="?attr/colorPrimary" android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize" android:minHeight="?attr/actionBarSize"
android:theme="@style/Toolbar.Theme" app:layout_collapseMode="pin" />
app:layout_collapseMode="pin"
app:popupTheme="@style/Theme.AppCompat.DayNight.NoActionBar"
app:subtitleTextAppearance="@style/Toolbar.SubtitleText"
app:titleTextAppearance="@style/Toolbar.TitleText" />

View File

@ -1,124 +1,16 @@
<resources> <resources>
<!-- Base application theme. --> <style name="AppTheme.Snackbar" parent="Widget.Material3.Snackbar">
<style name="AppTheme" parent="AppTheme.Base" /> <item name="materialThemeOverlay">@style/Snackbar</item>
<item name="backgroundTint">@color/colorBlack</item>
<style name="Theme.AppCompat.DayNight" parent="Theme.AppCompat" />
<style name="AppTheme.Base" parent="Theme.AppCompat.DayNight.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorPrimary</item>
<item name="alertDialogTheme">@style/AlertDialogCustom</item>
<item name="android:windowAnimationStyle">@style/CustomActivityAnimation</item>
<item name="preferenceTheme">@style/PreferenceTheme</item>
<item name="preferenceStyle">@style/PreferenceTheme</item>
<item name="android:fontFamily">@font/open_sans</item>
</style> </style>
<style name="AppTheme.Starting" parent="Theme.SplashScreen.IconBackground"> <style name="Snackbar" parent="">
<item name="windowSplashScreenBackground">@color/colorPrimary</item> <item name="backgroundTint">@color/colorBlack</item>
<item name="windowSplashScreenAnimatedIcon">@drawable/ic_launcher_foreground</item>
<item name="windowSplashScreenIconBackgroundColor">@color/material_grey_850</item>
<item name="postSplashScreenTheme">@style/AppTheme</item>
</style> </style>
<style name="PreferenceTheme" parent="PreferenceThemeOverlay"> <style name="ModalBottomSheet" parent="Widget.Material3.BottomSheet.Modal">
<item name="android:textColor">@color/textColorWhite</item> <item name="backgroundTint">@color/colorBlack</item>
<item name="android:textColorPrimary">@color/colorPrimary</item>
<item name="android:textColorSecondary">@color/textColorLight</item>
</style>
<style name="AlertDialogCustom" parent="Theme.AppCompat.DayNight.Dialog.Alert">
<item name="colorAccent">@color/colorPrimary</item>
</style>
<style name="Toolbar.Theme" parent="ThemeOverlay.AppCompat.Dark.ActionBar">
<item name="colorAccent">@color/textColorWhite</item>
</style>
<style name="AppTheme.Hint">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_centerVertical">true</item>
<item name="android:layout_centerHorizontal">true</item>
<item name="android:layout_gravity">center</item>
</style>
<style name="AppTheme.ProgressBar">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_centerInParent">true</item>
<item name="android:layout_gravity">center</item>
<item name="android:visibility">visible</item>
</style>
<style name="AppTheme.RetryButton">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_centerVertical">true</item>
<item name="android:layout_centerHorizontal">true</item>
<item name="android:layout_gravity">center</item>
</style>
<style name="AppTheme.ListItem">
<item name="android:gravity">center_vertical</item>
<item name="android:layout_height">48dp</item>
<item name="android:textSize">16sp</item>
<item name="android:layout_width">match_parent</item>
<item name="android:layout_marginStart">16dp</item>
<item name="android:layout_marginEnd">16dp</item>
<item name="android:paddingBottom">16dp</item>
<item name="android:drawablePadding">32dp</item>
<item name="android:clickable">true</item>
<item name="android:focusable">true</item>
</style>
<style name="AppTheme.ListItemDarkTextColor">
<item name="android:textColor">@color/textColorPrimary</item>
</style>
<style name="AppTheme.ListItemLightTextColor">
<item name="android:textColor">@color/textColorLight</item>
</style>
<style name="BottomSheetBackground" parent="AppTheme">
<item name="android:background">@color/colorGray</item>
</style>
<style name="Toolbar.TitleText" parent="TextAppearance.Widget.AppCompat.Toolbar.Title">
<item name="android:textSize">20sp</item>
<item name="android:textColor">@color/textColorWhite</item>
<item name="android:fontFamily">@font/quicksand_medium</item>
</style>
<style name="Toolbar.SubtitleText" parent="TextAppearance.Widget.AppCompat.Toolbar.Subtitle">
<item name="android:textSize">14sp</item>
<item name="android:fontFamily">@font/quicksand_medium</item>
</style>
<style name="CustomActivityAnimation" parent="@android:style/Animation.Activity">
<item name="android:activityOpenEnterAnimation">@anim/slide_in_right</item>
<item name="android:activityOpenExitAnimation">@anim/slide_out_left</item>
<item name="android:activityCloseEnterAnimation">@anim/slide_in_left</item>
<item name="android:activityCloseExitAnimation">@anim/slide_out_right</item>
</style>
<style name="Theme.Transparent" parent="@style/Theme.AppCompat.DayNight.NoActionBar">
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:colorBackgroundCacheHint">@null</item>
<!-- windowIsTranslucent=false due to https://issuetracker.google.com/issues/68454482 see #467 -->
<item name="android:windowIsTranslucent">false</item>
<item name="android:windowAnimationStyle">@null</item>
</style>
<style name="FullscreenTheme" parent="AppTheme">
<item name="android:windowBackground">@null</item>
</style> </style>
</resources> </resources>

View File

@ -4,6 +4,8 @@
<color name="colorPrimaryTransparent">#66CC68</color> <color name="colorPrimaryTransparent">#66CC68</color>
<color name="colorPrimaryDark">#407F41</color> <color name="colorPrimaryDark">#407F41</color>
<color name="colorSecondary">#008A7B</color>
<color name="textColorPrimary">#222222</color> <color name="textColorPrimary">#222222</color>
<color name="textColorWhite">#F7F7F7</color> <color name="textColorWhite">#F7F7F7</color>
<color name="textColorLight">#9E9E9E</color> <color name="textColorLight">#9E9E9E</color>

View File

@ -381,6 +381,7 @@
<string name="dialog_unsaved_changes_save" translatable="false">@string/screen_share_files_save_button_text</string> <string name="dialog_unsaved_changes_save" translatable="false">@string/screen_share_files_save_button_text</string>
<string name="dialog_file_name_title" translatable="false">@string/screen_file_browser_action_create_new_text_file</string> <string name="dialog_file_name_title" translatable="false">@string/screen_file_browser_action_create_new_text_file</string>
<string name="dialog_file_name_hint">File name</string>
<string name="dialog_file_name_create" translatable="false">@string/screen_enter_vault_name_button_text</string> <string name="dialog_file_name_create" translatable="false">@string/screen_enter_vault_name_button_text</string>
<string name="dialog_file_name_cancel" translatable="false">@string/dialog_button_cancel</string> <string name="dialog_file_name_cancel" translatable="false">@string/dialog_button_cancel</string>
<string name="dialog_file_name_placeholder">text.txt</string> <string name="dialog_file_name_placeholder">text.txt</string>

View File

@ -3,20 +3,27 @@
<!-- Base application theme. --> <!-- Base application theme. -->
<style name="AppTheme" parent="AppTheme.Base" /> <style name="AppTheme" parent="AppTheme.Base" />
<style name="Theme.AppCompat.DayNight" parent="Theme.AppCompat.Light" /> <style name="Theme.AppCompat.DayNight" parent="Theme.Material3.Light" />
<style name="AppTheme.Base" parent="Theme.AppCompat.DayNight.NoActionBar"> <style name="AppTheme.Base" parent="Theme.Material3.DayNight.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorPrimaryDark">@color/colorPrimary</item>
<item name="colorAccent">@color/colorPrimary</item> <item name="colorAccent">@color/colorPrimaryTransparent</item>
<item name="colorOnPrimary">@color/colorWhite</item>
<item name="colorError">@color/textColorError</item>
<item name="android:textColorHighlight">@color/colorPrimaryTransparent</item>
<item name="alertDialogTheme">@style/AlertDialogCustom</item>
<item name="android:windowAnimationStyle">@style/CustomActivityAnimation</item> <item name="android:windowAnimationStyle">@style/CustomActivityAnimation</item>
<item name="preferenceTheme">@style/PreferenceTheme</item>
<item name="preferenceStyle">@style/PreferenceTheme</item>
<item name="android:fontFamily">@font/open_sans</item> <item name="android:fontFamily">@font/open_sans</item>
<item name="floatingActionButtonStyle">@style/AppTheme.FloatingActionButton</item>
<item name="toolbarStyle">@style/AppTheme.Toolbar</item>
<item name="snackbarStyle">@style/AppTheme.Snackbar</item>
<item name="snackbarButtonStyle">@style/AppTheme.SnackbarButton</item>
<item name="snackbarTextViewStyle">@style/AppTheme.SnackbarTextview</item>
<item name="preferenceTheme">@style/PreferenceTheme</item>
<item name="bottomSheetDialogTheme">@style/ModalBottomSheetDialog</item>
</style> </style>
<style name="AppTheme.Starting" parent="Theme.SplashScreen.IconBackground"> <style name="AppTheme.Starting" parent="Theme.SplashScreen.IconBackground">
@ -26,20 +33,6 @@
<item name="postSplashScreenTheme">@style/AppTheme</item> <item name="postSplashScreenTheme">@style/AppTheme</item>
</style> </style>
<style name="PreferenceTheme" parent="PreferenceThemeOverlay">
<item name="android:textColor">@color/textColorPrimary</item>
<item name="android:textColorPrimary">@color/colorPrimary</item>
<item name="android:textColorSecondary">@color/textColorLight</item>
</style>
<style name="AlertDialogCustom" parent="Theme.AppCompat.DayNight.Dialog.Alert">
<item name="colorAccent">@color/colorPrimary</item>
</style>
<style name="Toolbar.Theme" parent="ThemeOverlay.AppCompat.Dark.ActionBar">
<item name="colorAccent">@color/textColorWhite</item>
</style>
<style name="AppTheme.Hint"> <style name="AppTheme.Hint">
<item name="android:layout_width">wrap_content</item> <item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item> <item name="android:layout_height">wrap_content</item>
@ -85,17 +78,69 @@
<item name="android:textColor">@color/textColorLight</item> <item name="android:textColor">@color/textColorLight</item>
</style> </style>
<style name="BottomSheetBackground" parent="AppTheme" /> <style name="AppTheme.Toolbar" parent="Widget.Material3.Toolbar">
<item name="materialThemeOverlay">@style/Toolbar</item>
<style name="Toolbar.TitleText" parent="TextAppearance.Widget.AppCompat.Toolbar.Title"> <item name="titleTextAppearance">@style/Toolbar.TitleText</item>
<item name="android:textSize">20sp</item> <item name="subtitleTextAppearance">@style/Toolbar.SubtitleText</item>
<item name="android:textColor">@color/textColorWhite</item>
<item name="android:fontFamily">@font/quicksand_medium</item>
</style> </style>
<style name="Toolbar.SubtitleText" parent="TextAppearance.Widget.AppCompat.Toolbar.Subtitle"> <style name="Toolbar" parent="">
<item name="android:textSize">14sp</item> <item name="colorOnSurface">@color/colorWhite</item>
<item name="colorOnPrimary">@color/colorWhite</item>
<item name="colorOnSurfaceVariant">@color/colorWhite</item>
<item name="colorControlNormal">@color/colorWhite</item>
<item name="android:editTextColor">@color/colorWhite</item>
</style>
<style name="Toolbar.TitleText" parent="TextAppearance.Material3.TitleLarge">
<item name="fontFamily">@font/quicksand_medium</item>
<item name="android:fontFamily">@font/quicksand_medium</item> <item name="android:fontFamily">@font/quicksand_medium</item>
<item name="android:textColor">@color/colorWhite</item>
</style>
<style name="Toolbar.SubtitleText" parent="TextAppearance.Material3.TitleMedium">
<item name="fontFamily">@font/quicksand_medium</item>
<item name="android:fontFamily">@font/quicksand_medium</item>
<item name="android:textColor">@color/colorWhite</item>
</style>
<style name="AppTheme.Snackbar" parent="Widget.Material3.Snackbar">
<item name="materialThemeOverlay">@style/Snackbar</item>
<item name="backgroundTint">@color/colorWhite</item>
</style>
<style name="Snackbar" parent="">
<item name="backgroundTint">@color/colorWhite</item>
</style>
<style name="AppTheme.SnackbarButton" parent="Widget.Material3.Button.TextButton.Snackbar">
<item name="android:textColor">@color/colorPrimary</item>
</style>
<style name="AppTheme.SnackbarTextview" parent="Widget.Material3.Snackbar.TextView">
<item name="android:textColor">@color/textColorPrimary</item>
</style>
<style name="AppTheme.FloatingActionButton" parent="Widget.Material3.FloatingActionButton.Primary">
<item name="materialThemeOverlay">@style/FloatingActionButton</item>
</style>
<style name="FloatingActionButton" parent="">
<item name="colorContainer">@color/colorPrimary</item>
<item name="colorOnContainer">@color/colorWhite</item>
</style>
<style name="PreferenceTheme" parent="@style/BasePreferenceThemeOverlay">
<item name="preferenceCategoryTitleTextColor">@color/colorPrimary</item>
<item name="android:textColor">@color/textColorPrimary</item>
</style>
<style name="ModalBottomSheetDialog" parent="ThemeOverlay.Material3.BottomSheetDialog">
<item name="bottomSheetStyle">@style/ModalBottomSheet</item>
</style>
<style name="ModalBottomSheet" parent="Widget.Material3.BottomSheet.Modal">
<item name="backgroundTint">@color/colorWhite</item>
</style> </style>
<style name="CustomActivityAnimation" parent="@android:style/Animation.Activity"> <style name="CustomActivityAnimation" parent="@android:style/Animation.Activity">
@ -105,7 +150,7 @@
<item name="android:activityCloseExitAnimation">@anim/slide_out_right</item> <item name="android:activityCloseExitAnimation">@anim/slide_out_right</item>
</style> </style>
<style name="Theme.Transparent" parent="@style/Theme.AppCompat.DayNight.NoActionBar"> <style name="Theme.Transparent" parent="@style/Theme.Material3.DayNight.NoActionBar">
<item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="android:windowNoTitle">true</item> <item name="android:windowNoTitle">true</item>
<item name="android:windowBackground">@android:color/transparent</item> <item name="android:windowBackground">@android:color/transparent</item>

View File

@ -24,13 +24,13 @@
android:key="biometricAuthentication" android:key="biometricAuthentication"
android:title="@string/screen_settings_biometric_auth" /> android:title="@string/screen_settings_biometric_auth" />
<androidx.preference.SwitchPreferenceCompat <SwitchPreference
android:defaultValue="true" android:defaultValue="true"
android:key="disableAppWhenObscured" android:key="disableAppWhenObscured"
android:summary="@string/screen_settings_block_app_when_obscured_summary" android:summary="@string/screen_settings_block_app_when_obscured_summary"
android:title="@string/screen_settings_block_app_when_obscured" /> android:title="@string/screen_settings_block_app_when_obscured" />
<androidx.preference.SwitchPreferenceCompat <SwitchPreference
android:defaultValue="true" android:defaultValue="true"
android:key="secureScreen" android:key="secureScreen"
android:summary="@string/screen_settings_secure_screen_summary" android:summary="@string/screen_settings_secure_screen_summary"
@ -54,13 +54,13 @@
<PreferenceCategory android:title="@string/screen_settings_section_search"> <PreferenceCategory android:title="@string/screen_settings_section_search">
<androidx.preference.SwitchPreferenceCompat <SwitchPreference
android:defaultValue="false" android:defaultValue="false"
android:key="liveSearch" android:key="liveSearch"
android:summary="@string/screen_settings_live_search_summary" android:summary="@string/screen_settings_live_search_summary"
android:title="@string/screen_settings_live_search" /> android:title="@string/screen_settings_live_search" />
<androidx.preference.SwitchPreferenceCompat <SwitchPreference
android:defaultValue="false" android:defaultValue="false"
android:key="globSearch" android:key="globSearch"
android:summary="@string/screen_settings_glob_search_summary" android:summary="@string/screen_settings_glob_search_summary"
@ -72,7 +72,7 @@
android:key="@string/screen_settings_section_auto_lock" android:key="@string/screen_settings_section_auto_lock"
android:title="@string/screen_settings_section_auto_lock"> android:title="@string/screen_settings_section_auto_lock">
<androidx.preference.SwitchPreferenceCompat <SwitchPreference
android:defaultValue="true" android:defaultValue="true"
android:key="lockOnScreenOff" android:key="lockOnScreenOff"
android:title="@string/screen_settings_auto_lock_on_screen_lock" /> android:title="@string/screen_settings_auto_lock_on_screen_lock" />
@ -92,24 +92,24 @@
android:key="@string/screen_settings_section_auto_photo_upload" android:key="@string/screen_settings_section_auto_photo_upload"
android:title="@string/screen_settings_section_auto_photo_upload"> android:title="@string/screen_settings_section_auto_photo_upload">
<androidx.preference.SwitchPreferenceCompat <SwitchPreference
android:defaultValue="false" android:defaultValue="false"
android:key="photoUpload" android:key="photoUpload"
android:summary="@string/screen_settings_section_auto_photo_upload_toggle_summary" android:summary="@string/screen_settings_section_auto_photo_upload_toggle_summary"
android:title="@string/screen_settings_section_auto_photo_upload_toggle" /> android:title="@string/screen_settings_section_auto_photo_upload_toggle" />
<androidx.preference.SwitchPreferenceCompat <SwitchPreference
android:defaultValue="true" android:defaultValue="true"
android:key="photoUploadInstant" android:key="photoUploadInstant"
android:summary="@string/screen_settings_section_auto_photo_upload_toggle_instant_upload_summary" android:summary="@string/screen_settings_section_auto_photo_upload_toggle_instant_upload_summary"
android:title="@string/screen_settings_section_auto_photo_upload_toggle_instant_upload" /> android:title="@string/screen_settings_section_auto_photo_upload_toggle_instant_upload" />
<androidx.preference.SwitchPreferenceCompat <SwitchPreference
android:defaultValue="true" android:defaultValue="true"
android:key="photoUploadOnlyUsingWifi" android:key="photoUploadOnlyUsingWifi"
android:title="@string/screen_settings_section_auto_photo_upload_only_wifi_toggle" /> android:title="@string/screen_settings_section_auto_photo_upload_only_wifi_toggle" />
<androidx.preference.SwitchPreferenceCompat <SwitchPreference
android:defaultValue="false" android:defaultValue="false"
android:key="photoUploadIncludingVideos" android:key="photoUploadIncludingVideos"
android:title="@string/screen_settings_section_auto_photo_upload_including_videos" /> android:title="@string/screen_settings_section_auto_photo_upload_including_videos" />
@ -122,7 +122,7 @@
<PreferenceCategory android:title="@string/screen_settings_lru_cache"> <PreferenceCategory android:title="@string/screen_settings_lru_cache">
<androidx.preference.SwitchPreferenceCompat <SwitchPreference
android:defaultValue="true" android:defaultValue="true"
android:key="lruCache" android:key="lruCache"
android:summary="@string/screen_settings_lru_cache_toggle_summary" android:summary="@string/screen_settings_lru_cache_toggle_summary"
@ -155,7 +155,7 @@
android:data="@string/screen_settings_support_uri" /> android:data="@string/screen_settings_support_uri" />
</androidx.preference.PreferenceScreen> </androidx.preference.PreferenceScreen>
<androidx.preference.SwitchPreferenceCompat <SwitchPreference
android:defaultValue="false" android:defaultValue="false"
android:key="debugMode" android:key="debugMode"
android:title="@string/screen_settings_debug_mode_label" /> android:title="@string/screen_settings_debug_mode_label" />
@ -168,13 +168,13 @@
<PreferenceCategory android:title="@string/screen_settings_advanced_settings"> <PreferenceCategory android:title="@string/screen_settings_advanced_settings">
<androidx.preference.SwitchPreferenceCompat <SwitchPreference
android:defaultValue="true" android:defaultValue="true"
android:key="backgroundUnlockPreparation" android:key="backgroundUnlockPreparation"
android:summary="@string/screen_settings_background_unlock_preparation_label_summary" android:summary="@string/screen_settings_background_unlock_preparation_label_summary"
android:title="@string/screen_settings_background_unlock_preparation_label" /> android:title="@string/screen_settings_background_unlock_preparation_label" />
<androidx.preference.SwitchPreferenceCompat <SwitchPreference
android:defaultValue="false" android:defaultValue="false"
android:key="keepUnlockedWhileEditing" android:key="keepUnlockedWhileEditing"
android:summary="@string/screen_settings_keep_unlocked_while_editing_files_summary" android:summary="@string/screen_settings_keep_unlocked_while_editing_files_summary"