Compare commits

..

4 Commits

Author SHA1 Message Date
adbenitez 98d711e0ca tweak createForExternal 2025-12-22 18:23:08 +01:00
copilot-swe-agent[bot] 99c848b1b7 Add clarifying comment about fallback logic
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
2025-12-22 16:58:38 +00:00
copilot-swe-agent[bot] fe26af88b4 Fix quick-camera button crash on devices with external SD cards
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
2025-12-22 16:55:15 +00:00
copilot-swe-agent[bot] 6af6ff80ba Initial plan 2025-12-22 16:51:35 +00:00
13 changed files with 45 additions and 60 deletions
+1 -5
View File
@@ -59,8 +59,6 @@ jobs:
rm build/outputs/apk/foss/release/*universal*
./gradlew assembleGplayRelease
mv build/outputs/apk/gplay/release/*universal* build/outputs/apk/foss/release/ArcaneChat-gplay.apk
mv build/outputs/mapping/fossRelease/mapping.txt build/outputs/mapping/fossRelease/mapping-foss.txt
mv build/outputs/mapping/gplayRelease/mapping.txt build/outputs/mapping/fossRelease/mapping-gplay.txt
- name: Release on GitHub
uses: softprops/action-gh-release@v1
@@ -69,9 +67,7 @@ jobs:
body: '[<img src="store/get-it-on-gplay.png" alt="Get it on Google Play" height="48">](https://play.google.com/store/apps/details?id=com.github.arcanechat) [<img src="store/get-it-on-fdroid.png" alt="Get it on F-Droid" height="48">](https://f-droid.org/packages/chat.delta.lite) [<img src="store/get-it-on-github.png" alt="Get it on GitHub" height="48">](https://github.com/ArcaneChat/android/releases/latest/download/ArcaneChat-gplay.apk)'
prerelease: ${{ contains(github.event.ref, '-beta') }}
fail_on_unmatched_files: true
files: |
build/outputs/apk/foss/release/*.apk
build/outputs/mapping/fossRelease/mapping-*.txt
files: build/outputs/apk/foss/release/*.apk
- name: Release on ZapStore
run: |
Binary file not shown.

Before

Width:  |  Height:  |  Size: 135 KiB

After

Width:  |  Height:  |  Size: 137 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 283 KiB

After

Width:  |  Height:  |  Size: 287 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 250 KiB

After

Width:  |  Height:  |  Size: 256 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 446 KiB

After

Width:  |  Height:  |  Size: 447 KiB

@@ -152,8 +152,6 @@ public class ConversationFragment extends MessageSelectorFragment
// setLayerType() is needed to allow larger items (long texts in our case)
// with hardware layers, drawing may result in errors as "OpenGLRenderer: Path too large to be rendered into a texture"
// On foldable devices with large screens, software layer can exceed memory limits (~11MB).
// To prevent this, message bubble width is constrained via maxWidth in layout files.
list.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
return view;
@@ -202,8 +202,7 @@ public class InputPanel extends ConstraintLayout
public void setSubjectVisible(boolean visible) {
subjectText.setVisibility(visible ? View.VISIBLE : View.GONE);
// don't make it visible if visible is false to avoid showing it while recording audio and an event triggers setSubjectVisible(false)
if (visible) emojiToggle.setVisibility(View.GONE);
emojiToggle.setVisibility(!visible ? View.VISIBLE : View.GONE);
}
public String getSubject() {
@@ -122,8 +122,26 @@ public class PersistentBlobProvider {
}
public Uri createForExternal(@NonNull Context context, @NonNull String mimeType) throws IOException, IllegalStateException, NullPointerException {
File target = new File(getExternalDir(context), System.currentTimeMillis() + "." + getExtensionFromMimeType(mimeType));
return FileProviderUtil.getUriFor(context, target);
String filename = System.currentTimeMillis() + "." + getExtensionFromMimeType(mimeType);
// 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) {
@@ -38,13 +38,13 @@
android:id="@+id/reply_icon"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignStart="@id/body_bubble_wrapper"
android:layout_alignTop="@id/body_bubble_wrapper"
android:layout_alignBottom="@id/body_bubble_wrapper"
android:layout_alignStart="@id/body_bubble"
android:layout_alignTop="@id/body_bubble"
android:layout_alignBottom="@id/body_bubble"
android:alpha="0"
app:srcCompat="?menu_reply_icon"
android:tint="?icon_tint"
android:layout_alignLeft="@id/body_bubble_wrapper" />
android:layout_alignLeft="@id/body_bubble" />
<FrameLayout
android:id="@+id/contact_photo_container"
@@ -52,7 +52,7 @@
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignBottom="@id/body_bubble_wrapper">
android:layout_alignBottom="@id/body_bubble">
<org.thoughtcrime.securesms.components.AvatarImageView
android:id="@+id/contact_photo"
@@ -65,8 +65,8 @@
</FrameLayout>
<FrameLayout
android:id="@+id/body_bubble_wrapper"
<LinearLayout
android:id="@+id/body_bubble"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/message_bubble_edge_margin"
@@ -74,12 +74,7 @@
android:layout_marginLeft="6dp"
android:layout_marginStart="6dp"
android:layout_toRightOf="@id/contact_photo_container"
android:layout_toEndOf="@id/contact_photo_container">
<LinearLayout
android:id="@+id/body_bubble"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toEndOf="@id/contact_photo_container"
android:orientation="vertical"
android:clipToPadding="false"
android:clipChildren="false"
@@ -117,7 +112,6 @@
android:id="@+id/quote_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxWidth="@dimen/message_bubble_max_width"
android:layout_marginTop="@dimen/message_bubble_top_padding"
android:layout_marginStart="6dp"
android:layout_marginEnd="6dp"
@@ -192,7 +186,6 @@
android:id="@+id/conversation_item_body"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxWidth="@dimen/message_bubble_max_width"
android:layout_marginBottom="@dimen/message_bubble_collapsed_footer_padding"
android:layout_marginLeft="@dimen/message_bubble_horizontal_padding"
android:layout_marginRight="@dimen/message_bubble_horizontal_padding"
@@ -254,14 +247,12 @@
</LinearLayout>
</FrameLayout>
<org.thoughtcrime.securesms.reactions.ReactionsConversationView
android:id="@+id/reactions_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/body_bubble_wrapper"
android:layout_alignStart="@id/body_bubble_wrapper"
android:layout_below="@id/body_bubble"
android:layout_alignStart="@id/body_bubble"
android:layout_marginTop="-4dp"
android:orientation="horizontal"
app:message_type="incoming" />
+11 -20
View File
@@ -40,29 +40,24 @@
android:id="@+id/reply_icon"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignStart="@id/body_bubble_wrapper"
android:layout_alignTop="@id/body_bubble_wrapper"
android:layout_alignBottom="@id/body_bubble_wrapper"
android:layout_alignStart="@id/body_bubble"
android:layout_alignTop="@id/body_bubble"
android:layout_alignBottom="@id/body_bubble"
android:alpha="0"
app:srcCompat="?menu_reply_icon"
android:tint="?icon_tint"
android:layout_alignLeft="@id/body_bubble_wrapper" />
<FrameLayout
android:id="@+id/body_bubble_wrapper"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@+id/indicators_parent"
android:layout_toStartOf="@+id/indicators_parent"
android:layout_alignWithParentIfMissing="true"
android:layout_marginLeft="@dimen/message_bubble_edge_margin"
android:layout_marginStart="@dimen/message_bubble_edge_margin">
android:layout_alignLeft="@id/body_bubble" />
<LinearLayout
android:id="@+id/body_bubble"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_toLeftOf="@+id/indicators_parent"
android:layout_toStartOf="@+id/indicators_parent"
android:layout_alignWithParentIfMissing="true"
android:layout_marginLeft="@dimen/message_bubble_edge_margin"
android:layout_marginStart="@dimen/message_bubble_edge_margin"
android:clipToPadding="false"
android:clipChildren="false"
android:background="@color/white"
@@ -99,7 +94,6 @@
android:id="@+id/quote_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxWidth="@dimen/message_bubble_max_width"
android:layout_marginTop="@dimen/message_bubble_top_padding"
android:layout_marginStart="6dp"
android:layout_marginEnd="6dp"
@@ -174,7 +168,6 @@
android:id="@+id/conversation_item_body"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxWidth="@dimen/message_bubble_max_width"
android:layout_marginLeft="@dimen/message_bubble_horizontal_padding"
android:layout_marginRight="@dimen/message_bubble_horizontal_padding"
android:layout_marginBottom="@dimen/message_bubble_collapsed_footer_padding"
@@ -235,14 +228,12 @@
</LinearLayout>
</FrameLayout>
<org.thoughtcrime.securesms.reactions.ReactionsConversationView
android:id="@+id/reactions_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/body_bubble_wrapper"
android:layout_alignEnd="@id/body_bubble_wrapper"
android:layout_below="@id/body_bubble"
android:layout_alignEnd="@id/body_bubble"
android:layout_marginTop="-4dp"
android:orientation="horizontal"
app:message_type="outgoing" />
-5
View File
@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Limit bubble width on large screens (tablets/foldable devices) to prevent software layer overflow -->
<dimen name="message_bubble_max_width">600dp</dimen>
</resources>
-1
View File
@@ -23,7 +23,6 @@
<dimen name="message_bubble_edge_margin">32dp</dimen>
<dimen name="message_bubble_bottom_padding">6dp</dimen>
<dimen name="message_bubble_showmore_padding">8dp</dimen>
<dimen name="message_bubble_max_width">512dp</dimen>
<dimen name="transparent_footer_padding">2dp</dimen>
<dimen name="media_bubble_remove_button_size">24dp</dimen>
<dimen name="media_bubble_edit_button_size">24dp</dimen>
+2 -4
View File
@@ -1,13 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<paths>
<cache-path name="cache" path="." />
<external-cache-path name="external_cache" path="." />
<external-files-path name="external_files" path="." />
<!-- this is needed for access to the cache dir in SD card -->
<root-path name="external_root" path="/storage/" />
<external-path name="external_pictures" path="Pictures"/>
<external-path name="external_video" path="Movies"/>
<external-path name="external_audio" path="Music"/>
<external-path name="external_download" path="Download"/>
</paths>
</paths>