feat(external-share): use transparent background

This commit is contained in:
FineFindus 2023-03-16 15:38:35 +01:00
parent 5208195f72
commit 05168b9826
No known key found for this signature in database
GPG Key ID: 64873EE210FF8E6B
3 changed files with 12 additions and 3 deletions

View File

@ -44,7 +44,8 @@
<data android:scheme="moshidon-android-auth" android:host="callback"/>
</intent-filter>
</activity>
<activity android:name=".ExternalShareActivity" android:exported="true" android:configChanges="orientation|screenSize" android:windowSoftInputMode="adjustResize">
<activity android:name=".ExternalShareActivity" android:exported="true" android:configChanges="orientation|screenSize" android:windowSoftInputMode="adjustResize"
android:theme="@style/TransparentDialog">
<intent-filter>
<action android:name="android.intent.action.SEND"/>
<category android:name="android.intent.category.DEFAULT"/>

View File

@ -3,7 +3,6 @@ package org.joinmastodon.android;
import android.app.Fragment;
import android.content.ClipData;
import android.content.Intent;
import android.graphics.drawable.ColorDrawable;
import android.net.Uri;
import android.os.Bundle;
import android.text.TextUtils;
@ -34,7 +33,6 @@ public class ExternalShareActivity extends FragmentStackActivity{
}else if(sessions.size()==1){
openComposeFragment(sessions.get(0).getID());
}else{
getWindow().setBackgroundDrawable(new ColorDrawable(0xff000000));
UiUtils.pickAccount(this, null, R.string.choose_account, 0,
session -> openComposeFragment(session.getID()),
b -> b.setOnCancelListener(d -> finish())

View File

@ -1,5 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<style name="TransparentDialog" parent="android:Theme.Dialog">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">true</item>
<item name="android:backgroundDimEnabled">false</item>
</style>
<style name="Theme.Mastodon.Light" parent="Theme.AppKit.Light">
<!-- needed to disable scrim on API 29+ -->
<item name="android:enforceNavigationBarContrast" tools:ignore="NewApi">false</item>