add fwtwitter

This commit is contained in:
Michel Roux 2023-07-24 14:26:50 +02:00
parent 297f8bca57
commit 4f91fe244c
4 changed files with 8 additions and 3 deletions

View File

@ -8,4 +8,3 @@
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:

View File

@ -1,7 +1,9 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:icon="@android:drawable/ic_menu_share"
android:label="FxPixiv"
android:theme="@android:style/Theme.NoDisplay">
<activity
android:name=".MainActivity"
@ -13,4 +15,5 @@
</intent-filter>
</activity>
</application>
</manifest>

View File

@ -13,11 +13,15 @@ public class MainActivity extends Activity {
String type = intent.getType();
if (Intent.ACTION_SEND.equals(intent.getAction()) && "text/plain".equals(type)) {
String ppxivUrl = intent.getStringExtra(Intent.EXTRA_TEXT).replace("pixiv", "ppxiv");
String ppxivUrl = intent.getStringExtra(Intent.EXTRA_TEXT)
.replace("pixiv", "ppxiv")
.replace("twitter", "fxtwitter");
Intent sharingIntent = new Intent(Intent.ACTION_SEND);
sharingIntent.setType("text/plain");
sharingIntent.putExtra(Intent.EXTRA_TEXT, ppxivUrl);
startActivity(Intent.createChooser(sharingIntent, "Share via"));
}
finish();
}
}

View File

@ -1,4 +1,3 @@
// Boilerplate from https://transang.me/create-a-minimal-android-boilerplate-from-scratch/
rootProject.name = 'SharePixiv'
include ':app'