mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 98d711e0ca | |||
| 99c848b1b7 | |||
| fe26af88b4 | |||
| 6af6ff80ba | |||
| 76e4c59119 | |||
| 33b69b9f3a | |||
| b4f5e2d124 |
@@ -6,3 +6,4 @@ find ./src/main/assets/help/ -type f -name '*.html' | xargs sed -i 's/Delta Chat
|
|||||||
find ./src/ -type f -name 'strings.xml' | xargs sed -i 's/get.delta.chat/github.com\/ArcaneChat/g'
|
find ./src/ -type f -name 'strings.xml' | xargs sed -i 's/get.delta.chat/github.com\/ArcaneChat/g'
|
||||||
find ./src/ -type f -name 'strings.xml' | xargs sed -i 's/delta.chat\/donate/arcanechat.me\/#contribute/g'
|
find ./src/ -type f -name 'strings.xml' | xargs sed -i 's/delta.chat\/donate/arcanechat.me\/#contribute/g'
|
||||||
find ./src/ -type f -name 'strings.xml' | xargs sed -i 's/Delta Chat/ArcaneChat/g'
|
find ./src/ -type f -name 'strings.xml' | xargs sed -i 's/Delta Chat/ArcaneChat/g'
|
||||||
|
find ./src/ -type f -name 'strings.xml' | xargs sed -i 's/❤️/💜/g'
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ find ./src/main/assets/help/ -type f -name '*.html' | xargs sed -i 's/ArcaneChat
|
|||||||
find ./src/ -type f -name 'strings.xml' | xargs sed -i 's/github.com\/ArcaneChat/get.delta.chat/g'
|
find ./src/ -type f -name 'strings.xml' | xargs sed -i 's/github.com\/ArcaneChat/get.delta.chat/g'
|
||||||
find ./src/ -type f -name 'strings.xml' | xargs sed -i 's/arcanechat.me\/#contribute/delta.chat\/donate/g'
|
find ./src/ -type f -name 'strings.xml' | xargs sed -i 's/arcanechat.me\/#contribute/delta.chat\/donate/g'
|
||||||
find ./src/ -type f -name 'strings.xml' | xargs sed -i 's/ArcaneChat/Delta Chat/g'
|
find ./src/ -type f -name 'strings.xml' | xargs sed -i 's/ArcaneChat/Delta Chat/g'
|
||||||
|
find ./src/ -type f -name 'strings.xml' | xargs sed -i 's/💜/❤️/g'
|
||||||
|
|
||||||
# don't revert the app name
|
# don't revert the app name
|
||||||
sed -i 's/>Delta Chat</>ArcaneChat</g' ./src/main/res/values/strings.xml
|
sed -i 's/>Delta Chat</>ArcaneChat</g' ./src/main/res/values/strings.xml
|
||||||
|
|||||||
@@ -786,6 +786,8 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
return future;
|
return future;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inputPanel.setSubject(draft.getSubject());
|
||||||
|
|
||||||
final String text = TextUtils.isEmpty(sharedText)? draft.getText() : sharedText;
|
final String text = TextUtils.isEmpty(sharedText)? draft.getText() : sharedText;
|
||||||
if(!text.isEmpty()) {
|
if(!text.isEmpty()) {
|
||||||
composeText.setText(text);
|
composeText.setText(text);
|
||||||
@@ -977,10 +979,12 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
if (dcChat.canSend()) {
|
if (dcChat.canSend()) {
|
||||||
composePanel.setVisibility(View.VISIBLE);
|
composePanel.setVisibility(View.VISIBLE);
|
||||||
attachmentManager.setHidden(false);
|
attachmentManager.setHidden(false);
|
||||||
|
inputPanel.setSubjectVisible(!dcChat.isEncrypted());
|
||||||
} else {
|
} else {
|
||||||
composePanel.setVisibility(View.GONE);
|
composePanel.setVisibility(View.GONE);
|
||||||
attachmentManager.setHidden(true);
|
attachmentManager.setHidden(true);
|
||||||
hideSoftKeyboard();
|
hideSoftKeyboard();
|
||||||
|
inputPanel.setSubjectVisible(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1063,12 +1067,14 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
|
|
||||||
Optional<QuoteModel> quote = inputPanel.getQuote();
|
Optional<QuoteModel> quote = inputPanel.getQuote();
|
||||||
boolean editing = isEditing;
|
boolean editing = isEditing;
|
||||||
|
final String subject = inputPanel.getSubject();
|
||||||
|
|
||||||
// for a quick ui feedback, we clear the related controls immediately on sending messages.
|
// for a quick ui feedback, we clear the related controls immediately on sending messages.
|
||||||
// for drafts, however, we do not change the controls, the activity may be resumed.
|
// for drafts, however, we do not change the controls, the activity may be resumed.
|
||||||
if (action==ACTION_SEND_OUT) {
|
if (action==ACTION_SEND_OUT) {
|
||||||
composeText.setText("");
|
composeText.setText("");
|
||||||
inputPanel.clearQuote();
|
inputPanel.clearQuote();
|
||||||
|
inputPanel.clearSubject();
|
||||||
}
|
}
|
||||||
|
|
||||||
Util.runOnAnyBackgroundThread(() -> {
|
Util.runOnAnyBackgroundThread(() -> {
|
||||||
@@ -1133,6 +1139,10 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
msg.setQuote(quote.get().getQuotedMsg());
|
msg.setQuote(quote.get().getQuotedMsg());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!subject.isEmpty() && msg != null) {
|
||||||
|
msg.setSubject(subject);
|
||||||
|
}
|
||||||
|
|
||||||
if (action==ACTION_SEND_OUT) {
|
if (action==ACTION_SEND_OUT) {
|
||||||
|
|
||||||
// for WEBXDC, drafts are just sent out as is.
|
// for WEBXDC, drafts are just sent out as is.
|
||||||
|
|||||||
@@ -411,8 +411,11 @@ public class ConversationItem extends BaseConversationItem
|
|||||||
bodyText.setClickable(false);
|
bodyText.setClickable(false);
|
||||||
bodyText.setFocusable(false);
|
bodyText.setFocusable(false);
|
||||||
|
|
||||||
|
String subject = messageRecord.getSubject();
|
||||||
String text = messageRecord.getText();
|
String text = messageRecord.getText();
|
||||||
|
|
||||||
|
if (!subject.isEmpty() && messageRecord.isOutgoing() && !messageRecord.isSecure()) text = subject + "\n\n" + text;
|
||||||
|
|
||||||
if (messageRecord.getType() == DcMsg.DC_MSG_CALL || text.isEmpty()) {
|
if (messageRecord.getType() == DcMsg.DC_MSG_CALL || text.isEmpty()) {
|
||||||
bodyText.setVisibility(View.GONE);
|
bodyText.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ public class InputPanel extends ConstraintLayout
|
|||||||
private QuoteView quoteView;
|
private QuoteView quoteView;
|
||||||
private EmojiToggle emojiToggle;
|
private EmojiToggle emojiToggle;
|
||||||
private ComposeText composeText;
|
private ComposeText composeText;
|
||||||
|
private android.widget.EditText subjectText;
|
||||||
private View quickCameraToggle;
|
private View quickCameraToggle;
|
||||||
private View quickAudioToggle;
|
private View quickAudioToggle;
|
||||||
private View buttonToggle;
|
private View buttonToggle;
|
||||||
@@ -91,6 +92,7 @@ public class InputPanel extends ConstraintLayout
|
|||||||
this.quoteView = findViewById(R.id.quote_view);
|
this.quoteView = findViewById(R.id.quote_view);
|
||||||
this.emojiToggle = findViewById(R.id.emoji_toggle);
|
this.emojiToggle = findViewById(R.id.emoji_toggle);
|
||||||
this.composeText = findViewById(R.id.embedded_text_editor);
|
this.composeText = findViewById(R.id.embedded_text_editor);
|
||||||
|
this.subjectText = findViewById(R.id.subject_text);
|
||||||
this.quickCameraToggle = findViewById(R.id.quick_camera_toggle);
|
this.quickCameraToggle = findViewById(R.id.quick_camera_toggle);
|
||||||
this.quickAudioToggle = findViewById(R.id.quick_audio_toggle);
|
this.quickAudioToggle = findViewById(R.id.quick_audio_toggle);
|
||||||
this.buttonToggle = findViewById(R.id.button_toggle);
|
this.buttonToggle = findViewById(R.id.button_toggle);
|
||||||
@@ -198,6 +200,30 @@ public class InputPanel extends ConstraintLayout
|
|||||||
composeText.performClick();
|
composeText.performClick();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setSubjectVisible(boolean visible) {
|
||||||
|
subjectText.setVisibility(visible ? View.VISIBLE : View.GONE);
|
||||||
|
emojiToggle.setVisibility(!visible ? View.VISIBLE : View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSubject() {
|
||||||
|
if (subjectText != null && subjectText.getVisibility() == View.VISIBLE) {
|
||||||
|
return subjectText.getText().toString().trim();
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public void clearSubject() {
|
||||||
|
if (subjectText != null) {
|
||||||
|
subjectText.setText("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSubject(String subject) {
|
||||||
|
if (subjectText != null && subject != null) {
|
||||||
|
subjectText.setText(subject);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void setMediaKeyboard(@NonNull MediaKeyboard mediaKeyboard) {
|
public void setMediaKeyboard(@NonNull MediaKeyboard mediaKeyboard) {
|
||||||
mediaKeyboard.setKeyboardListener(this);
|
mediaKeyboard.setKeyboardListener(this);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,8 +122,26 @@ public class PersistentBlobProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Uri createForExternal(@NonNull Context context, @NonNull String mimeType) throws IOException, IllegalStateException, NullPointerException {
|
public Uri createForExternal(@NonNull Context context, @NonNull String mimeType) throws IOException, IllegalStateException, NullPointerException {
|
||||||
File target = new File(getExternalDir(context), System.currentTimeMillis() + "." + getExtensionFromMimeType(mimeType));
|
String filename = System.currentTimeMillis() + "." + getExtensionFromMimeType(mimeType);
|
||||||
return FileProviderUtil.getUriFor(context, target);
|
|
||||||
|
// Try external cache first
|
||||||
|
try {
|
||||||
|
File externalDir = getExternalDir(context);
|
||||||
|
File target = new File(externalDir, filename);
|
||||||
|
return FileProviderUtil.getUriFor(context, target);
|
||||||
|
} catch (IllegalArgumentException e) {
|
||||||
|
// FileProvider doesn't support the external cache path (e.g., on removable SD card).
|
||||||
|
// Note: getExternalDir() already falls back to internal cache when external cache is null,
|
||||||
|
// but when external cache exists on a removable SD card, FileProvider may reject it.
|
||||||
|
// In that case, we explicitly use internal cache which FileProvider always supports.
|
||||||
|
Log.w(TAG, "FileProvider doesn't support external cache path, falling back to internal cache", e);
|
||||||
|
File internalDir = context.getCacheDir();
|
||||||
|
if (internalDir == null) {
|
||||||
|
throw new IOException("no cache directory available");
|
||||||
|
}
|
||||||
|
File target = new File(internalDir, filename);
|
||||||
|
return FileProviderUtil.getUriFor(context, target);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean delete(@NonNull Context context, @NonNull Uri uri) {
|
public boolean delete(@NonNull Context context, @NonNull Uri uri) {
|
||||||
|
|||||||
@@ -25,11 +25,28 @@
|
|||||||
app:message_type="preview"
|
app:message_type="preview"
|
||||||
tools:visibility="visible" />
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/subject_text"
|
||||||
|
style="@style/ComposeEditText"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:layout_marginBottom="6dp"
|
||||||
|
android:hint="@string/subject"
|
||||||
|
android:inputType="text"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/quote_view"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/input_field_frame_layout"
|
android:id="@+id/input_field_frame_layout"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/button_toggle"
|
app:layout_constraintEnd_toStartOf="@+id/button_toggle"
|
||||||
app:layout_constraintTop_toBottomOf="@id/quote_view"
|
app:layout_constraintTop_toBottomOf="@id/subject_text"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<paths>
|
<paths>
|
||||||
|
<cache-path name="cache" path="." />
|
||||||
<external-cache-path name="external_cache" path="." />
|
<external-cache-path name="external_cache" path="." />
|
||||||
<external-files-path name="external_files" path="." />
|
<external-files-path name="external_files" path="." />
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user