mirror of
https://github.com/oxen-io/session-android.git
synced 2025-10-15 18:20:14 +00:00
Initial integration of CrowdIn strings (English only)
This commit is contained in:
@@ -32,7 +32,7 @@ class AvatarSelection(
|
||||
private val bgColor by lazy { activity.getColorFromAttr(android.R.attr.colorPrimary) }
|
||||
private val txtColor by lazy { activity.getColorFromAttr(android.R.attr.textColorPrimary) }
|
||||
private val imageScrim by lazy { ContextCompat.getColor(activity, R.color.avatar_background) }
|
||||
private val activityTitle by lazy { activity.getString(R.string.photo) }
|
||||
private val activityTitle by lazy { activity.getString(R.string.image) }
|
||||
|
||||
/**
|
||||
* Returns result on [.REQUEST_CODE_CROP_IMAGE]
|
||||
@@ -120,7 +120,7 @@ class AvatarSelection(
|
||||
|
||||
val chooserIntent = Intent.createChooser(
|
||||
galleryIntent,
|
||||
context.getString(R.string.photo)
|
||||
context.getString(R.string.image)
|
||||
)
|
||||
|
||||
if (!extraIntents.isEmpty()) {
|
||||
|
@@ -1943,7 +1943,7 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
|
||||
} else {
|
||||
Permissions.with(this)
|
||||
.request(Manifest.permission.RECORD_AUDIO)
|
||||
.withRationaleDialog(getString(R.string.permissionsMicrophoneAccessRequired), R.drawable.ic_baseline_mic_48)
|
||||
.withRationaleDialog(getString(R.string.permissionsMicrophoneAccessRequiredAndroid), R.drawable.ic_baseline_mic_48)
|
||||
.withPermanentDenialDialog(Phrase.from(applicationContext, R.string.permissionsMicrophoneAccessRequiredAndroid)
|
||||
.put(APP_NAME_KEY, getString(R.string.app_name))
|
||||
.format().toString())
|
||||
|
@@ -539,7 +539,7 @@ class ConversationReactionOverlay : FrameLayout {
|
||||
}
|
||||
// Copy Account ID
|
||||
if (recipient.isGroupRecipient && !recipient.isCommunityRecipient && message.recipient.address.toString() != userPublicKey) {
|
||||
items += ActionItem(R.attr.menu_copy_icon, R.string.accountIdCopy, { handleActionItemClicked(Action.COPY_ACCOUNT_ID) })
|
||||
items += ActionItem(R.attr.menu_copy_icon, R.string.accountIDCopy, { handleActionItemClicked(Action.COPY_ACCOUNT_ID) })
|
||||
}
|
||||
// Delete message
|
||||
if (userCanDeleteSelectedItems(context, message, openGroup, userPublicKey, blindedPublicKey)) {
|
||||
|
@@ -1,5 +1,7 @@
|
||||
package org.thoughtcrime.securesms.mediasend;
|
||||
|
||||
import static org.session.libsession.utilities.StringSubstitutionConstants.NAME_KEY;
|
||||
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
|
||||
@@ -20,7 +22,10 @@ import android.view.ViewGroup;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.squareup.phrase.Phrase;
|
||||
|
||||
import org.session.libsession.utilities.recipients.Recipient;
|
||||
import org.session.libsignal.utilities.Log;
|
||||
import org.session.libsignal.utilities.guava.Optional;
|
||||
|
||||
import network.loki.messenger.R;
|
||||
@@ -110,11 +115,15 @@ public class MediaPickerFolderFragment extends Fragment implements MediaPickerFo
|
||||
private void initToolbar(Toolbar toolbar) {
|
||||
((AppCompatActivity) requireActivity()).setSupportActionBar(toolbar);
|
||||
ActionBar actionBar = ((AppCompatActivity) requireActivity()).getSupportActionBar();
|
||||
actionBar.setTitle(getString(R.string.MediaPickerActivity_send_to, recipientName));
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
actionBar.setHomeButtonEnabled(true);
|
||||
|
||||
toolbar.setNavigationOnClickListener(v -> requireActivity().onBackPressed());
|
||||
if (actionBar == null) {
|
||||
Log.w("MediaPickerFolderFragment", "ActionBar is null in initToolbar - cannot continue.");
|
||||
} else {
|
||||
CharSequence txt = Phrase.from(requireContext(), R.string.attachmentsSendTo).put(NAME_KEY, recipientName).format();
|
||||
actionBar.setTitle(txt);
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
actionBar.setHomeButtonEnabled(true);
|
||||
toolbar.setNavigationOnClickListener(v -> requireActivity().onBackPressed());
|
||||
}
|
||||
}
|
||||
|
||||
private void onScreenWidthChanged(int newWidth) {
|
||||
|
@@ -8,9 +8,14 @@ import android.net.Uri
|
||||
import android.os.Build
|
||||
import android.os.Environment
|
||||
import android.provider.MediaStore
|
||||
import android.text.TextUtils
|
||||
import android.webkit.MimeTypeMap
|
||||
import android.widget.Toast
|
||||
import java.io.File
|
||||
import java.io.FileOutputStream
|
||||
import java.io.IOException
|
||||
import java.lang.ref.WeakReference
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.concurrent.TimeUnit
|
||||
import network.loki.messenger.R
|
||||
import org.session.libsession.utilities.TextSecurePreferences
|
||||
import org.session.libsession.utilities.task.ProgressDialogAsyncTask
|
||||
@@ -18,13 +23,6 @@ import org.session.libsignal.utilities.ExternalStorageUtil
|
||||
import org.session.libsignal.utilities.Log
|
||||
import org.thoughtcrime.securesms.mms.PartAuthority
|
||||
import org.thoughtcrime.securesms.showSessionDialog
|
||||
import java.io.File
|
||||
import java.io.FileOutputStream
|
||||
import java.io.IOException
|
||||
import java.lang.ref.WeakReference
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
/**
|
||||
* Saves attachment files to an external storage using [MediaStore] API.
|
||||
@@ -47,22 +45,28 @@ class SaveAttachmentTask @JvmOverloads constructor(context: Context, count: Int
|
||||
@JvmStatic
|
||||
@JvmOverloads
|
||||
fun showWarningDialog(context: Context, count: Int = 1, onAcceptListener: () -> Unit = {}) {
|
||||
context.showSessionDialog {
|
||||
title(R.string.warning)
|
||||
iconAttribute(R.attr.dialog_alert_icon)
|
||||
text(context.getString(R.string.attachmentsWarning))
|
||||
dangerButton(R.string.save) {
|
||||
// On Android API 30+ there is no WRITE_EXTERNAL_STORAGE permission to save files so we can't
|
||||
// check against that to show a one-time warning that saved attachments can be accessed by other
|
||||
// apps - so on such devices we'll use a saved boolean preference.
|
||||
val haveWarned = TextSecurePreferences.getHaveWarnedUserAboutSavingAttachments(context)
|
||||
if (!haveWarned && Build.VERSION.SDK_INT >= 30) {
|
||||
// If we've already warned the user that saved attachments can be accessed by other apps
|
||||
// then we'll just perform the save..
|
||||
val haveWarned = TextSecurePreferences.getHaveWarnedUserAboutSavingAttachments(context)
|
||||
if (haveWarned) {
|
||||
onAcceptListener()
|
||||
} else {
|
||||
// .. otherwise we'll show a warning dialog and only save if the user accepts the
|
||||
// potential risks of other apps accessing their saved attachments.
|
||||
context.showSessionDialog {
|
||||
title(R.string.warning)
|
||||
iconAttribute(R.attr.dialog_alert_icon)
|
||||
text(context.getString(R.string.attachmentsWarning))
|
||||
dangerButton(R.string.save) {
|
||||
// Regardless of Android API version, we'll always warn the user that saved attachments
|
||||
// can be accessed by other apps - but we'll only ever do this ONCE. When the user accepts
|
||||
// this warning and agrees to proceed we write a shared pref flag and will never show this
|
||||
// warning again due to the early-exit condition at the top of this method.
|
||||
TextSecurePreferences.setHaveWarnedUserAboutSavingAttachments(context)
|
||||
onAcceptListener()
|
||||
}
|
||||
|
||||
onAcceptListener()
|
||||
button(R.string.cancel)
|
||||
}
|
||||
button(R.string.cancel)
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -23,7 +23,7 @@
|
||||
android:drawableStart="@drawable/ic_content_copy_white_24dp"
|
||||
android:drawableTint="?attr/colorControlNormal"
|
||||
android:visibility="gone"
|
||||
android:text="@string/accountIdCopy" />
|
||||
android:text="@string/accountIDCopy" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/copyCommunityUrl"
|
||||
|
@@ -3,7 +3,7 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item
|
||||
android:title="@string/accountIdCopy"
|
||||
android:title="@string/accountIDCopy"
|
||||
android:id="@+id/menu_copy_account_id"
|
||||
android:icon="@drawable/ic_content_copy_white_24dp"
|
||||
android:contentDescription="@string/AccessibilityId_accountIdCopy" />
|
||||
|
@@ -53,7 +53,7 @@
|
||||
app:showAsAction="never" />
|
||||
|
||||
<item
|
||||
android:title="@string/accountIdCopy"
|
||||
android:title="@string/accountIDCopy"
|
||||
android:id="@+id/menu_context_copy_public_key"
|
||||
app:showAsAction="never" />
|
||||
|
||||
|
Reference in New Issue
Block a user