Skip to content

Commit

Permalink
make sharing activity transparent
Browse files Browse the repository at this point in the history
  • Loading branch information
lz233 committed Aug 2, 2022
1 parent 2392b7e commit 8e0b7d4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 2 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
<activity
android:name=".ReceiveOpenActivity"
android:excludeFromRecents="true"
android:launchMode="singleInstance"
android:theme="@style/AppTheme.NoDisplay"
android:exported="true">
<intent-filter
android:label="@string/convert_text"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ protected void onCreate(Bundle savedInstanceState) {
// StrictMode.setVmPolicy(builder.build());
// builder.detectFileUriExposure();

setContentView(R.layout.activity_receive_open);
//setContentView(R.layout.activity_receive_open);
//Toast.makeText(this,"已经将打开文件转换为分享文件",Toast.LENGTH_LONG).show();

Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
//sendIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
sendIntent.addCategory("android.intent.category.DEFAULT");
// Log.d("分享","Data:"+ getIntent().getData().toString());
// Log.d("分享","Type:"+ getIntent().getType());
Expand Down
7 changes: 7 additions & 0 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,11 @@
<item name="colorAccent">@color/colorAccent</item>
</style>

<style name="AppTheme.NoDisplay" parent="AppTheme">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
</style>
</resources>

0 comments on commit 8e0b7d4

Please sign in to comment.