mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
Setting to hide UUID #757
This commit is contained in:
@@ -123,6 +123,12 @@ object PreferencesUtil {
|
||||
context.resources.getBoolean(R.bool.hide_expired_entries_default))
|
||||
}
|
||||
|
||||
fun showUUID(context: Context): Boolean {
|
||||
val prefs = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
return prefs.getBoolean(context.getString(R.string.show_uuid_key),
|
||||
context.resources.getBoolean(R.bool.show_uuid_default))
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the text size in % (1 for 100%)
|
||||
*/
|
||||
|
||||
@@ -43,6 +43,7 @@ import com.kunzisoft.keepass.model.EntryAttachmentState
|
||||
import com.kunzisoft.keepass.model.StreamDirection
|
||||
import com.kunzisoft.keepass.otp.OtpElement
|
||||
import com.kunzisoft.keepass.otp.OtpType
|
||||
import com.kunzisoft.keepass.settings.PreferencesUtil
|
||||
import java.util.*
|
||||
|
||||
|
||||
@@ -78,6 +79,7 @@ class EntryContentsView @JvmOverloads constructor(context: Context,
|
||||
private val historyListView: RecyclerView
|
||||
private val historyAdapter = EntryHistoryAdapter(context)
|
||||
|
||||
private val uuidContainerView: View
|
||||
private val uuidView: TextView
|
||||
private val uuidReferenceView: TextView
|
||||
|
||||
@@ -126,6 +128,10 @@ class EntryContentsView @JvmOverloads constructor(context: Context,
|
||||
adapter = historyAdapter
|
||||
}
|
||||
|
||||
uuidContainerView = findViewById(R.id.entry_UUID_container)
|
||||
uuidContainerView?.apply {
|
||||
visibility = if (PreferencesUtil.showUUID(context)) View.VISIBLE else View.GONE
|
||||
}
|
||||
uuidView = findViewById(R.id.entry_UUID)
|
||||
uuidReferenceView = findViewById(R.id.entry_UUID_reference)
|
||||
}
|
||||
|
||||
@@ -299,6 +299,7 @@
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/entry_UUID_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/card_view_margin"
|
||||
|
||||
@@ -173,6 +173,8 @@
|
||||
<bool name="monospace_font_fields_enable_default" translatable="false">true</bool>
|
||||
<string name="hide_expired_entries_key" translatable="false">hide_expired_entries_key</string>
|
||||
<bool name="hide_expired_entries_default" translatable="false">false</bool>
|
||||
<string name="show_uuid_key" translatable="false">hide_expired_entries_key</string>
|
||||
<bool name="show_uuid_default" translatable="false">false</bool>
|
||||
<string name="enable_education_screens_key" translatable="false">enable_education_screens_key</string>
|
||||
<bool name="enable_education_screens_default" translatable="false">true</bool>
|
||||
<string name="reset_education_screens_key" translatable="false">relaunch_education_screens_key</string>
|
||||
|
||||
@@ -520,4 +520,6 @@
|
||||
<string name="icon_pack_choose_summary">Icon pack used in the app</string>
|
||||
<string name="hide_expired_entries_title">Hide expired entries</string>
|
||||
<string name="hide_expired_entries_summary">Expired entries are not shown</string>
|
||||
<string name="show_uuid_title">Show UUID</string>
|
||||
<string name="show_uuid_summary">Displays the UUID linked to an entry</string>
|
||||
</resources>
|
||||
|
||||
@@ -67,12 +67,17 @@
|
||||
|
||||
<PreferenceCategory
|
||||
android:title="@string/other">
|
||||
|
||||
<SwitchPreference
|
||||
android:key="@string/hide_expired_entries_key"
|
||||
android:title="@string/hide_expired_entries_title"
|
||||
android:summary="@string/hide_expired_entries_summary"
|
||||
android:defaultValue="@bool/hide_expired_entries_default"/>
|
||||
|
||||
<SwitchPreference
|
||||
android:key="@string/show_uuid_key"
|
||||
android:title="@string/show_uuid_title"
|
||||
android:summary="@string/show_uuid_summary"
|
||||
android:defaultValue="@bool/show_uuid_default"/>
|
||||
<SwitchPreference
|
||||
android:key="@string/enable_education_screens_key"
|
||||
android:title="@string/enable_education_screens_title"
|
||||
|
||||
Reference in New Issue
Block a user