add fwtwitter
This commit is contained in:
parent
297f8bca57
commit
4f91fe244c
1
app/proguard-rules.pro
vendored
1
app/proguard-rules.pro
vendored
@ -8,4 +8,3 @@
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# Add any project specific keep options here:
|
||||
|
||||
|
@ -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>
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,3 @@
|
||||
// Boilerplate from https://transang.me/create-a-minimal-android-boilerplate-from-scratch/
|
||||
rootProject.name = 'SharePixiv'
|
||||
include ':app'
|
||||
|
||||
|
Reference in New Issue
Block a user