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
|
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||||
|
|
||||||
# Add any project specific keep options here:
|
# Add any project specific keep options here:
|
||||||
|
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<application
|
<application
|
||||||
android:icon="@android:drawable/ic_menu_share"
|
android:icon="@android:drawable/ic_menu_share"
|
||||||
|
android:label="FxPixiv"
|
||||||
android:theme="@android:style/Theme.NoDisplay">
|
android:theme="@android:style/Theme.NoDisplay">
|
||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
@ -13,4 +15,5 @@
|
|||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
|
@ -13,11 +13,15 @@ public class MainActivity extends Activity {
|
|||||||
String type = intent.getType();
|
String type = intent.getType();
|
||||||
|
|
||||||
if (Intent.ACTION_SEND.equals(intent.getAction()) && "text/plain".equals(type)) {
|
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);
|
Intent sharingIntent = new Intent(Intent.ACTION_SEND);
|
||||||
sharingIntent.setType("text/plain");
|
sharingIntent.setType("text/plain");
|
||||||
sharingIntent.putExtra(Intent.EXTRA_TEXT, ppxivUrl);
|
sharingIntent.putExtra(Intent.EXTRA_TEXT, ppxivUrl);
|
||||||
startActivity(Intent.createChooser(sharingIntent, "Share via"));
|
startActivity(Intent.createChooser(sharingIntent, "Share via"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
finish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
// Boilerplate from https://transang.me/create-a-minimal-android-boilerplate-from-scratch/
|
// Boilerplate from https://transang.me/create-a-minimal-android-boilerplate-from-scratch/
|
||||||
rootProject.name = 'SharePixiv'
|
rootProject.name = 'SharePixiv'
|
||||||
include ':app'
|
include ':app'
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user