Merge branch 'dev' into utilise-dialog-dsl

This commit is contained in:
andrew 2023-07-13 12:12:01 +09:30
commit adfa94614b
8 changed files with 21 additions and 30 deletions

View File

@ -1580,7 +1580,7 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
showVoiceMessageUI()
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
audioRecorder.startRecording()
stopAudioHandler.postDelayed(stopVoiceMessageRecordingTask, 60000) // Limit voice messages to 1 minute each
stopAudioHandler.postDelayed(stopVoiceMessageRecordingTask, 300000) // Limit voice messages to 5 minute each
} else {
Permissions.with(this)
.request(Manifest.permission.RECORD_AUDIO)

View File

@ -1,9 +0,0 @@
package org.thoughtcrime.securesms.preferences
import android.content.Context
import android.util.AttributeSet
import android.widget.FrameLayout
class BlockedContactsLayout @JvmOverloads constructor(
context: Context, attrs: AttributeSet? = null
) : FrameLayout(context, attrs)

View File

@ -3,7 +3,6 @@ package org.thoughtcrime.securesms.preferences
import android.content.Context
import android.content.Intent
import android.util.AttributeSet
import android.view.View
import androidx.preference.PreferenceCategory
import androidx.preference.PreferenceViewHolder
@ -16,8 +15,7 @@ class BlockedContactsPreference @JvmOverloads constructor(
super.onBindViewHolder(holder)
holder.itemView.setOnClickListener {
val intent = Intent(context, BlockedContactsActivity::class.java)
context.startActivity(intent)
Intent(context, BlockedContactsActivity::class.java).let(context::startActivity)
}
}
}

View File

@ -1,18 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<org.thoughtcrime.securesms.preferences.BlockedContactsLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
<Button
xmlns:android="http://schemas.android.com/apk/res/android"
android:contentDescription="@string/AccessibilityId_blocked_contacts"
style="@style/Widget.Session.Button.Common.Borderless"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingHorizontal="@dimen/medium_spacing"
android:layout_marginHorizontal="@dimen/large_spacing"
android:layout_marginVertical="@dimen/medium_spacing"
android:layout_height="wrap_content">
<Button
android:contentDescription="@string/AccessibilityId_blocked_contacts"
style="@style/Widget.Session.Button.Common.Borderless"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingHorizontal="@dimen/medium_spacing"
android:text="@string/blocked_contacts_title"
android:textColor="@color/destructive"
android:textSize="16sp"
android:textStyle="bold"
/>
</org.thoughtcrime.securesms.preferences.BlockedContactsLayout>
android:text="@string/blocked_contacts_title"
android:textColor="@color/destructive"
android:textSize="16sp"
android:textStyle="bold"
/>

View File

@ -14,7 +14,7 @@
<!-- TODO: check figure out what is needed for this -->
<org.thoughtcrime.securesms.components.SwitchPreferenceCompat
android:defaultValue="true"
android:defaultValue="@bool/screen_security_default"
android:key="pref_screen_security"
android:title="@string/preferences__screen_security"
android:summary="@string/preferences__disable_screen_security_to_allow_screen_shots" />

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<bool name="screen_security_default">false</bool>
</resources>

View File

@ -649,7 +649,7 @@ interface TextSecurePreferences {
@JvmStatic
fun isScreenSecurityEnabled(context: Context): Boolean {
return getBooleanPreference(context, SCREEN_SECURITY_PREF, !BuildConfig.DEBUG)
return getBooleanPreference(context, SCREEN_SECURITY_PREF, context.resources.getBoolean(R.bool.screen_security_default))
}
fun getLastVersionCode(context: Context): Int {

View File

@ -2,4 +2,5 @@
<resources>
<bool name="enable_alarm_manager">true</bool>
<bool name="enable_job_service">false</bool>
<bool name="screen_security_default">true</bool>
</resources>