From 74c7a1de4dfa1bc618a111a56ac62290d8b5cebf Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Thu, 23 Jul 2020 20:04:48 +0100 Subject: [PATCH 1/2] sdk 0.79.1. Clear resolved sub cache after sync. --- app/build.gradle | 4 ++-- app/src/main/java/io/lbry/browser/MainActivity.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 768d4038..cc23619b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -101,8 +101,8 @@ dependencies { androidTestImplementation 'androidx.test.ext:junit:1.1.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' - __32bitImplementation 'io.lbry:lbrysdk32:0.79.0' - __64bitImplementation 'io.lbry:lbrysdk64:0.79.0' + __32bitImplementation 'io.lbry:lbrysdk32:0.79.1' + __64bitImplementation 'io.lbry:lbrysdk64:0.79.1' } apply plugin: 'com.google.gms.google-services' diff --git a/app/src/main/java/io/lbry/browser/MainActivity.java b/app/src/main/java/io/lbry/browser/MainActivity.java index 961a5090..3b0f30db 100644 --- a/app/src/main/java/io/lbry/browser/MainActivity.java +++ b/app/src/main/java/io/lbry/browser/MainActivity.java @@ -1795,11 +1795,11 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(MainActivity.this); sp.edit().putBoolean(PREFERENCE_KEY_INTERNAL_INITIAL_SUBSCRIPTION_MERGE_DONE, true).apply(); + Lbryio.cacheResolvedSubscriptions.clear(); for (Fragment fragment : openNavFragments.values()) { if (fragment instanceof FollowingFragment) { // reload local subscriptions - Lbryio.cacheResolvedSubscriptions.clear(); FollowingFragment followingFragment = (FollowingFragment) fragment; followingFragment.fetchLoadedSubscriptions(true); } -- 2.45.2 From feb7f260dcf5d979c37f2cc17edfac61de778930 Mon Sep 17 00:00:00 2001 From: Javi Rueda Date: Thu, 23 Jul 2020 05:36:15 +0200 Subject: [PATCH 2/2] Allow to publish files via Send To feature --- app/src/main/AndroidManifest.xml | 7 +++++++ .../java/io/lbry/browser/MainActivity.java | 21 +++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 7ac0cf49..f7d535e9 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -50,6 +50,13 @@ + + + + + + + diff --git a/app/src/main/java/io/lbry/browser/MainActivity.java b/app/src/main/java/io/lbry/browser/MainActivity.java index 961a5090..4368970a 100644 --- a/app/src/main/java/io/lbry/browser/MainActivity.java +++ b/app/src/main/java/io/lbry/browser/MainActivity.java @@ -8,6 +8,7 @@ import android.app.NotificationManager; import android.app.PendingIntent; import android.app.PictureInPictureParams; import android.content.BroadcastReceiver; +import android.content.ClipData; import android.content.ComponentName; import android.content.Context; import android.content.Intent; @@ -579,6 +580,7 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener protected void onNewIntent(Intent intent) { super.onNewIntent(intent); + checkSendToIntent(intent); checkUrlIntent(intent); checkNotificationOpenIntent(intent); } @@ -833,6 +835,12 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener openFragment(FileViewFragment.class, true, NavMenuItem.ID_ITEM_FOLLOWING, params); } + public void openSendTo(String path) { + Map params = new HashMap<>(); + params.put("directFilePath", path); + openFragment(PublishFormFragment.class, true, NavMenuItem.ID_ITEM_NEW_PUBLISH, params); + } + public void openFileClaim(Claim claim) { Map params = new HashMap<>(); params.put("claimId", claim.getClaimId()); @@ -2644,6 +2652,19 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener LbryAnalytics.logEvent(LbryAnalytics.EVENT_LBRY_NOTIFICATION_OPEN, bundle); } + private void checkSendToIntent(Intent intent) { + String intentAction = intent.getAction(); + if (intentAction != null && intentAction.equals("android.intent.action.SEND")) { + ClipData clipData = intent.getClipData(); + if (clipData != null) { + Uri uri = clipData.getItemAt(0).getUri(); + + String path = Helper.getRealPathFromURI_API19(this, uri); + openSendTo(path); + } + } + } + private void registerServiceActionsReceiver() { IntentFilter intentFilter = new IntentFilter(); intentFilter.addAction(DownloadManager.ACTION_DOWNLOAD_EVENT); -- 2.45.2