Skip to content
Draft
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
1 change: 1 addition & 0 deletions FlowCrypt/src/main/java/com/flowcrypt/email/Constants.kt
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class Constants {
const val PREF_KEY_INSTALL_VERSION = "pref_key_install_version"
const val PREF_KEY_SERVER_SETTINGS = "pref_key_server_settings"
const val PREF_KEY_GENERAL = "pref_key_general"
const val PREF_KEY_ATTACHMENTS_CATEGORY = "pref_key_attachments_category"

/**
* The max total size off all attachment which can be send via the app.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,11 @@ class MainSettingsFragment : BasePreferenceFragment() {
override fun onAccountInfoRefreshed(accountEntity: AccountEntity?) {
super.onAccountInfoRefreshed(accountEntity)
findPreference<Preference>(Constants.PREF_KEY_BACKUPS)?.isVisible =
!(accountEntity?.hasClientConfigurationProperty(ClientConfiguration.ConfigurationProperty.NO_PRV_BACKUP)
?: false)
accountEntity?.hasClientConfigurationProperty(
ClientConfiguration.ConfigurationProperty.NO_PRV_BACKUP
) != true

findPreference<Preference>(Constants.PREF_KEY_SERVER_SETTINGS)?.isVisible =
accountEntity?.useAPI == false

findPreference<Preference>(Constants.PREF_KEY_GENERAL)?.isVisible =
accountEntity?.isHandlingAttachmentRestricted() == false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ package com.flowcrypt.email.ui.activity.fragment.preferences

import android.os.Bundle
import android.view.View
import androidx.preference.Preference
import com.flowcrypt.email.Constants
import com.flowcrypt.email.R
import com.flowcrypt.email.database.entity.AccountEntity
import com.flowcrypt.email.extensions.androidx.fragment.app.supportActionBar
import com.flowcrypt.email.ui.activity.fragment.base.BasePreferenceFragment

Expand All @@ -25,4 +28,10 @@ open class GeneralSettingsFragment : BasePreferenceFragment() {
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
setPreferencesFromResource(R.xml.preferences_general_settings, rootKey)
}

override fun onAccountInfoRefreshed(accountEntity: AccountEntity?) {
super.onAccountInfoRefreshed(accountEntity)
findPreference<Preference>(Constants.PREF_KEY_ATTACHMENTS_CATEGORY)?.isVisible =
accountEntity?.isHandlingAttachmentRestricted() == false
}
}
2 changes: 2 additions & 0 deletions FlowCrypt/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,8 @@
<string name="general">Общиe</string>
<string name="disable_smart_mode_for_attachments_preview">Отключить интеллектуальный режим для предварительного просмотра вложений</string>
<string name="message_not_found_please_reload_the_thread">Сообщение не найдено. Похоже, оно было перемещено или удалено. Пожалуйста, перезагрузите переписку, чтобы получить последние обновления.</string>
<string name="conversation">Conversation</string>
<string name="conversation_view">Conversation view</string>
<plurals name="drafts_count">
<item quantity="one" tools:ignore="ImpliedQuantity">Черновик</item>
<item quantity="few">Черновики(%1$d)</item>
Expand Down
2 changes: 2 additions & 0 deletions FlowCrypt/src/main/res/values-uk/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,8 @@
<string name="general">Загальні</string>
<string name="disable_smart_mode_for_attachments_preview">Вимкнути розумний режим для попереднього перегляду вкладень</string>
<string name="message_not_found_please_reload_the_thread">Повідомлення не знайдено. Схоже, його перемістили або видалили. Оновіть бесіду, щоб отримати останні оновлення.</string>
<string name="conversation">Conversation</string>
<string name="conversation_view">Conversation view</string>
<plurals name="drafts_count">
<item quantity="one" tools:ignore="ImpliedQuantity">Чорновик</item>
<item quantity="few">Чорновики(%1$d)</item>
Expand Down
2 changes: 2 additions & 0 deletions FlowCrypt/src/main/res/values/preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<string name="preferences_key_manage_notifications" translatable="false">preferences_key_manage_notifications</string>
<string name="preferences_key_security_change_pass_phrase" translatable="false">preferences_key_security_change_pass_phrase</string>
<string name="preferences_key_attachments_disable_smart_mode_for_preview" translatable="false">preferences_key_attachments_disable_smart_mode_for_preview</string>
<string name="preferences_key_attachments_category" translatable="false">preferences_key_attachments_category</string>
<string name="preferences_key_conversation_view" translatable="false">preferences_key_conversation_view</string>
<string name="pref_key_backups" translatable="false">pref_key_backups</string>
<string name="pref_key_general" translatable="false">pref_key_general</string>
<string name="pref_key_server_settings" translatable="false">pref_key_server_settings</string>
Expand Down
2 changes: 2 additions & 0 deletions FlowCrypt/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,8 @@
<string name="general">General</string>
<string name="disable_smart_mode_for_attachments_preview">Disable smart mode for attachments preview</string>
<string name="message_not_found_please_reload_the_thread">Message not found. It looks like it was moved or deleted. Please reload the thread to get the latest updates.</string>
<string name="conversation">Conversation</string>
<string name="conversation_view">Conversation view</string>
<plurals name="drafts_count">
<item quantity="one">Draft</item>
<item quantity="other">Drafts(%1$d)</item>
Expand Down
18 changes: 17 additions & 1 deletion FlowCrypt/src/main/res/xml/preferences_general_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,23 @@

<PreferenceCategory
app:iconSpaceReserved="false"
app:key="attachments_category"
app:key="conversation"
app:title="@string/conversation">

<SwitchPreference
app:defaultValue="true"
app:iconSpaceReserved="false"
app:key="@string/preferences_key_conversation_view"
app:summaryOff="@string/pref_summary_disabled"
app:summaryOn="@string/pref_summary_enabled"
app:title="@string/conversation_view" />

</PreferenceCategory>

<PreferenceCategory
app:iconSpaceReserved="false"
app:isPreferenceVisible="false"
app:key="@string/preferences_key_attachments_category"
app:title="@string/attachments">

<SwitchPreference
Expand Down
3 changes: 1 addition & 2 deletions FlowCrypt/src/main/res/xml/preferences_main_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@
<Preference
android:key="@string/pref_key_general"
android:title="@string/general"
app:iconSpaceReserved="false"
app:isPreferenceVisible="false" />
app:iconSpaceReserved="false" />

<Preference
android:key="@string/pref_key_experimental"
Expand Down