Compare commits

..
121 Commits
Author SHA1 Message Date
Akinwale Ariwodola 6fa308ef96 bumpversion 0.16.13 --> 0.16.14 2021-01-25 18:54:00 +01:00
Akinwale Ariwodola f3e513fc2d Update translations and content filters 2021-01-25 18:52:21 +01:00
Akinwale Ariwodola d72a8faec4 sdk 0.88.0 2021-01-23 19:23:11 +01:00
Akinwale Ariwodola fdb4578349 Merge pull request #1119 from kekkyojin/remove-sha256
Remove Helper.SHA256() method
2021-01-18 20:24:22 +01:00
Javi Rueda c08237d399 Remove Helper.SHA256() method 2021-01-14 13:04:43 +01:00
Akinwale Ariwodola bdf8a58818 bumpversion 0.16.12 --> 0.16.13 2021-01-12 09:11:26 +01:00
Akinwale Ariwodola e1d51c881a Fix crash bug for anonymous repost claim results. Better handle channel repost navigation. 2021-01-12 09:07:33 +01:00
Akinwale Ariwodola 28212808f8 Merge pull request #1115 from pakar/master
Upgrade ExoPlayer from 2.11.4 to 2.12.2
2021-01-12 08:35:04 +01:00
Akinwale Ariwodola 74f08f8f98 Merge pull request #1102 from kekkyojin/fix-markdown-rendering
Use Base64 to encode html when rendering Markdown files
2021-01-12 08:33:40 +01:00
Akinwale Ariwodola cb5c29fbce Merge pull request #1117 from kekkyojin/fix-nosuchmethod-commons
Fix NoSuchMethod exception for HelperSHA256 on API Level prior to P
2021-01-12 08:32:08 +01:00
Javi Rueda 4d775d3a17 Fix NoSuchMethod exception for HelperSHA256 on API Level prior to P 2021-01-11 20:44:03 +01:00
Patric Karlström fd94ef9fa7 Upgrade ExoPlayer from 2.11.4 to 2.12.2 2021-01-11 01:10:23 +01:00
Javi Rueda 2e0331305a Use Base64 to encode html when rendering Markdown files 2020-12-29 11:30:05 +01:00
Akinwale Ariwodola fb560f8f01 fix last resource build error 2020-12-29 07:20:46 +01:00
Akinwale Ariwodola ef80c9f7fd fix resource build error 2020-12-29 07:13:57 +01:00
Akinwale Ariwodola 99a4a0a22f Remove comment post confirmation. Fix resources build error. 2020-12-29 07:07:53 +01:00
Akinwale Ariwodola 136853853a bumpversion 0.16.11 --> 0.16.12 2020-12-29 07:02:13 +01:00
Akinwale Ariwodola ebf3299c30 add scrollbars attribute to listview 2020-12-29 07:00:45 +01:00
Akinwale Ariwodola 036b49a871 Merge pull request #1097 from kekkyojin/remove_stages_scrollbar
Avoid showing vertical scroll bar on stage error listview
2020-12-29 07:00:02 +01:00
Akinwale Ariwodola 67d5f88d34 Merge pull request #1100 from clay53/master
Changed wallet send notification to accept 4 digit decimal
2020-12-29 06:52:16 +01:00
Akinwale Ariwodola b1e0b9af33 sdk 0.87.0. Show confirmation for unfollow. 2020-12-29 06:47:10 +01:00
Clayton Hickey c30b012787 Changed wallet send notification to accept 4 digit decimal 2020-12-27 03:54:36 -05:00
Javi Rueda c8c6305757 Avoid showing vertical scroll bar on stage error listview 2020-12-22 02:26:37 +01:00
Akinwale Ariwodola ee1d090e62 Merge pull request #1068 from kekkyojin/fix-lintproblems
Some fixes for lint
2020-12-21 19:43:08 +01:00
Javi Rueda 9e56a86492 Some fixes for lint 2020-12-18 14:30:48 +01:00
Akinwale Ariwodola e6b83877f1 Merge pull request #1063 from clay53/1042
Removed comment tips
2020-12-18 13:01:49 +01:00
Akinwale Ariwodola b567e39aef Merge pull request #1069 from kekkyojin/add-twitter-instructions
Provide instructions to add dummy Twitter API credentials
2020-12-18 12:22:03 +01:00
Akinwale Ariwodola ae62dba0a6 Merge pull request #1071 from kekkyojin/sha256-unittest
Add unit test for Helper.SHA256(String)
2020-12-18 12:21:39 +01:00
Akinwale Ariwodola df1e8abf50 Merge pull request #1067 from kekkyojin/use-apache-hex
Replace Hex class from GMS with the one from Apache
2020-12-18 12:20:42 +01:00
Javi Rueda 31cfb26c3b Add unit test for Helper.SHA256(String) 2020-12-15 13:45:32 +01:00
Javi Rueda e5f34dc464 Provide instructions to add dummy Twitter API credentials 2020-12-14 20:38:57 +01:00
Javi Rueda 601031e55d Replace Hex class from GMS with the one from Apache 2020-12-14 18:17:13 +01:00
Akinwale Ariwodola a9aadbe6a8 bumpversion 0.16.10 --> 0.16.11 2020-12-13 18:08:10 +01:00
Akinwale Ariwodola f9a4b71037 fix crash error when following doesn't exist in shared user state 2020-12-13 18:07:19 +01:00
Clayton Hickey 0f10e9dc1f Removed comment tips 2020-12-12 20:11:00 -05:00
Akinwale Ariwodola 0647deb06c Merge pull request #1061 from kekkyojin/startupstage-listview
Use ListView to show startup stage errors
2020-12-12 23:16:17 +01:00
Akinwale Ariwodola b2f5fec293 make the channel filter name alphabet uppercase 2020-12-10 09:57:27 +01:00
Javi Rueda daf4e5aca2 Use ListView to show startup stage errors 2020-12-09 21:05:21 +01:00
Akinwale Ariwodola c1324efb41 bumpversion 0.16.9 --> 0.16.10 2020-12-09 11:47:58 +01:00
Akinwale Ariwodola 6221de2d3c sync notificationsDisabled states for followed channels 2020-12-09 11:31:13 +01:00
Akinwale Ariwodola 983bc68af2 Merge branch 'master' of https://github.com/lbryio/lbry-android 2020-12-09 11:00:25 +01:00
Akinwale Ariwodola f1b167693d SDK 0.86.1. is_seen vs is_read swap. Fix error condition where wallet sync starts if the wallet is not ready. 2020-12-09 10:59:25 +01:00
Akinwale Ariwodola 68ac64b534 Merge pull request #1057 from kekkyojin/sort-commentreplies
Sort replies from oldest to newest
2020-12-05 04:32:41 +01:00
Javi Rueda 6819ae46f9 Sort replies from oldest to newest 2020-12-01 04:58:48 +01:00
Akinwale Ariwodola 6c406c5a85 share_usage_data setting 2020-11-29 05:07:54 +01:00
Akinwale Ariwodola c179243d22 update dependencies 2020-11-26 00:04:37 +01:00
Akinwale Ariwodola d0f5504c80 LbryUri parsing improvements. Remove duplicate code. 2020-11-15 09:11:50 +01:00
Akinwale Ariwodola 896c566a02 Merge pull request #1045 from kekkyojin/open-file-external
Offer opening unsupported filetypes with external app
2020-11-13 15:42:59 +01:00
Javi Rueda da9352cc68 Offer opening unsupported filetypes with external app 2020-10-27 14:28:15 +01:00
Akinwale Ariwodola b8d2375e20 Merge pull request #1044 from ycohen-dev/fix_issue_1043
Fix floating wallet/rewards bar for RTL layout
2020-10-23 13:25:07 +01:00
Akinwale Ariwodola dd52ff9d07 Merge pull request #1033 from kekkyojin/md-text-rendering
Fix for text not rendering after # in markdown
2020-10-23 13:23:15 +01:00
yuval d9891f8a8a Floating wallet balance/rewards now visible in RTL layout
(Fix issue #1043)
2020-10-22 22:22:44 +03:00
Akinwale Ariwodola ea5fe6842d Merge pull request #1041 from ycohen-dev/fix_issue_1040
fix issue 1040
2020-10-21 00:15:36 +01:00
Akinwale Ariwodola fc649187df Merge pull request #1039 from ycohen-dev/fix_issue_1038
fix issue 1038
2020-10-21 00:14:15 +01:00
yuval b0f7c41885 fix issue 1040
Transaction amount text Direction changed to LTR.
Transaction amount pinned to end of view
2020-10-17 22:18:14 +03:00
yuval 45935717c8 fix issue 1038
Replaced gravity pinning to "end" instead of "right"
Pinned claim id which could be in rtl and ltr scripts to the start of the layout
2020-10-16 23:40:28 +03:00
Akinwale Ariwodola ac5e666369 bumpversion 0.16.8 --> 0.16.9 2020-10-16 06:58:57 +01:00
Akinwale Ariwodola ffeb72a383 Publish mature tags. String resource updates. 2020-10-16 06:53:08 +01:00
Akinwale Ariwodola 0ec09d751c Merge pull request #1036 from ycohen-dev/fix_issue_1034
Fix issue #1034
2020-10-16 06:39:45 +01:00
Akinwale Ariwodola b8e4fcff92 Merge pull request #1037 from lbryio/follow-text
add follow text beside follow icon
2020-10-16 06:37:50 +01:00
Akinwale Ariwodola b79f0f4820 add follow text beside follow icon 2020-10-16 06:36:36 +01:00
yuval a1cd58a214 Fix issue #1034
Hide notifications when entering PiP mode
2020-10-16 00:11:08 +03:00
Javi Rueda cfca8facbe Use '%23' instead of '#' when rendering #hashtag style text from markdown 2020-10-15 01:49:53 +02:00
Akinwale Ariwodola 066a0a099c Merge pull request #1032 from lbryio/wallet-balance-page
use credits icon on wallet balance page
2020-10-14 15:33:25 +01:00
Akinwale Ariwodola afeee2e5df use credits icon on wallet balance page 2020-10-14 15:30:59 +01:00
Akinwale Ariwodola 76036acfc7 Merge branch 'master' of https://github.com/lbryio/lbry-android 2020-10-14 15:17:35 +01:00
Akinwale Ariwodola 897bfdaffd fix build error 2020-10-14 15:16:45 +01:00
Akinwale Ariwodola 7475ae323c Merge pull request #1031 from ycohen-dev/fix_issue_1030
Fix issue #1030
2020-10-14 15:12:34 +01:00
Akinwale Ariwodola faf7f3ccbf make credits translatable 2020-10-14 15:11:36 +01:00
Akinwale Ariwodola 4940d1ca33 Merge branch 'master' of https://github.com/lbryio/lbry-android 2020-10-14 15:10:25 +01:00
Akinwale Ariwodola 3d48fa5741 also check pending when checking if item is a placeholder 2020-10-14 15:09:59 +01:00
yuval f9887cffae Fix issue #1030
Dismiss all active dialog fragment when entering PiP mode
So that PiP window contain the video only
2020-10-13 23:17:58 +03:00
Akinwale Ariwodola 6644907665 Merge pull request #1027 from ycohen-dev/fix_issue_1025
Fix issue #1025
2020-10-12 19:25:48 +01:00
Akinwale Ariwodola 5f850685d6 bumpversion 0.16.7 --> 0.16.8 2020-10-12 11:48:24 +01:00
Akinwale Ariwodola 5f9674e49c do not open lbry.*/$/verify links in the app 2020-10-12 11:47:45 +01:00
yuval 0d185c6db3 Fix issue #1025
Increased size of currency selection spinner in publish form fragment
Now spinner is in proper size to display "LBRY Credits" default value
2020-10-10 16:58:29 +03:00
Akinwale Ariwodola 53d22dd22d remove debug logs 2020-10-09 07:43:38 +01:00
Akinwale Ariwodola ff8ffda3c6 bumpversion 0.16.6 --> 0.16.7 2020-10-09 07:39:46 +01:00
Akinwale Ariwodola 64bd540322 In-app notification options (#1023)
* pull-down to refresh in-app notifications
* support deleting notifications
2020-10-09 07:38:47 +01:00
Akinwale Ariwodola 919f9a48f3 Merge pull request #1022 from lbryio/bell-icon
per-channel subscribe notification toggle
2020-10-09 06:58:08 +01:00
Akinwale Ariwodola 746d442051 per-channel subscribe notification toggle 2020-10-09 06:56:13 +01:00
Akinwale Ariwodola 1877b75188 fix strings.xml 2020-10-06 07:14:42 +01:00
Akinwale Ariwodola 6e8c38cace update module versions 2020-10-05 16:56:17 +01:00
Akinwale Ariwodola eab7bab267 Credits icon (#1021)
* new credits icon
* remove references to LBC
2020-10-05 16:50:39 +01:00
Akinwale Ariwodola aab648c3cf Fix errors with deep link handling (#1019) 2020-10-02 12:39:37 +01:00
Javi Rueda f79ff509bd Support some lbry hosts to deep links. Add unit tests (#1008)
* Support lbry.tv and other supported hosts for deep links. Add unit tests for LbryUri parse() method
* add unit test for lbry protocol schema
* Add unit test for lbry.tv deep-link with only channel
2020-10-02 12:34:38 +01:00
Akinwale Ariwodola 1197e990ca cleanup debug logging 2020-10-02 12:09:33 +01:00
Akinwale Ariwodola dce1c0715e move Unpublish button 2020-10-02 12:08:33 +01:00
Akinwale Ariwodola 6a0263c5bc Merge pull request #1013 from clay53/987
Add ability to download & delete your own videos and move unpublish button to description
2020-10-02 11:05:44 +01:00
Akinwale Ariwodola ca64db0499 sdk 0.82.0 2020-10-01 12:42:48 +01:00
Akinwale Ariwodola a5d4eda4d1 bumpversion 0.16.5 --> 0.16.6 2020-09-25 14:45:48 +01:00
Akinwale Ariwodola 5d210961c1 apply mature filter to Editor's Choice 2020-09-25 14:41:40 +01:00
Akinwale Ariwodola 1b88f565af bumpversion 0.16.4 --> 0.16.5 2020-09-23 16:37:41 +01:00
Akinwale Ariwodola 991a98b571 fix shuffle mode player getting stuck 2020-09-23 16:35:59 +01:00
Akinwale Ariwodola 0073277d6e Merge pull request #1017 from lbryio/shuffle-random
keep track of watched content for subsequent shuffle sessions
2020-09-23 16:23:57 +01:00
Akinwale Ariwodola eeca602f7a keep track of watched content for subsequent shuffle sessions 2020-09-23 15:31:34 +01:00
Akinwale Ariwodola 6c171560fd remove Finnish strings 2020-09-18 14:56:35 +01:00
Akinwale Ariwodola 66c4c00215 bumpversion 0.16.3 --> 0.16.4 2020-09-18 14:54:59 +01:00
Akinwale Ariwodola 9b9ef9ab74 Surf mode experiment (#1003)
* surf mode implementation
* occupy entire vertical area
* fix onResume logic
* shuffle mode with selected channel ids
2020-09-18 14:53:19 +01:00
Clayton Hickey 39a289e7f1 Add ability to download & delete your own videos and move unpublish button to description 2020-09-16 14:31:03 -04:00
Akinwale Ariwodola 722c829502 fix paid content stream source 2020-09-14 18:21:31 +01:00
Akinwale Ariwodola 7ecb80d136 Merge pull request #1009 from lbryio/mini-player-margin
add setting for mini-player bottom spacing
2020-09-14 18:05:09 +01:00
Akinwale Ariwodola ea19af04d4 add setting for mini-player bottom spacing 2020-09-14 18:01:38 +01:00
Akinwale Ariwodola 8196b69211 bumpversion 0.16.2 --> 0.16.3 2020-09-14 11:20:47 +01:00
Akinwale Ariwodola dc861caf6c fix websocket for Android < 7.0 2020-09-14 11:19:50 +01:00
Akinwale Ariwodola adb5ffa8d0 exclude x86_64 lib from build 2020-09-14 11:06:39 +01:00
Akinwale Ariwodola d918cb28bd sdk 0.81.0 2020-09-11 13:50:16 +01:00
Akinwale Ariwodola 7ce7314ab9 bumpversion 0.16.1 --> 0.16.2 2020-09-11 13:41:30 +01:00
Javi Rueda 13e5caa0ef Use Start/End instead of Left/Right to support RTL (#1005)
* Use Start/End instead of Left/Right to support RTL
* Change it also for relative layout properties
2020-09-11 13:28:37 +01:00
Akinwale Ariwodola ff59a7a89f Merge pull request #1007 from lbryio/first-run-install-id
generate install_id natively
2020-09-11 13:22:42 +01:00
Akinwale Ariwodola c3efa4d004 generate install_id natively 2020-09-10 12:20:49 +01:00
Akinwale Ariwodola ed50e1300a real time notifications over websocket (#1000)
* real time notifications over websocket
* automatically re-establish websocket connections
2020-09-09 14:16:22 +01:00
Akinwale Ariwodola 86dbfd54d1 Merge pull request #1006 from lbryio/notification-back
proper back navigation to the notifications screen
2020-09-09 14:05:29 +01:00
Akinwale Ariwodola 535120eebd proper back navigation to the notifications screen 2020-09-09 14:03:36 +01:00
Akinwale Ariwodola c1106d7186 display correct playback speed for media 2020-09-04 12:50:22 +01:00
Akinwale Ariwodola 45be7f2c9b Merge pull request #1004 from lbryio/player-resume-black-screen
display player view correctly after dismissing PIP view
2020-09-04 12:33:53 +01:00
Akinwale Ariwodola d6baf3d1c8 display player view correctly after dismissing PIP view 2020-09-04 12:32:53 +01:00
Akinwale Ariwodola 08c38c1723 bumpversion 0.16.0 --> 0.16.1 2020-08-28 10:07:20 +01:00
Javi Rueda af4fa454d3 Add setting to enable sending buffering events (#993)
* Add setting to enable sending buffering events
* Use true as default value
2020-08-28 10:06:41 +01:00
Akinwale Ariwodola 0620582a4e fix in-app notification read background in dark mode 2020-08-28 10:04:10 +01:00
Akinwale Ariwodola b11c07e3d1 fix comment redirect from device notifications 2020-08-28 10:00:57 +01:00
153 changed files with 5194 additions and 2609 deletions

No files matched your search

+11 -1
View File
@@ -18,7 +18,17 @@ The minimum supported Android version is 5.0 Lollipop. There are two ways to ins
The app can be launched by opening **LBRY** from the device's app drawer or via the shortcut on the home screen if that was created upon installation.
## Running from Source
Clone the repository and open the project in Android Studio. Android Studio will automatically run the initial build process. Click the Run button to launch the app on your simulator or connected debugging device after the build process is complete.
Clone the repository and open the project in Android Studio. Android Studio will automatically run the initial build process.
Create file 'twitter.properties' in app/ folder with the following content:
```
twitterConsumerKey=XXXXXX
twitterConsumerSecret=XXXXXX
```
Click the Sync button and when process finishes, the Run button to launch the app on your simulator or connected debugging device after the build process is complete.
## Contributing
Contributions to this project are welcome, encouraged, and compensated. For more details, see https://lbry.io/faq/contributing
+28 -20
View File
@@ -16,14 +16,15 @@ android {
applicationId "io.lbry.browser"
minSdkVersion 21
targetSdkVersion 29
versionCode 1600
versionName "0.16.0"
versionCode 1614
versionName "0.16.14"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
packagingOptions {
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'lib/x86_64/darwin/libscrypt.dylib'
}
productFlavors {
@@ -79,34 +80,35 @@ dependencies {
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.3.0-alpha01'
implementation "androidx.cardview:cardview:1.0.0"
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.navigation:navigation-fragment:2.2.2'
implementation 'androidx.navigation:navigation-ui:2.2.2'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.navigation:navigation-fragment:2.3.1'
implementation 'androidx.navigation:navigation-ui:2.3.1'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'
implementation 'androidx.preference:preference:1.1.1'
implementation 'androidx.webkit:webkit:1.3.0-alpha03'
implementation 'androidx.webkit:webkit:1.4.0-rc01'
implementation 'androidx.camera:camera-core:1.0.0-beta03'
implementation 'androidx.camera:camera-camera2:1.0.0-beta03'
implementation 'androidx.camera:camera-lifecycle:1.0.0-beta03'
implementation 'androidx.camera:camera-view:1.0.0-alpha10'
implementation 'androidx.browser:browser:1.2.0'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
implementation 'com.github.bumptech.glide:glide:4.11.0'
implementation 'com.squareup.okhttp3:okhttp:4.4.1'
implementation 'com.google.firebase:firebase-analytics:17.4.2'
implementation 'com.google.android.gms:play-services-base:17.2.1'
implementation 'com.google.firebase:firebase-messaging:20.2.0'
implementation 'com.google.firebase:firebase-analytics:18.0.0'
implementation 'com.google.android.gms:play-services-base:17.5.0'
implementation 'com.google.firebase:firebase-messaging:21.0.0'
implementation 'com.google.oauth-client:google-oauth-client:1.30.4'
implementation 'com.android.billingclient:billing:3.0.0'
implementation 'com.android.billingclient:billing:3.0.2'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.google.android.exoplayer:exoplayer-core:2.11.4'
implementation 'com.google.android.exoplayer:exoplayer-dash:2.11.4'
implementation 'com.google.android.exoplayer:exoplayer-ui:2.11.4'
implementation 'com.google.android.exoplayer:extension-cast:2.11.4'
implementation 'com.google.android.exoplayer:extension-mediasession:2.11.4'
implementation 'com.google.android.exoplayer:exoplayer-core:2.12.2'
implementation 'com.google.android.exoplayer:exoplayer-dash:2.12.2'
implementation 'com.google.android.exoplayer:exoplayer-ui:2.12.2'
implementation 'com.google.android.exoplayer:extension-cast:2.12.2'
implementation 'com.google.android.exoplayer:extension-mediasession:2.12.2'
implementation 'com.google.android:flexbox:2.0.1'
@@ -117,16 +119,22 @@ dependencies {
implementation 'com.arthenica:mobile-ffmpeg-full-gpl:4.3.1.LTS'
implementation 'commons-codec:commons-codec:1.15'
implementation 'org.bitcoinj:bitcoinj-tools:0.14.7'
implementation 'org.java-websocket:Java-WebSocket:1.5.1'
compileOnly 'org.projectlombok:lombok:1.18.10'
annotationProcessor 'org.projectlombok:lombok:1.18.10'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation 'androidx.test:runner:1.3.0'
androidTestImplementation 'androidx.test:rules:1.3.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
__32bitImplementation 'io.lbry:lbrysdk32:0.80.0'
__64bitImplementation 'io.lbry:lbrysdk64:0.80.0'
__32bitImplementation 'io.lbry:lbrysdk32:0.88.0'
__64bitImplementation 'io.lbry:lbrysdk64:0.88.0'
}
apply plugin: 'com.google.gms.google-services'
@@ -0,0 +1,12 @@
package io.lbry.browser.utils;
import androidx.test.filters.SmallTest;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
@SmallTest
public class HelperTest {
}
+13
View File
@@ -11,6 +11,7 @@
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.android.vending.BILLING" />
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<application
android:allowBackup="true"
@@ -68,6 +69,18 @@
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="https" android:host="open.lbry.com"/>
<data android:scheme="https" android:host="lbry.tv" android:pathPattern="/..*/*" />
<data android:scheme="https" android:host="lbry.tv" android:pathPattern="/.*:.*" />
<data android:scheme="https" android:host="lbry.tv" android:pathPattern="/.*#.*" />
<data android:scheme="https" android:host="lbry.lat" android:pathPattern="/..*/*" />
<data android:scheme="https" android:host="lbry.lat" android:pathPattern="/.*:.*" />
<data android:scheme="https" android:host="lbry.lat" android:pathPattern="/.*#.*" />
<data android:scheme="https" android:host="lbry.fr" android:pathPattern="/..*/*" />
<data android:scheme="https" android:host="lbry.fr" android:pathPattern="/.*:.*" />
<data android:scheme="https" android:host="lbry.fr" android:pathPattern="/.*#.*" />
<data android:scheme="https" android:host="lbry.in" android:pathPattern="/..*/*" />
<data android:scheme="https" android:host="lbry.in" android:pathPattern="/.*:.*" />
<data android:scheme="https" android:host="lbry.in" android:pathPattern="/.*#.*" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
@@ -15,12 +15,22 @@ import androidx.appcompat.app.AppCompatActivity;
import androidx.core.text.HtmlCompat;
import androidx.preference.PreferenceManager;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import io.lbry.browser.exceptions.AuthTokenInvalidatedException;
import io.lbry.browser.utils.Helper;
import io.lbry.browser.utils.Lbry;
import io.lbry.browser.utils.LbryAnalytics;
import io.lbry.browser.utils.Lbryio;
import io.lbry.lbrysdk.LbrynetService;
import io.lbry.lbrysdk.ServiceHelper;
import io.lbry.lbrysdk.Utils;
public class FirstRunActivity extends AppCompatActivity {
@@ -44,12 +54,7 @@ public class FirstRunActivity extends AppCompatActivity {
});
registerAuthReceiver();
if (!Lbry.SDK_READY) {
findViewById(R.id.welcome_wait_container).setVisibility(View.VISIBLE);
} else {
authenticate();
}
findViewById(R.id.welcome_wait_container).setVisibility(View.VISIBLE);
IntentFilter filter = new IntentFilter();
filter.addAction(MainActivity.ACTION_SDK_READY);
filter.addAction(LbrynetService.ACTION_STOP_SERVICE);
@@ -62,10 +67,38 @@ public class FirstRunActivity extends AppCompatActivity {
authenticate();
} else if (LbrynetService.ACTION_STOP_SERVICE.equals(action)) {
finish();
if (MainActivity.instance != null) {
MainActivity.instance.finish();
}
}
}
};
registerReceiver(sdkReceiver, filter);
CheckInstallIdTask task = new CheckInstallIdTask(this, new CheckInstallIdTask.InstallIdHandler() {
@Override
public void onInstallIdChecked(boolean result) {
// start the sdk from FirstRun
boolean serviceRunning = MainActivity.isServiceRunning(MainActivity.instance, LbrynetService.class);
if (!serviceRunning) {
Lbry.SDK_READY = false;
ServiceHelper.start(MainActivity.instance, "", LbrynetService.class, "lbrynetservice");
}
if (result) {
// install_id generated and validated, authenticate now
authenticate();
return;
}
// we weren't able to generate the install_id ourselves, depend on the sdk for that
if (Lbry.SDK_READY) {
authenticate();
return;
}
}
});
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
public void onResume() {
@@ -134,6 +167,74 @@ public class FirstRunActivity extends AppCompatActivity {
super.onDestroy();
}
private void generateIdAndAuthenticate() {
}
private static class CheckInstallIdTask extends AsyncTask<Void, Void, Boolean> {
private Context context;
private InstallIdHandler handler;
public CheckInstallIdTask(Context context, InstallIdHandler handler) {
this.context = context;
this.handler = handler;
}
protected Boolean doInBackground(Void... params) {
// Load the installation id from the file system
String lbrynetDir = String.format("%s/%s", Utils.getAppInternalStorageDir(context), "lbrynet");
File dir = new File(lbrynetDir);
boolean dirExists = dir.isDirectory();
if (!dirExists) {
dirExists = dir.mkdirs();
}
if (!dirExists) {
return false;
}
String installIdPath = String.format("%s/install_id", lbrynetDir);
File file = new File(installIdPath);
String installId = null;
if (!file.exists()) {
// generate the install_id
installId = Lbry.generateId();
BufferedWriter writer = null;
try {
writer = new BufferedWriter(new FileWriter(file));
writer.write(installId);
} catch (IOException ex) {
return false;
} finally {
Helper.closeCloseable(writer);
}
} else {
// read the installation id from the file
BufferedReader reader = null;
try {
reader = new BufferedReader(new InputStreamReader(new FileInputStream(installIdPath)));
installId = reader.readLine();
} catch (IOException ex) {
return false;
} finally {
Helper.closeCloseable(reader);
}
}
if (!Helper.isNullOrEmpty(installId)) {
Lbry.INSTALLATION_ID = installId;
}
return !Helper.isNullOrEmpty(installId);
}
protected void onPostExecute(Boolean result) {
if (handler != null) {
handler.onInstallIdChecked(result);
}
}
public interface InstallIdHandler {
void onInstallIdChecked(boolean result);
}
}
private static class AuthenticateTask extends AsyncTask<Void, Void, Void> {
private Context context;
public AuthenticateTask(Context context) {
@@ -100,7 +100,7 @@ public class LbrynetMessagingService extends FirebaseMessagingService {
@Override
public void onNewToken(String token) {
Log.d(TAG, "Refreshed token: " + token);
//Log.d(TAG, "Refreshed token: " + token);
// If you want to send messages to this application instance or
// manage this apps subscriptions on the server side, send the
File diff suppressed because it is too large. Load diff
@@ -31,6 +31,7 @@ import java.util.Arrays;
import java.util.List;
import io.lbry.browser.adapter.VerificationPagerAdapter;
import io.lbry.browser.listener.SdkStatusListener;
import io.lbry.browser.listener.SignInListener;
import io.lbry.browser.listener.WalletSyncListener;
import io.lbry.browser.model.lbryinc.RewardVerified;
@@ -48,6 +49,7 @@ public class VerificationActivity extends FragmentActivity implements SignInList
public static final int VERIFICATION_FLOW_REWARDS = 2;
public static final int VERIFICATION_FLOW_WALLET = 3;
private List<SdkStatusListener> sdkStatusListeners;
private BillingClient billingClient;
private BroadcastReceiver sdkReceiver;
private String email;
@@ -105,6 +107,8 @@ public class VerificationActivity extends FragmentActivity implements SignInList
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
sdkStatusListeners = new ArrayList<>();
signedIn = Lbryio.isSignedIn();
Intent intent = getIntent();
if (intent != null) {
@@ -126,11 +130,18 @@ public class VerificationActivity extends FragmentActivity implements SignInList
IntentFilter filter = new IntentFilter();
filter.addAction(LbrynetService.ACTION_STOP_SERVICE);
filter.addAction(MainActivity.ACTION_SDK_READY);
sdkReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (LbrynetService.ACTION_STOP_SERVICE.equals(action)) {
if (MainActivity.ACTION_SDK_READY.equals(action)) {
for (SdkStatusListener listener : sdkStatusListeners) {
if (listener != null) {
listener.onSdkReady();
}
}
} else if (LbrynetService.ACTION_STOP_SERVICE.equals(action)) {
finish();
}
}
@@ -436,4 +447,14 @@ public class VerificationActivity extends FragmentActivity implements SignInList
Helper.unregisterReceiver(sdkReceiver, this);
super.onDestroy();
}
public void addSdkStatusListener(SdkStatusListener listener) {
if (!sdkStatusListeners.contains(listener)) {
sdkStatusListeners.add(listener);
}
}
public void removeSdkStatusListener(SdkStatusListener listener) {
sdkStatusListeners.remove(listener);
}
}
@@ -101,7 +101,7 @@ public class ChannelFilterListAdapter extends RecyclerView.Adapter<ChannelFilter
}
vh.alphaContainer.setVisibility(claim.isPlaceholder() || Helper.isNullOrEmpty(thumbnailUrl) ? View.VISIBLE : View.GONE);
vh.thumbnailView.setVisibility(claim.isPlaceholder() || Helper.isNullOrEmpty(thumbnailUrl) ? View.GONE : View.VISIBLE);
vh.alphaView.setText(claim.isPlaceholder() ? null : claim.getName() != null ? claim.getName().substring(1, 2) : "");
vh.alphaView.setText(claim.isPlaceholder() ? null : claim.getName() != null ? claim.getName().substring(1, 2).toUpperCase() : "");
int bgColor = Helper.generateRandomColorForValue(claim.getClaimId());
Helper.setIconViewBackgroundColor(vh.alphaContainer, bgColor, claim.isPlaceholder(), context);
@@ -323,7 +323,7 @@ public class ClaimListAdapter extends RecyclerView.Adapter<ClaimListAdapter.View
int paddingBottom = position == getItemCount() - 1 ? 16 : 8;
int paddingTopScaled = Helper.getScaledValue(paddingTop, scale);
int paddingBottomScaled = Helper.getScaledValue(paddingBottom, scale);
vh.itemView.setPadding(vh.itemView.getPaddingLeft(), paddingTopScaled, vh.itemView.getPaddingRight(), paddingBottomScaled);
vh.itemView.setPadding(vh.itemView.getPaddingStart(), paddingTopScaled, vh.itemView.getPaddingEnd(), paddingBottomScaled);
Claim original = items.get(position);
boolean isRepost = Claim.TYPE_REPOST.equalsIgnoreCase(original.getValueType());
@@ -404,7 +404,7 @@ public class ClaimListAdapter extends RecyclerView.Adapter<ClaimListAdapter.View
vh.publishTimeView.setVisibility(!isPending ? View.VISIBLE : View.GONE);
vh.pendingTextView.setVisibility(isPending && !item.isLoadingPlaceholder() ? View.VISIBLE : View.GONE);
vh.repostInfoView.setVisibility(isRepost && type != VIEW_TYPE_FEATURED ? View.VISIBLE : View.GONE);
vh.repostChannelView.setText(isRepost ? original.getSigningChannel().getName() : null);
vh.repostChannelView.setText(isRepost && original.getSigningChannel() != null ? original.getSigningChannel().getName() : null);
vh.repostChannelView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
@@ -430,7 +430,7 @@ public class ClaimListAdapter extends RecyclerView.Adapter<ClaimListAdapter.View
Helper.setViewVisibility(vh.loadingTextPlaceholder2, item.isLoadingPlaceholder() ? View.VISIBLE : View.GONE);
Helper.setViewVisibility(vh.titleView, !item.isLoadingPlaceholder() ? View.VISIBLE : View.GONE);
Helper.setViewVisibility(vh.publisherView, !item.isLoadingPlaceholder() ? View.VISIBLE : View.GONE);
Helper.setViewVisibility(vh.publishTimeView, !item.isLoadingPlaceholder() ? View.VISIBLE : View.GONE);
Helper.setViewVisibility(vh.publishTimeView, !item.isLoadingPlaceholder() && !isPending ? View.VISIBLE : View.GONE);
if (type == VIEW_TYPE_FEATURED && item.isUnresolved()) {
vh.durationView.setVisibility(View.GONE);
@@ -173,9 +173,9 @@ public class CommentListAdapter extends RecyclerView.Adapter<CommentListAdapter.
public void onBindViewHolder(ViewHolder holder, int position) {
Comment comment = items.get(position);
holder.itemView.setPadding(
nested ? Helper.getScaledValue(56, scale) : holder.itemView.getPaddingLeft(),
nested ? Helper.getScaledValue(56, scale) : holder.itemView.getPaddingStart(),
holder.itemView.getPaddingTop(),
nested ? 0 : holder.itemView.getPaddingRight(),
nested ? 0 : holder.itemView.getPaddingEnd(),
holder.itemView.getPaddingBottom());
holder.channelName.setText(comment.getChannelName());
@@ -14,6 +14,7 @@ import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.google.android.material.snackbar.Snackbar;
import java.util.ArrayList;
import java.util.Calendar;
@@ -24,6 +25,7 @@ import java.util.List;
import java.util.TimeZone;
import io.lbry.browser.R;
import io.lbry.browser.listener.SelectionModeListener;
import io.lbry.browser.model.Claim;
import io.lbry.browser.model.lbryinc.LbryNotification;
import io.lbry.browser.ui.controls.SolidIconView;
@@ -43,15 +45,19 @@ public class NotificationListAdapter extends RecyclerView.Adapter<NotificationLi
private Context context;
private List<LbryNotification> items;
private List<LbryNotification> selectedItems;
@Setter
private NotificationClickListener clickListener;
@Getter
@Setter
private int customizeMode;
private boolean inSelectionMode;
@Setter
private SelectionModeListener selectionModeListener;
public NotificationListAdapter(List<LbryNotification> notifications, Context context) {
this.context = context;
this.items = new ArrayList<>(notifications);
this.selectedItems = new ArrayList<>();
Collections.sort(items, Collections.reverseOrder(new LbryNotification()));
}
@@ -62,6 +68,7 @@ public class NotificationListAdapter extends RecyclerView.Adapter<NotificationLi
protected TextView timeView;
protected SolidIconView iconView;
protected ImageView thumbnailView;
protected View selectedOverlayView;
public ViewHolder(View v) {
super(v);
layoutView = v.findViewById(R.id.notification_layout);
@@ -70,12 +77,25 @@ public class NotificationListAdapter extends RecyclerView.Adapter<NotificationLi
timeView = v.findViewById(R.id.notification_time);
iconView = v.findViewById(R.id.notification_icon);
thumbnailView = v.findViewById(R.id.notification_author_thumbnail);
selectedOverlayView = v.findViewById(R.id.notification_selected_overlay);
}
}
public int getItemCount() {
return items != null ? items.size() : 0;
}
public List<LbryNotification> getSelectedItems() {
return this.selectedItems;
}
public int getSelectedCount() {
return selectedItems != null ? selectedItems.size() : 0;
}
public void clearSelectedItems() {
this.selectedItems.clear();
}
public boolean isNotificationSelected(LbryNotification notification) {
return selectedItems.contains(notification);
}
public void insertNotification(LbryNotification notification, int index) {
if (!items.contains(notification)) {
@@ -90,6 +110,12 @@ public class NotificationListAdapter extends RecyclerView.Adapter<NotificationLi
}
notifyDataSetChanged();
}
public void removeNotifications(List<LbryNotification> notifications) {
for (LbryNotification notification : notifications) {
items.remove(notification);
}
notifyDataSetChanged();
}
public List<String> getAuthorUrls() {
List<String> urls = new ArrayList<>();
@@ -158,8 +184,8 @@ public class NotificationListAdapter extends RecyclerView.Adapter<NotificationLi
@Override
public void onBindViewHolder(NotificationListAdapter.ViewHolder vh, int position) {
LbryNotification notification = items.get(position);
vh.layoutView.setBackgroundColor(ContextCompat.getColor(context, notification.isSeen() ? R.color.white : R.color.nextLbryGreenSemiTransparent));
vh.layoutView.setBackgroundColor(ContextCompat.getColor(context, notification.isSeen() ? android.R.color.transparent : R.color.nextLbryGreenSemiTransparent));
vh.selectedOverlayView.setVisibility(isNotificationSelected(notification) ? View.VISIBLE : View.GONE);
vh.titleView.setVisibility(!Helper.isNullOrEmpty(notification.getTitle()) ? View.VISIBLE : View.GONE);
vh.titleView.setText(notification.getTitle());
@@ -180,11 +206,49 @@ public class NotificationListAdapter extends RecyclerView.Adapter<NotificationLi
vh.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (clickListener != null) {
clickListener.onNotificationClicked(notification);
if (inSelectionMode) {
toggleSelectedNotification(notification);
} else {
if (clickListener != null) {
clickListener.onNotificationClicked(notification);
}
}
}
});
vh.itemView.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View view) {
if (!inSelectionMode) {
inSelectionMode = true;
if (selectionModeListener != null) {
selectionModeListener.onEnterSelectionMode();
}
}
toggleSelectedNotification(notification);
return true;
}
});
}
private void toggleSelectedNotification(LbryNotification notification) {
if (selectedItems.contains(notification)) {
selectedItems.remove(notification);
} else {
selectedItems.add(notification);
}
if (selectionModeListener != null) {
selectionModeListener.onItemSelectionToggled();
}
if (selectedItems.size() == 0) {
inSelectionMode = false;
if (selectionModeListener != null) {
selectionModeListener.onExitSelectionMode();
}
}
notifyDataSetChanged();
}
private long getLocalNotificationTime(LbryNotification notification) {
@@ -0,0 +1,70 @@
package io.lbry.browser.adapter;
import android.content.Context;
import android.graphics.Color;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import java.util.List;
import io.lbry.browser.R;
import io.lbry.browser.model.StartupStage;
public class StartupStageAdapter extends BaseAdapter {
private final List<StartupStage> list;
private final LayoutInflater inflater;
private final String[] stagesString;
public StartupStageAdapter(Context ctx, List<StartupStage> rows) {
this.list = rows;
this.inflater = LayoutInflater.from(ctx);
stagesString = new String[9];
stagesString[0] = ctx.getResources().getString(R.string.installation_id_loaded);
stagesString[1] = ctx.getResources().getString(R.string.known_tags_loaded);
stagesString[2] = ctx.getResources().getString(R.string.exchange_rate_loaded);
stagesString[3] = ctx.getResources().getString(R.string.user_authenticated);
stagesString[4] = ctx.getResources().getString(R.string.installation_registered);
stagesString[5] = ctx.getResources().getString(R.string.subscriptions_loaded);
stagesString[6] = ctx.getResources().getString(R.string.subscriptions_resolved);
stagesString[7] = ctx.getResources().getString(R.string.block_list_loaded);
stagesString[8] = ctx.getResources().getString(R.string.filter_list_loaded);
}
@Override
public int getCount() {
return list.size();
}
@Override
public Object getItem(int i) {
return list.get(i);
}
@Override
public long getItemId(int i) {
return i;
}
@Override
public View getView(int i, View view, ViewGroup viewGroup) {
if (view == null) {
view = inflater.inflate(R.layout.list_item_startupstage, viewGroup, false);
ImageView iconView = view.findViewById(R.id.startup_stage_icon);
TextView textView = view.findViewById(R.id.startup_stage_text);
StartupStage item = (StartupStage) getItem(i);
iconView.setImageResource(item.stageDone ? R.drawable.ic_check : R.drawable.ic_close);
iconView.setColorFilter(item.stageDone ? Color.WHITE : Color.RED);
textView.setText(stagesString[item.stage - 1]);
}
return view;
}
}
@@ -6,6 +6,7 @@ import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import java.math.BigDecimal;
import java.sql.SQLInput;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
@@ -21,13 +22,13 @@ import io.lbry.browser.utils.Helper;
import io.lbry.browser.utils.LbryUri;
public class DatabaseHelper extends SQLiteOpenHelper {
public static final int DATABASE_VERSION = 6;
public static final int DATABASE_VERSION = 8;
public static final String DATABASE_NAME = "LbryApp.db";
private static DatabaseHelper instance;
private static final String[] SQL_CREATE_TABLES = {
// local subscription store
"CREATE TABLE subscriptions (url TEXT PRIMARY KEY NOT NULL, channel_name TEXT NOT NULL)",
"CREATE TABLE subscriptions (url TEXT PRIMARY KEY NOT NULL, channel_name TEXT NOT NULL, is_notifications_disabled INTEGER DEFAULT 0 NOT NULL)",
// url entry / suggestion history
"CREATE TABLE url_history (id INTEGER PRIMARY KEY NOT NULL, value TEXT NOT NULL, url TEXT, type INTEGER NOT NULL, timestamp TEXT NOT NULL)",
// tags (known and followed)
@@ -60,6 +61,7 @@ public class DatabaseHelper extends SQLiteOpenHelper {
", is_read INTEGER DEFAULT 0 NOT NULL" +
", is_seen INTEGER DEFAULT 0 NOT NULL " +
", timestamp TEXT NOT NULL)",
"CREATE TABLE shuffle_watched (id INTEGER PRIMARY KEY NOT NULL, claim_id TEXT NOT NULL)"
};
private static final String[] SQL_CREATE_INDEXES = {
"CREATE UNIQUE INDEX idx_subscription_url ON subscriptions (url)",
@@ -69,7 +71,8 @@ public class DatabaseHelper extends SQLiteOpenHelper {
"CREATE UNIQUE INDEX idx_view_history_url_device ON view_history (url, device)",
"CREATE INDEX idx_view_history_device ON view_history (device)",
"CREATE UNIQUE INDEX idx_notification_remote_id ON notifications (remote_id)",
"CREATE INDEX idx_notification_timestamp ON notifications (timestamp)"
"CREATE INDEX idx_notification_timestamp ON notifications (timestamp)",
"CREATE UNIQUE INDEX idx_shuffle_watched_claim ON shuffle_watched (claim_id)",
};
private static final String[] SQL_V1_V2_UPGRADE = {
@@ -99,11 +102,19 @@ public class DatabaseHelper extends SQLiteOpenHelper {
private static final String[] SQL_V5_V6_UPGRADE = {
"ALTER TABLE notifications ADD COLUMN author_url TEXT"
};
private static final String[] SQL_V6_V7_UPGRADE = {
"CREATE TABLE shuffle_watched (id INTEGER PRIMARY KEY NOT NULL, claim_id TEXT NOT NULL)",
"CREATE UNIQUE INDEX idx_shuffle_watched_claim ON shuffle_watched (claim_id)"
};
private static final String[] SQL_V7_V8_UPGRADE = {
"AlTER TABLE subscriptions ADD COLUMN is_notifications_disabled INTEGER DEFAULT 0 NOT NULL"
};
private static final String SQL_INSERT_SUBSCRIPTION = "REPLACE INTO subscriptions (channel_name, url) VALUES (?, ?)";
private static final String SQL_INSERT_SUBSCRIPTION = "REPLACE INTO subscriptions (channel_name, url, is_notifications_disabled) VALUES (?, ?, ?)";
private static final String SQL_UPDATE_SUBSCRIPTION_NOTIFICATION = "UPDATE subscriptions SET is_notification_disabled = ? WHERE url = ?";
private static final String SQL_CLEAR_SUBSCRIPTIONS = "DELETE FROM subscriptions";
private static final String SQL_DELETE_SUBSCRIPTION = "DELETE FROM subscriptions WHERE url = ?";
private static final String SQL_GET_SUBSCRIPTIONS = "SELECT channel_name, url FROM subscriptions";
private static final String SQL_GET_SUBSCRIPTIONS = "SELECT channel_name, url, is_notifications_disabled FROM subscriptions";
private static final String SQL_INSERT_URL_HISTORY = "REPLACE INTO url_history (value, url, type, timestamp) VALUES (?, ?, ?, ?)";
private static final String SQL_CLEAR_URL_HISTORY = "DELETE FROM url_history";
@@ -113,9 +124,14 @@ public class DatabaseHelper extends SQLiteOpenHelper {
private static final String SQL_INSERT_NOTIFICATION = "REPLACE INTO notifications (remote_id, author_url, title, description, rule, target_url, is_read, is_seen, timestamp) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)";
private static final String SQL_GET_NOTIFICATIONS = "SELECT id, remote_id, author_url, title, description, rule, target_url, is_read, is_seen, timestamp FROM notifications ORDER BY timestamp DESC LIMIT 500";
private static final String SQL_GET_UNREAD_NOTIFICATIONS_COUNT = "SELECT COUNT(id) FROM notifications WHERE is_read <> 1";
private static final String SQL_GET_UNSEEN_NOTIFICATIONS_COUNT = "SELECT COUNT(id) FROM notifications WHERE is_seen <> 1";
private static final String SQL_MARK_NOTIFICATIONS_READ = "UPDATE notifications SET is_read = 1 WHERE is_read = 0";
private static final String SQL_MARK_NOTIFICATIONS_SEEN = "UPDATE notifications SET is_seen = 1 WHERE is_seen = 0";
private static final String SQL_MARK_NOTIFICATION_READ_AND_SEEN = "UPDATE notifications SET is_read = 1, is_seen = 1 WHERE id = ?";
private static final String SQL_INSERT_SHUFFLE_WATCHED = "REPLACE INTO shuffle_watched (claim_id) VALUES (?)";
private static final String SQL_GET_SHUFFLE_WATCHED_CLAIMS = "SELECT claim_id FROM shuffle_watched";
private static final String SQL_INSERT_VIEW_HISTORY =
"REPLACE INTO view_history (url, claim_id, claim_name, cost, currency, title, publisher_claim_id, publisher_name, publisher_title, thumbnail_url, device, release_time, timestamp) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
private static final String SQL_GET_VIEW_HISTORY =
@@ -174,6 +190,16 @@ public class DatabaseHelper extends SQLiteOpenHelper {
db.execSQL(sql);
}
}
if (oldVersion < 7) {
for (String sql : SQL_V6_V7_UPGRADE) {
db.execSQL(sql);
}
}
if (oldVersion < 8) {
for (String sql : SQL_V7_V8_UPGRADE) {
db.execSQL(sql);
}
}
}
public void onDowngrade(SQLiteDatabase db, int oldVersion, int newVersion) {
@@ -190,6 +216,7 @@ public class DatabaseHelper extends SQLiteOpenHelper {
public static void clearUrlHistoryBefore(Date date, SQLiteDatabase db) {
db.execSQL(SQL_CLEAR_URL_HISTORY_BEFORE_TIME, new Object[] { new SimpleDateFormat(Helper.ISO_DATE_FORMAT_PATTERN).format(new Date()) });
}
// History items are essentially url suggestions
public static List<UrlSuggestion> getRecentHistory(SQLiteDatabase db) {
List<UrlSuggestion> suggestions = new ArrayList<>();
@@ -289,7 +316,14 @@ public class DatabaseHelper extends SQLiteOpenHelper {
}
public static void createOrUpdateSubscription(Subscription subscription, SQLiteDatabase db) {
db.execSQL(SQL_INSERT_SUBSCRIPTION, new Object[] { subscription.getChannelName(), subscription.getUrl() });
db.execSQL(SQL_INSERT_SUBSCRIPTION, new Object[] {
subscription.getChannelName(),
subscription.getUrl(),
subscription.isNotificationsDisabled() ? 1 : 0
});
}
public static void setSubscriptionNotificationDisabled(boolean flag, String url, SQLiteDatabase db) {
db.execSQL(SQL_UPDATE_SUBSCRIPTION_NOTIFICATION, new Object[] { flag ? 1 : 0, url });
}
public static void deleteSubscription(Subscription subscription, SQLiteDatabase db) {
db.execSQL(SQL_DELETE_SUBSCRIPTION, new Object[] { subscription.getUrl() });
@@ -306,6 +340,7 @@ public class DatabaseHelper extends SQLiteOpenHelper {
Subscription subscription = new Subscription();
subscription.setChannelName(cursor.getString(0));
subscription.setUrl(cursor.getString(1));
subscription.setNotificationsDisabled(cursor.getInt(2) == 1);
subscriptions.add(subscription);
}
} finally {
@@ -357,6 +392,20 @@ public class DatabaseHelper extends SQLiteOpenHelper {
}
return notifications;
}
public static void deleteNotifications(List<LbryNotification> notifications, SQLiteDatabase db) {
StringBuilder sb = new StringBuilder("DELETE FROM notifications WHERE remote_id IN (");
List<Object> remoteIds = new ArrayList<>();
String delim = "";
for (int i = 0; i < notifications.size(); i++) {
remoteIds.add(String.valueOf(notifications.get(i).getRemoteId()));
sb.append(delim).append("?");
delim = ",";
}
sb.append(")");
String sql = sb.toString();
db.execSQL(sql, remoteIds.toArray());
}
public static int getUnreadNotificationsCount(SQLiteDatabase db) {
int count = 0;
Cursor cursor = null;
@@ -370,10 +419,42 @@ public class DatabaseHelper extends SQLiteOpenHelper {
}
return count;
}
public static int getUnseenNotificationsCount(SQLiteDatabase db) {
int count = 0;
Cursor cursor = null;
try {
cursor = db.rawQuery(SQL_GET_UNSEEN_NOTIFICATIONS_COUNT, null);
if (cursor.moveToNext()) {
count = cursor.getInt(0);
}
} finally {
Helper.closeCursor(cursor);
}
return count;
}
public static void markNotificationsSeen(SQLiteDatabase db) {
db.execSQL(SQL_MARK_NOTIFICATIONS_SEEN);
}
public static void markNotificationsRead(SQLiteDatabase db) {
db.execSQL(SQL_MARK_NOTIFICATIONS_READ);
}
public static void markNotificationReadAndSeen(long notificationId, SQLiteDatabase db) {
db.execSQL(SQL_MARK_NOTIFICATION_READ_AND_SEEN, new Object[] { notificationId });
}
public static void createOrUpdateShuffleWatched(String claimId, SQLiteDatabase db) {
db.execSQL(SQL_INSERT_SHUFFLE_WATCHED, new Object[] { claimId });
}
public static List<String> getShuffleWatchedClaims(SQLiteDatabase db) {
List<String> claimIds = new ArrayList<>();
Cursor cursor = null;
try {
cursor = db.rawQuery(SQL_GET_SHUFFLE_WATCHED_CLAIMS, null);
while (cursor.moveToNext()) {
claimIds.add(cursor.getString(0));
}
} finally {
Helper.closeCursor(cursor);
}
return claimIds;
}
}
@@ -225,9 +225,10 @@ public class CreateSupportDialogFragment extends BottomSheetDialogFragment imple
if (!isTip) {
sendButton.setText(R.string.send_revocable_support);
} else {
String amountString = Helper.getValue(inputAmount.getText());
String amountString = Helper.getValue(inputAmount.getText(), "0");
double parsedAmount = Helper.parseDouble(amountString, 0);
sendButton.setText(parsedAmount == 0 ? getString(R.string.send_a_tip) : getString(R.string.send_lbc_tip, amountString));
String text = getResources().getQuantityString(R.plurals.send_lbc_tip, parsedAmount == 1.0 ? 1 : 2, amountString);
sendButton.setText(text);
}
}
@@ -11,8 +11,7 @@ import io.lbry.browser.utils.Helper;
import lombok.Data;
@Data
public class Comment {
public static final double LBC_COST = 1;
public class Comment implements Comparable<Comment> {
public static final int MAX_LENGTH = 2000;
private Claim poster;
@@ -66,4 +65,9 @@ public class Comment {
return null;
}
}
@Override
public int compareTo(Comment comment) {
return (int)(this.getTimestamp() - comment.getTimestamp());
}
}
@@ -20,6 +20,7 @@ public class NavMenuItem {
public static final int ID_ITEM_FOLLOWING = 101;
public static final int ID_ITEM_EDITORS_CHOICE = 102;
public static final int ID_ITEM_ALL_CONTENT = 103;
public static final int ID_ITEM_SHUFFLE = 104;
// Your Content
public static final int ID_ITEM_CHANNELS = 201;
@@ -0,0 +1,11 @@
package io.lbry.browser.model;
public class StartupStage {
public Integer stage;
public Boolean stageDone;
public StartupStage(Integer stage, Boolean stageDone) {
this.stage = stage;
this.stageDone = stageDone;
}
}
@@ -11,17 +11,21 @@ public class Subscription {
@Getter
@Setter
private String url;
@Getter
@Setter
private boolean isNotificationsDisabled;
public Subscription() {
}
public Subscription(String channelName, String url) {
public Subscription(String channelName, String url, boolean isNotificationsDisabled) {
this.channelName = channelName;
this.url = url;
this.isNotificationsDisabled = isNotificationsDisabled;
}
public static Subscription fromClaim(Claim claim) {
return new Subscription(claim.getName(), claim.getPermanentUrl());
return new Subscription(claim.getName(), claim.getPermanentUrl(), false);
}
public String toString() {
return url;
@@ -24,18 +24,16 @@ import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
public class CommentCreateWithTipTask extends AsyncTask<Void, Void, Comment> {
public class CommentCreateTask extends AsyncTask<Void, Void, Comment> {
private static final String STATUS_ENDPOINT = "https://comments.lbry.com";
private Comment comment;
private BigDecimal amount;
private View progressView;
private CommentCreateWithTipHandler handler;
private Exception error;
public CommentCreateWithTipTask(Comment comment, BigDecimal amount, View progressView, CommentCreateWithTipHandler handler) {
public CommentCreateTask(Comment comment, View progressView, CommentCreateWithTipHandler handler) {
this.comment = comment;
this.amount = amount;
this.progressView = progressView;
this.handler = handler;
}
@@ -62,13 +60,6 @@ public class CommentCreateWithTipTask extends AsyncTask<Void, Void, Comment> {
}
Map<String, Object> options = new HashMap<>();
options.put("blocking", true);
options.put("claim_id", comment.getClaimId());
options.put("amount", new DecimalFormat(Helper.SDK_AMOUNT_FORMAT, new DecimalFormatSymbols(Locale.US)).format(amount.doubleValue()));
options.put("tip", true);
Lbry.genericApiCall(Lbry.METHOD_SUPPORT_CREATE, options);
options = new HashMap<>();
options.put("comment", comment.getText());
options.put("claim_id", comment.getClaimId());
options.put("channel_id", comment.getChannelId());
@@ -8,6 +8,7 @@ import org.json.JSONArray;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -51,7 +52,6 @@ public class CommentListTask extends AsyncTask<Void, Void, List<Comment>> {
options.put("skip_validation", true);
options.put("visible", true);
JSONObject result = (JSONObject) Lbry.genericApiCall(Lbry.METHOD_COMMENT_LIST, options);
JSONArray items = result.getJSONArray("items");
@@ -68,6 +68,9 @@ public class CommentListTask extends AsyncTask<Void, Void, List<Comment>> {
}
}
// Sort all replies from oldest to newest at once
Collections.sort(children);
for (Comment child : children) {
for (Comment parent : comments) {
if (parent.getId().equalsIgnoreCase(child.getParentId())) {
@@ -76,13 +76,15 @@ public class MergeSubscriptionsTask extends AsyncTask<Void, Void, List<Subscript
// check for any remote subs that may have been removed, and unsubscribe from them
for (int i = 0; i < array.length(); i++) {
JSONObject item = array.getJSONObject(i);
// TODO: Refactor by creating static Subscription.fromJSON method
String claimId = item.getString("claim_id");
String channelName = item.getString("channel_name");
boolean isNotificationsDisabled = item.getBoolean("is_notifications_disabled");
LbryUri url = new LbryUri();
url.setChannelName(channelName);
url.setClaimId(claimId);
Subscription subscription = new Subscription(channelName, url.toString());
Subscription subscription = new Subscription(channelName, url.toString(), isNotificationsDisabled);
remoteSubs.add(subscription);
}
}
@@ -51,11 +51,11 @@ public class ChannelSubscribeTask extends AsyncTask<Void, Void, Boolean> {
options.put("claim_id", channelClaimId);
if (!isUnsubscribing) {
options.put("channel_name", subscription.getChannelName());
options.put("notifications_disabled", String.valueOf(subscription.isNotificationsDisabled()).toLowerCase());
}
String action = isUnsubscribing ? "delete" : "new";
Lbryio.call("subscription", action, options, context);
Object response = Lbryio.parseResponse(Lbryio.call("subscription", action, options, context));
if (!isUnsubscribing) {
Lbryio.addSubscription(subscription);
} else {
@@ -49,11 +49,12 @@ public class FetchSubscriptionsTask extends AsyncTask<Void, Void, List<Subscript
JSONObject item = array.getJSONObject(i);
String claimId = item.getString("claim_id");
String channelName = item.getString("channel_name");
boolean isNotificationsDisabled = item.getBoolean("is_notifications_disabled");
LbryUri url = new LbryUri();
url.setChannelName(channelName);
url.setClaimId(claimId);
Subscription subscription = new Subscription(channelName, url.toString());
Subscription subscription = new Subscription(channelName, url.toString(), isNotificationsDisabled);
subscriptions.add(subscription);
// Persist the subscription locally if it doesn't exist
if (db != null) {
@@ -0,0 +1,33 @@
package io.lbry.browser.tasks.lbryinc;
import android.os.AsyncTask;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import io.lbry.browser.exceptions.LbryioRequestException;
import io.lbry.browser.exceptions.LbryioResponseException;
import io.lbry.browser.utils.Helper;
import io.lbry.browser.utils.Lbryio;
public class NotificationDeleteTask extends AsyncTask<Void, Void, Boolean> {
private List<Long> ids;
public NotificationDeleteTask(List<Long> ids) {
this.ids = ids;
}
protected Boolean doInBackground(Void... params) {
Map<String, String> options = new HashMap<>();
options.put("notification_ids", Helper.joinL(ids, ","));
try {
Object result = Lbryio.parseResponse(Lbryio.call("notification", "delete", options, null));
return "ok".equalsIgnoreCase(result.toString());
} catch (LbryioResponseException | LbryioRequestException ex) {
// pass
}
return false;
}
}
@@ -15,25 +15,25 @@ public class NotificationUpdateTask extends AsyncTask<Void, Void, Boolean> {
private List<Long> ids;
private boolean seen;
private boolean read;
private boolean updateSeen;
private boolean updateRead;
public NotificationUpdateTask(List<Long> ids, boolean read) {
this(ids, read, false, false);
public NotificationUpdateTask(List<Long> ids, boolean seen) {
this(ids, false, true, false);
}
public NotificationUpdateTask(List<Long> ids, boolean read, boolean seen, boolean updateSeen) {
public NotificationUpdateTask(List<Long> ids, boolean read, boolean seen, boolean updateRead) {
this.ids = ids;
this.read = read;
this.seen = seen;
this.updateSeen = updateSeen;
this.updateRead = updateRead;
}
protected Boolean doInBackground(Void... params) {
Map<String, String> options = new HashMap<>();
options.put("notification_ids", Helper.joinL(ids, ","));
options.put("is_read", String.valueOf(read));
if (updateSeen) {
options.put("is_seen", String.valueOf(seen));
options.put("is_seen", String.valueOf(seen));
if (updateRead) {
options.put("is_read", String.valueOf(read));
}
try {
@@ -18,6 +18,7 @@ import io.lbry.browser.exceptions.ApiCallException;
import io.lbry.browser.exceptions.LbryUriException;
import io.lbry.browser.model.Tag;
import io.lbry.browser.model.lbryinc.Subscription;
import io.lbry.browser.utils.Helper;
import io.lbry.browser.utils.Lbry;
import io.lbry.browser.utils.LbryUri;
@@ -69,6 +70,8 @@ public class LoadSharedUserStateTask extends AsyncTask<Void, Void, Boolean> {
value.has("subscriptions") && !value.isNull("subscriptions") ? value.getJSONArray("subscriptions") : null;
JSONArray tags =
value.has("tags") && !value.isNull("tags") ? value.getJSONArray("tags") : null;
JSONArray following =
value.has("following") && !value.isNull("following") ? value.getJSONArray("following") : null;
if (subscriptionUrls != null) {
subscriptions = new ArrayList<>();
@@ -78,7 +81,8 @@ public class LoadSharedUserStateTask extends AsyncTask<Void, Void, Boolean> {
LbryUri uri = LbryUri.parse(LbryUri.normalize(url));
Subscription subscription = new Subscription();
subscription.setChannelName(uri.getChannelName());
subscription.setUrl(url);
subscription.setUrl(uri.toString());
subscription.setNotificationsDisabled(isNotificationsDisabledForSubUrl(uri.toString(), following));
subscriptions.add(subscription);
if (db != null) {
DatabaseHelper.createOrUpdateSubscription(subscription, db);
@@ -125,6 +129,28 @@ public class LoadSharedUserStateTask extends AsyncTask<Void, Void, Boolean> {
return false;
}
protected boolean isNotificationsDisabledForSubUrl(String url, JSONArray following) {
if (following == null) {
return true;
}
try {
for (int i = 0; i < following.length(); i++) {
JSONObject item = following.getJSONObject(i);
String itemUrl = Helper.getJSONString("url", null, item);
boolean notificationsDisabled = Helper.getJSONBoolean("notificationsDisabled", true, item);
if (url.equalsIgnoreCase(itemUrl)) {
return notificationsDisabled;
}
}
} catch (JSONException ex) {
// pass
}
// always default notifications disabled to true
return true;
}
protected void onPostExecute(Boolean result) {
if (handler != null) {
if (result) {
@@ -2,6 +2,7 @@ package io.lbry.browser.tasks.wallet;
import android.os.AsyncTask;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
@@ -11,9 +12,11 @@ import java.util.List;
import java.util.Map;
import io.lbry.browser.exceptions.ApiCallException;
import io.lbry.browser.exceptions.LbryUriException;
import io.lbry.browser.model.lbryinc.Subscription;
import io.lbry.browser.utils.Helper;
import io.lbry.browser.utils.Lbry;
import io.lbry.browser.utils.LbryUri;
import io.lbry.browser.utils.Lbryio;
/*
@@ -40,9 +43,16 @@ public class SaveSharedUserStateTask extends AsyncTask<Void, Void, Boolean> {
protected Boolean doInBackground(Void... params) {
// data to save
// current subscriptions
List<Subscription> subs = new ArrayList<>(Lbryio.subscriptions);
List<String> subscriptionUrls = new ArrayList<>();
for (Subscription subscription : Lbryio.subscriptions) {
subscriptionUrls.add(subscription.getUrl());
try {
for (Subscription subscription : subs) {
LbryUri uri = LbryUri.parse(LbryUri.normalize(subscription.getUrl()));
subscriptionUrls.add(uri.toString());
}
} catch (LbryUriException ex) {
error = ex;
return false;
}
// followed tags
@@ -62,6 +72,7 @@ public class SaveSharedUserStateTask extends AsyncTask<Void, Void, Boolean> {
JSONObject value = shared.getJSONObject("value");
value.put("subscriptions", Helper.jsonArrayFromList(subscriptionUrls));
value.put("tags", Helper.jsonArrayFromList(followedTags));
value.put("following", buildUpdatedNotificationsDisabledStates(subs));
sharedObject = shared;
}
}
@@ -71,6 +82,7 @@ public class SaveSharedUserStateTask extends AsyncTask<Void, Void, Boolean> {
JSONObject value = new JSONObject();
value.put("subscriptions", Helper.jsonArrayFromList(subscriptionUrls));
value.put("tags", Helper.jsonArrayFromList(followedTags));
value.put("following", buildUpdatedNotificationsDisabledStates(subs));
sharedObject = new JSONObject();
sharedObject.put("type", "object");
@@ -91,6 +103,26 @@ public class SaveSharedUserStateTask extends AsyncTask<Void, Void, Boolean> {
return false;
}
private static JSONArray buildUpdatedNotificationsDisabledStates(List<Subscription> subscriptions) {
JSONArray states = new JSONArray();
for (Subscription subscription : subscriptions) {
if (!Helper.isNullOrEmpty(subscription.getUrl())) {
try {
JSONObject item = new JSONObject();
LbryUri uri = LbryUri.parse(LbryUri.normalize(subscription.getUrl()));
item.put("uri", uri.toString());
item.put("notificationsDisabled", subscription.isNotificationsDisabled());
states.put(item);
} catch (JSONException | LbryUriException ex) {
// pass
}
}
}
return states;
}
protected void onPostExecute(Boolean result) {
if (handler != null) {
if (result) {
@@ -33,6 +33,7 @@ public class WalletSendTask extends AsyncTask<Void, Void, Boolean> {
Map<String, Object> options = new HashMap<>();
options.put("addresses", Arrays.asList(recipientAddress));
options.put("amount", amount);
options.put("blocking", true);
Lbry.genericApiCall(Lbry.METHOD_WALLET_SEND, options);
} catch (ApiCallException ex) {
error = ex;
@@ -65,6 +65,14 @@ public class BaseFragment extends Fragment {
MainActivity.resumeGlobalPlayer(context);
}
}
if (params != null && params.containsKey("source") && "notification".equalsIgnoreCase(params.get("source").toString())) {
Context context = getContext();
if (context instanceof MainActivity) {
((MainActivity) context).navigateBackToNotifications();
}
}
rewardDriverClickListenerSet = false;
super.onStop();
}
@@ -30,7 +30,6 @@ import com.google.android.material.snackbar.Snackbar;
import com.google.android.material.textfield.TextInputEditText;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;
@@ -45,7 +44,7 @@ import io.lbry.browser.listener.WalletBalanceListener;
import io.lbry.browser.model.Claim;
import io.lbry.browser.model.Comment;
import io.lbry.browser.model.WalletBalance;
import io.lbry.browser.tasks.CommentCreateWithTipTask;
import io.lbry.browser.tasks.CommentCreateTask;
import io.lbry.browser.tasks.CommentListHandler;
import io.lbry.browser.tasks.CommentListTask;
import io.lbry.browser.tasks.claim.ChannelCreateUpdateTask;
@@ -58,7 +57,6 @@ import io.lbry.browser.utils.Helper;
import io.lbry.browser.utils.Lbry;
import io.lbry.browser.utils.LbryAnalytics;
import io.lbry.browser.utils.LbryUri;
import io.lbry.browser.utils.Lbryio;
import lombok.Setter;
public class ChannelCommentsFragment extends Fragment implements SdkStatusListener, WalletBalanceListener {
@@ -367,9 +365,6 @@ public class ChannelCommentsFragment extends Fragment implements SdkStatusListen
}
private void initCommentForm(View root) {
double amount = Comment.LBC_COST;
String buttonText = getResources().getQuantityString(R.plurals.post_for_credits, amount == 1 ? 1 : 2, Helper.LBC_CURRENCY_FORMAT.format(amount));
buttonPostComment.setText(buttonText);
textCommentLimit.setText(String.format("%d / %d", Helper.getValue(inputComment.getText()).length(), Comment.MAX_LENGTH));
buttonClearReplyToComment.setOnClickListener(new View.OnClickListener() {
@@ -387,7 +382,7 @@ public class ChannelCommentsFragment extends Fragment implements SdkStatusListen
return;
}
validateAndCheckPostComment(amount);
validateAndCheckPostComment();
}
});
@@ -433,7 +428,7 @@ public class ChannelCommentsFragment extends Fragment implements SdkStatusListen
});
}
private void validateAndCheckPostComment(double amount) {
private void validateAndCheckPostComment() {
String comment = Helper.getValue(inputComment.getText());
Claim channel = (Claim) commentChannelSpinner.getSelectedItem();
@@ -445,33 +440,8 @@ public class ChannelCommentsFragment extends Fragment implements SdkStatusListen
showError(getString(R.string.please_select_channel));
return;
}
if (Lbry.walletBalance == null || amount > Lbry.walletBalance.getAvailable().doubleValue()) {
showError(getString(R.string.insufficient_balance));
return;
}
Context context = getContext();
if (context != null) {
String titleText = getResources().getQuantityString(
R.plurals.post_and_tip,
amount == 1 ? 1 : 2,
Helper.LBC_CURRENCY_FORMAT.format(amount));
String confirmText = getResources().getQuantityString(
R.plurals.confirm_post_comment,
amount == 1 ? 1 : 2,
Helper.LBC_CURRENCY_FORMAT.format(amount),
claim.getTitleOrName());
AlertDialog.Builder builder = new AlertDialog.Builder(context).
setTitle(titleText).
setMessage(confirmText)
.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
postComment(amount);
}
}).setNegativeButton(R.string.no, null);
builder.show();
}
postComment();
}
private void updatePostAsChannel(Claim channel) {
@@ -545,17 +515,15 @@ public class ChannelCommentsFragment extends Fragment implements SdkStatusListen
replyToComment = null;
}
private void postComment(double tipAmount) {
private void postComment() {
if (postingComment) {
return;
}
Comment comment = buildPostComment();
// only use 2 decimal places
BigDecimal amount = new BigDecimal(String.valueOf(tipAmount));
beforePostComment();
CommentCreateWithTipTask task = new CommentCreateWithTipTask(comment, amount, progressPostComment, new CommentCreateWithTipTask.CommentCreateWithTipHandler() {
CommentCreateTask task = new CommentCreateTask(comment, progressPostComment, new CommentCreateTask.CommentCreateWithTipHandler() {
@Override
public void onSuccess(Comment createdComment) {
inputComment.setText(null);
@@ -573,7 +541,6 @@ public class ChannelCommentsFragment extends Fragment implements SdkStatusListen
checkNoComments();
Bundle bundle = new Bundle();
bundle.putDouble("amount", amount.doubleValue());
bundle.putString("claim_id", claim != null ? claim.getClaimId() : null);
bundle.putString("claim_name", claim != null ? claim.getName() : null);
LbryAnalytics.logEvent(LbryAnalytics.EVENT_COMMENT_CREATE, bundle);
@@ -227,6 +227,8 @@ public class ChannelContentFragment extends Fragment implements DownloadActionLi
null,
getContentSortOrder(),
contentReleaseTime,
0,
0,
currentClaimSearchPage == 0 ? 1 : currentClaimSearchPage,
Helper.CONTENT_PAGE_SIZE);
}
@@ -258,6 +260,8 @@ public class ChannelContentFragment extends Fragment implements DownloadActionLi
contentClaimSearchTask = new ClaimSearchTask(claimSearchOptions, Lbry.LBRY_TV_CONNECTION_STRING, getLoadingView(), new ClaimSearchResultHandler() {
@Override
public void onSuccess(List<Claim> claims, boolean hasReachedEnd) {
claims = Helper.filterClaimsByOutpoint(claims);
if (contentListAdapter == null) {
Context context = getContext();
if (context != null) {
@@ -80,7 +80,10 @@ public class ChannelFragment extends BaseFragment implements FetchChannelsListen
private View buttonShare;
private View buttonTip;
private View buttonFollowUnfollow;
private View buttonBell;
private SolidIconView iconBell;
private int subCount;
private TextView textFollow;
private OutlineIconView iconFollow;
private SolidIconView iconUnfollow;
private View layoutNothingAtLocation;
@@ -110,8 +113,11 @@ public class ChannelFragment extends BaseFragment implements FetchChannelsListen
buttonShare = root.findViewById(R.id.channel_view_share);
buttonTip = root.findViewById(R.id.channel_view_tip);
buttonFollowUnfollow = root.findViewById(R.id.channel_view_follow_unfollow);
textFollow = root.findViewById(R.id.channel_view_text_follow);
iconFollow = root.findViewById(R.id.channel_view_icon_follow);
iconUnfollow = root.findViewById(R.id.channel_view_icon_unfollow);
buttonBell = root.findViewById(R.id.channel_view_subscribe_notify);
iconBell = root.findViewById(R.id.channel_view_icon_bell);
tabPager = root.findViewById(R.id.channel_view_pager);
tabLayout = root.findViewById(R.id.channel_view_tabs);
@@ -202,6 +208,42 @@ public class ChannelFragment extends BaseFragment implements FetchChannelsListen
}
});
buttonBell.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (claim != null) {
boolean isNotificationsDisabled = Lbryio.isNotificationsDisabled(claim);
final Subscription subscription = Subscription.fromClaim(claim);
subscription.setNotificationsDisabled(!isNotificationsDisabled);
view.setEnabled(false);
Context context = getContext();
new ChannelSubscribeTask(context, claim.getClaimId(), subscription, false, new ChannelSubscribeTask.ChannelSubscribeHandler() {
@Override
public void onSuccess() {
view.setEnabled(true);
Lbryio.updateSubscriptionNotificationsDisabled(subscription);
Context context = getContext();
if (context instanceof MainActivity) {
((MainActivity) context).showMessage(subscription.isNotificationsDisabled() ?
R.string.receive_no_notifications : R.string.receive_all_notifications);
}
checkIsFollowing();
if (context != null) {
context.sendBroadcast(new Intent(MainActivity.ACTION_SAVE_SHARED_USER_STATE));
}
}
@Override
public void onError(Exception exception) {
view.setEnabled(true);
}
}).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
}
});
buttonFollowUnfollow.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
@@ -210,39 +252,22 @@ public class ChannelFragment extends BaseFragment implements FetchChannelsListen
return;
}
subscribing = true;
boolean isFollowing = Lbryio.isFollowing(claim);
Subscription subscription = Subscription.fromClaim(claim);
buttonFollowUnfollow.setEnabled(false);
new ChannelSubscribeTask(getContext(), claim.getClaimId(), subscription, isFollowing, new ChannelSubscribeTask.ChannelSubscribeHandler() {
@Override
public void onSuccess() {
if (isFollowing) {
Lbryio.removeSubscription(subscription);
Lbryio.removeCachedResolvedSubscription(claim);
} else {
Lbryio.addSubscription(subscription);
Lbryio.addCachedResolvedSubscription(claim);
}
buttonFollowUnfollow.setEnabled(true);
subscribing = false;
checkIsFollowing();
FollowingFragment.resetClaimSearchContent = true;
if (Lbry.SDK_READY) {
Context context = getContext();
if (context instanceof MainActivity) {
((MainActivity) context).saveSharedUserState();
}
}
}
@Override
public void onError(Exception exception) {
buttonFollowUnfollow.setEnabled(true);
subscribing = false;
}
}).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
if (isFollowing) {
Context context = getContext();
AlertDialog.Builder builder = new AlertDialog.Builder(context).
setTitle(R.string.confirm_unfollow).
setMessage(R.string.confirm_unfollow_message)
.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
doFollowUnfollow(isFollowing, view);
}
}).setNegativeButton(R.string.no, null);
builder.show();
} else {
doFollowUnfollow(isFollowing, view);
}
}
}
});
@@ -250,6 +275,39 @@ public class ChannelFragment extends BaseFragment implements FetchChannelsListen
return root;
}
private void doFollowUnfollow(boolean isFollowing, View view) {
subscribing = true;
Subscription subscription = Subscription.fromClaim(claim);
view.setEnabled(false);
new ChannelSubscribeTask(getContext(), claim.getClaimId(), subscription, isFollowing, new ChannelSubscribeTask.ChannelSubscribeHandler() {
@Override
public void onSuccess() {
if (isFollowing) {
Lbryio.removeSubscription(subscription);
Lbryio.removeCachedResolvedSubscription(claim);
} else {
Lbryio.addSubscription(subscription);
Lbryio.addCachedResolvedSubscription(claim);
}
buttonFollowUnfollow.setEnabled(true);
subscribing = false;
checkIsFollowing();
FollowingFragment.resetClaimSearchContent = true;
Context context = getContext();
if (context != null) {
context.sendBroadcast(new Intent(MainActivity.ACTION_SAVE_SHARED_USER_STATE));
}
}
@Override
public void onError(Exception exception) {
buttonFollowUnfollow.setEnabled(true);
subscribing = false;
}
}).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
private void deleteCurrentClaim() {
if (claim != null) {
Helper.setViewVisibility(layoutDisplayArea, View.GONE);
@@ -280,8 +338,15 @@ public class ChannelFragment extends BaseFragment implements FetchChannelsListen
private void checkIsFollowing() {
if (claim != null) {
boolean isFollowing = Lbryio.isFollowing(claim);
boolean notificationsDisabled = Lbryio.isNotificationsDisabled(claim);
Helper.setViewVisibility(iconFollow, !isFollowing ? View.VISIBLE : View.GONE);
Helper.setViewVisibility(textFollow, !isFollowing ? View.VISIBLE : View.GONE);
Helper.setViewVisibility(iconUnfollow, isFollowing ? View.VISIBLE : View.GONE);
Helper.setViewVisibility(buttonBell, isFollowing ? View.VISIBLE : View.GONE);
if (iconBell != null) {
iconBell.setText(notificationsDisabled ? R.string.fa_bell : R.string.fa_bell_slash);
}
}
}
@@ -414,6 +414,8 @@ public class AllContentFragment extends BaseFragment implements DownloadActionLi
null,
getContentSortOrder(),
contentReleaseTime,
0,
0,
currentClaimSearchPage == 0 ? 1 : currentClaimSearchPage,
Helper.CONTENT_PAGE_SIZE);
}
@@ -445,6 +447,8 @@ public class AllContentFragment extends BaseFragment implements DownloadActionLi
contentClaimSearchTask = new ClaimSearchTask(claimSearchOptions, Lbry.LBRY_TV_CONNECTION_STRING, getLoadingView(), new ClaimSearchResultHandler() {
@Override
public void onSuccess(List<Claim> claims, boolean hasReachedEnd) {
claims = Helper.filterClaimsByOutpoint(claims);
if (contentListAdapter == null) {
Context context = getContext();
if (context != null) {
@@ -32,6 +32,7 @@ import io.lbry.browser.ui.BaseFragment;
import io.lbry.browser.utils.Helper;
import io.lbry.browser.utils.Lbry;
import io.lbry.browser.utils.LbryAnalytics;
import io.lbry.browser.utils.Predefined;
public class EditorsChoiceFragment extends BaseFragment {
@@ -72,7 +73,7 @@ public class EditorsChoiceFragment extends BaseFragment {
return Lbry.buildClaimSearchOptions(
Claim.TYPE_REPOST,
null,
null, /*canShowMatureContent ? null : new ArrayList<>(Predefined.MATURE_TAGS),*/
canShowMatureContent ? null : new ArrayList<>(Predefined.MATURE_TAGS),
new ArrayList<>(titleChannelIdsMap.values()),
null,
Arrays.asList(Claim.ORDER_BY_RELEASE_TIME),
@@ -9,13 +9,15 @@ import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.ActivityInfo;
import android.graphics.Color;
import android.graphics.Outline;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Handler;
import android.text.Editable;
import android.text.TextWatcher;
import android.text.format.DateUtils;
import android.text.method.LinkMovementMethod;
import android.util.Base64;
import android.view.ContextMenu;
import android.view.LayoutInflater;
import android.view.MenuItem;
@@ -29,6 +31,7 @@ import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.AdapterView;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.TextView;
@@ -37,7 +40,7 @@ import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.widget.AppCompatSpinner;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.core.content.ContextCompat;
import androidx.core.text.HtmlCompat;
import androidx.core.widget.NestedScrollView;
import androidx.preference.PreferenceManager;
import androidx.recyclerview.widget.LinearLayoutManager;
@@ -122,7 +125,7 @@ import io.lbry.browser.model.WalletBalance;
import io.lbry.browser.model.lbryinc.Reward;
import io.lbry.browser.model.lbryinc.Subscription;
import io.lbry.browser.tasks.BufferEventTask;
import io.lbry.browser.tasks.CommentCreateWithTipTask;
import io.lbry.browser.tasks.CommentCreateTask;
import io.lbry.browser.tasks.CommentListHandler;
import io.lbry.browser.tasks.CommentListTask;
import io.lbry.browser.tasks.GenericTaskHandler;
@@ -144,7 +147,6 @@ import io.lbry.browser.tasks.lbryinc.ClaimRewardTask;
import io.lbry.browser.tasks.lbryinc.FetchStatCountTask;
import io.lbry.browser.tasks.lbryinc.LogFileViewTask;
import io.lbry.browser.ui.BaseFragment;
import io.lbry.browser.ui.controls.OutlineIconView;
import io.lbry.browser.ui.controls.SolidIconView;
import io.lbry.browser.ui.publish.PublishFragment;
import io.lbry.browser.utils.Helper;
@@ -167,7 +169,7 @@ public class FileViewFragment extends BaseFragment implements
WalletBalanceListener {
private static final int RELATED_CONTENT_SIZE = 16;
private static final String DEFAULT_PLAYBACK_SPEED = "1x";
private static final String CDN_PREFIX = "https://cdn.lbryplayer.xyz";
public static final String CDN_PREFIX = "https://cdn.lbryplayer.xyz";
private PlayerControlView castControlView;
private Player currentPlayer;
@@ -211,6 +213,7 @@ public class FileViewFragment extends BaseFragment implements
private TextView textReplyingTo;
private TextView textReplyToBody;
private View buttonClearReplyToComment;
private TextView textNothingAtLocation;
private boolean postingComment;
private boolean fetchingChannels;
@@ -261,6 +264,7 @@ public class FileViewFragment extends BaseFragment implements
commentPostAsThumbnail = root.findViewById(R.id.comment_form_thumbnail);
commentPostAsNoThumbnail = root.findViewById(R.id.comment_form_no_thumbnail);
commentPostAsAlpha = root.findViewById(R.id.comment_form_thumbnail_alpha);
textNothingAtLocation = root.findViewById(R.id.nothing_at_location_text);
inlineChannelCreator = root.findViewById(R.id.container_inline_channel_form_create);
inlineChannelCreatorInputName = root.findViewById(R.id.inline_channel_form_input_name);
@@ -298,13 +302,20 @@ public class FileViewFragment extends BaseFragment implements
loadingNewClaim = false;
}
} else if (playbackState == Player.STATE_BUFFERING) {
if (MainActivity.appPlayer != null && MainActivity.appPlayer.getCurrentPosition() > 0) {
Context ctx = getContext();
boolean sendBufferingEvents = true;
if (ctx != null) {
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(ctx);
sendBufferingEvents = sp.getBoolean(MainActivity.PREFERENCE_KEY_SEND_BUFFERING_EVENTS, true);
}
if (MainActivity.appPlayer != null && MainActivity.appPlayer.getCurrentPosition() > 0 && sendBufferingEvents) {
// we only want to log a buffer event after the media has already started playing
String mediaSourceUrl = getStreamingUrl();
long duration = MainActivity.appPlayer.getDuration();
long position = MainActivity.appPlayer.getCurrentPosition();
// TODO: Determine a hash for the userId
String userIdHash = Helper.SHA256(Lbryio.currentUser != null ? String.valueOf(Lbryio.currentUser.getId()) : "0");
String userIdHash = Lbryio.currentUser != null ? String.valueOf(Lbryio.currentUser.getId()) : "0";
if (mediaSourceUrl.startsWith(CDN_PREFIX)) {
BufferEventTask bufferEvent = new BufferEventTask(claim.getPermanentUrl(), duration, position, 1, userIdHash);
bufferEvent.executeOnExecutor(AsyncTask.SERIAL_EXECUTOR);
@@ -422,8 +433,11 @@ public class FileViewFragment extends BaseFragment implements
renderNothingAtLocation();
} else if (claim.getName().startsWith("@")) {
// this is a reposted channel, so launch the channel url
if (context instanceof MainActivity) {
((MainActivity) context).openChannelUrl(!Helper.isNullOrEmpty(claim.getShortUrl()) ? claim.getShortUrl() : claim.getPermanentUrl());
if (context instanceof MainActivity) {
MainActivity activity = (MainActivity) context;
//activity.onBackPressed(); // remove the reposted url page from the back stack
activity.getSupportFragmentManager().popBackStack();
activity.openChannelUrl(!Helper.isNullOrEmpty(claim.getShortUrl()) ? claim.getShortUrl() : claim.getPermanentUrl());
}
return;
}
@@ -445,13 +459,17 @@ public class FileViewFragment extends BaseFragment implements
if (claim != null && !invalidRepost) {
Helper.saveViewHistory(currentUrl, claim);
checkAndLoadRelatedContent();
checkAndLoadComments();
renderClaim();
if (claim.getFile() == null) {
loadFile();
if (Helper.isClaimBlocked(claim)) {
renderClaimBlocked();
} else {
initialFileLoadDone = true;
checkAndLoadRelatedContent();
checkAndLoadComments();
renderClaim();
if (claim.getFile() == null) {
loadFile();
} else {
initialFileLoadDone = true;
}
}
}
@@ -464,6 +482,21 @@ public class FileViewFragment extends BaseFragment implements
Helper.setViewVisibility(buttonPublishSomething, View.VISIBLE);
Helper.setViewVisibility(layoutResolving, View.GONE);
Helper.setViewVisibility(layoutDisplayArea, View.INVISIBLE);
if (textNothingAtLocation != null) {
textNothingAtLocation.setText(R.string.nothing_at_this_location);
}
}
private void renderClaimBlocked() {
Helper.setViewVisibility(layoutLoadingState, View.VISIBLE);
Helper.setViewVisibility(layoutNothingAtLocation, View.VISIBLE);
Helper.setViewVisibility(buttonPublishSomething, View.INVISIBLE);
Helper.setViewVisibility(layoutResolving, View.GONE);
Helper.setViewVisibility(layoutDisplayArea, View.INVISIBLE);
if (textNothingAtLocation != null) {
textNothingAtLocation.setMovementMethod(LinkMovementMethod.getInstance());
textNothingAtLocation.setText(HtmlCompat.fromHtml(getString(R.string.dmca_complaint_blocked), HtmlCompat.FROM_HTML_MODE_LEGACY));
}
}
private void checkNewClaimAndUrl(Claim newClaim, String newUrl) {
@@ -601,7 +634,7 @@ public class FileViewFragment extends BaseFragment implements
}
}
if (!Helper.isNullOrEmpty(lbryFile.getStreamingUrl()) && !Lbryio.isSignedIn()) {
if (!Helper.isNullOrEmpty(lbryFile.getStreamingUrl()) && (!claim.isFree() || !Lbryio.isSignedIn())) {
return lbryFile.getStreamingUrl();
}
}
@@ -673,9 +706,13 @@ public class FileViewFragment extends BaseFragment implements
if (claim != null) {
Helper.saveViewHistory(url, claim);
checkAndLoadRelatedContent();
checkAndLoadComments();
renderClaim();
if (Helper.isClaimBlocked(claim)) {
renderClaimBlocked();
} else {
checkAndLoadRelatedContent();
checkAndLoadComments();
renderClaim();
}
}
}
@@ -720,6 +757,7 @@ public class FileViewFragment extends BaseFragment implements
}
}
updatePlaybackSpeedView(root);
loadAndScheduleDurations();
}
@@ -732,6 +770,13 @@ public class FileViewFragment extends BaseFragment implements
}
}
public void onPause() {
if (MainActivity.appPlayer != null) {
MainActivity.nowPlayingSource = MainActivity.SOURCE_NOW_PLAYING_FILE;
}
super.onPause();
}
public void onStop() {
super.onStop();
Context context = getContext();
@@ -764,35 +809,34 @@ public class FileViewFragment extends BaseFragment implements
View root = getView();
if (root != null) {
PlayerView view = root.findViewById(R.id.file_view_exoplayer_view);
view.setVisibility(View.VISIBLE);
view.setPlayer(null);
view.setPlayer(MainActivity.appPlayer);
}
}
private View.OnClickListener followUnfollowListener = new View.OnClickListener() {
private View.OnClickListener bellIconListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
if (claim != null && claim.getSigningChannel() != null) {
Claim publisher = claim.getSigningChannel();
boolean isFollowing = Lbryio.isFollowing(publisher);
Subscription subscription = Subscription.fromClaim(publisher);
boolean isNotificationsDisabled = Lbryio.isNotificationsDisabled(publisher);
final Subscription subscription = Subscription.fromClaim(publisher);
subscription.setNotificationsDisabled(!isNotificationsDisabled);
view.setEnabled(false);
Context context = getContext();
new ChannelSubscribeTask(context, publisher.getClaimId(), subscription, isFollowing, new ChannelSubscribeTask.ChannelSubscribeHandler() {
new ChannelSubscribeTask(context, publisher.getClaimId(), subscription, false, new ChannelSubscribeTask.ChannelSubscribeHandler() {
@Override
public void onSuccess() {
if (isFollowing) {
Lbryio.removeSubscription(subscription);
Lbryio.removeCachedResolvedSubscription(publisher);
} else {
Lbryio.addSubscription(subscription);
Lbryio.addCachedResolvedSubscription(publisher);
}
view.setEnabled(true);
Lbryio.updateSubscriptionNotificationsDisabled(subscription);
Context context = getContext();
if (context instanceof MainActivity) {
((MainActivity) context).showMessage(subscription.isNotificationsDisabled() ?
R.string.receive_no_notifications : R.string.receive_all_notifications);
}
checkIsFollowing();
FollowingFragment.resetClaimSearchContent = true;
// Save shared user state
if (context != null) {
context.sendBroadcast(new Intent(MainActivity.ACTION_SAVE_SHARED_USER_STATE));
}
@@ -807,6 +851,66 @@ public class FileViewFragment extends BaseFragment implements
}
};
private View.OnClickListener followUnfollowListener = new View.OnClickListener() {
@Override
public void onClick(final View view) {
if (claim != null && claim.getSigningChannel() != null) {
Claim publisher = claim.getSigningChannel();
boolean isFollowing = Lbryio.isFollowing(publisher);
if (isFollowing) {
// show unfollow confirmation
Context context = getContext();
AlertDialog.Builder builder = new AlertDialog.Builder(context).
setTitle(R.string.confirm_unfollow).
setMessage(R.string.confirm_unfollow_message)
.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
doFollowUnfollow(isFollowing, view);
}
}).setNegativeButton(R.string.no, null);
builder.show();
} else {
doFollowUnfollow(isFollowing, view);
}
}
}
};
private void doFollowUnfollow(boolean isFollowing, View view) {
if (claim != null && claim.getSigningChannel() != null) {
Claim publisher = claim.getSigningChannel();
Subscription subscription = Subscription.fromClaim(publisher);
view.setEnabled(false);
Context context = getContext();
new ChannelSubscribeTask(context, publisher.getClaimId(), subscription, isFollowing, new ChannelSubscribeTask.ChannelSubscribeHandler() {
@Override
public void onSuccess() {
if (isFollowing) {
Lbryio.removeSubscription(subscription);
Lbryio.removeCachedResolvedSubscription(publisher);
} else {
Lbryio.addSubscription(subscription);
Lbryio.addCachedResolvedSubscription(publisher);
}
view.setEnabled(true);
checkIsFollowing();
FollowingFragment.resetClaimSearchContent = true;
// Save shared user state
if (context != null) {
context.sendBroadcast(new Intent(MainActivity.ACTION_SAVE_SHARED_USER_STATE));
}
}
@Override
public void onError(Exception exception) {
view.setEnabled(true);
}
}).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
}
private void resolveUrl(String url) {
resolving = true;
Helper.setViewVisibility(layoutDisplayArea, View.INVISIBLE);
@@ -825,7 +929,9 @@ public class FileViewFragment extends BaseFragment implements
// this is a reposted channel, so finish this activity and launch the channel url
Context context = getContext();
if (context instanceof MainActivity) {
((MainActivity) context).openChannelUrl(!Helper.isNullOrEmpty(claim.getShortUrl()) ? claim.getShortUrl() : claim.getPermanentUrl());
MainActivity activity = (MainActivity) context;
activity.getSupportFragmentManager().popBackStack();
activity.openChannelUrl(!Helper.isNullOrEmpty(claim.getShortUrl()) ? claim.getShortUrl() : claim.getPermanentUrl());
}
return;
}
@@ -839,11 +945,15 @@ public class FileViewFragment extends BaseFragment implements
Helper.saveViewHistory(url, claim);
checkAndResetNowPlayingClaim();
loadFile();
checkAndLoadRelatedContent();
checkAndLoadComments();
renderClaim();
if (Helper.isClaimBlocked(claim)) {
renderClaimBlocked();
} else {
loadFile();
checkAndLoadRelatedContent();
checkAndLoadComments();
renderClaim();
}
} else {
// render nothing at location
renderNothingAtLocation();
@@ -1000,30 +1110,39 @@ public class FileViewFragment extends BaseFragment implements
}
if (claim != null) {
boolean isOwnClaim = Lbry.ownClaims.contains(claim);
if (isOwnClaim) {
AlertDialog.Builder builder = new AlertDialog.Builder(getContext()).
setTitle(R.string.delete_content).
setMessage(R.string.confirm_delete_content_message)
.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
deleteCurrentClaim();
}
}).setNegativeButton(R.string.no, null);
builder.show();
} else {
AlertDialog.Builder builder = new AlertDialog.Builder(getContext()).
setTitle(R.string.delete_file).
setMessage(R.string.confirm_delete_file_message)
.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
deleteClaimFile();
}
}).setNegativeButton(R.string.no, null);
builder.show();
}
AlertDialog.Builder builder = new AlertDialog.Builder(getContext()).
setTitle(R.string.delete_file).
setMessage(R.string.confirm_delete_file_message)
.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
deleteClaimFile();
}
}).setNegativeButton(R.string.no, null);
builder.show();
}
}
});
root.findViewById(R.id.file_view_action_unpublish).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (!Lbry.SDK_READY) {
Snackbar.make(root.findViewById(R.id.file_view_claim_display_area), R.string.sdk_initializing_functionality, Snackbar.LENGTH_LONG).show();
return;
}
if (claim != null) {
AlertDialog.Builder builder = new AlertDialog.Builder(getContext()).
setTitle(R.string.delete_content).
setMessage(R.string.confirm_delete_content_message)
.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
deleteCurrentClaim();
}
}).setNegativeButton(R.string.no, null);
builder.show();
}
}
});
@@ -1145,8 +1264,10 @@ public class FileViewFragment extends BaseFragment implements
View buttonFollow = root.findViewById(R.id.file_view_icon_follow);
View buttonUnfollow = root.findViewById(R.id.file_view_icon_unfollow);
View buttonBell = root.findViewById(R.id.file_view_icon_bell);
buttonFollow.setOnClickListener(followUnfollowListener);
buttonUnfollow.setOnClickListener(followUnfollowListener);
buttonBell.setOnClickListener(bellIconListener);
commentChannelSpinnerAdapter = new InlineChannelSpinnerAdapter(getContext(), R.layout.spinner_item_channel, new ArrayList<>());
commentChannelSpinnerAdapter.addPlaceholder(false);
@@ -1175,6 +1296,16 @@ public class FileViewFragment extends BaseFragment implements
commentsList.setLayoutManager(commentsListLLM);
}
private void updatePlaybackSpeedView(View root) {
if (root != null) {
PlayerView playerView = root.findViewById(R.id.file_view_exoplayer_view);
TextView textPlaybackSpeed = playerView.findViewById(R.id.player_playback_speed_label);
textPlaybackSpeed.setText(MainActivity.appPlayer != null && MainActivity.appPlayer.getPlaybackParameters() != null ?
Helper.getDisplayValueForPlaybackSpeed((double) MainActivity.appPlayer.getPlaybackParameters().speed) :
DEFAULT_PLAYBACK_SPEED);
}
}
private void deleteCurrentClaim() {
if (claim != null) {
Helper.setViewVisibility(layoutDisplayArea, View.INVISIBLE);
@@ -1452,6 +1583,12 @@ public class FileViewFragment extends BaseFragment implements
onMainActionButtonClicked();
}
});
root.findViewById(R.id.file_view_open_external_button).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
openClaimExternally(claim, claim.getMediaType());
}
});
if (metadata instanceof Claim.StreamMetadata) {
Claim.StreamMetadata streamMetadata = (Claim.StreamMetadata) metadata;
@@ -1574,6 +1711,8 @@ public class FileViewFragment extends BaseFragment implements
.build();
MainActivity.appPlayer = new SimpleExoPlayer.Builder(context).build();
MainActivity.appPlayer.setWakeMode(C.WAKE_MODE_NETWORK);
MainActivity.appPlayer.setAudioAttributes(audioAttributes, true);
MainActivity.playerCache =
new SimpleCache(context.getCacheDir(),
@@ -1854,7 +1993,7 @@ public class FileViewFragment extends BaseFragment implements
}
private void handleMainActionForClaim() {
if (claim.isPlayable() && Lbryio.isSignedIn()) {
if (claim.isPlayable() && claim.isFree() && Lbryio.isSignedIn()) {
// always use lbry.tv streaming when signed in and playabble
startTimeMillis = System.currentTimeMillis();
showExoplayerView();
@@ -1999,6 +2138,8 @@ public class FileViewFragment extends BaseFragment implements
}
handled = true;
}
} else {
openClaimExternally(claim, mediaType);
}
}
@@ -2036,9 +2177,9 @@ public class FileViewFragment extends BaseFragment implements
ReadTextFileTask task = new ReadTextFileTask(filePath, new ReadTextFileTask.ReadTextFileHandler() {
@Override
public void onSuccess(String text) {
String html = buildMarkdownHtml(text);
if (webView != null) {
webView.loadData(html, "text/html", "utf-8");
String html = buildMarkdownHtml(text);
webView.loadData(Base64.encodeToString(html.getBytes(), Base64.NO_PADDING), "text/html", "base64");
}
}
@@ -2075,6 +2216,17 @@ public class FileViewFragment extends BaseFragment implements
" </html>";
}
private void openClaimExternally(Claim claim, String mediaType) {
Uri fileUri = Uri.parse(claim.getFile().getDownloadPath());
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.setDataAndType(fileUri, mediaType.toLowerCase());
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
Intent chooser = Intent.createChooser(intent, getString(R.string.choose_app));
startActivityForResult(chooser, 419);
}
public void showError(String message) {
View root = getView();
if (root != null) {
@@ -2489,13 +2641,18 @@ public class FileViewFragment extends BaseFragment implements
private void checkIsFollowing() {
if (claim != null && claim.getSigningChannel() != null) {
boolean isFollowing = Lbryio.isFollowing(claim.getSigningChannel());
boolean notificationsDisabled = Lbryio.isNotificationsDisabled(claim.getSigningChannel());
Context context = getContext();
View root = getView();
if (context != null && root != null) {
OutlineIconView iconFollow = root.findViewById(R.id.file_view_icon_follow);
View iconFollow = root.findViewById(R.id.file_view_icon_follow);
SolidIconView iconUnfollow = root.findViewById(R.id.file_view_icon_unfollow);
Helper.setViewVisibility(iconFollow, !isFollowing ? View.VISIBLE: View.INVISIBLE);
Helper.setViewVisibility(iconUnfollow, isFollowing ? View.VISIBLE : View.INVISIBLE);
SolidIconView iconBell = root.findViewById(R.id.file_view_icon_bell);
Helper.setViewVisibility(iconFollow, !isFollowing ? View.VISIBLE: View.GONE);
Helper.setViewVisibility(iconUnfollow, isFollowing ? View.VISIBLE : View.GONE);
Helper.setViewVisibility(iconBell, isFollowing ? View.VISIBLE : View.GONE);
iconBell.setText(notificationsDisabled ? R.string.fa_bell : R.string.fa_bell_slash);
}
}
}
@@ -2753,15 +2910,18 @@ public class FileViewFragment extends BaseFragment implements
boolean isOwnClaim = Lbry.ownClaims.contains(claim);
View root = getView();
if (root != null) {
Helper.setViewVisibility(root.findViewById(R.id.file_view_action_download), isOwnClaim ? View.GONE : View.VISIBLE);
Helper.setViewVisibility(root.findViewById(R.id.file_view_action_report), isOwnClaim ? View.GONE : View.VISIBLE);
Helper.setViewVisibility(root.findViewById(R.id.file_view_action_edit), isOwnClaim ? View.VISIBLE : View.GONE);
Helper.setViewVisibility(root.findViewById(R.id.file_view_action_delete), isOwnClaim ? View.VISIBLE : View.GONE);
Helper.setViewVisibility(root.findViewById(R.id.file_view_action_unpublish), isOwnClaim ? View.VISIBLE : View.GONE);
LinearLayout fileViewActionsArea = root.findViewById(R.id.file_view_actions_area);
fileViewActionsArea.setWeightSum(isOwnClaim ? 6 : 5);
}
}
}
private static class StreamLoadErrorPolicy extends DefaultLoadErrorHandlingPolicy {
public static class StreamLoadErrorPolicy extends DefaultLoadErrorHandlingPolicy {
@Override
public long getRetryDelayMsFor(int dataType, long loadDurationMs, IOException exception, int errorCount) {
return exception instanceof ParserException
@@ -2877,9 +3037,6 @@ public class FileViewFragment extends BaseFragment implements
}
private void initCommentForm(View root) {
double amount = Comment.LBC_COST;
String buttonText = getResources().getQuantityString(R.plurals.post_for_credits, amount == 1 ? 1 : 2, Helper.LBC_CURRENCY_FORMAT.format(amount));
buttonPostComment.setText(buttonText);
textCommentLimit.setText(String.format("%d / %d", Helper.getValue(inputComment.getText()).length(), Comment.MAX_LENGTH));
buttonClearReplyToComment.setOnClickListener(new View.OnClickListener() {
@@ -2897,7 +3054,7 @@ public class FileViewFragment extends BaseFragment implements
return;
}
validateAndCheckPostComment(amount);
validateAndCheckPostComment();
}
});
@@ -2943,7 +3100,7 @@ public class FileViewFragment extends BaseFragment implements
});
}
private void validateAndCheckPostComment(double amount) {
private void validateAndCheckPostComment() {
String comment = Helper.getValue(inputComment.getText());
Claim channel = (Claim) commentChannelSpinner.getSelectedItem();
@@ -2955,33 +3112,8 @@ public class FileViewFragment extends BaseFragment implements
showError(getString(R.string.please_select_channel));
return;
}
if (Lbry.walletBalance == null || amount > Lbry.walletBalance.getAvailable().doubleValue()) {
showError(getString(R.string.insufficient_balance));
return;
}
Context context = getContext();
if (context != null) {
String titleText = getResources().getQuantityString(
R.plurals.post_and_tip,
amount == 1 ? 1 : 2,
Helper.LBC_CURRENCY_FORMAT.format(amount));
String confirmText = getResources().getQuantityString(
R.plurals.confirm_post_comment,
amount == 1 ? 1 : 2,
Helper.LBC_CURRENCY_FORMAT.format(amount),
claim.getTitleOrName());
AlertDialog.Builder builder = new AlertDialog.Builder(context).
setTitle(titleText).
setMessage(confirmText)
.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
postComment(amount);
}
}).setNegativeButton(R.string.no, null);
builder.show();
}
postComment();
}
private void updatePostAsChannel(Claim channel) {
@@ -3055,17 +3187,15 @@ public class FileViewFragment extends BaseFragment implements
replyToComment = null;
}
private void postComment(double tipAmount) {
private void postComment() {
if (postingComment) {
return;
}
Comment comment = buildPostComment();
// only use 2 decimal places
BigDecimal amount = new BigDecimal(String.valueOf(tipAmount));
beforePostComment();
CommentCreateWithTipTask task = new CommentCreateWithTipTask(comment, amount, progressPostComment, new CommentCreateWithTipTask.CommentCreateWithTipHandler() {
CommentCreateTask task = new CommentCreateTask(comment, progressPostComment, new CommentCreateTask.CommentCreateWithTipHandler() {
@Override
public void onSuccess(Comment createdComment) {
inputComment.setText(null);
@@ -3083,7 +3213,6 @@ public class FileViewFragment extends BaseFragment implements
checkNoComments();
Bundle bundle = new Bundle();
bundle.putDouble("amount", amount.doubleValue());
bundle.putString("claim_id", claim != null ? claim.getClaimId() : null);
bundle.putString("claim_name", claim != null ? claim.getName() : null);
LbryAnalytics.logEvent(LbryAnalytics.EVENT_COMMENT_CREATE, bundle);
@@ -434,6 +434,8 @@ public class FollowingFragment extends BaseFragment implements
null,
getContentSortOrder(),
contentReleaseTime,
0,
0,
currentClaimSearchPage == 0 ? 1 : currentClaimSearchPage,
Helper.CONTENT_PAGE_SIZE);
}
@@ -597,6 +599,8 @@ public class FollowingFragment extends BaseFragment implements
contentClaimSearchTask = new ClaimSearchTask(claimSearchOptions, Lbry.LBRY_TV_CONNECTION_STRING, getLoadingView(), new ClaimSearchResultHandler() {
@Override
public void onSuccess(List<Claim> claims, boolean hasReachedEnd) {
claims = Helper.filterClaimsByOutpoint(claims);
if (contentListAdapter == null) {
Context context = getContext();
if (context != null) {
@@ -0,0 +1,837 @@
package io.lbry.browser.ui.findcontent;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.database.sqlite.SQLiteDatabase;
import android.graphics.Color;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.GestureDetector;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.ProgressBar;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.preference.PreferenceManager;
import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.PlaybackParameters;
import com.google.android.exoplayer2.Player;
import com.google.android.exoplayer2.SimpleExoPlayer;
import com.google.android.exoplayer2.audio.AudioAttributes;
import com.google.android.exoplayer2.database.ExoDatabaseProvider;
import com.google.android.exoplayer2.extractor.DefaultExtractorsFactory;
import com.google.android.exoplayer2.source.MediaSource;
import com.google.android.exoplayer2.source.ProgressiveMediaSource;
import com.google.android.exoplayer2.ui.PlayerView;
import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory;
import com.google.android.exoplayer2.upstream.cache.CacheDataSourceFactory;
import com.google.android.exoplayer2.upstream.cache.LeastRecentlyUsedCacheEvictor;
import com.google.android.exoplayer2.upstream.cache.SimpleCache;
import com.google.android.exoplayer2.util.Util;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import io.lbry.browser.MainActivity;
import io.lbry.browser.R;
import io.lbry.browser.data.DatabaseHelper;
import io.lbry.browser.exceptions.LbryUriException;
import io.lbry.browser.model.Claim;
import io.lbry.browser.model.lbryinc.Reward;
import io.lbry.browser.tasks.BufferEventTask;
import io.lbry.browser.tasks.GenericTaskHandler;
import io.lbry.browser.tasks.claim.ClaimSearchResultHandler;
import io.lbry.browser.tasks.claim.ClaimSearchTask;
import io.lbry.browser.tasks.lbryinc.ClaimRewardTask;
import io.lbry.browser.tasks.lbryinc.LogFileViewTask;
import io.lbry.browser.ui.BaseFragment;
import io.lbry.browser.utils.Helper;
import io.lbry.browser.utils.Lbry;
import io.lbry.browser.utils.LbryAnalytics;
import io.lbry.browser.utils.LbryUri;
import io.lbry.browser.utils.Lbryio;
import io.lbry.browser.utils.Predefined;
public class ShuffleFragment extends BaseFragment {
private static final int PAGE_SIZE = 50;
private int currentClaimSearchPage;
private int playlistIndex;
private Claim current;
private List<Claim> playlist;
private List<String> watchedContentClaimIds;
private long sessionStart;
private ProgressBar surfModeLoading;
private TextView textTitle;
private TextView textPublisher;
private Player player;
private long elapsedDuration = 0;
private long totalDuration = 0;
private boolean elapsedPlaybackScheduled;
private ScheduledExecutorService elapsedPlaybackScheduler;
private boolean playbackStarted;
private long startTimeMillis;
private boolean isPlaying;
private boolean newPlayerCreated;
private String currentUrl;
private Player.EventListener playerListener;
public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
View root = inflater.inflate(R.layout.fragment_shuffle, container, false);
surfModeLoading = root.findViewById(R.id.shuffle_loading);
textTitle = root.findViewById(R.id.shuffle_content_title);
textPublisher = root.findViewById(R.id.shuffle_content_publisher);
playerListener = new Player.EventListener() {
@Override
public void onPlayerStateChanged(boolean playWhenReady, int playbackState) {
if (playbackState == Player.STATE_READY) {
elapsedDuration = MainActivity.appPlayer.getCurrentPosition();
totalDuration = MainActivity.appPlayer.getDuration() < 0 ? 0 : MainActivity.appPlayer.getDuration();
if (!playbackStarted) {
logPlay(currentUrl, startTimeMillis);
playbackStarted = true;
isPlaying = true;
if (current != null) {
saveWatchedContent(current.getClaimId());
}
}
renderTotalDuration();
scheduleElapsedPlayback();
hideBuffering();
} else if (playbackState == Player.STATE_BUFFERING) {
Context ctx = getContext();
boolean sendBufferingEvents = true;
if (ctx != null) {
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(ctx);
sendBufferingEvents = sp.getBoolean(MainActivity.PREFERENCE_KEY_SEND_BUFFERING_EVENTS, true);
}
if (MainActivity.appPlayer != null && MainActivity.appPlayer.getCurrentPosition() > 0 && sendBufferingEvents) {
// we only want to log a buffer event after the media has already started playing
String mediaSourceUrl = getStreamingUrl();
long duration = MainActivity.appPlayer.getDuration();
long position = MainActivity.appPlayer.getCurrentPosition();
String userIdHash = Lbryio.currentUser != null ? String.valueOf(Lbryio.currentUser.getId()) : "0";
if (mediaSourceUrl.startsWith(FileViewFragment.CDN_PREFIX)) {
BufferEventTask bufferEvent = new BufferEventTask(current.getPermanentUrl(), duration, position, 1, userIdHash);
bufferEvent.executeOnExecutor(AsyncTask.SERIAL_EXECUTOR);
}
}
showBuffering();
} else if (playbackState == Player.STATE_ENDED) {
playNextClaim();
} else {
hideBuffering();
}
}
};
Context context = getContext();
PlayerView playerView = root.findViewById(R.id.shuffle_exoplayer_view);
playerView.setOnTouchListener(new SwipeListener(playerView, context) {
@Override
public void onSwipeLeft() { playNextClaim(); }
@Override
public void onSwipeRight() { playPreviousClaim(); }
});
root.findViewById(R.id.shuffle_share_button).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (current != null) {
try {
String shareUrl = LbryUri.parse(
!Helper.isNullOrEmpty(current.getCanonicalUrl()) ? current.getCanonicalUrl() :
(!Helper.isNullOrEmpty(current.getShortUrl()) ? current.getShortUrl() : current.getPermanentUrl())).toTvString();
Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.setType("text/plain");
shareIntent.putExtra(Intent.EXTRA_TEXT, shareUrl);
MainActivity.startingShareActivity = true;
Intent shareUrlIntent = Intent.createChooser(shareIntent, getString(R.string.share_lbry_content));
shareUrlIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(shareUrlIntent);
} catch (LbryUriException ex) {
// pass
}
}
}
});
root.setOnTouchListener(new SwipeListener(root, context) {
@Override
public void onSwipeLeft() { playNextClaim(); }
@Override
public void onSwipeRight() { playPreviousClaim(); }
});
return root;
}
private String getStreamingUrl() {
return current != null ? String.format("https://cdn.lbryplayer.xyz/content/claims/%s/%s/stream", current.getName(), current.getClaimId()) : "";
}
private Map<String, Object> buildContentOptions() {
Context context = getContext();
boolean canShowMatureContent = false;
if (context != null) {
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(getContext());
canShowMatureContent = sp.getBoolean(MainActivity.PREFERENCE_KEY_SHOW_MATURE_CONTENT, false);
}
return Lbry.buildClaimSearchOptions(
Claim.TYPE_STREAM,
canShowMatureContent ? null : new ArrayList<>(Predefined.MATURE_TAGS),
null/*contentChannelIds*/,
Arrays.asList(Claim.ORDER_BY_TRENDING_GROUP),
121, // 2 minutes or less
1,
currentClaimSearchPage == 0 ? 1 : currentClaimSearchPage,
PAGE_SIZE);
}
public void onStart() {
super.onStart();
MainActivity activity = (MainActivity) getContext();
if (activity != null) {
activity.hideFloatingWalletBalance();
}
}
public void onResume() {
super.onResume();
sessionStart = System.currentTimeMillis();
MainActivity activity = (MainActivity) getContext();
if (activity != null) {
LbryAnalytics.setCurrentScreen(activity, "Shuffle", "Shuffle");
}
if (MainActivity.appPlayer != null && MainActivity.nowPlayingSource != MainActivity.SOURCE_NOW_PLAYING_SHUFFLE) {
MainActivity.appPlayer.setPlayWhenReady(false);
}
if (playlist == null) {
loadWatchedContentList();
} else {
if (current != null) {
playbackCurrentClaim();
} else {
startPlaylist();
}
loadAndScheduleDurations();
}
if (MainActivity.appPlayer != null) {
if (MainActivity.playerReassigned) {
setPlayerForPlayerView();
MainActivity.playerReassigned = false;
}
}
}
private void setPlayerForPlayerView() {
View root = getView();
if (root != null) {
PlayerView view = root.findViewById(R.id.shuffle_exoplayer_view);
view.setVisibility(View.VISIBLE);
view.setPlayer(null);
view.setPlayer(MainActivity.appPlayer);
}
}
public void onPause() {
if (MainActivity.appPlayer != null && MainActivity.appPlayer.isPlaying()) {
MainActivity.nowPlayingSource = MainActivity.SOURCE_NOW_PLAYING_SHUFFLE;
}
super.onPause();
}
public void onStop() {
long sessionDuration = System.currentTimeMillis() - sessionStart;
if (sessionStart > 0 && sessionDuration > 0) {
Bundle bundle = new Bundle();
bundle.putLong("duration_ms", sessionDuration);
bundle.putInt("duration", Double.valueOf(Math.ceil(sessionDuration / 1000.0)).intValue());
LbryAnalytics.logEvent(LbryAnalytics.EVENT_SHUFFLE_SESSION, bundle);
}
sessionStart = 0;
MainActivity activity = (MainActivity) getContext();
if (activity != null) {
activity.hideFloatingWalletBalance();
}
super.onStop();
}
private void loadWatchedContentList() {
(new AsyncTask<Void, Void, List<String>>() {
protected List<String> doInBackground(Void... params) {
MainActivity activity = (MainActivity) getContext();
if (activity != null) {
try {
SQLiteDatabase db = activity.getDbHelper().getReadableDatabase();
return DatabaseHelper.getShuffleWatchedClaims(db);
} catch (Exception ex) {
// pass
}
}
return null;
}
protected void onPostExecute(List<String> claimIds) {
watchedContentClaimIds = new ArrayList<>(claimIds);
if (playlist == null) {
loadContent();
}
}
}).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
private void saveWatchedContent(final String claimId) {
(new AsyncTask<Void, Void, Void>() {
protected Void doInBackground(Void... params) {
MainActivity activity = (MainActivity) getContext();
if (activity != null) {
try {
SQLiteDatabase db = activity.getDbHelper().getWritableDatabase();
DatabaseHelper.createOrUpdateShuffleWatched(claimId, db);
} catch (Exception ex) {
// pass
}
}
return null;
}
}).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
private void loadContent() {
if (playlist == null || playlist.size() == 0) {
Helper.setViewVisibility(surfModeLoading, View.VISIBLE);
}
Map<String, Object> claimSearchOptions = buildContentOptions();
ClaimSearchTask task = new ClaimSearchTask(claimSearchOptions, Lbry.LBRY_TV_CONNECTION_STRING, null, new ClaimSearchResultHandler() {
@Override
public void onSuccess(List<Claim> claims, boolean hasReachedEnd) {
claims = Helper.filterClaimsByOutpoint(claims);
if (playlist == null) {
playlist = new ArrayList<>(claims);
startPlaylist();
} else {
for (Claim claim : claims) {
if (!playlist.contains(claim)) {
playlist.add(claim);
}
}
}
Helper.setViewVisibility(surfModeLoading, View.GONE);
}
@Override
public void onError(Exception error) {
Helper.setViewVisibility(surfModeLoading, View.GONE);
}
});
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
private void startPlaylist() {
if (playlist == null || playlist.size() == 0) {
return;
}
playlistIndex = 0;
current = playlist.get(playlistIndex);
checkCurrentClaimIsVideo(false);
checkCurrentClaimWatched(false);
playbackCurrentClaim();
}
private void checkCurrentClaimIsVideo(boolean previous) {
while (current == null || current.getMediaType() == null || !current.getMediaType().startsWith("video")) {
// only play videos
if (previous) {
playlistIndex--;
} else {
playlistIndex++;
checkPlaylistSize();
}
current = playlist.get(playlistIndex);
}
}
private void checkCurrentClaimWatched(boolean previous) {
if (current != null && watchedContentClaimIds != null) {
while (watchedContentClaimIds.contains(current.getClaimId())) {
if (previous) {
playlistIndex--;
} else {
playlistIndex++;
checkPlaylistSize();
}
current = playlist.get(playlistIndex);
}
}
}
private void playPreviousClaim() {
if (playlist == null || playlist.size() == 0) {
return;
}
if (playlistIndex > 0) {
playlistIndex--;
}
current = playlist.get(playlistIndex);
checkCurrentClaimIsVideo(true);
checkCurrentClaimWatched(true);
playbackCurrentClaim();
}
private void playNextClaim() {
if (playlist == null || playlist.size() == 0) {
return;
}
if (playlistIndex < playlist.size() - 1) {
playlistIndex++;
}
checkPlaylistSize();
current = playlist.get(playlistIndex);
checkCurrentClaimIsVideo(false);
checkCurrentClaimWatched(false);
playbackCurrentClaim();
}
private void checkPlaylistSize() {
if (playlist.size() - playlistIndex < 10) {
currentClaimSearchPage++;
loadContent();
}
}
private void playbackCurrentClaim() {
resetPlayer();
String publisherText = !Helper.isNullOrEmpty(current.getPublisherTitle()) ?
String.format("%s (%s)", current.getPublisherTitle(), current.getPublisherName()) :
!Helper.isNullOrEmpty(current.getPublisherName()) ? current.getPublisherName() : getString(R.string.anonymous);
textTitle.setText(current.getTitle());
textPublisher.setText(publisherText);
Context context = getContext();
if (MainActivity.appPlayer == null && context != null) {
AudioAttributes audioAttributes = new AudioAttributes.Builder()
.setUsage(C.USAGE_MEDIA)
.setContentType(C.CONTENT_TYPE_MOVIE)
.build();
MainActivity.appPlayer = new SimpleExoPlayer.Builder(context).build();
MainActivity.appPlayer.setWakeMode(C.WAKE_MODE_NETWORK);
MainActivity.appPlayer.setAudioAttributes(audioAttributes, true);
MainActivity.playerCache =
new SimpleCache(context.getCacheDir(),
new LeastRecentlyUsedCacheEvictor(1024 * 1024 * 256), new ExoDatabaseProvider(context));
if (context instanceof MainActivity) {
MainActivity activity = (MainActivity) context;
activity.initMediaSession();
activity.initPlaybackNotification();
}
if (playerListener != null) {
MainActivity.appPlayer.addListener(playerListener);
}
newPlayerCreated = true;
}
if (context instanceof MainActivity) {
MainActivity activity = (MainActivity) context;
activity.initPlaybackNotification();
}
View root = getView();
if (root != null) {
PlayerView view = root.findViewById(R.id.shuffle_exoplayer_view);
view.setShutterBackgroundColor(Color.TRANSPARENT);
view.setPlayer(MainActivity.appPlayer);
view.setUseController(true);
if (context instanceof MainActivity) {
((MainActivity) context).getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
}
if (MainActivity.nowPlayingClaim != null &&
MainActivity.nowPlayingClaim.getClaimId().equalsIgnoreCase(current.getClaimId()) &&
!newPlayerCreated) {
// if the claim is already playing, we don't need to reload the media source
return;
}
if (MainActivity.appPlayer != null) {
showBuffering();
if (context instanceof MainActivity) {
((MainActivity) context).setNowPlayingClaim(current, current.getPermanentUrl());
}
MainActivity.appPlayer.setPlayWhenReady(true);
String userAgent = Util.getUserAgent(context, getString(R.string.app_name));
String mediaSourceUrl = getStreamingUrl();
MediaSource mediaSource = new ProgressiveMediaSource.Factory(
new CacheDataSourceFactory(MainActivity.playerCache, new DefaultDataSourceFactory(context, userAgent)),
new DefaultExtractorsFactory()
).setLoadErrorHandlingPolicy(new FileViewFragment.StreamLoadErrorPolicy()).createMediaSource(Uri.parse(mediaSourceUrl));
MainActivity.appPlayer.prepare(mediaSource, true, true);
}
}
}
private void resetPlayer() {
elapsedDuration = 0;
totalDuration = 0;
renderElapsedDuration();
renderTotalDuration();
elapsedPlaybackScheduled = false;
if (elapsedPlaybackScheduler != null) {
elapsedPlaybackScheduler.shutdownNow();
elapsedPlaybackScheduler = null;
}
playbackStarted = false;
startTimeMillis = 0;
/*if (MainActivity.appPlayer != null) {
MainActivity.appPlayer.stop(true);
MainActivity.appPlayer.removeListener(fileViewPlayerListener);
PlaybackParameters params = new PlaybackParameters(1.0f);
MainActivity.appPlayer.setPlaybackParameters(params);
}*/
}
private void logPlay(String url, long startTimeMillis) {
long timeToStartMillis = startTimeMillis > 0 ? System.currentTimeMillis() - startTimeMillis : 0;
Bundle bundle = new Bundle();
bundle.putString("uri", url);
bundle.putLong("time_to_start_ms", timeToStartMillis);
bundle.putLong("time_to_start_seconds", Double.valueOf(timeToStartMillis / 1000.0).longValue());
LbryAnalytics.logEvent(LbryAnalytics.EVENT_PLAY, bundle);
logFileView(current.getPermanentUrl(), timeToStartMillis);
}
private void logFileView(String url, long timeToStart) {
if (current != null) {
LogFileViewTask task = new LogFileViewTask(url, current, timeToStart, new GenericTaskHandler() {
@Override
public void beforeStart() { }
@Override
public void onSuccess() {
claimEligibleRewards();
}
@Override
public void onError(Exception error) { }
});
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
}
private void showBuffering() {
View root = getView();
if (root != null) {
root.findViewById(R.id.player_buffering_progress).setVisibility(View.VISIBLE);
PlayerView playerView = root.findViewById(R.id.shuffle_exoplayer_view);
playerView.findViewById(R.id.player_skip_back_10).setVisibility(View.INVISIBLE);
playerView.findViewById(R.id.player_skip_forward_10).setVisibility(View.INVISIBLE);
}
}
private void hideBuffering() {
View root = getView();
if (root != null) {
root.findViewById(R.id.player_buffering_progress).setVisibility(View.INVISIBLE);
PlayerView playerView = root.findViewById(R.id.shuffle_exoplayer_view);
playerView.findViewById(R.id.player_skip_back_10).setVisibility(View.VISIBLE);
playerView.findViewById(R.id.player_skip_forward_10).setVisibility(View.VISIBLE);
}
}
private void renderElapsedDuration() {
View view = getView();
if (view != null) {
Helper.setViewText(view.findViewById(R.id.player_duration_elapsed), Helper.formatDuration(Double.valueOf(elapsedDuration / 1000.0).longValue()));
}
}
private void renderTotalDuration() {
View view = getView();
if (view != null) {
Helper.setViewText(view.findViewById(R.id.player_duration_total), Helper.formatDuration(Double.valueOf(totalDuration / 1000.0).longValue()));
}
}
private void loadAndScheduleDurations() {
if (MainActivity.appPlayer != null && playbackStarted) {
elapsedDuration = MainActivity.appPlayer.getCurrentPosition() < 0 ? 0 : MainActivity.appPlayer.getCurrentPosition();
totalDuration = MainActivity.appPlayer.getDuration() < 0 ? 0 : MainActivity.appPlayer.getDuration();
renderElapsedDuration();
renderTotalDuration();
scheduleElapsedPlayback();
}
}
private void scheduleElapsedPlayback() {
if (!elapsedPlaybackScheduled) {
elapsedPlaybackScheduler = Executors.newSingleThreadScheduledExecutor();
elapsedPlaybackScheduler.scheduleAtFixedRate(new Runnable() {
@Override
public void run() {
Context context = getContext();
if (context instanceof MainActivity) {
((MainActivity) context).runOnUiThread(new Runnable() {
@Override
public void run() {
if (MainActivity.appPlayer != null) {
elapsedDuration = MainActivity.appPlayer.getCurrentPosition();
int elapsedSeconds = Double.valueOf(elapsedDuration / 1000.0).intValue();
renderElapsedDuration();
}
}
});
}
}
}, 0, 500, TimeUnit.MILLISECONDS);
elapsedPlaybackScheduled = true;
}
}
// TODO: Move this call to MainActivity?
private void claimEligibleRewards() {
// attempt to claim eligible rewards after viewing or playing a file (fail silently)
Context context = getContext();
ClaimRewardTask firstStreamTask = new ClaimRewardTask(Reward.TYPE_FIRST_STREAM, null, null, context, eligibleRewardHandler);
ClaimRewardTask dailyViewTask = new ClaimRewardTask(Reward.TYPE_DAILY_VIEW, null, null, context, eligibleRewardHandler);
firstStreamTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
dailyViewTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
private ClaimRewardTask.ClaimRewardHandler eligibleRewardHandler = new ClaimRewardTask.ClaimRewardHandler() {
@Override
public void onSuccess(double amountClaimed, String message) {
if (Helper.isNullOrEmpty(message)) {
message = getResources().getQuantityString(
R.plurals.claim_reward_message,
amountClaimed == 1 ? 1 : 2,
new DecimalFormat(Helper.LBC_CURRENCY_FORMAT_PATTERN).format(amountClaimed));
}
Context context = getContext();
if (context instanceof MainActivity) {
((MainActivity) context).showMessage(message);
}
}
@Override
public void onError(Exception error) {
// pass
}
};
private static class SwipeListener implements View.OnTouchListener {
private final GestureDetector gestureDetector;
private final View control;
public SwipeListener(View control, Context context) {
this.control = control;
gestureDetector = new GestureDetector(context, new SwipeGestureListener());
}
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
return gestureDetector.onTouchEvent(motionEvent);
}
public void onSwipeLeft() { }
public void onSwipeRight() { }
public void onSwipeTop() { }
public void onSwipeBottom() { }
private final class SwipeGestureListener extends GestureDetector.SimpleOnGestureListener {
private static final int SWIPE_THRESHOLD = 100;
private static final int SWIPE_VELOCITY_THRESHOLD = 100;
@Override
public boolean onDown(MotionEvent e) {
if (control instanceof PlayerView) {
return false;
}
return true;
}
@Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
boolean result = false;
try {
float diffY = e2.getY() - e1.getY();
float diffX = e2.getX() - e1.getX();
if (Math.abs(diffX) > Math.abs(diffY)) {
if (Math.abs(diffX) > SWIPE_THRESHOLD && Math.abs(velocityX) > SWIPE_VELOCITY_THRESHOLD) {
if (diffX > 0) {
onSwipeRight();
} else {
onSwipeLeft();
}
result = true;
}
}
else if (Math.abs(diffY) > SWIPE_THRESHOLD && Math.abs(velocityY) > SWIPE_VELOCITY_THRESHOLD) {
if (diffY > 0) {
onSwipeBottom();
} else {
onSwipeTop();
}
result = true;
}
} catch (Exception ex) {
// pass
}
return result;
}
}
}
@Override
public boolean shouldHideGlobalPlayer() {
return true;
}
private static final List<String> contentChannelIds = Arrays.asList(
"3fec094c5937e9eb4e8f5e71e4ca430e8a993d03",
"6184648aab0431c4c95c649072d1f9ff08b9bb7c",
"b5d31cde873073718c033076656a27471e392afc",
"7317cdf6f62be93b22295062e191f6ba59a5db26",
"1cdb5d0bdcb484907d0a2fea4efdfe0153838642",
"b516294f541a18ce00b71a60b2c82ad2f87ff78d",
"91e42cc450075f2c4c245bac7617bf903f16b4ce",
"b6e207c5f8c58e7c8362cd05a1501bf2f5b694f2",
"25f384bd95e218f6ac37fcaca99ed40f36760d8c",
"f33657a2fcbab2dc3ce555d5d6728f8758af7bc7",
"294f5c164da5ac9735658b2d58d8fee6745dfc45",
"119a2e8c0b50f78d3861636d37c3b44ba8e689b5",
"7b23cca3f49059f005e812be03931c81272eaac4",
"fb0efeaa3788d1292bb49a94d77622503fe08129",
"797a528c49b6535560f7fd8222b121b0223287c8",
"bc490776f367b8afccf0ea7349d657431ba1ded6",
"48c7ea8bc2c4adba09bf21a29689e3b8c2967522",
"bf7490f905904e79de5c90e472bb9e6f26e634a0",
"df961194a798cc76306b9290701130c592530fb6",
"cf0be9078d76951e2e228df68b5b0bbf71313aaa",
"d746ac8d782f94d12d176c7a591f5bf8365bef3d",
"1f30267438257020f08abf452746a48e53a71ad5",
"4ad942982e43326c7700b1b6443049b3cfd82161",
"1cdb5d0bdcb484907d0a2fea4efdfe0153838642",
"6616707e1109aaa1c11b9f399f914d0cfb4f5303",
"4ee7cfaf1fc50a6df858ed0b99c278d633bccca9",
"b7d02b4a0036114732c072269adb891dc5e34ca4",
"9c51c1a119137cd17ed5ae09daa80c1cab6ac01d",
"5f2a5c14b971a6f5eed0a67dc7af3a3fe5c0b6a4",
"0e2b5b4cf59e859860000ff123dc12a317ad416b",
"3fe68ad3da93065e35c37b14fbeef88b4b7785ed",
"fd7ffcbafb74412a8812df4720feaf11fe70fe12",
"b4c30fe36b79870a79c55e1e909adb5ad23f323f",
"92c0f2f3239f1f61496997bd2cdc197ec51bd423",
"29193e9240a71a735639c66ee954e68414f11236",
"25f384bd95e218f6ac37fcaca99ed40f36760d8c",
"87b13b074936b1f42a7c6758c7c2995f58c602e7",
"8d935c6c30510e1dfc10f803a9646fa8aa128b07",
"8f4fecfc836ea33798ee3e5cef56926fa54e2cf9",
"9a5dfcb1a4b29c3a1598392d039744b9938b5a26",
"c5724e280283cd985186af9a62494aae377daabd",
"b39833be3032bbe1005f4f719f379a4621faeb13",
"589276465a23c589801d874f484cc39f307d7ec7",
"fb364ef587872515f545a5b4b3182b58073f230f",
"6c0bf1fed2705d675da950a94e4af004ec975a06",
"b924ac36b7499591f7929d9c4903de79b07b1cb9",
"113515e893b8186595595e594ecc410bae50c026",
"72f9815b087b6d346745e3de71a6ce5fe73a8677",
"b0198a465290f065378f3535666bee0653d6a9bb",
"020ebeb40642bfb4bc3d9f6d28c098afc0a47481",
"5c15e604c4207f52c8cf58fe21e63164c230e257",
"273a2fa759f1a9f56b078633ea2f08fc2406002a",
"930fc43ca7bae20d4706543e97175d1872b0671f",
"0cb2ec46f06ba85520a1c1a56706acf35d5176dd",
"057053dfb657aaa98553e2c544b06e1a2371557e",
"64e091964a611a48424d254a3de2b952d0d6565a",
"50ebba2b06908f93d7963b1c6826cc0fd6104477",
"374ff82251a384601da73f30485c3ac8d7f4176b",
"1487afc813124abbeb0629d2172be0f01ccec3bf",
"6a4fa1a68b92336e64006a4310cb160b07854329",
"15f986a262fc6eff5774050c94d174c0533d505d",
"6184648aab0431c4c95c649072d1f9ff08b9bb7c",
"1efa9b640ad980b2ec53834d60e9cff9554979cd",
"064d4999ea15e433e06f16f391922390acab01cb",
"4884e30b93b3c4c123a83154516196095f9e831e",
"2827bfc459c12d7c6d280cbacee750811291d4ba",
"9626816275585ac3443e7cddd1272c8652c23f1d",
"a2e1bb1fed32c6a6290b679785dd31ca5c59cb5f",
"d9535951222dd7a1ff7f763872cb0df44f7962bf",
"243b6f18093ff97c861d0568c7d3379606201a4b",
"1ce5ac7bab7f2e82af02305ced3c095e320b52e5",
"3e63119a8503a6f666b0a736c8fdeb9e79d11eb4",
"e33372c0d8b2cdd3e12252962ee1671d66143075",
"7364ba2ac9090e468855ce9074bb50c306196f4c",
"d6350f9158825662b99e4b5e0442bcc94d39bc11",
"2a294ea41312c6da8de5ebd0f18dbfb2963bb1a4",
"44c49bbab8a3e9999f3ba9dee0186288b1d960a7",
"2305db36455aa0d18571015b9e9bd0950262aa0f",
"82f1d8c257d3e76b711a5cecd1e49bd3fa6a9de9",
"faed2b028a9b5a712d5180eaa6fd2aa619f941bc",
"39ac239b5687f7d1c2ba74cd020b3547545dfdaf",
"5737eb22f6119f27c9afccfe73ba710afd885371",
"5f22b6daf7204d73cf79d3ff0b46fc4fe237c7f7",
"3583f5a570af6870504eea5a5f7afad6e1508508",
"b0e489f986c345aef23c4a48d91cbcf5a6fdb9ac",
"ba79c80788a9e1751e49ad401f5692d86f73a2db",
"c54323436f50c633c870298bb374ac8e7560e6cd",
"83725c7ee23bd4a8ca28a4fab0e313409def1dc7",
"61c4e8636704f2f38bbe88b1f30ef0d74d6c0f49",
"87ef9ba36019f7f3bf217cf47511645893b13f2e",
"1bd0adfcf1c75bafc1ba3fc9b65a1a0470df6a91",
"1be15348c51955179b7bf9aa90230a9425927ef6",
"1f45ab3495df2c3be7d9c882bca9966305115cbb",
"7317777e3751efa66218f6da5ef0d01dda69af48",
"3346a4ff80b70ee7eea8a79fc79f19c43bb4464a",
"452916a904030d2ce4ea2440fad2d0774e7296d9",
"2675ef3adf52ebf8a44ff5da4306c293dfa6f901",
"e2a76643735f8611a561794509c6bb2aac70eb04",
"dc577db3caf5ff83a3b573ba92f2d447f067eee1",
"89c4cf244099918b1d3ed413df27d4216e97b499",
"4b2b5822c8af3074c6ef9b789a8142d0ef623402",
"3c5794f775975669745c412b0c30f48991d9e455",
"1df464dbb302ced815c61431a5548a273e6de8e1"
);
}
@@ -4,9 +4,13 @@ import android.content.Context;
import android.content.SharedPreferences;
import android.os.AsyncTask;
import android.os.Bundle;
import android.text.InputType;
import android.widget.EditText;
import androidx.annotation.NonNull;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatDelegate;
import androidx.preference.EditTextPreference;
import androidx.preference.PreferenceFragmentCompat;
import androidx.preference.PreferenceManager;
@@ -23,6 +27,15 @@ public class SettingsFragment extends PreferenceFragmentCompat implements Shared
@Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
setPreferencesFromResource(R.xml.settings, rootKey);
PreferenceManager manager = getPreferenceManager();
EditTextPreference miniPlayerBottomMarginPreference = manager.findPreference(MainActivity.PREFERENCE_KEY_MINI_PLAYER_BOTTOM_MARGIN);
miniPlayerBottomMarginPreference.setOnBindEditTextListener(new EditTextPreference.OnBindEditTextListener() {
@Override
public void onBindEditText(@NonNull EditText editText) {
editText.setInputType(InputType.TYPE_CLASS_NUMBER);
}
});
}
@Override
@@ -257,7 +257,7 @@ public class PublishFormFragment extends BaseFragment implements
suggestedTagsAdapter.setClickListener(this);
suggestedTagsList.setAdapter(suggestedTagsAdapter);
matureTagsAdapter = new TagListAdapter(Helper.getTagObjectsForTags(Predefined.MATURE_TAGS), context);
matureTagsAdapter = new TagListAdapter(Helper.getTagObjectsForTags(Predefined.PUBLISH_MATURE_TAGS), context);
matureTagsAdapter.setCustomizeMode(TagListAdapter.CUSTOMIZE_MODE_ADD);
matureTagsAdapter.setClickListener(this);
matureTagsList.setAdapter(matureTagsAdapter);
@@ -21,6 +21,8 @@ import com.google.android.material.textfield.TextInputEditText;
import io.lbry.browser.MainActivity;
import io.lbry.browser.R;
import io.lbry.browser.VerificationActivity;
import io.lbry.browser.listener.SdkStatusListener;
import io.lbry.browser.listener.WalletSyncListener;
import io.lbry.browser.model.WalletSync;
import io.lbry.browser.tasks.wallet.DefaultSyncTaskHandler;
@@ -33,7 +35,7 @@ import io.lbry.browser.utils.Lbryio;
import io.lbry.lbrysdk.Utils;
import lombok.Setter;
public class WalletVerificationFragment extends Fragment {
public class WalletVerificationFragment extends Fragment implements SdkStatusListener {
@Setter
private WalletSyncListener listener = null;
@@ -86,6 +88,30 @@ public class WalletVerificationFragment extends Fragment {
@Override
public void onResume() {
super.onResume();
if (!Lbry.SDK_READY) {
Context context = getContext();
if (context instanceof VerificationActivity) {
VerificationActivity activity = (VerificationActivity) context;
activity.addSdkStatusListener(this);
}
Helper.setViewVisibility(loading, View.VISIBLE);
Helper.setViewVisibility(textLoading, View.VISIBLE);
} else {
onSdkReady();
}
}
@Override
public void onStop() {
Context context = getContext();
if (context instanceof VerificationActivity) {
VerificationActivity activity = (VerificationActivity) context;
activity.removeSdkStatusListener(this);
}
super.onStop();
}
public void onSdkReady() {
start();
}
@@ -463,7 +463,7 @@ public class WalletFragment extends BaseFragment implements SdkStatusListener, W
double sentAmount = actualSendAmount;
String message = getResources().getQuantityString(
R.plurals.you_sent_credits, sentAmount == 1.0 ? 1 : 2,
new DecimalFormat("#,###.##").format(sentAmount));
new DecimalFormat("#,###.####").format(sentAmount));
Helper.setViewText(inputSendAddress, null);
Helper.setViewText(inputSendAmount, null);
if (view != null) {
@@ -6,9 +6,13 @@ import android.os.Handler;
import androidx.annotation.Nullable;
import com.google.android.exoplayer2.DefaultRenderersFactory;
import com.google.android.exoplayer2.PlaybackParameters;
import com.google.android.exoplayer2.Renderer;
import com.google.android.exoplayer2.audio.AudioCapabilities;
import com.google.android.exoplayer2.audio.AudioProcessor;
import com.google.android.exoplayer2.audio.AudioRendererEventListener;
import com.google.android.exoplayer2.audio.AudioSink;
import com.google.android.exoplayer2.audio.DefaultAudioSink;
import com.google.android.exoplayer2.audio.TeeAudioProcessor;
import com.google.android.exoplayer2.drm.DrmSessionManager;
import com.google.android.exoplayer2.drm.FrameworkMediaCrypto;
@@ -30,22 +34,18 @@ public class ExoplayerAudioRenderer extends DefaultRenderersFactory {
Context context,
int extensionRendererMode,
MediaCodecSelector mediaCodecSelector,
@Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager,
boolean playClearSamplesWithoutKeys,
boolean enableDecoderFallback,
AudioProcessor[] audioProcessors,
AudioSink audioSink,
Handler eventHandler,
AudioRendererEventListener eventListener,
ArrayList<Renderer> out) {
AudioProcessor[] audioProcessorList = { new TeeAudioProcessor(audioBufferSink) };
super.buildAudioRenderers(
context,
extensionRendererMode,
mediaCodecSelector,
drmSessionManager,
playClearSamplesWithoutKeys,
enableDecoderFallback,
audioProcessorList,
audioSink,
eventHandler,
eventListener,
out);
@@ -20,7 +20,6 @@ import android.provider.MediaStore;
import android.text.method.LinkMovementMethod;
import android.view.ContextMenu;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
@@ -30,7 +29,6 @@ import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.google.android.gms.common.util.Hex;
import org.json.JSONArray;
import org.json.JSONException;
@@ -39,9 +37,6 @@ import org.json.JSONObject;
import java.io.Closeable;
import java.io.File;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
@@ -103,6 +98,11 @@ public final class Helper {
}
}
public static String getDisplayValueForPlaybackSpeed(Double speed) {
DecimalFormat formatter = new DecimalFormat("0.##");
return String.format("%sx", formatter.format(speed));
}
public static String capitalize(String value) {
StringBuilder sb = new StringBuilder();
boolean capitalizeNext = true;
@@ -343,6 +343,10 @@ public final class Helper {
return cs != null ? cs.toString().trim() : "";
}
public static String getValue(CharSequence cs, String defaultValue) {
return cs != null && !Helper.isNullOrEmpty(cs.toString()) ? cs.toString().trim() : defaultValue;
}
public static List<String> buildContentSortOrder(int sortBy) {
List<String> sortOrder = new ArrayList<>();
switch (sortBy) {
@@ -783,13 +787,38 @@ public final class Helper {
return id.toString();
}
public static String SHA256(String value) {
try {
MessageDigest digest = MessageDigest.getInstance("SHA-256");
byte[] hash = digest.digest(value.getBytes("UTF-8"));
return Hex.bytesToStringLowercase(hash);
} catch (NoSuchAlgorithmException | UnsupportedEncodingException ex) {
return null;
public static List<Claim> filterClaimsByOutpoint(List<Claim> claims) {
List<Claim> filtered = new ArrayList<>();
for (Claim claim : claims) {
String outpoint = String.format("%s:%d", claim.getTxid(), claim.getNout());
if (Lbryio.blockedOutpoints.contains(outpoint) || Lbryio.filteredOutpoints.contains(outpoint)) {
continue;
}
if (claim.getSigningChannel() != null) {
Claim signingChannel = claim.getSigningChannel();
String channelOutpoint = String.format("%s:%d", signingChannel.getTxid(), signingChannel.getNout());
if (Lbryio.blockedOutpoints.contains(channelOutpoint) || Lbryio.filteredOutpoints.contains(channelOutpoint)) {
continue;
}
}
filtered.add(claim);
}
return filtered;
}
public static boolean isClaimBlocked(Claim claim) {
if (claim.getSigningChannel() != null) {
Claim signingChannel = claim.getSigningChannel();
String channelOutpoint = String.format("%s:%d", signingChannel.getTxid(), signingChannel.getNout());
if (Lbryio.blockedOutpoints.contains(channelOutpoint)) {
return true;
}
}
String outpoint = String.format("%s:%d", claim.getTxid(), claim.getNout());
return Lbryio.blockedOutpoints.contains(outpoint);
}
}
@@ -2,12 +2,15 @@ package io.lbry.browser.utils;
import android.util.Log;
import org.bitcoinj.core.Base58;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;
import java.security.KeyStore;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
@@ -17,6 +20,7 @@ import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.concurrent.TimeUnit;
import io.lbry.browser.exceptions.ApiCallException;
@@ -371,6 +375,23 @@ public final class Lbry {
"any_tags", "channel_ids", "order_by", "not_tags", "not_channel_ids", "urls"
};
// build claim search for surf mode
public static Map<String, Object> buildClaimSearchOptions(
String claimType, List<String> notTags, List<String> channelIds, List<String> orderBy, long maxDuration, int limitClaimsPerChannel, int page, int pageSize) {
return buildClaimSearchOptions(
Collections.singletonList(claimType),
null,
notTags,
channelIds,
null,
orderBy,
null,
maxDuration,
limitClaimsPerChannel,
page,
pageSize);
}
public static Map<String, Object> buildClaimSearchOptions(
String claimType,
List<String> anyTags,
@@ -389,6 +410,8 @@ public final class Lbry {
notChannelIds,
orderBy,
releaseTime,
0,
0,
page,
pageSize);
}
@@ -401,6 +424,8 @@ public final class Lbry {
List<String> notChannelIds,
List<String> orderBy,
String releaseTime,
long maxDuration,
int limitClaimsPerChannel,
int page,
int pageSize) {
Map<String, Object> options = new HashMap<>();
@@ -413,6 +438,12 @@ public final class Lbry {
if (!Helper.isNullOrEmpty(releaseTime)) {
options.put("release_time", releaseTime);
}
if (maxDuration > 0) {
options.put("duration", String.format("<%d", maxDuration));
}
if (limitClaimsPerChannel > 0) {
options.put("limit_claims_per_channel", limitClaimsPerChannel);
}
addClaimSearchListOption("any_tags", anyTags, options);
addClaimSearchListOption("not_tags", notTags, options);
@@ -522,4 +553,20 @@ public final class Lbry {
}
}
}
public static String generateId() {
return generateId(64);
}
public static String generateId(int numBytes) {
byte[] arr = new byte[numBytes];
new Random().nextBytes(arr);
try {
MessageDigest md = MessageDigest.getInstance("SHA-384");
byte[] hash = md.digest(arr);
return Base58.encode(hash);
} catch (NoSuchAlgorithmException e) {
// pass
return null;
}
}
}
@@ -28,6 +28,7 @@ public class LbryAnalytics {
public static final String EVENT_PUBLISH_UPDATE = "publish_update";
public static final String EVENT_CHANNEL_CREATE = "channel_create";
public static final String EVENT_SEARCH = "search";
public static final String EVENT_SHUFFLE_SESSION = "shuffle_session";
private static FirebaseAnalytics analytics;
@@ -10,7 +10,7 @@ import lombok.Data;
@Data
public class LbryUri {
public static final String LBRY_TV_BASE_URL = "https://lbry.tv";
public static final String LBRY_TV_BASE_URL = "https://lbry.tv/";
public static final String PROTO_DEFAULT = "lbry://";
public static final String REGEX_INVALID_URI = "[ =&#:$@%?;/\\\\\"<>%\\{\\}|^~\\[\\]`\u0000-\u0008\u000b-\u000c\u000e-\u001F\uD800-\uDFFF\uFFFE-\uFFFF]";
public static final String REGEX_ADDRESS = "^(b)(?=[^0OIl]{32,33})[0-9A-Za-z]{32,33}$";
@@ -18,7 +18,7 @@ public class LbryUri {
public static final int CLAIM_ID_MAX_LENGTH = 40;
private static final String REGEX_PART_PROTOCOL = "^((?:lbry://|https://)?)";
private static final String REGEX_PART_HOST = "((?:open.lbry.com/)?)";
private static final String REGEX_PART_HOST = "((?:open.lbry.com/|lbry.tv/|lbry.lat/|lbry.fr/|lbry.in/)?)";
private static final String REGEX_PART_STREAM_OR_CHANNEL_NAME = "([^:$#/]*)";
private static final String REGEX_PART_MODIFIER_SEPARATOR = "([:$#]?)([^/]*)";
private static final String QUERY_STRING_BREAKER = "^([\\S]+)([?][\\S]*)";
@@ -128,9 +128,14 @@ public class LbryUri {
boolean isChannel = includesChannel && Helper.isNullOrEmpty(possibleStreamName);
String channelName = includesChannel && streamOrChannelName.length() > 1 ? streamOrChannelName.substring(1) : null;
// It would have thrown already on the RegEx parser if protocol value was incorrect
// open.lbry.com uses ':' as ModSeparators while lbry:// expects '#'
if (components.get(1).equals("open.lbry.com/")) {
/*
* It would have thrown already on the RegEx parser if protocol value was incorrect
* or HTTPS host was unknown to us.
*
* [https://] hosts use ':' as ModSeparators while [lbry://] protocol expects '#'
*/
if (!components.get(1).isEmpty()) {
if (primaryModSeparator.equals(":"))
primaryModSeparator = "#";
if (secondaryModSeparator.equals(":"))
@@ -178,7 +183,7 @@ public class LbryUri {
return uri;
}
public String build(boolean includeProto, String protoDefault, boolean vanity) {
public String build(boolean includeProto, String protocol, boolean vanity) {
String formattedChannelName = null;
if (channelName != null) {
formattedChannelName = channelName.startsWith("@") ? channelName : String.format("@%s", channelName);
@@ -201,7 +206,7 @@ public class LbryUri {
StringBuilder sb = new StringBuilder();
if (includeProto) {
sb.append(protoDefault);
sb.append(protocol);
}
sb.append(primaryClaimName);
if (vanity) {
@@ -219,79 +224,34 @@ public class LbryUri {
if (!Helper.isNullOrEmpty(primaryClaimId)) {
sb.append('#').append(primaryClaimId);
}
if (primaryClaimSequence > 0) {
} else if (primaryClaimSequence > 0) {
sb.append(':').append(primaryClaimSequence);
}
if (primaryBidPosition > 0) {
} else if (primaryBidPosition > 0) {
sb.append('$').append(primaryBidPosition);
}
if (!Helper.isNullOrEmpty(secondaryClaimName)) {
sb.append('/').append(secondaryClaimName);
}
if (!Helper.isNullOrEmpty(secondaryClaimId)) {
sb.append('#').append(secondaryClaimId);
}
if (secondaryClaimSequence > 0) {
} else if (secondaryClaimSequence > 0) {
sb.append(':').append(secondaryClaimSequence);
}
if (secondaryBidPosition > 0) {
} else if (secondaryBidPosition > 0) {
sb.append('$').append(secondaryBidPosition);
}
return sb.toString();
}
public String toTvString() {
String formattedChannelName = null;
if (channelName != null) {
formattedChannelName = channelName.startsWith("@") ? channelName : String.format("@%s", channelName);
}
String primaryClaimName = claimName;
if (Helper.isNullOrEmpty(primaryClaimName)) {
primaryClaimName = contentName;
}
if (Helper.isNullOrEmpty(primaryClaimName)) {
primaryClaimName = formattedChannelName;
}
if (Helper.isNullOrEmpty(primaryClaimName)) {
primaryClaimName = streamName;
}
String primaryClaimId = claimId;
if (Helper.isNullOrEmpty(primaryClaimId)) {
primaryClaimId = !Helper.isNullOrEmpty(formattedChannelName) ? channelClaimId : streamClaimId;
}
StringBuilder sb = new StringBuilder();
sb.append(LBRY_TV_BASE_URL).append('/');
sb.append(primaryClaimName);
String secondaryClaimName = null;
if (Helper.isNullOrEmpty(claimName) && !Helper.isNullOrEmpty(contentName)) {
secondaryClaimName = contentName;
}
if (Helper.isNullOrEmpty(secondaryClaimName)) {
secondaryClaimName = !Helper.isNullOrEmpty(formattedChannelName) ? streamName : null;
}
String secondaryClaimId = !Helper.isNullOrEmpty(secondaryClaimName) ? streamClaimId : null;
if (!Helper.isNullOrEmpty(primaryClaimId)) {
sb.append(':').append(primaryClaimId);
}
if (!Helper.isNullOrEmpty(secondaryClaimName)) {
sb.append('/').append(secondaryClaimName);
}
if (!Helper.isNullOrEmpty(secondaryClaimId)) {
sb.append(':').append(secondaryClaimId);
}
return sb.toString();
}
public static String normalize(String url) throws LbryUriException {
return parse(url).toString();
}
public String toTvString() {
return build(true, LBRY_TV_BASE_URL, false);
}
public String toVanityString() {
return build(true, PROTO_DEFAULT, true);
}
@@ -15,6 +15,7 @@ import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
@@ -57,9 +58,12 @@ public final class Lbryio {
public static final String TAG = "Lbryio";
public static final String CONNECTION_STRING = "https://api.lbry.com";
public static final String WS_CONNECTION_BASE_URL = "wss://api.lbry.com/subscribe?auth_token=";
public static final String AUTH_TOKEN_PARAM = "auth_token";
public static List<Subscription> subscriptions = new ArrayList<>();
public static List<Claim> cacheResolvedSubscriptions = new ArrayList<>();
public static List<String> blockedOutpoints = new ArrayList<>();
public static List<String> filteredOutpoints = new ArrayList<>();
public static double LBCUSDRate = 0;
public static String AUTH_TOKEN;
private static boolean generatingAuthToken = false;
@@ -205,6 +209,15 @@ public final class Lbryio {
}
}
public static void populateOutpointList(List<String> outpoints, JSONArray source) throws JSONException {
outpoints.clear();
if (source != null) {
for (int i = 0; i < source.length(); i++) {
outpoints.add(source.getString(i));
}
}
}
public static User fetchCurrentUser(Context context) throws AuthTokenInvalidatedException {
try {
Response response = Lbryio.call("user", "me", context);
@@ -332,6 +345,15 @@ public final class Lbryio {
}
}
public static void updateSubscriptionNotificationsDisabled(Subscription subscription) {
synchronized (lock) {
int index = subscriptions.indexOf(subscription);
if (index > -1) {
subscriptions.get(index).setNotificationsDisabled(subscription.isNotificationsDisabled());
}
}
}
public static void addSubscription(Subscription subscription) {
synchronized (lock) {
if (!subscriptions.contains(subscription)) {
@@ -363,6 +385,15 @@ public final class Lbryio {
public static boolean isFollowing(Claim claim) {
return subscriptions.contains(Subscription.fromClaim(claim));
}
public static boolean isNotificationsDisabled(Claim claim) {
Subscription sub = Subscription.fromClaim(claim);
int index = subscriptions.indexOf(sub);
if (index > -1) {
Subscription actual = subscriptions.get(subscriptions.indexOf(sub));
return actual.isNotificationsDisabled();
}
return false;
}
public static void updateRewardsLists(List<Reward> rewards) {
synchronized (lock) {
@@ -493,7 +493,35 @@ public final class Predefined {
"covidcuts",
"covid-19"
);
public static final List<String> MATURE_TAGS = Arrays.asList("mature", "nsfw", "porn", "xxx");
public static final List<String> MATURE_TAGS = Arrays.asList(
"porn",
"porno",
"nsfw",
"mature",
"xxx",
"sex",
"creampie",
"blowjob",
"handjob",
"vagina",
"boobs",
"big boobs",
"big dick",
"pussy",
"cumshot",
"anal",
"hard fucking",
"ass",
"fuck",
"hentai"
);
// Subset of mature tags to be displayed on the publish page
public static final List<String> PUBLISH_MATURE_TAGS = Arrays.asList(
"porn",
"nsfw",
"mature",
"xxx"
);
public static final List<String> ADJECTIVES = Arrays.asList(
"aback",
"abaft",
@@ -0,0 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="#FFFFFF"
android:alpha="0.8">
<path
android:fillColor="@android:color/white"
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM17,13L7,13v-2h10v2z"/>
</vector>
Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 302 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 388 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 504 B

@@ -24,7 +24,7 @@
android:id="@+id/welcome_progress_bar"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginRight="8dp"
android:layout_marginEnd="8dp"
android:layout_gravity="center_vertical"/>
<TextView
android:id="@+id/welcome_wait_text"
@@ -21,7 +21,7 @@
android:visibility="gone"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_marginRight="8dp"
android:layout_marginEnd="8dp"
android:layout_marginTop="8dp"
android:background="?attr/selectableItemBackground"
app:layout_constraintTop_toTopOf="parent"
@@ -31,7 +31,7 @@
android:layout_width="24dp"
android:layout_height="24dp"
android:src="@drawable/ic_close"
android:tint="@color/white" />
app:tint="@color/white" />
</RelativeLayout>
<ProgressBar
+19 -175
View File
@@ -33,17 +33,17 @@
android:id="@+id/wunderbar"
android:background="@android:color/transparent"
android:layout_centerVertical="true"
android:drawableLeft="@drawable/ic_search"
android:drawableStart="@drawable/ic_search"
android:drawablePadding="8dp"
android:drawableTint="@color/actionBarForeground"
android:fontFamily="@font/inter"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="24dp"
android:layout_marginEnd="24dp"
android:hint="@string/uri_placeholder"
android:imeOptions="actionGo"
android:inputType="textNoSuggestions"
android:paddingRight="36dp"
android:paddingEnd="36dp"
android:selectAllOnFocus="true"
android:singleLine="true"
android:textFontWeight="300"
@@ -54,15 +54,15 @@
android:background="?attr/selectableItemBackground"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="24dp"
android:layout_alignParentRight="true"
android:layout_marginEnd="24dp"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:visibility="gone">
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:src="@drawable/ic_close"
android:tint="@color/actionBarForeground" />
app:tint="@color/actionBarForeground" />
</LinearLayout>
<RelativeLayout
@@ -71,7 +71,7 @@
android:background="?attr/selectableItemBackground"
android:layout_width="48dp"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true">
<ImageView
android:id="@+id/notifications_toggle_icon"
@@ -79,7 +79,7 @@
android:layout_height="24dp"
android:layout_centerInParent="true"
android:src="@drawable/ic_notifications"
android:tint="@color/actionBarForeground" />
app:tint="@color/actionBarForeground" />
<TextView
android:id="@+id/notifications_badge_count"
android:layout_width="wrap_content"
@@ -88,10 +88,10 @@
android:fontFamily="@font/inter"
android:gravity="center_horizontal"
android:minWidth="12dp"
android:paddingLeft="2dp"
android:paddingRight="2dp"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:layout_marginTop="12dp"
android:layout_marginLeft="24dp"
android:layout_marginStart="24dp"
android:textColor="@color/white"
android:textSize="10sp"
android:visibility="invisible"
@@ -156,173 +156,17 @@
android:textColor="@color/white"
android:textFontWeight="300"
android:textSize="14sp" />
<LinearLayout
<ListView
android:id="@+id/startup_stage_error_listview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="0dp"
android:layout_marginTop="12dp"
android:orientation="horizontal">
<ImageView
android:id="@+id/startup_stage_icon_install_id"
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_gravity="center_vertical"
android:tint="@color/white"
android:src="@drawable/ic_check" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_gravity="center_vertical"
android:fontFamily="@font/inter"
android:text="@string/installation_id_loaded"
android:textColor="@color/white"
android:textFontWeight="300"
android:textSize="14sp" />
</LinearLayout>
android:divider="@android:color/transparent"
android:dividerHeight="8dp"
android:scrollbars="none"
tools:listitem="@layout/list_item_startupstage">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:orientation="horizontal">
<ImageView
android:id="@+id/startup_stage_icon_known_tags"
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_gravity="center_vertical"
android:tint="@color/white"
android:src="@drawable/ic_check" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_gravity="center_vertical"
android:fontFamily="@font/inter"
android:text="@string/known_tags_loaded"
android:textColor="@color/white"
android:textFontWeight="300"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:orientation="horizontal">
<ImageView
android:id="@+id/startup_stage_icon_exchange_rate"
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_gravity="center_vertical"
android:tint="@color/white"
android:src="@drawable/ic_check" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_gravity="center_vertical"
android:fontFamily="@font/inter"
android:text="@string/exchange_rate_loaded"
android:textColor="@color/white"
android:textFontWeight="300"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:orientation="horizontal">
<ImageView
android:id="@+id/startup_stage_icon_user_authenticated"
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_gravity="center_vertical"
android:tint="@color/white"
android:src="@drawable/ic_check" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_gravity="center_vertical"
android:fontFamily="@font/inter"
android:text="@string/user_authenticated"
android:textColor="@color/white"
android:textFontWeight="300"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:orientation="horizontal">
<ImageView
android:id="@+id/startup_stage_icon_install_new"
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_gravity="center_vertical"
android:tint="@color/white"
android:src="@drawable/ic_check" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_gravity="center_vertical"
android:fontFamily="@font/inter"
android:text="@string/installation_registered"
android:textColor="@color/white"
android:textFontWeight="300"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:orientation="horizontal">
<ImageView
android:id="@+id/startup_stage_icon_subscriptions_loaded"
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_gravity="center_vertical"
android:tint="@color/white"
android:src="@drawable/ic_check" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_gravity="center_vertical"
android:fontFamily="@font/inter"
android:text="@string/subscriptions_loaded"
android:textColor="@color/white"
android:textFontWeight="300"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:orientation="horizontal">
<ImageView
android:id="@+id/startup_stage_icon_subscriptions_resolved"
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_gravity="center_vertical"
android:tint="@color/white"
android:src="@drawable/ic_check" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_gravity="center_vertical"
android:fontFamily="@font/inter"
android:text="@string/subscriptions_resolved"
android:textColor="@color/white"
android:textFontWeight="300"
android:textSize="14sp" />
</LinearLayout>
</ListView>
</LinearLayout>
</RelativeLayout>
@@ -47,14 +47,14 @@
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_centerVertical="true"
android:layout_marginRight="24dp"
android:layout_toLeftOf="@id/invites_email_button"
android:layout_marginEnd="24dp"
android:layout_toStartOf="@id/invites_email_button"
android:visibility="gone" />
<com.google.android.material.button.MaterialButton
android:id="@+id/invites_email_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:enabled="false"
android:fontFamily="@font/inter"
android:text="@string/invite" />
@@ -24,7 +24,7 @@
android:id="@+id/invites_loading_channels_progress"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:visibility="gone" />
</RelativeLayout>
@@ -54,11 +54,11 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toLeftOf="@id/invites_copy_invite_link"
android:layout_toStartOf="@id/invites_copy_invite_link"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:paddingLeft="12dp"
android:paddingRight="12dp">
android:paddingStart="12dp"
android:paddingEnd="12dp">
<TextView
android:id="@+id/invites_invite_link"
android:clickable="true"
@@ -72,14 +72,14 @@
</LinearLayout>
<ImageButton
android:id="@+id/invites_copy_invite_link"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_centerVertical="true"
android:background="@null"
android:src="@drawable/ic_copy"
android:tint="@color/lbryGreen"
android:layout_alignParentRight="true" />
android:layout_alignParentEnd="true" />
</RelativeLayout>
<TextView
@@ -23,7 +23,7 @@
android:id="@+id/invites_loading_status_progress"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:visibility="gone" />
</RelativeLayout>
@@ -27,8 +27,8 @@
android:layout_centerVertical="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_toRightOf="@id/reward_driver_icon"
android:layout_marginStart="8dp"
android:layout_toEndOf="@id/reward_driver_icon"
android:fontFamily="@font/inter"
android:lineSpacingMultiplier="1.2"
android:textColor="@color/white"
+37 -49
View File
@@ -38,6 +38,12 @@
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_above="@id/wallet_balance_usd_value">
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_gravity="center_vertical"
android:layout_marginEnd="4dp"
android:src="@drawable/ic_credits" />
<TextView
android:id="@+id/wallet_balance_value"
android:layout_width="wrap_content"
@@ -48,15 +54,6 @@
android:textSize="36sp"
android:textFontWeight="300"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:fontFamily="@font/inter"
android:text="@string/lbc"
android:textColor="@color/white"
android:textSize="16sp"
android:textFontWeight="300" />
</LinearLayout>
<TextView
android:id="@+id/wallet_balance_usd_value"
@@ -76,8 +73,8 @@
android:fontFamily="@font/inter"
android:text="@string/buy_lbc"
android:layout_marginTop="8dp"
android:layout_marginLeft="12dp"
android:layout_marginRight="12dp"
android:layout_marginStart="12dp"
android:layout_marginEnd="12dp"
android:textSize="16sp" />
<TextView
@@ -85,8 +82,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:fontFamily="@font/inter"
android:text="@string/convert_credits"
android:textColorLink="@color/lbryGreen"
@@ -97,7 +94,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:fontFamily="@font/inter"
android:text="@string/convert_credits_bittrex"
android:textColorLink="@color/lbryGreen"
@@ -115,8 +112,8 @@
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp">
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp">
<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
@@ -129,7 +126,7 @@
android:textColor="@color/lbryGreen" />
<LinearLayout
android:orientation="vertical"
android:layout_marginLeft="4dp"
android:layout_marginStart="4dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
@@ -145,6 +142,12 @@
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_gravity="center_vertical"
android:src="@drawable/ic_credits"
android:layout_marginEnd="4dp" />
<TextView
android:id="@+id/wallet_balance_tips"
android:layout_width="wrap_content"
@@ -152,15 +155,6 @@
android:fontFamily="@font/inter"
android:text="0"
android:textSize="24sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:fontFamily="@font/inter"
android:text="@string/lbc"
android:textAllCaps="true"
android:textSize="10sp"
android:textFontWeight="300" />
</LinearLayout>
<TextView
@@ -189,9 +183,9 @@
android:layout_centerVertical="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/wallet_in_tips_label"
android:layout_toEndOf="@id/wallet_in_tips_label"
android:fontFamily="@font/inter"
android:layout_marginLeft="24dp"
android:layout_marginStart="24dp"
android:text="@string/unlock"
android:textColor="@color/lbryGreen"
android:textSize="14sp"
@@ -201,8 +195,8 @@
android:layout_centerVertical="true"
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_marginLeft="24dp"
android:layout_toRightOf="@id/wallet_in_tips_label"
android:layout_marginStart="24dp"
android:layout_toEndOf="@id/wallet_in_tips_label"
android:visibility="gone" />
</RelativeLayout>
@@ -232,7 +226,7 @@
android:textColor="@color/lbryGreen" />
<LinearLayout
android:orientation="vertical"
android:layout_marginLeft="4dp"
android:layout_marginStart="4dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
@@ -248,6 +242,12 @@
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_gravity="center_vertical"
android:src="@drawable/ic_credits"
android:layout_marginEnd="4dp" />
<TextView
android:id="@+id/wallet_balance_staked_publishes"
android:layout_width="wrap_content"
@@ -255,15 +255,6 @@
android:fontFamily="@font/inter"
android:text="0"
android:textSize="24sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:fontFamily="@font/inter"
android:text="@string/lbc"
android:textAllCaps="true"
android:textSize="10sp"
android:textFontWeight="300" />
</LinearLayout>
<TextView
@@ -278,6 +269,12 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp">
<ImageView
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_gravity="center_vertical"
android:src="@drawable/ic_credits"
android:layout_marginEnd="4dp" />
<TextView
android:id="@+id/wallet_balance_staked_supports"
android:layout_width="wrap_content"
@@ -285,15 +282,6 @@
android:fontFamily="@font/inter"
android:text="0"
android:textSize="24sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:fontFamily="@font/inter"
android:text="@string/lbc"
android:textAllCaps="true"
android:textSize="10sp"
android:textFontWeight="300" />
</LinearLayout>
<TextView
@@ -36,7 +36,7 @@
android:id="@+id/wallet_receive_address"
android:clickable="true"
android:layout_centerVertical="true"
android:layout_toLeftOf="@id/wallet_copy_receive_address"
android:layout_toStartOf="@id/wallet_copy_receive_address"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/inter"
@@ -45,21 +45,21 @@
android:letterSpacing="0.05"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:paddingStart="8dp"
android:paddingEnd="8dp"
android:singleLine="true"
android:textAlignment="center"
android:ellipsize="middle" />
<ImageButton
android:id="@+id/wallet_copy_receive_address"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_centerVertical="true"
android:background="@null"
android:src="@drawable/ic_copy"
android:tint="@color/lbryGreen"
android:layout_alignParentRight="true" />
android:layout_alignParentEnd="true" />
</RelativeLayout>
<com.google.android.material.button.MaterialButton
@@ -12,8 +12,8 @@
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginTop="16dp">
<TextView
android:layout_width="wrap_content"
@@ -63,7 +63,7 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:text="@string/loading_transactions"
android:fontFamily="@font/inter"
android:textSize="14sp"
@@ -52,10 +52,10 @@
<TextView
android:id="@+id/wallet_input_currency"
android:layout_toRightOf="@id/wallet_input_layout_amount"
android:layout_toEndOf="@id/wallet_input_layout_amount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="30dp"
android:fontFamily="@font/inter"
android:text="@string/lbc"
@@ -65,38 +65,39 @@
<LinearLayout
android:id="@+id/wallet_inline_balance_container"
android:layout_toRightOf="@id/wallet_input_currency"
android:layout_marginLeft="24dp"
android:layout_toEndOf="@id/wallet_input_currency"
android:layout_marginStart="24dp"
android:layout_marginTop="28dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:visibility="invisible">
<io.lbry.browser.ui.controls.SolidIconView
android:layout_width="18dp"
android:layout_height="18dp"
android:text="@string/fa_coins" />
<ImageView
android:layout_width="12dp"
android:layout_height="12dp"
android:layout_gravity="center_vertical"
android:src="@drawable/ic_credits" />
<TextView
android:id="@+id/wallet_inline_balance_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/inter"
android:textFontWeight="300"
android:layout_marginLeft="2dp" />
android:layout_marginStart="2dp" />
</LinearLayout>
<ProgressBar
android:id="@+id/wallet_send_progress"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_toLeftOf="@id/wallet_send"
android:layout_toStartOf="@id/wallet_send"
android:layout_centerVertical="true"
android:layout_marginRight="8dp"
android:layout_marginEnd="8dp"
android:visibility="gone" />
<com.google.android.material.button.MaterialButton
android:id="@+id/wallet_send"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+7 -7
View File
@@ -12,7 +12,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:fontFamily="@font/inter"
android:textStyle="bold"
@@ -29,8 +29,8 @@
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:weightSum="10">
<TextView
android:layout_weight="4"
@@ -66,8 +66,8 @@
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:weightSum="10">
<TextView
android:layout_weight="4"
@@ -106,8 +106,8 @@
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="12dp"
android:weightSum="2">
<TextView
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/comment_form_card"
android:orientation="vertical"
android:layout_width="match_parent"
@@ -24,7 +25,7 @@
android:textFontWeight="300" />
<ProgressBar
android:id="@+id/comment_form_channels_loading"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_width="20dp"
android:layout_height="20dp"
@@ -47,22 +48,25 @@
android:layout_marginBottom="8dp"
android:orientation="horizontal"
android:visibility="gone">
<View
android:id="@+id/comment_form_reply_to_vertical_bar"
android:layout_width="3dp"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/nextLbryGreen" />
android:background="@color/nextLbryGreen"
android:orientation="vertical" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp">
android:layout_marginStart="8dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginRight="40dp">
android:layout_marginEnd="40dp"
android:orientation="vertical">
<TextView
android:id="@+id/comment_form_replying_to_text"
android:layout_width="wrap_content"
@@ -77,25 +81,26 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:lineSpacingMultiplier="1.05"
android:fontFamily="@font/inter"
android:lineSpacingMultiplier="1.05"
android:textFontWeight="300"
android:textSize="14sp" />
</LinearLayout>
<RelativeLayout
android:id="@+id/comment_form_clear_reply_to"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:layout_alignParentRight="true"
android:layout_width="36dp"
android:layout_height="36dp">
android:layout_height="36dp"
android:layout_alignParentEnd="true"
android:background="?attr/selectableItemBackground"
android:clickable="true">
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_centerInParent="true"
android:src="@drawable/ic_close"
android:tint="@color/foreground" />
app:tint="@color/foreground" />
</RelativeLayout>
</RelativeLayout>
</LinearLayout>
@@ -136,8 +141,8 @@
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/comment_form_avatar_container"
android:layout_marginLeft="16dp">
android:layout_toEndOf="@id/comment_form_avatar_container"
android:layout_marginStart="16dp">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/comment_form_body"
android:hint="@string/comment"
@@ -168,19 +173,21 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp">
<com.google.android.material.button.MaterialButton
android:id="@+id/comment_form_post"
android:layout_centerVertical="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/inter" />
android:layout_centerVertical="true"
android:fontFamily="@font/inter"
android:text="@string/comment_form_post" />
<ProgressBar
android:id="@+id/comment_form_post_progress"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/comment_form_post"
android:layout_marginLeft="24dp"
android:layout_toEndOf="@id/comment_form_post"
android:layout_marginStart="24dp"
android:visibility="gone" />
</RelativeLayout>
</LinearLayout>
@@ -42,10 +42,10 @@
<TextView
android:id="@+id/inline_channel_form_inline_currency"
android:layout_toRightOf="@id/inline_channel_form_layout_deposit"
android:layout_toEndOf="@id/inline_channel_form_layout_deposit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="30dp"
android:fontFamily="@font/inter"
android:text="@string/lbc"
@@ -55,24 +55,25 @@
<LinearLayout
android:id="@+id/inline_channel_form_inline_balance_container"
android:layout_toRightOf="@id/inline_channel_form_inline_currency"
android:layout_marginLeft="24dp"
android:layout_toEndOf="@id/inline_channel_form_inline_currency"
android:layout_marginStart="24dp"
android:layout_marginTop="28dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:visibility="invisible">
<io.lbry.browser.ui.controls.SolidIconView
android:layout_width="18dp"
android:layout_height="18dp"
android:text="@string/fa_coins" />
<ImageView
android:layout_width="12dp"
android:layout_height="12dp"
android:layout_gravity="center_vertical"
android:src="@drawable/ic_credits" />
<TextView
android:id="@+id/inline_channel_form_inline_balance_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/inter"
android:textFontWeight="300"
android:layout_marginLeft="2dp" />
android:layout_marginStart="2dp" />
</LinearLayout>
</RelativeLayout>
@@ -105,15 +106,15 @@
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_centerVertical="true"
android:layout_marginRight="24dp"
android:layout_toLeftOf="@id/inline_channel_form_create_button"
android:layout_marginEnd="24dp"
android:layout_toStartOf="@id/inline_channel_form_create_button"
android:visibility="gone" />
<com.google.android.material.button.MaterialButton
android:id="@+id/inline_channel_form_create_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:fontFamily="@font/inter"
android:text="@string/create"/>
@@ -18,6 +18,7 @@
android:adjustViewBounds="true"
android:src="@drawable/gerbil_happy" />
<TextView
android:id="@+id/nothing_at_location_text"
android:text="@string/nothing_at_this_location"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+20 -15
View File
@@ -71,13 +71,18 @@
android:textSize="16sp"
android:textAlignment="center" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/notifications_list"
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/notifications_list_swipe_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="8dp"
android:clipToPadding="false"
/>
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/notifications_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="8dp"
android:clipToPadding="false"
/>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
</RelativeLayout>
<include layout="@layout/floating_wallet_balance" />
@@ -104,7 +109,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:fontFamily="@font/inter"
android:text="@string/sdk_initializing"
android:textSize="14sp"
@@ -118,8 +123,8 @@
android:clickable="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:layout_marginRight="4dp"
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:layout_marginBottom="4dp"
android:visibility="gone"
app:cardElevation="8dp"
@@ -133,9 +138,9 @@
android:layout_width="160dp"
android:layout_height="90dp" />
<LinearLayout
android:layout_toRightOf="@id/global_now_playing_player_view"
android:layout_toLeftOf="@id/global_now_playing_close"
android:layout_marginLeft="8dp"
android:layout_toEndOf="@id/global_now_playing_player_view"
android:layout_toStartOf="@id/global_now_playing_close"
android:layout_marginStart="8dp"
android:layout_centerVertical="true"
android:orientation="vertical"
android:layout_width="match_parent"
@@ -165,13 +170,13 @@
android:layout_width="36dp"
android:layout_alignParentEnd="true"
android:clickable="true"
android:layout_marginLeft="8dp">
android:layout_marginStart="8dp">
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:tint="@color/foreground"
android:src="@drawable/ic_close"
android:layout_centerInParent="true"/>
android:layout_centerInParent="true"
app:tint="@color/foreground" />
</RelativeLayout>
</RelativeLayout>
</androidx.cardview.widget.CardView>
+20 -19
View File
@@ -1,11 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_marginTop="8dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -19,8 +20,8 @@
android:layout_height="0.5dp"
android:background="@color/divider"
android:layout_marginTop="8dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp" />
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp" />
<RelativeLayout
android:id="@+id/content_from_past_24_hours_item"
@@ -41,11 +42,11 @@
android:id="@+id/content_from_past_24_hours_item_selected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:src="@drawable/ic_check"
android:tint="@color/lbryGreen"
android:visibility="gone" />
android:visibility="gone"
app:tint="@color/lbryGreen" />
</RelativeLayout>
<RelativeLayout
@@ -67,11 +68,11 @@
android:id="@+id/content_from_past_week_item_selected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:src="@drawable/ic_check"
android:tint="@color/lbryGreen"
android:visibility="gone" />
android:visibility="gone"
app:tint="@color/lbryGreen" />
</RelativeLayout>
<RelativeLayout
@@ -93,11 +94,11 @@
android:id="@+id/content_from_past_month_item_selected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:src="@drawable/ic_check"
android:tint="@color/lbryGreen"
android:visibility="gone" />
android:visibility="gone"
app:tint="@color/lbryGreen" />
</RelativeLayout>
<RelativeLayout
@@ -119,11 +120,11 @@
android:id="@+id/content_from_past_year_item_selected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:src="@drawable/ic_check"
android:tint="@color/lbryGreen"
android:visibility="gone" />
android:visibility="gone"
app:tint="@color/lbryGreen" />
</RelativeLayout>
<RelativeLayout
@@ -145,10 +146,10 @@
android:id="@+id/content_from_all_time_item_selected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:src="@drawable/ic_check"
android:tint="@color/lbryGreen"
android:visibility="gone" />
android:visibility="gone"
app:tint="@color/lbryGreen" />
</RelativeLayout>
</LinearLayout>
@@ -1,11 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_marginTop="8dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -19,8 +20,8 @@
android:layout_height="0.5dp"
android:background="@color/divider"
android:layout_marginTop="8dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp" />
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp" />
<RelativeLayout
android:id="@+id/content_scope_everyone_item"
@@ -37,10 +38,10 @@
android:layout_centerVertical="true"
android:text="@string/fa_globe_americas" />
<TextView
android:layout_toRightOf="@+id/content_scope_everyone_item_icon"
android:layout_toEndOf="@+id/content_scope_everyone_item_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_centerVertical="true"
android:fontFamily="@font/inter"
android:text="@string/everyone"
@@ -50,11 +51,11 @@
android:id="@+id/content_scope_everyone_item_selected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:src="@drawable/ic_check"
android:tint="@color/lbryGreen"
android:visibility="gone" />
android:visibility="gone"
app:tint="@color/lbryGreen" />
</RelativeLayout>
<RelativeLayout
@@ -72,10 +73,10 @@
android:layout_centerVertical="true"
android:text="@string/fa_hashtag" />
<TextView
android:layout_toRightOf="@+id/content_scope_tags_item_icon"
android:layout_toEndOf="@+id/content_scope_tags_item_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_centerVertical="true"
android:fontFamily="@font/inter"
android:text="@string/tags_you_follow"
@@ -85,10 +86,10 @@
android:id="@+id/content_scope_tags_item_selected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:src="@drawable/ic_check"
android:tint="@color/lbryGreen"
android:visibility="gone" />
android:visibility="gone"
app:tint="@color/lbryGreen" />
</RelativeLayout>
</LinearLayout>
+23 -22
View File
@@ -1,11 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_marginTop="8dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -19,8 +20,8 @@
android:layout_height="0.5dp"
android:background="@color/divider"
android:layout_marginTop="8dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp" />
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp" />
<RelativeLayout
android:id="@+id/sort_by_trending_item"
@@ -35,12 +36,12 @@
android:layout_height="18dp"
android:layout_centerVertical="true"
android:src="@drawable/ic_trending"
android:tint="@color/foreground" />
app:tint="@color/foreground" />
<TextView
android:layout_toRightOf="@+id/sort_by_trending_item_icon"
android:layout_toEndOf="@+id/sort_by_trending_item_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_centerVertical="true"
android:fontFamily="@font/inter"
android:text="@string/trending_content"
@@ -50,11 +51,11 @@
android:id="@+id/sort_by_trending_item_selected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:src="@drawable/ic_check"
android:tint="@color/lbryGreen"
android:visibility="gone" />
android:visibility="gone"
app:tint="@color/lbryGreen" />
</RelativeLayout>
<RelativeLayout
@@ -70,12 +71,12 @@
android:layout_height="18dp"
android:layout_centerVertical="true"
android:src="@drawable/ic_new"
android:tint="@color/foreground" />
app:tint="@color/foreground" />
<TextView
android:layout_toRightOf="@+id/sort_by_new_item_icon"
android:layout_toEndOf="@+id/sort_by_new_item_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_centerVertical="true"
android:fontFamily="@font/inter"
android:text="@string/new_content"
@@ -85,11 +86,11 @@
android:id="@+id/sort_by_new_item_selected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:src="@drawable/ic_check"
android:tint="@color/lbryGreen"
android:visibility="gone" />
android:visibility="gone"
app:tint="@color/lbryGreen" />
</RelativeLayout>
<RelativeLayout
@@ -105,12 +106,12 @@
android:layout_height="18dp"
android:layout_centerVertical="true"
android:src="@drawable/ic_top"
android:tint="@color/foreground" />
app:tint="@color/foreground" />
<TextView
android:layout_toRightOf="@+id/sort_by_top_item_icon"
android:layout_toEndOf="@+id/sort_by_top_item_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_centerVertical="true"
android:fontFamily="@font/inter"
android:text="@string/top_content"
@@ -120,10 +121,10 @@
android:id="@+id/sort_by_top_item_selected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:src="@drawable/ic_check"
android:tint="@color/lbryGreen"
android:visibility="gone" />
android:visibility="gone"
app:tint="@color/lbryGreen" />
</RelativeLayout>
</LinearLayout>
@@ -50,7 +50,7 @@
android:text="@string/channel_to_show_support_as" />
<ProgressBar
android:id="@+id/create_support_channel_progress"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_width="20dp"
android:layout_height="20dp"
@@ -83,10 +83,10 @@
<TextView
android:id="@+id/create_support_input_currency"
android:layout_toRightOf="@id/create_support_input_layout_amount"
android:layout_toEndOf="@id/create_support_input_layout_amount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="30dp"
android:fontFamily="@font/inter"
android:text="@string/lbc"
@@ -96,24 +96,25 @@
<LinearLayout
android:id="@+id/create_support_inline_balance_container"
android:layout_toRightOf="@id/create_support_input_currency"
android:layout_marginLeft="24dp"
android:layout_toEndOf="@id/create_support_input_currency"
android:layout_marginStart="24dp"
android:layout_marginTop="28dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:visibility="invisible">
<io.lbry.browser.ui.controls.SolidIconView
android:layout_width="18dp"
android:layout_height="18dp"
android:text="@string/fa_coins" />
<ImageView
android:layout_width="12dp"
android:layout_height="12dp"
android:layout_gravity="center_vertical"
android:src="@drawable/ic_credits" />
<TextView
android:id="@+id/create_support_inline_balance_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/inter"
android:textFontWeight="300"
android:layout_marginLeft="2dp" />
android:layout_marginStart="2dp" />
</LinearLayout>
</RelativeLayout>
@@ -148,9 +149,9 @@
android:id="@+id/create_support_progress"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_toLeftOf="@id/create_support_send"
android:layout_toStartOf="@id/create_support_send"
android:layout_centerVertical="true"
android:layout_marginRight="8dp"
android:layout_marginEnd="8dp"
android:visibility="gone" />
<com.google.android.material.button.MaterialButton
@@ -158,8 +159,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/inter"
android:text="@string/send_lbc_tip"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true" />
</RelativeLayout>
</LinearLayout>
@@ -8,8 +8,8 @@
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_marginTop="8dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -23,22 +23,22 @@
android:layout_height="0.5dp"
android:background="@color/divider"
android:layout_marginTop="8dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="16dp"/>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/customize_tags_followed_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp" />
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp" />
<TextView
android:id="@+id/customize_no_followed_tags"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="6dp"
android:fontFamily="@font/inter"
android:text="@string/no_followed_tags"
@@ -51,23 +51,23 @@
android:layout_height="0.5dp"
android:background="@color/divider"
android:layout_marginTop="10dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="16dp"/>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/customize_tags_suggested_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp" />
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp" />
<TextView
android:id="@+id/customize_no_tag_results"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="6dp"
android:fontFamily="@font/inter"
android:text="@string/no_tag_results"
@@ -79,8 +79,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/customize_tag_filter_input"
@@ -97,8 +97,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:fontFamily="@font/inter"
android:text="@string/done" />
+3 -3
View File
@@ -22,7 +22,7 @@
android:id="@+id/discover_loading"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:visibility="gone" />
</RelativeLayout>
@@ -46,8 +46,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:fontFamily="@font/inter"
android:text="@string/done" />
+16 -15
View File
@@ -74,7 +74,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/repost_name_prefix"
android:layout_toEndOf="@id/repost_name_prefix"
android:fontFamily="@font/inter"
android:singleLine="true"
android:textSize="14sp"
@@ -107,10 +107,10 @@
<TextView
android:id="@+id/repost_input_currency"
android:layout_toRightOf="@id/repost_input_layout_amount"
android:layout_toEndOf="@id/repost_input_layout_amount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="30dp"
android:fontFamily="@font/inter"
android:text="@string/lbc"
@@ -120,24 +120,25 @@
<LinearLayout
android:id="@+id/repost_inline_balance_container"
android:layout_toRightOf="@id/repost_input_currency"
android:layout_marginLeft="24dp"
android:layout_toEndOf="@id/repost_input_currency"
android:layout_marginStart="24dp"
android:layout_marginTop="28dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:visibility="invisible">
<io.lbry.browser.ui.controls.SolidIconView
android:layout_width="18dp"
android:layout_height="18dp"
android:text="@string/fa_coins" />
<ImageView
android:layout_width="12dp"
android:layout_height="12dp"
android:layout_gravity="center_vertical"
android:src="@drawable/ic_credits" />
<TextView
android:id="@+id/repost_inline_balance_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/inter"
android:textFontWeight="300"
android:layout_marginLeft="2dp" />
android:layout_marginStart="2dp" />
</LinearLayout>
</RelativeLayout>
</LinearLayout>
@@ -165,8 +166,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginRight="24dp"
android:layout_toLeftOf="@id/repost_button"
android:layout_marginEnd="24dp"
android:layout_toStartOf="@id/repost_button"
android:fontFamily="@font/inter"
android:textSize="14sp"
android:text="@string/show_advanced" />
@@ -174,9 +175,9 @@
android:id="@+id/repost_progress"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_toLeftOf="@id/repost_button"
android:layout_toStartOf="@id/repost_button"
android:layout_centerVertical="true"
android:layout_marginRight="8dp"
android:layout_marginEnd="8dp"
android:visibility="gone" />
<com.google.android.material.button.MaterialButton
android:id="@+id/repost_button"
@@ -184,7 +185,7 @@
android:layout_height="wrap_content"
android:fontFamily="@font/inter"
android:text="@string/repost"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true" />
</RelativeLayout>
</LinearLayout>
@@ -14,7 +14,7 @@
android:layout_centerVertical="true"
android:layout_width="72dp"
android:layout_height="72dp"
android:layout_toLeftOf="@id/player_play_pause">
android:layout_toStartOf="@id/player_play_pause">
<ImageView
android:layout_width="36dp"
android:layout_height="36dp"
@@ -22,7 +22,7 @@
android:layout_alignParentBottom="true"
android:layout_marginBottom="16dp"
android:src="@drawable/ic_replay_10"
android:tint="@color/white" />
app:tint="@color/white" />
</RelativeLayout>
<RelativeLayout
@@ -66,7 +66,7 @@
android:layout_centerVertical="true"
android:layout_width="72dp"
android:layout_height="72dp"
android:layout_toRightOf="@id/player_play_pause">
android:layout_toEndOf="@id/player_play_pause">
<ImageView
android:layout_width="36dp"
android:layout_height="36dp"
@@ -74,7 +74,7 @@
android:layout_alignParentBottom="true"
android:layout_marginBottom="16dp"
android:src="@drawable/ic_forward_10"
android:tint="@color/white" />
app:tint="@color/white" />
</RelativeLayout>
<RelativeLayout
@@ -84,7 +84,7 @@
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:visibility="gone">
<ImageView
android:id="@+id/player_image_cast_toggle"
@@ -92,7 +92,7 @@
android:layout_height="24dp"
android:layout_centerInParent="true"
android:src="@drawable/ic_cast"
android:tint="@color/white" />
app:tint="@color/white" />
</RelativeLayout>
<RelativeLayout
@@ -103,14 +103,14 @@
android:layout_alignParentBottom="true"
android:layout_width="56dp"
android:layout_height="48dp"
android:layout_toLeftOf="@id/player_toggle_fullscreen">
android:layout_toStartOf="@id/player_toggle_fullscreen">
<TextView
android:id="@+id/player_playback_speed_label"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="8dp"
android:layout_marginEnd="8dp"
android:fontFamily="@font/inter"
android:letterSpacing="0.05"
android:singleLine="true"
@@ -126,23 +126,23 @@
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true">
android:layout_alignParentEnd="true">
<ImageView
android:id="@+id/player_image_full_screen_toggle"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_centerInParent="true"
android:src="@drawable/ic_fullscreen"
android:tint="@color/white" />
app:tint="@color/white" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_alignParentBottom="true"
android:layout_toLeftOf="@id/player_playback_speed"
android:paddingLeft="16dp"
android:paddingRight="4dp">
android:layout_toStartOf="@id/player_playback_speed"
android:paddingStart="16dp"
android:paddingEnd="4dp">
<TextView
android:id="@+id/player_duration_elapsed"
android:layout_width="64dp"
@@ -155,12 +155,12 @@
android:textSize="14sp" />
<com.google.android.exoplayer2.ui.DefaultTimeBar
android:id="@id/exo_progress"
android:layout_toLeftOf="@id/player_duration_total"
android:layout_toRightOf="@id/player_duration_elapsed"
android:layout_toStartOf="@id/player_duration_total"
android:layout_toEndOf="@id/player_duration_elapsed"
android:layout_width="match_parent"
android:layout_height="24dp"
android:layout_marginLeft="4dp"
android:layout_marginRight="4dp"
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:layout_centerVertical="true"
app:scrubber_color="@color/scrubberColor"
app:played_color="@color/playedColor"
@@ -170,7 +170,7 @@
android:layout_width="64dp"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:gravity="end"
android:fontFamily="@font/inter"
android:singleLine="true"
@@ -6,9 +6,9 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginRight="8dp"
android:layout_marginEnd="8dp"
android:elevation="4dp"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent">
<LinearLayout
android:id="@+id/floating_reward_container"
@@ -19,8 +19,8 @@
android:layout_height="wrap_content"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:paddingLeft="8dp"
android:paddingRight="44dp"
android:paddingStart="8dp"
android:paddingEnd="44dp"
android:visibility="invisible">
<io.lbry.browser.ui.controls.SolidIconView
android:layout_width="16dp"
@@ -33,7 +33,7 @@
android:id="@+id/floating_reward_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:layout_marginStart="2dp"
android:layout_gravity="center_vertical"
android:fontFamily="@font/inter"
android:textColor="@color/white"
@@ -50,19 +50,17 @@
android:foreground="?attr/selectableItemBackground"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/floating_reward_container"
android:layout_marginLeft="-36dp"
android:layout_toEndOf="@id/floating_reward_container"
android:layout_marginStart="-36dp"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:paddingLeft="12dp"
android:paddingRight="16dp">
<io.lbry.browser.ui.controls.SolidIconView
android:layout_width="16dp"
android:layout_height="16dp"
android:textSize="10dp"
android:paddingStart="12dp"
android:paddingEnd="16dp">
<ImageView
android:layout_width="12dp"
android:layout_height="12dp"
android:layout_gravity="center_vertical"
android:textColor="@color/white"
android:text="@string/fa_coins" />
android:src="@drawable/ic_credits" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -73,7 +71,7 @@
android:id="@+id/floating_balance_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:layout_marginStart="2dp"
android:layout_gravity="center_vertical"
android:fontFamily="@font/inter"
android:textColor="@color/white"
@@ -87,7 +85,7 @@
android:layout_gravity="center_vertical"
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_marginLeft="2dp" />
android:layout_marginStart="2dp" />
</LinearLayout>
@@ -25,8 +25,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp">
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp">
<TextView
android:id="@+id/all_content_page_title"
android:layout_width="wrap_content"
@@ -41,7 +41,7 @@
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_centerVertical="true"
android:layout_alignParentRight="true" />
android:layout_alignParentEnd="true" />
</RelativeLayout>
<RelativeLayout
@@ -50,8 +50,8 @@
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:layout_marginBottom="8dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:visibility="visible">
<LinearLayout
android:layout_width="wrap_content"
@@ -76,19 +76,19 @@
<ImageView
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_marginLeft="2dp"
android:layout_marginStart="2dp"
android:layout_gravity="center_vertical"
android:src="@drawable/ic_arrow_dropdown"
android:tint="@color/foreground" />
app:tint="@color/foreground" />
</LinearLayout>
<TextView
android:id="@+id/all_content_for_prefix"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/all_content_sort_link"
android:layout_toEndOf="@id/all_content_sort_link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:layout_marginStart="2dp"
android:fontFamily="@font/inter"
android:textFontWeight="300"
android:textSize="12sp"
@@ -96,12 +96,12 @@
android:visibility="gone" />
<LinearLayout
android:id="@+id/all_content_scope_link"
android:layout_toRightOf="@id/all_content_sort_link"
android:layout_toEndOf="@id/all_content_sort_link"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:layout_marginStart="2dp"
android:layout_centerVertical="true"
android:visibility="gone">
<TextView
@@ -109,7 +109,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="4dp"
android:layout_marginStart="4dp"
android:fontFamily="@font/inter"
android:textFontWeight="300"
android:textSize="12sp"
@@ -117,19 +117,19 @@
<ImageView
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_marginLeft="2dp"
android:layout_marginStart="2dp"
android:layout_gravity="center_vertical"
android:src="@drawable/ic_arrow_dropdown"
android:tint="@color/foreground" />
app:tint="@color/foreground" />
</LinearLayout>
<TextView
android:id="@+id/all_content_from_prefix"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/all_content_sort_link"
android:layout_toEndOf="@id/all_content_sort_link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:layout_marginStart="2dp"
android:fontFamily="@font/inter"
android:textFontWeight="300"
android:textSize="12sp"
@@ -142,15 +142,15 @@
android:clickable="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:layout_toRightOf="@id/all_content_sort_link"
android:layout_marginStart="2dp"
android:layout_toEndOf="@id/all_content_sort_link"
android:visibility="gone">
<TextView
android:id="@+id/all_content_time_link_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="4dp"
android:layout_marginStart="4dp"
android:fontFamily="@font/inter"
android:textFontWeight="300"
android:textSize="12sp"
@@ -158,10 +158,10 @@
<ImageView
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_marginLeft="2dp"
android:layout_marginStart="2dp"
android:layout_gravity="center_vertical"
android:src="@drawable/ic_arrow_dropdown"
android:tint="@color/foreground" />
app:tint="@color/foreground" />
</LinearLayout>
</LinearLayout>
@@ -170,7 +170,7 @@
android:background="?attr/selectableItemBackground"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:clickable="true"
android:fontFamily="@font/inter"
+55 -23
View File
@@ -19,7 +19,7 @@
<ProgressBar
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_marginRight="8dp"
android:layout_marginEnd="8dp"
android:layout_gravity="center_vertical" />
<TextView
android:layout_width="wrap_content"
@@ -53,18 +53,18 @@
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="12dp"
android:layout_marginRight="12dp"
android:layout_marginStart="12dp"
android:layout_marginEnd="12dp"
android:layout_above="@+id/channel_view_tabs"
android:layout_toRightOf="@id/channel_view_icon_container"
android:layout_toEndOf="@id/channel_view_icon_container"
android:orientation="vertical">
<TextView
android:id="@+id/channel_view_title"
android:background="@color/channelCoverBackground"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="4dp"
android:paddingRight="4dp"
android:paddingStart="4dp"
android:paddingEnd="4dp"
android:paddingTop="2dp"
android:paddingBottom="2dp"
android:ellipsize="end"
@@ -80,8 +80,8 @@
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:layout_marginBottom="2dp"
android:paddingLeft="4dp"
android:paddingRight="4dp"
android:paddingStart="4dp"
android:paddingEnd="4dp"
android:paddingTop="2dp"
android:paddingBottom="2dp"
android:fontFamily="@font/inter"
@@ -95,7 +95,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:paddingLeft="110dp"
android:paddingStart="110dp"
app:tabGravity="fill"
app:tabMode="scrollable"/>
<RelativeLayout
@@ -103,7 +103,7 @@
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_alignParentBottom="true"
android:layout_marginLeft="12dp"
android:layout_marginStart="12dp"
android:layout_marginBottom="12dp">
<RelativeLayout
android:layout_centerHorizontal="true"
@@ -143,7 +143,7 @@
android:elevation="4dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:padding="8dp">
<RelativeLayout
android:id="@+id/channel_view_edit"
@@ -151,14 +151,14 @@
android:background="?attr/selectableItemBackground"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_marginRight="8dp"
android:layout_marginEnd="8dp"
android:visibility="gone">
<ImageView
android:layout_centerInParent="true"
android:layout_width="24dp"
android:layout_height="24dp"
android:tint="@color/foreground"
android:src="@drawable/ic_edit" />
android:src="@drawable/ic_edit"
app:tint="@color/foreground" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/channel_view_delete"
@@ -166,14 +166,14 @@
android:background="?attr/selectableItemBackground"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_marginRight="8dp"
android:layout_marginEnd="8dp"
android:visibility="gone">
<ImageView
android:layout_centerInParent="true"
android:layout_width="24dp"
android:layout_height="24dp"
android:tint="@color/foreground"
android:src="@drawable/ic_delete" />
android:src="@drawable/ic_delete"
app:tint="@color/foreground" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/channel_view_share"
@@ -181,13 +181,13 @@
android:background="?attr/selectableItemBackground"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_marginRight="8dp">
android:layout_marginEnd="8dp">
<ImageView
android:layout_centerInParent="true"
android:layout_width="22dp"
android:layout_height="22dp"
android:tint="@color/foreground"
android:src="@drawable/ic_share" />
android:src="@drawable/ic_share"
app:tint="@color/foreground" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/channel_view_tip"
@@ -195,7 +195,7 @@
android:clickable="true"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_marginRight="8dp">
android:layout_marginEnd="8dp">
<io.lbry.browser.ui.controls.SolidIconView
android:layout_centerInParent="true"
android:layout_width="24dp"
@@ -208,13 +208,27 @@
android:id="@+id/channel_view_follow_unfollow"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:layout_width="36dp"
android:layout_width="wrap_content"
android:layout_height="36dp">
<TextView
android:id="@+id/channel_view_text_follow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginStart="6dp"
android:layout_marginEnd="6dp"
android:fontFamily="@font/inter"
android:text="@string/follow"
android:textSize="12sp"
android:textStyle="bold"
android:textAllCaps="true" />
<io.lbry.browser.ui.controls.OutlineIconView
android:id="@+id/channel_view_icon_follow"
android:layout_centerInParent="true"
android:layout_toRightOf="@id/channel_view_text_follow"
android:layout_centerVertical="true"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginEnd="6dp"
android:text="@string/fa_heart"
android:textColor="@color/red"
android:textSize="20dp" />
@@ -224,9 +238,27 @@
android:layout_width="24dp"
android:layout_height="24dp"
android:text="@string/fa_heart_broken"
android:textColor="@color/foreground"
android:textSize="20dp"
android:visibility="invisible"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/channel_view_subscribe_notify"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_marginStart="8dp"
android:visibility="gone">
<io.lbry.browser.ui.controls.SolidIconView
android:id="@+id/channel_view_icon_bell"
android:layout_centerInParent="true"
android:layout_width="24dp"
android:layout_height="24dp"
android:text="@string/fa_bell_slash"
android:textColor="@color/foreground"
android:textSize="20dp"/>
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
@@ -8,8 +8,8 @@
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp">
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp">
<ProgressBar
android:id="@+id/channel_comments_progress"
android:layout_width="20dp"
@@ -31,16 +31,16 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="0dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp" />
<TextView
android:id="@+id/channel_no_comments"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginTop="8dp"
android:fontFamily="@font/inter"
android:text="@string/no_comments"
@@ -52,8 +52,8 @@
android:id="@+id/channel_comments_sdk_initializing"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginTop="8dp"
android:fontFamily="@font/inter"
android:text="@string/sdk_initializing_comments"
@@ -27,8 +27,8 @@
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:layout_marginBottom="8dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:visibility="visible">
<LinearLayout
android:layout_width="wrap_content"
@@ -53,10 +53,10 @@
<ImageView
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_marginLeft="2dp"
android:layout_marginStart="2dp"
android:layout_gravity="center_vertical"
android:src="@drawable/ic_arrow_dropdown"
android:tint="@color/foreground" />
app:tint="@color/foreground" />
</LinearLayout>
<LinearLayout
@@ -66,15 +66,15 @@
android:clickable="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="24dp"
android:layout_toRightOf="@id/channel_content_sort_link"
android:layout_marginStart="24dp"
android:layout_toEndOf="@id/channel_content_sort_link"
android:visibility="gone">
<TextView
android:id="@+id/channel_content_time_link_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="4dp"
android:layout_marginStart="4dp"
android:fontFamily="@font/inter"
android:textFontWeight="300"
android:textSize="12sp"
@@ -82,10 +82,10 @@
<ImageView
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_marginLeft="2dp"
android:layout_marginStart="2dp"
android:layout_gravity="center_vertical"
android:src="@drawable/ic_arrow_dropdown"
android:tint="@color/foreground" />
app:tint="@color/foreground" />
</LinearLayout>
</LinearLayout>
@@ -29,7 +29,7 @@
android:background="@drawable/bg_small_icon"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginBottom="16dp"
android:layout_alignParentBottom="true">
<ImageView
@@ -38,23 +38,23 @@
android:layout_height="16dp"
android:layout_centerInParent="true"
android:src="@drawable/ic_edit"
android:tint="@color/white" />
app:tint="@color/white" />
</RelativeLayout>
<LinearLayout
android:id="@+id/channel_form_upload_progress"
android:background="@color/channelCoverBackground"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:layout_marginStart="4dp"
android:layout_marginTop="4dp"
android:orientation="horizontal"
android:paddingTop="2dp"
android:paddingBottom="2dp"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:paddingStart="8dp"
android:paddingEnd="8dp"
android:visibility="gone">
<ProgressBar
android:layout_width="16dp"
@@ -62,7 +62,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:layout_marginStart="4dp"
android:fontFamily="@font/inter"
android:text="@string/uploading"
android:textColor="@color/white"
@@ -103,7 +103,7 @@
android:background="@drawable/bg_small_icon"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginBottom="16dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true">
@@ -112,7 +112,7 @@
android:layout_height="16dp"
android:layout_centerInParent="true"
android:src="@drawable/ic_edit"
android:tint="@color/white" />
app:tint="@color/white" />
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>
@@ -169,7 +169,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="28dp"
android:layout_marginLeft="12dp"
android:layout_marginStart="12dp"
android:text="@string/at"
android:visibility="gone" />
</RelativeLayout>
@@ -195,10 +195,10 @@
<TextView
android:id="@+id/channel_form_input_currency"
android:layout_toRightOf="@id/channel_form_input_layout_deposit"
android:layout_toEndOf="@id/channel_form_input_layout_deposit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="30dp"
android:fontFamily="@font/inter"
android:text="@string/lbc"
@@ -208,24 +208,25 @@
<LinearLayout
android:id="@+id/channel_form_inline_balance_container"
android:layout_toRightOf="@id/channel_form_input_currency"
android:layout_marginLeft="24dp"
android:layout_toEndOf="@id/channel_form_input_currency"
android:layout_marginStart="24dp"
android:layout_marginTop="28dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:visibility="invisible">
<io.lbry.browser.ui.controls.SolidIconView
android:layout_width="18dp"
android:layout_height="18dp"
android:text="@string/fa_coins" />
<ImageView
android:layout_width="12dp"
android:layout_height="12dp"
android:layout_gravity="center_vertical"
android:src="@drawable/ic_credits" />
<TextView
android:id="@+id/channel_form_inline_balance_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/inter"
android:textFontWeight="300"
android:layout_marginLeft="2dp" />
android:layout_marginStart="2dp" />
</LinearLayout>
</RelativeLayout>
@@ -323,8 +324,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginRight="24dp"
android:layout_toLeftOf="@id/channel_form_save_button"
android:layout_marginEnd="24dp"
android:layout_toStartOf="@id/channel_form_save_button"
android:fontFamily="@font/inter"
android:textSize="14sp"
android:text="@string/show_optional_fields" />
@@ -333,14 +334,14 @@
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_centerVertical="true"
android:layout_marginRight="24dp"
android:layout_toLeftOf="@+id/channel_form_save_button"
android:layout_marginEnd="24dp"
android:layout_toStartOf="@+id/channel_form_save_button"
android:visibility="gone" />
<com.google.android.material.button.MaterialButton
android:id="@+id/channel_form_save_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:fontFamily="@font/inter"
android:text="@string/save" />
@@ -15,9 +15,9 @@
android:id="@+id/channel_manager_list_loading"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_marginTop="16dp"
android:layout_marginRight="16dp"
android:layout_marginEnd="16dp"
android:visibility="gone" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/channel_manager_list"
@@ -66,9 +66,9 @@
android:id="@+id/channel_manager_fab_new_channel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginRight="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:src="@drawable/ic_add"
android:visibility="gone" />
File diff suppressed because it is too large. Load diff
+17 -17
View File
@@ -26,8 +26,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="6dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp">
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp">
<TextView
android:id="@+id/following_page_title"
android:layout_width="wrap_content"
@@ -41,14 +41,14 @@
android:layout_height="16dp"
android:visibility="gone"
android:layout_centerVertical="true"
android:layout_alignParentRight="true" />
android:layout_alignParentEnd="true" />
<ProgressBar
android:id="@+id/following_content_progress"
android:visibility="gone"
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_centerVertical="true"
android:layout_alignParentRight="true" />
android:layout_alignParentEnd="true" />
</RelativeLayout>
<RelativeLayout
@@ -57,8 +57,8 @@
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:layout_marginBottom="8dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:visibility="gone">
<LinearLayout
android:id="@+id/following_sort_link"
@@ -79,20 +79,20 @@
<ImageView
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_marginLeft="2dp"
android:layout_marginStart="2dp"
android:layout_gravity="center_vertical"
android:src="@drawable/ic_arrow_dropdown"
android:tint="@color/foreground" />
app:tint="@color/foreground" />
</LinearLayout>
<LinearLayout
android:id="@+id/following_time_link"
android:layout_toRightOf="@id/following_sort_link"
android:layout_toEndOf="@id/following_sort_link"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="24dp"
android:layout_marginStart="24dp"
android:layout_centerVertical="true"
android:visibility="gone">
<TextView
@@ -107,10 +107,10 @@
<ImageView
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_marginLeft="2dp"
android:layout_marginStart="2dp"
android:layout_gravity="center_vertical"
android:src="@drawable/ic_arrow_dropdown"
android:tint="@color/foreground" />
app:tint="@color/foreground" />
</LinearLayout>
<TextView
@@ -118,7 +118,7 @@
android:background="?attr/selectableItemBackground"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:clickable="true"
android:fontFamily="@font/inter"
@@ -131,8 +131,8 @@
android:id="@+id/following_page_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:fontFamily="@font/inter"
android:textFontWeight="300"
android:text="@string/lbry_works_better"
@@ -188,8 +188,8 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/following_suggested_done_button"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
+1 -2
View File
@@ -3,8 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.gallery.GalleryFragment">
android:layout_height="match_parent">
<TextView
android:id="@+id/text_gallery"
+1 -2
View File
@@ -3,8 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.home.HomeFragment">
android:layout_height="match_parent">
<TextView
android:id="@+id/text_home"
+1 -1
View File
@@ -80,7 +80,7 @@
android:layout_alignParentBottom="true">
<com.google.android.material.button.MaterialButton
android:id="@+id/invites_get_started_button"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
+24 -24
View File
@@ -8,8 +8,8 @@
android:id="@+id/library_filter_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginTop="16dp">
<RelativeLayout
android:layout_width="match_parent"
@@ -32,8 +32,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="24dp"
android:layout_toRightOf="@id/library_filter_link_downloads"
android:layout_marginStart="24dp"
android:layout_toEndOf="@id/library_filter_link_downloads"
android:fontFamily="@font/inter"
android:text="@string/purchases" />
<TextView
@@ -43,8 +43,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="24dp"
android:layout_toRightOf="@id/library_filter_link_purchases"
android:layout_marginStart="24dp"
android:layout_toEndOf="@id/library_filter_link_purchases"
android:fontFamily="@font/inter"
android:text="@string/history"
android:textSize="14sp" />
@@ -52,7 +52,7 @@
android:id="@+id/library_list_loading"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:visibility="gone" />
<TextView
@@ -61,7 +61,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:fontFamily="@font/inter"
android:text="@string/stats"
android:textColor="@color/lbryGreen"
@@ -75,8 +75,8 @@
android:layout_below="@id/library_filter_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginTop="16dp"
android:visibility="gone">
<LinearLayout
@@ -105,7 +105,7 @@
android:id="@+id/library_storage_stat_unit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"
android:layout_marginStart="3dp"
android:fontFamily="@font/inter"
android:text="@string/mb"
android:textColor="@color/lbryGreen"
@@ -119,7 +119,7 @@
android:clickable="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_marginTop="4dp"
android:fontFamily="@font/inter"
android:text="@string/hide"
@@ -174,13 +174,13 @@
android:layout_height="10dp"
android:layout_centerVertical="true" />
<TextView
android:layout_toRightOf="@id/library_storage_legend_video_icon"
android:layout_toEndOf="@id/library_storage_legend_video_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:fontFamily="@font/inter"
android:text="@string/video"
android:layout_marginLeft="4dp"
android:layout_marginStart="4dp"
android:textFontWeight="300"
android:textSize="12sp" />
@@ -190,7 +190,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:fontFamily="@font/inter"
android:text="@string/zero_mb"
android:textFontWeight="300"
@@ -210,13 +210,13 @@
android:layout_height="10dp"
android:layout_centerVertical="true" />
<TextView
android:layout_toRightOf="@id/library_storage_legend_audio_icon"
android:layout_toEndOf="@id/library_storage_legend_audio_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:fontFamily="@font/inter"
android:text="@string/audio"
android:layout_marginLeft="4dp"
android:layout_marginStart="4dp"
android:textFontWeight="300"
android:textSize="12sp" />
@@ -226,7 +226,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:fontFamily="@font/inter"
android:text="@string/zero_mb"
android:textFontWeight="300"
@@ -246,13 +246,13 @@
android:layout_height="10dp"
android:layout_centerVertical="true" />
<TextView
android:layout_toRightOf="@id/library_storage_legend_image_icon"
android:layout_toEndOf="@id/library_storage_legend_image_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:fontFamily="@font/inter"
android:text="@string/images"
android:layout_marginLeft="4dp"
android:layout_marginStart="4dp"
android:textFontWeight="300"
android:textSize="12sp" />
@@ -262,7 +262,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:fontFamily="@font/inter"
android:text="@string/zero_mb"
android:textFontWeight="300"
@@ -282,13 +282,13 @@
android:layout_height="10dp"
android:layout_centerVertical="true" />
<TextView
android:layout_toRightOf="@id/library_storage_legend_other_icon"
android:layout_toEndOf="@id/library_storage_legend_other_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:fontFamily="@font/inter"
android:text="@string/other"
android:layout_marginLeft="4dp"
android:layout_marginStart="4dp"
android:textFontWeight="300"
android:textSize="12sp" />
@@ -298,7 +298,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:fontFamily="@font/inter"
android:text="@string/zero_mb"
android:textFontWeight="300"
+10 -10
View File
@@ -26,7 +26,7 @@
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginLeft="-1.5dp">
android:layout_marginStart="-1.5dp">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -36,8 +36,8 @@
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_gravity="center_horizontal"
android:tint="@color/white"
android:src="@drawable/ic_record" />
android:src="@drawable/ic_record"
app:tint="@color/white" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -64,7 +64,7 @@
android:clickable="true"
android:background="@android:color/black"
android:foreground="?attr/selectableItemBackground"
android:layout_toRightOf="@id/publish_vertical_divider"
android:layout_toEndOf="@id/publish_vertical_divider"
android:layout_width="match_parent"
android:layout_height="148.5dp">
<LinearLayout
@@ -76,8 +76,8 @@
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_gravity="center_horizontal"
android:tint="@color/white"
android:src="@drawable/ic_photo" />
android:src="@drawable/ic_photo"
app:tint="@color/white" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -106,7 +106,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/publish_photo_upload_divider"
android:layout_toRightOf="@id/publish_vertical_divider">
android:layout_toEndOf="@id/publish_vertical_divider">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -116,8 +116,8 @@
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_gravity="center_horizontal"
android:tint="@color/white"
android:src="@drawable/ic_upload" />
android:src="@drawable/ic_upload"
app:tint="@color/white" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -168,7 +168,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:fontFamily="@font/inter"
android:text="@string/loading_videos"
android:textColor="@color/white"
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/pageBackground">
@@ -29,16 +30,16 @@
<LinearLayout
android:id="@+id/publish_form_thumbnail_upload_progress"
android:background="@color/channelCoverBackground"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:layout_marginStart="4dp"
android:layout_marginTop="4dp"
android:orientation="horizontal"
android:paddingTop="2dp"
android:paddingBottom="2dp"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:paddingStart="8dp"
android:paddingEnd="8dp"
android:visibility="gone">
<ProgressBar
android:layout_width="16dp"
@@ -46,9 +47,9 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:layout_marginStart="4dp"
android:fontFamily="@font/inter"
android:text="@string/uploading"
android:text="@string/uploading_thumbnail"
android:textColor="@color/white"
android:textFontWeight="300"
android:textSize="12sp" />
@@ -58,7 +59,7 @@
android:background="@drawable/bg_small_icon"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginBottom="16dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true">
@@ -67,7 +68,7 @@
android:layout_height="16dp"
android:layout_centerInParent="true"
android:src="@drawable/ic_edit"
android:tint="@color/white" />
app:tint="@color/white" />
</RelativeLayout>
</RelativeLayout>
@@ -149,7 +150,7 @@
android:layout_centerVertical="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:fontFamily="@font/inter"
android:textFontWeight="300"
android:textSize="16sp" />
@@ -183,7 +184,7 @@
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_centerVertical="true"
android:layout_marginRight="16dp"
android:layout_marginEnd="16dp"
android:visibility="gone" />
<TextView
@@ -191,7 +192,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/publish_form_video_opt_progress"
android:layout_toEndOf="@id/publish_form_video_opt_progress"
android:fontFamily="@font/inter"
android:textFontWeight="300"
android:textSize="14sp" />
@@ -243,7 +244,7 @@
android:id="@+id/publish_form_loading_channels"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:visibility="gone" />
</RelativeLayout>
@@ -280,7 +281,7 @@
android:id="@+id/publish_form_price_switch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true" />
</RelativeLayout>
@@ -316,10 +317,10 @@
<androidx.appcompat.widget.AppCompatSpinner
android:id="@+id/publish_form_currency_spinner"
android:entries="@array/publish_currencies"
android:layout_width="110dp"
android:layout_width="160dp"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/publish_form_price_layout"
android:layout_marginLeft="4dp"
android:layout_toEndOf="@+id/publish_form_price_layout"
android:layout_marginStart="4dp"
android:layout_marginTop="24dp" />
</RelativeLayout>
</LinearLayout>
@@ -349,7 +350,7 @@
android:id="@+id/publish_form_generate_address"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -416,10 +417,10 @@
<TextView
android:id="@+id/publish_form_input_currency"
android:layout_toRightOf="@id/publish_form_input_layout_deposit"
android:layout_toEndOf="@id/publish_form_input_layout_deposit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="30dp"
android:fontFamily="@font/inter"
android:text="@string/lbc"
@@ -429,24 +430,25 @@
<LinearLayout
android:id="@+id/publish_form_inline_balance_container"
android:layout_toRightOf="@id/publish_form_input_currency"
android:layout_marginLeft="24dp"
android:layout_toEndOf="@id/publish_form_input_currency"
android:layout_marginStart="24dp"
android:layout_marginTop="28dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:visibility="invisible">
<io.lbry.browser.ui.controls.SolidIconView
android:layout_width="18dp"
android:layout_height="18dp"
android:text="@string/fa_coins" />
<ImageView
android:layout_width="12dp"
android:layout_height="12dp"
android:layout_gravity="center_vertical"
android:src="@drawable/ic_credits" />
<TextView
android:id="@+id/publish_form_inline_balance_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/inter"
android:textFontWeight="300"
android:layout_marginLeft="2dp" />
android:layout_marginStart="2dp" />
</LinearLayout>
</RelativeLayout>
@@ -538,7 +540,7 @@
android:layout_height="wrap_content"
android:layout_gravity="end"
android:layout_marginTop="24dp"
android:layout_marginRight="16dp"
android:layout_marginEnd="16dp"
android:fontFamily="@font/inter"
android:text="@string/show_extra_fields"
android:textFontWeight="300" />
@@ -546,8 +548,8 @@
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:layout_marginTop="24dp">
<TextView
android:id="@+id/publish_form_cancel"
@@ -567,14 +569,14 @@
android:layout_centerVertical="true"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginRight="16dp"
android:layout_toLeftOf="@id/publish_form_publish_button"
android:layout_marginEnd="16dp"
android:layout_toStartOf="@id/publish_form_publish_button"
android:visibility="gone" />
<com.google.android.material.button.MaterialButton
android:id="@+id/publish_form_publish_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:fontFamily="@font/inter"
android:text="@string/publish" />
@@ -15,9 +15,9 @@
android:id="@+id/publishes_list_loading"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_marginTop="16dp"
android:layout_marginRight="16dp"
android:layout_marginEnd="16dp"
android:visibility="gone" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/publishes_list"
@@ -66,9 +66,9 @@
android:id="@+id/publishes_fab_new_publish"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginRight="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:src="@drawable/ic_add"
android:visibility="gone" />
+7 -7
View File
@@ -8,8 +8,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp">
android:paddingStart="16dp"
android:paddingEnd="16dp">
<androidx.cardview.widget.CardView
android:id="@+id/rewards_filter_card"
android:layout_width="match_parent"
@@ -35,8 +35,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="16dp"
android:layout_toRightOf="@id/rewards_filter_link_unclaimed"
android:layout_marginStart="16dp"
android:layout_toEndOf="@id/rewards_filter_link_unclaimed"
android:fontFamily="@font/inter"
android:text="@string/all"
android:textSize="14sp" />
@@ -44,7 +44,7 @@
android:id="@+id/rewards_list_loading"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:visibility="gone" />
</RelativeLayout>
@@ -87,7 +87,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:fontFamily="@font/inter"
android:textSize="24sp"
android:textColor="@color/white" />
@@ -143,7 +143,7 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/rewards_get_started_button"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
+1 -1
View File
@@ -11,7 +11,7 @@
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginTop="8dp"
android:layout_marginRight="8dp"
android:layout_marginEnd="8dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintRight_toRightOf="parent"/>
Loaded 100 of 153 files, more files were not shown because too many files have changed in this diff. Show more