Compare commits

..
46 Commits
Author SHA1 Message Date
zeppi 89237a3da0 flexbox 3.0.0
Publish APK / build-release (push) Waiting to run
2022-11-26 11:06:34 -05:00
zeppi b87fcee359 typo 2022-11-26 11:03:23 -05:00
zeppi 7bfd9be732 flexbox snapshot? 2022-11-26 10:58:00 -05:00
zeppi c09109263b fix flexbox? 2022-11-26 10:47:56 -05:00
zeppi de1e4c7c5b chmod gradlew 2022-11-26 10:42:36 -05:00
zeppi da09cc231c try odysee android script 2022-11-26 10:32:55 -05:00
zeppi 21dc2b2ad6 test github env android root 2022-11-25 23:31:23 -05:00
zeppi d5d633122b troubleshoot... 2022-11-25 23:23:06 -05:00
zeppi 73eab49365 gradlew stacktrace 2022-11-25 23:05:28 -05:00
zeppi 5e0548ce2a move export ANDROID_SDK_ROOT up 2022-11-25 22:59:51 -05:00
zeppi 576c092902 try updated impls 2022-11-25 22:55:48 -05:00
zeppi 753499fc5c try newer exoplayer 2022-11-25 22:34:23 -05:00
zeppi 2ba7647179 troubleshoot build 2022-11-25 22:20:25 -05:00
zeppi ab498cc8ed github_workspace 2022-11-25 22:10:29 -05:00
zeppi 11b810fe72 build 2022-11-25 22:09:09 -05:00
zeppi 89436434ff git ownership workaround 2022-11-25 21:56:09 -05:00
zeppi 4b96cfd12d fix apt scripts 2022-11-25 21:43:12 -05:00
zeppi 1b34352820 apt-get 2022-11-25 21:40:29 -05:00
zeppi 130412bbdf upgrade git 2022-11-25 21:35:45 -05:00
zeppi d6eebb51b0 check git version 2022-11-25 21:04:36 -05:00
zeppi 2de5f7d79a try global safe hack 2022-11-25 20:56:19 -05:00
zeppi 681ae1c70c git rev-parse inside? 2022-11-25 20:51:51 -05:00
zeppi e4a708f38e g s r 2022-11-25 20:48:49 -05:00
zeppi 9480579b4e try 2022-11-25 20:46:24 -05:00
zeppi 8ccfb57713 try init again 2022-11-25 20:44:29 -05:00
zeppi b6a2eb2c39 try git secret init 2022-11-25 20:40:52 -05:00
zeppi c51f324645 troubleshooting 2022-11-25 20:37:28 -05:00
zeppi 72281739f6 try git init 2022-11-25 20:28:57 -05:00
zeppi 0ef598c78d try git-secret 2022-11-25 20:20:22 -05:00
zeppi c80876402c try gsr 2022-11-25 19:53:13 -05:00
zeppi a5cbf14bea typo ls 2022-11-25 19:50:45 -05:00
zeppi 74b5435961 verify ls al 2022-11-25 19:48:52 -05:00
zeppi 7a7506eb5f verify pwd 2022-11-25 15:33:56 -05:00
zeppi 6ef7d0499f add push condition for action 2022-11-25 15:13:58 -05:00
zeppi eaec3a8836 test setup step 2022-11-25 15:11:57 -05:00
jessopb 7250435d7f Create deploy.yml 2022-11-25 14:03:02 -05:00
jessopb b81abf74a1 Merge pull request #1244 from Coolguy3289/patch-1
Update LBRY_TV_CONNECTION_STRING to new Odysee Backend
2022-11-23 13:59:38 -05:00
Ralph 208e2c2d42 Update LBRY_TV_CONNECTION_STRING to new Odysee Backend 2022-11-23 11:29:52 -05:00
Alex Grin 1e3a74cae1 Update README.md 2021-09-28 10:19:37 -04:00
Akinwale Ariwodola ca08f71a72 sdk 0.102.0 2021-08-20 15:32:14 +01:00
Akinwale Ariwodola b60ca39df1 fix crash bug when trying to play content 2021-08-19 12:27:18 +01:00
soup-jingle 696bc86b7c Added QR scanner to wallet send card (#1194)
* Added QR scanner to wallet send card

* * app/src/main/java/io/lbry/browser/ui/wallet/WalletFragment.java:

Changed orientation of QR scanner, along with some style corrections

* Revert "* app/src/main/java/io/lbry/browser/ui/wallet/WalletFragment.java:"

This reverts commit 519c45ae0dfaee556de909bf65cea8c3b38c34ab.

* Fixed orientation of QR scanner activity, plus style corrections
2021-08-13 09:01:53 +01:00
Akinwale Ariwodola 4c163c6244 Merge pull request #1216 from lbryio/new_cdn_url
Use the new CDN url scheme for thumbnails
2021-08-13 09:01:09 +01:00
Akinwale Ariwodola 2ad49ca281 Merge pull request #1208 from lbryio/claimid-modifier-char
Accept colon or octoshape as claimID modifier character
2021-08-11 10:20:58 +01:00
Javi Rueda 56caeef72b Use the new CDN url scheme for thumbnails 2021-08-10 18:28:20 +02:00
Javi Rueda 84bb014557 Accept colon or octoshape as claimID modifier character and add unit tests 2021-07-29 00:55:45 +02:00
28 changed files with 283 additions and 60 deletions

No files matched your search

+107
View File
@@ -0,0 +1,107 @@
name: Publish APK
on:
pull_request:
branches: [test-deploy]
push:
branches: [test-deploy]
jobs:
# build:
# runs-on: ubuntu-latest
# container: lbry/android-base:platform-28
# steps:
# - name: update git # container git is too old
# run: |
# apt-get install -y software-properties-common
# apt-get update
# add-apt-repository -y ppa:git-core/ppa
# apt-get update
# apt-get install -y git
# - name: work around for permission issue # git doesn't trust user that owns the checkout
# run: |
# git config --global --add safe.directory /__w/lbry-android/lbry-android
# - name: checkout
# uses: actions/checkout@v3
# - name: hacky copy # docker image runs ~ as /root, but github actions uses ~=/github/home
# run: |
# cp -r /root/.buildozer ~/.buildozer/
# - name: setup
# run: |
# echo "$PGP_PRIVATE_KEY" | gpg --batch --import
# echo 'deb https://gitsecret.jfrog.io/artifactory/git-secret-deb git-secret main' >> /etc/apt/sources.list
# wget -qO - 'https://gitsecret.jfrog.io/artifactory/api/gpg/key/public' | apt-key add -
# apt-get -y update && apt-get -y install build-essential ca-certificates curl gpg-agent openjdk-8-jdk software-properties-common wget zipalign git-secret
# ls -al ..
# ls -al
# git rev-parse --is-inside-work-tree
# git secret reveal
# chmod u+x $GITHUB_WORKSPACE/gradlew
# export BUILD_VERSION=$($GITHUB_WORKSPACE/gradlew -p $GITHUB_WORKSPACE -q printVersionName --console=plain | tail -1)
# export PATH=/usr/bin:$PATH
# export ANDROID_SDK_ROOT=~/.buildozer/android/platform/android-sdk-23
# echo $ANDROID_SDK_ROOT
# echo "ANDROID_SDK_ROOT=$ANDROID_SDK_ROOT" >> $GITHUB_ENV
# echo "end of setup home:"
# echo $HOME
# env:
# PGP_PRIVATE_KEY: ${{ secrets.PGP_PRIVATE_KEY }}
# KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
# - name: build
# run: |
# ls -al ~/
# chmod u+x ./release.sh
# ./release.sh
# cp bin/browser-$BUILD_VERSION-release__arm.apk /dev/null
# cp bin/browser-$BUILD_VERSION-release__arm64.apk /dev/null
# env:
# PGP_PRIVATE_KEY: ${{ secrets.PGP_PRIVATE_KEY }}
# KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
# - name: Upload math result for job 1
# uses: actions/upload-artifact@v3
# with:
# name: homework
# path: math-homework.txt
build-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: gradle/wrapper-validation-action@v1
- name: Create and checkout branch
# push events already checked out the branch
if: github.event_name == 'pull_request'
run: git checkout -B ${{ github.head_ref }}
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: 'gradle'
- name: Reveal secrets
env:
PGP_PRIVATE_KEY: ${{ secrets.PGP_PRIVATE_KEY }}
run: |
sudo apt install git-secret gpg-agent
echo "$PGP_PRIVATE_KEY" | gpg --batch --import
git secret reveal
- name: Install NDK version 21.0.6113669
run: echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;21.0.6113669"
- name: Build
env:
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
run: |
sudo apt install zipalign apksigner
chmod +x gradlew
./release.sh
rm bin/*-unsigned.apk
- name: Upload APK
uses: actions/upload-artifact@v3
with:
name: app-release
path: bin/*.apk
+1
View File
@@ -67,3 +67,4 @@ app/twitter.properties
app/build
bin
app/debuglib
.vscode
+1 -1
View File
@@ -37,7 +37,7 @@ Contributions to this project are welcome, encouraged, and compensated. For more
This project is MIT licensed. For the full license, see [LICENSE](LICENSE).
## Security
We take security seriously. Please contact security@lbry.com regarding any security issues. Our PGP key is [here](https://keybase.io/lbry/key.asc) if you need it.
We take security seriously. Please contact security@lbry.com regarding any security issues. Our PGP key is [here](https://lbry.com/faq/pgp-key) if you need it.
## Contact
The primary contact for this project is [@akinwale](https://github.com/akinwale) (akinwale@lbry.com)
+14 -11
View File
@@ -21,7 +21,7 @@ android {
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
packagingOptions {
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'lib/x86_64/darwin/libscrypt.dylib'
}
@@ -103,25 +103,28 @@ dependencies {
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.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.exoplayer:exoplayer-core:2.15.1'
implementation 'com.google.android.exoplayer:exoplayer-dash:2.15.1'
implementation 'com.google.android.exoplayer:exoplayer-ui:2.15.1'
implementation 'com.google.android.exoplayer:extension-cast:2.15.1'
implementation 'com.google.android.exoplayer:extension-mediasession:2.15.1'
implementation 'com.google.android:flexbox:2.0.1'
implementation 'com.google.android.flexbox:flexbox:3.0.0'
implementation 'com.hbb20:ccp:2.3.8'
implementation 'com.hbb20:ccp:2.4.7'
implementation 'com.github.chrisbanes:PhotoView:2.3.0'
implementation 'com.atlassian.commonmark:commonmark:0.14.0'
implementation 'com.arthenica:mobile-ffmpeg-full-gpl:4.3.1.LTS'
implementation 'com.arthenica:mobile-ffmpeg-full-gpl:4.4.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'
implementation ('com.journeyapps:zxing-android-embedded:4.1.0') { transitive = false }
implementation 'com.google.zxing:core:3.3.0'
compileOnly 'org.projectlombok:lombok:1.18.10'
annotationProcessor 'org.projectlombok:lombok:1.18.10'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
@@ -132,8 +135,8 @@ dependencies {
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
__32bitImplementation 'io.lbry:lbrysdk32:0.100.0'
__64bitImplementation 'io.lbry:lbrysdk64:0.100.0'
__32bitImplementation 'io.lbry:lbrysdk32:0.102.0'
__64bitImplementation 'io.lbry:lbrysdk64:0.102.0'
//__64bitImplementation(name: 'lbrysdk', ext: 'aar')
}
+8
View File
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="io.lbry.browser"
android:installLocation="auto">
@@ -13,6 +14,8 @@
<uses-permission android:name="com.android.vending.BILLING" />
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-sdk tools:overrideLibrary="com.google.zxing.client.android" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
@@ -98,6 +101,11 @@
android:theme="@style/AppTheme.NoActionBarTranslucent"
android:windowSoftInputMode="adjustResize" />
<activity
android:name="com.journeyapps.barcodescanner.CaptureActivity"
android:screenOrientation="fullSensor"
tools:replace="screenOrientation" />
<service
android:name="io.lbry.browser.LbrynetMessagingService"
android:exported="false">
@@ -2102,7 +2102,7 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener
if (nowPlayingClaimBitmap == null &&
nowPlayingClaim != null &&
!Helper.isNullOrEmpty(nowPlayingClaim.getThumbnailUrl())) {
Glide.with(getApplicationContext()).asBitmap().load(nowPlayingClaim.getThumbnailUrl()).into(new CustomTarget<Bitmap>() {
Glide.with(getApplicationContext()).asBitmap().load(nowPlayingClaim.getThumbnailUrl(0, 0, 75)).into(new CustomTarget<Bitmap>() {
@Override
public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition<? super Bitmap> transition) {
nowPlayingClaimBitmap = resource;
@@ -95,7 +95,7 @@ public class ChannelFilterListAdapter extends RecyclerView.Adapter<ChannelFilter
vh.allView.setVisibility(claim.isPlaceholder() ? View.VISIBLE : View.GONE);
vh.titleView.setText(Helper.isNullOrEmpty(claim.getTitle()) ? claim.getName() : claim.getTitle());
String thumbnailUrl = claim.getThumbnailUrl();
String thumbnailUrl = claim.getThumbnailUrl(vh.thumbnailView.getLayoutParams().width, vh.thumbnailView.getLayoutParams().height, 85);
if (!Helper.isNullOrEmpty(thumbnailUrl) && context != null) {
Glide.with(context.getApplicationContext()).load(thumbnailUrl).apply(RequestOptions.circleCropTransform()).into(vh.thumbnailView);
}
@@ -334,7 +334,8 @@ public class ClaimListAdapter extends RecyclerView.Adapter<ClaimListAdapter.View
if (metadata instanceof Claim.StreamMetadata) {
streamMetadata = (Claim.StreamMetadata) metadata;
}
String thumbnailUrl = item.getThumbnailUrl();
String thumbnailUrl = item.getThumbnailUrl(vh.thumbnailView.getLayoutParams().width, vh.thumbnailView.getLayoutParams().height, 85);
long publishTime = (streamMetadata != null && streamMetadata.getReleaseTime() > 0) ? streamMetadata.getReleaseTime() * 1000 : item.getTimestamp() * 1000;
int bgColor = Helper.generateRandomColorForValue(item.getClaimId());
if (bgColor == 0) {
@@ -190,7 +190,7 @@ public class CommentListAdapter extends RecyclerView.Adapter<CommentListAdapter.
int bgColor = Helper.generateRandomColorForValue(comment.getChannelId());
Helper.setIconViewBackgroundColor(holder.noThumbnailView, bgColor, false, context);
if (hasThumbnail) {
Glide.with(context.getApplicationContext()).asBitmap().load(comment.getPoster().getThumbnailUrl()).
Glide.with(context.getApplicationContext()).asBitmap().load(comment.getPoster().getThumbnailUrl(holder.thumbnailView.getLayoutParams().width, holder.thumbnailView.getLayoutParams().height, 85)).
apply(RequestOptions.circleCropTransform()).into(holder.thumbnailView);
}
holder.alphaView.setText(comment.getChannelName() != null ? comment.getChannelName().substring(1, 2).toUpperCase() : null);
@@ -193,7 +193,7 @@ public class NotificationListAdapter extends RecyclerView.Adapter<NotificationLi
vh.thumbnailView.setVisibility(notification.getCommentAuthor() == null ? View.INVISIBLE : View.VISIBLE);
if (notification.getCommentAuthor() != null) {
Glide.with(context.getApplicationContext()).load(
notification.getCommentAuthor().getThumbnailUrl()).apply(RequestOptions.circleCropTransform()).into(vh.thumbnailView);
notification.getCommentAuthor().getThumbnailUrl(vh.thumbnailView.getLayoutParams().width, vh.thumbnailView.getLayoutParams().height, 85)).apply(RequestOptions.circleCropTransform()).into(vh.thumbnailView);
}
vh.iconView.setVisibility(notification.getCommentAuthor() != null ? View.INVISIBLE : View.VISIBLE);
@@ -89,7 +89,8 @@ public class SuggestedChannelGridAdapter extends RecyclerView.Adapter<SuggestedC
@Override
public void onBindViewHolder(SuggestedChannelGridAdapter.ViewHolder vh, int position) {
Claim claim = items.get(position);
String thumbnailUrl = claim.getThumbnailUrl();
ViewGroup.LayoutParams lp = vh.thumbnailView.getLayoutParams();
String thumbnailUrl = claim.getThumbnailUrl(lp.width, lp.height, 85);
int bgColor = Helper.generateRandomColorForValue(claim.getClaimId());
Helper.setIconViewBackgroundColor(vh.noThumbnailView, bgColor, false, context);
@@ -1,5 +1,7 @@
package io.lbry.browser.model;
import androidx.annotation.Nullable;
import com.google.gson.FieldNamingPolicy;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
@@ -184,6 +186,21 @@ public class Claim {
return null;
}
/**
* Gets the URL from the CDN where getting the image file
* @param width Pass zero for width and height for the full size image file
* @param height Pass zero for width and height for the full size image file
* @param q Desired quality for the image to be retrieved
* @return URL from the CDN from where image can be retrieved
*/
public String getThumbnailUrl(int width, int height, int q) {
if (value != null && value.getThumbnail() != null) {
ImageCDNUrl imageCDNUrl = new ImageCDNUrl(Math.max(width, 0), Math.max(height, 0), q, null, value.getThumbnail().getUrl());
return imageCDNUrl.toString();
}
return null;
}
public String getCoverUrl() {
if (TYPE_CHANNEL.equals(valueType) && value != null && value instanceof ChannelMetadata && ((ChannelMetadata) value).getCover() != null) {
return ((ChannelMetadata) value).getCover().getUrl();
@@ -491,6 +508,30 @@ public class Claim {
private String url;
}
/**
* Object to be instantiated. In order to get the URLto the CDN, call toString() on it
*/
static class ImageCDNUrl {
private String appendedPath = "";
public ImageCDNUrl(int width, int height, int quality, @Nullable String format, String thumbnailUrl) {
if (width != 0 && height != 0)
appendedPath = "s:".concat(String.valueOf(width)).concat(":").concat(String.valueOf(height)).concat("/");
appendedPath = appendedPath.concat("quality:").concat(String.valueOf(quality)).concat("/");
appendedPath = appendedPath.concat("plain/").concat(thumbnailUrl);
if (format != null)
appendedPath = appendedPath.concat("@").concat(format);
}
@Override
public String toString() {
String url = "https://image-processor.vanwanet.com/optimize/";
return url.concat(appendedPath);
}
}
@Data
public static class StreamInfo {
private long duration; // video / audio
@@ -467,7 +467,7 @@ public class ChannelCommentsFragment extends Fragment implements SdkStatusListen
if (hasThumbnail && context != null) {
Glide.with(context.getApplicationContext()).
asBitmap().
load(channel.getThumbnailUrl()).
load(channel.getThumbnailUrl(commentPostAsThumbnail.getLayoutParams().width, commentPostAsThumbnail.getLayoutParams().height, 85)).
apply(RequestOptions.circleCropTransform()).
into(commentPostAsThumbnail);
}
@@ -285,7 +285,7 @@ public class ChannelFormFragment extends BaseFragment implements
coverUrl = currentClaim.getCoverUrl();
}
if (!Helper.isNullOrEmpty(currentClaim.getThumbnailUrl())) {
Glide.with(context.getApplicationContext()).load(currentClaim.getThumbnailUrl()).apply(RequestOptions.circleCropTransform()).into(imageThumbnail);
Glide.with(context.getApplicationContext()).load(currentClaim.getThumbnailUrl(imageThumbnail.getLayoutParams().width, imageThumbnail.getLayoutParams().height, 85)).apply(RequestOptions.circleCropTransform()).into(imageThumbnail);
thumbnailUrl = currentClaim.getThumbnailUrl();
}
}
@@ -538,11 +538,15 @@ public class ChannelFragment extends BaseFragment implements FetchChannelsListen
else
buttonTip.setVisibility(View.VISIBLE);
String thumbnailUrl = claim.getThumbnailUrl();
String thumbnailUrl = "";
String coverUrl = claim.getCoverUrl();
textTitle.setText(Helper.isNullOrEmpty(claim.getTitle()) ? claim.getName() : claim.getTitle());
Context context = getContext();
if (context != null) {
thumbnailUrl = claim.getThumbnailUrl(imageThumbnail.getLayoutParams().width, imageThumbnail.getLayoutParams().height, 85);
}
if (context != null && !Helper.isNullOrEmpty(coverUrl)) {
Glide.with(context.getApplicationContext()).load(coverUrl).centerCrop().into(imageCover);
}
@@ -316,7 +316,10 @@ public class FileViewFragment extends BaseFragment implements
hideBuffering();
if (loadingNewClaim) {
MainActivity.appPlayer.setPlayWhenReady(Objects.requireNonNull((MainActivity) (getActivity())).isMediaAutoplayEnabled());
Context context = getContext();
if (context instanceof MainActivity) {
MainActivity.appPlayer.setPlayWhenReady(((MainActivity) context).isMediaAutoplayEnabled());
}
loadingNewClaim = false;
}
} else if (playbackState == Player.STATE_BUFFERING) {
@@ -1566,7 +1569,8 @@ public class FileViewFragment extends BaseFragment implements
int bgColor = Helper.generateRandomColorForValue(signingChannel.getClaimId());
Helper.setIconViewBackgroundColor(root.findViewById(R.id.file_view_publisher_no_thumbnail), bgColor, false, context);
if (hasPublisherThumbnail && context != null) {
Glide.with(context.getApplicationContext()).load(signingChannel.getThumbnailUrl()).
ViewGroup.LayoutParams lp = root.findViewById(R.id.file_view_publisher_thumbnail).getLayoutParams();
Glide.with(context.getApplicationContext()).load(signingChannel.getThumbnailUrl(lp.width, lp.height, 85)).
apply(RequestOptions.circleCropTransform()).into((ImageView) root.findViewById(R.id.file_view_publisher_thumbnail));
}
((TextView) root.findViewById(R.id.file_view_publisher_thumbnail_alpha)).
@@ -1606,7 +1610,7 @@ public class FileViewFragment extends BaseFragment implements
Claim.GenericMetadata metadata = claim.getValue();
if (!Helper.isNullOrEmpty(claim.getThumbnailUrl())) {
ImageView thumbnailView = root.findViewById(R.id.file_view_thumbnail);
Glide.with(context.getApplicationContext()).asBitmap().load(claim.getThumbnailUrl()).centerCrop().into(thumbnailView);
Glide.with(context.getApplicationContext()).asBitmap().load(claim.getThumbnailUrl(context.getResources().getDisplayMetrics().widthPixels, thumbnailView.getLayoutParams().height, 85)).centerCrop().into(thumbnailView);
} else {
// display first x letters of claim name, with random background
}
@@ -3243,7 +3247,7 @@ public class FileViewFragment extends BaseFragment implements
if (hasThumbnail && context != null) {
Glide.with(context.getApplicationContext()).
asBitmap().
load(channel.getThumbnailUrl()).
load(channel.getThumbnailUrl(commentPostAsThumbnail.getLayoutParams().width, commentPostAsThumbnail.getLayoutParams().height, 85)).
apply(RequestOptions.circleCropTransform()).
into(commentPostAsThumbnail);
}
@@ -583,7 +583,9 @@ public class PublishFormFragment extends BaseFragment implements
Context context = getContext();
try {
Claim.StreamMetadata metadata = (Claim.StreamMetadata) currentClaim.getValue();
uploadedThumbnailUrl = currentClaim.getThumbnailUrl();
if (context != null) {
uploadedThumbnailUrl = currentClaim.getThumbnailUrl(imageThumbnail.getLayoutParams().width, imageThumbnail.getLayoutParams().height, 85);
}
if (context != null && !Helper.isNullOrEmpty(uploadedThumbnailUrl)) {
Glide.with(context.getApplicationContext()).load(uploadedThumbnailUrl).centerCrop().into(imageThumbnail);
}
@@ -3,6 +3,7 @@ package io.lbry.browser.ui.wallet;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Color;
import android.net.Uri;
@@ -60,6 +61,9 @@ import java.util.concurrent.Future;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import com.google.zxing.integration.android.IntentIntegrator;
import com.google.zxing.integration.android.IntentResult;
import io.lbry.browser.MainActivity;
import io.lbry.browser.R;
import io.lbry.browser.adapter.TransactionListAdapter;
@@ -117,6 +121,7 @@ public class WalletFragment extends BaseFragment implements SdkStatusListener, W
private ImageButton buttonCopyReceiveAddress;
private MaterialButton buttonGetNewAddress;
private TextInputEditText inputSendAddress;
private ImageButton buttonQRScanAddress;
private TextInputEditText inputSendAmount;
private MaterialButton buttonSend;
private TextView textConnectedEmail;
@@ -162,6 +167,7 @@ public class WalletFragment extends BaseFragment implements SdkStatusListener, W
buttonCopyReceiveAddress = root.findViewById(R.id.wallet_copy_receive_address);
buttonGetNewAddress = root.findViewById(R.id.wallet_get_new_address);
inputSendAddress = root.findViewById(R.id.wallet_input_send_address);
buttonQRScanAddress = root.findViewById(R.id.wallet_qr_scan_address);
inputSendAmount = root.findViewById(R.id.wallet_input_amount);
buttonSend = root.findViewById(R.id.wallet_send);
textConnectedEmail = root.findViewById(R.id.wallet_connected_email);
@@ -368,6 +374,13 @@ public class WalletFragment extends BaseFragment implements SdkStatusListener, W
copyReceiveAddress();
}
});
buttonQRScanAddress.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
IntentIntegrator intentIntegrator = IntentIntegrator.forSupportFragment(WalletFragment.this);
intentIntegrator.setOrientationLocked(false).initiateScan();
}
});
buttonSend.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
@@ -800,4 +813,12 @@ public class WalletFragment extends BaseFragment implements SdkStatusListener, W
checkRewardsDriverCard(rewardsDriverText, 0);
}
}
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == IntentIntegrator.REQUEST_CODE) {
IntentResult intentResult = IntentIntegrator.parseActivityResult(requestCode, resultCode, data);
String code = intentResult.getContents();
inputSendAddress.setText(code);
}
}
}
@@ -51,7 +51,7 @@ public final class Lbry {
public static final int TTL_CLAIM_SEARCH_VALUE = 120000; // 2-minute TTL for cache
public static final String SDK_CONNECTION_STRING = "http://127.0.0.1:5279";
public static final String LBRY_TV_CONNECTION_STRING = "https://api.lbry.tv/api/v1/proxy";
public static final String LBRY_TV_CONNECTION_STRING = "https://api.na-backend.odysee.com/api/v1/proxy";
public static final String TAG = "Lbry";
// Values to obtain from LBRY SDK status
@@ -141,20 +141,6 @@ 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
* 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(":"))
secondaryModSeparator = "#";
}
if (includesChannel) {
if (Helper.isNullOrEmpty(channelName)) {
throw new LbryUriException("No channel name after @.");
@@ -329,9 +315,9 @@ public class LbryUri {
throw new LbryUriException(String.format("No modifier provided after separator %s", modSeparator));
}
if ("#".equals(modSeparator)) {
if ("#".equals(modSeparator) || ":".equals(modSeparator)) {
claimId = modValue;
} else if (":".equals(modSeparator)) {
} else if ("*".equals(modSeparator)) {
claimSequence = Helper.parseInt(modValue, -1);
} else if ("$".equals(modSeparator)) {
bidPosition = Helper.parseInt(modValue, -1);
+10
View File
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M9.5,6.5v3h-3v-3H9.5M11,5H5v6h6V5L11,5zM9.5,14.5v3h-3v-3H9.5M11,13H5v6h6V13L11,13zM17.5,6.5v3h-3v-3H17.5M19,5h-6v6h6V5L19,5zM13,13h1.5v1.5H13V13zM14.5,14.5H16V16h-1.5V14.5zM16,13h1.5v1.5H16V13zM13,16h1.5v1.5H13V16zM14.5,17.5H16V19h-1.5V17.5zM16,16h1.5v1.5H16V16zM17.5,14.5H19V16h-1.5V14.5zM17.5,17.5H19V19h-1.5V17.5zM22,7h-2V4h-3V2h5V7zM22,22v-5h-2v3h-3v2H22zM2,22h5v-2H4v-3H2V22zM2,2v5h2V4h3V2H2z"/>
</vector>
Binary file not shown.

After

Width:  |  Height:  |  Size: 217 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 B

@@ -19,18 +19,41 @@
android:text="@string/send_credits"
android:textSize="20sp"/>
<com.google.android.material.textfield.TextInputLayout
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/recipient_address">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/wallet_input_send_address"
android:fontFamily="@font/inter"
android:textSize="14sp"
android:layout_height="match_parent"
android:layout_marginTop="8dp"
android:orientation="horizontal">
<com.google.android.material.textfield.TextInputLayout
android:layout_centerVertical="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:imeOptions="actionNext" />
</com.google.android.material.textfield.TextInputLayout>
android:layout_weight="1"
android:hint="@string/recipient_address"
android:layout_toStartOf="@id/wallet_qr_scan_address">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/wallet_input_send_address"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/inter"
android:imeOptions="actionNext"
android:textSize="14sp" />
</com.google.android.material.textfield.TextInputLayout>
<ImageButton
android:id="@+id/wallet_qr_scan_address"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_marginStart="8dp"
android:background="@null"
android:src="@drawable/ic_qr_scanner"
android:tint="@color/lbryGreen" />
</RelativeLayout>
<RelativeLayout
android:layout_marginTop="16dp"
@@ -10,6 +10,7 @@ import static org.junit.Assert.assertEquals;
public class LbryUriTest {
private LbryUri expected;
private LbryUri expectedOctoshape;
/*
* Create an LbryUri object and assign fields manually using class methods. This object will be
@@ -18,14 +19,21 @@ public class LbryUriTest {
@Before
public void createExpected() {
expected = new LbryUri();
expectedOctoshape = new LbryUri();
expected.setChannelName("@lbry");
expected.setStreamName("lbryturns4");
expectedOctoshape.setChannelName("@lbry");
expectedOctoshape.setStreamName("lbryturns4");
try {
LbryUri.UriModifier primaryMod = LbryUri.UriModifier.parse("#", "3f");
LbryUri.UriModifier secondaryMod = LbryUri.UriModifier.parse("#", "6");
LbryUri.UriModifier primaryMod = LbryUri.UriModifier.parse(":", "3f");
LbryUri.UriModifier secondaryMod = LbryUri.UriModifier.parse(":", "6");
LbryUri.UriModifier primaryModOctoshape = LbryUri.UriModifier.parse("#", "3f");
LbryUri.UriModifier secondaryModOctoshape = LbryUri.UriModifier.parse("#", "6");
expected.setChannelClaimId(primaryMod.getClaimId());
expected.setStreamClaimId(secondaryMod.getClaimId());
expectedOctoshape.setChannelClaimId(primaryModOctoshape.getClaimId());
expectedOctoshape.setStreamClaimId(secondaryModOctoshape.getClaimId());
} catch (LbryUriException e) {
e.printStackTrace();
}
@@ -71,7 +79,7 @@ public class LbryUriTest {
}
@Test
public void parseLbryProtocolWithChannel() {
public void parseLbryProtocolWithChannelOctoshape() {
LbryUri obtained = new LbryUri();
try {
@@ -80,12 +88,12 @@ public class LbryUriTest {
e.printStackTrace();
}
assertEquals(expected, obtained);
assertEquals(expectedOctoshape, obtained);
}
@Test
public void parseLbryProtocolOnlyChannel() {
LbryUri expectedForChannel = sinthesizeExpected();
LbryUri expectedForChannel = sinthesizeExpectedChannelOctoshape();
LbryUri obtained = new LbryUri();
@@ -100,7 +108,7 @@ public class LbryUriTest {
@Test
public void parseLbryTvProtocolOnlyChannel() {
LbryUri expectedForChannel = sinthesizeExpected();
LbryUri expectedForChannel = sinthesizeExpectedChannelOctoshape();
LbryUri obtained = new LbryUri();
@@ -192,7 +200,7 @@ public class LbryUriTest {
}
@NotNull
private LbryUri sinthesizeExpected() {
private LbryUri sinthesizeExpectedChannelOctoshape() {
LbryUri expectedForChannel = new LbryUri();
expectedForChannel.setChannelName("@UCBerkeley");
expectedForChannel.setChannel(true);
+4 -1
View File
@@ -1,5 +1,8 @@
#!/bin/bash
./gradlew assembleRelease --console=plain
echo "release.sh"
echo $HOME
echo $ANDROID_SDK_ROOT
./gradlew assembleRelease --console=plain --stacktrace
version=$(./gradlew -q printVersionName --console=plain | tail -1)
mkdir -p bin/
rm -f bin/*