From 4f91fe244cae8754f0687bca56f3fb9fe0e9e18c Mon Sep 17 00:00:00 2001 From: Michel Roux Date: Mon, 24 Jul 2023 14:26:50 +0200 Subject: [PATCH] add fwtwitter --- app/proguard-rules.pro | 1 - app/src/main/AndroidManifest.xml | 3 +++ .../main/java/net.crystalyx.sharepixiv/MainActivity.java | 6 +++++- settings.gradle | 1 - 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index e15b8d8..11b0257 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -8,4 +8,3 @@ # http://developer.android.com/guide/developing/tools/proguard.html # Add any project specific keep options here: - diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 59f4766..dbe7163 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,7 +1,9 @@ + + diff --git a/app/src/main/java/net.crystalyx.sharepixiv/MainActivity.java b/app/src/main/java/net.crystalyx.sharepixiv/MainActivity.java index 011e362..cc0c331 100644 --- a/app/src/main/java/net.crystalyx.sharepixiv/MainActivity.java +++ b/app/src/main/java/net.crystalyx.sharepixiv/MainActivity.java @@ -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(); } } diff --git a/settings.gradle b/settings.gradle index 541c1d6..5f131b1 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,4 +1,3 @@ // Boilerplate from https://transang.me/create-a-minimal-android-boilerplate-from-scratch/ rootProject.name = 'SharePixiv' include ':app' -