From b901ff7b0dcb8d1d6031c3e97343d982fc348b1c Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Fri, 22 May 2020 05:52:49 +0100 Subject: [PATCH] adjust minimum deposit. fix channel edit mode. --- .../main/java/io/lbry/browser/MainActivity.java | 4 ++++ .../browser/ui/channel/ChannelFormFragment.java | 16 ++++++++-------- .../lbry/browser/ui/channel/ChannelFragment.java | 4 ++-- .../main/java/io/lbry/browser/utils/Helper.java | 2 +- app/src/main/res/values/strings.xml | 2 +- 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/io/lbry/browser/MainActivity.java b/app/src/main/java/io/lbry/browser/MainActivity.java index 436f4c28..18b39e6f 100644 --- a/app/src/main/java/io/lbry/browser/MainActivity.java +++ b/app/src/main/java/io/lbry/browser/MainActivity.java @@ -1665,6 +1665,10 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener @Override public void onSyncGetWalletNotFound() { // pass. This actually shouldn't happen at this point. + // But if it does, send what we have + if (Lbryio.isSignedIn() && userSyncEnabled()) { + syncApplyAndSet(); + } } @Override diff --git a/app/src/main/java/io/lbry/browser/ui/channel/ChannelFormFragment.java b/app/src/main/java/io/lbry/browser/ui/channel/ChannelFormFragment.java index 4f3d2b7a..441ba9b1 100644 --- a/app/src/main/java/io/lbry/browser/ui/channel/ChannelFormFragment.java +++ b/app/src/main/java/io/lbry/browser/ui/channel/ChannelFormFragment.java @@ -289,7 +289,7 @@ public class ChannelFormFragment extends BaseFragment implements } private void validateAndSaveClaim(Claim claim) { - if (Helper.isNullOrEmpty(claim.getName())) { + if (!editMode && Helper.isNullOrEmpty(claim.getName())) { showError(getString(R.string.please_enter_channel_name)); return; } @@ -629,13 +629,13 @@ public class ChannelFormFragment extends BaseFragment implements private Claim buildChannelClaimToSave() { Claim claim = new Claim(); - if (!editMode) { - String name = Helper.getValue(inputChannelName.getText()); - if (!name.startsWith("@")) { - name = String.format("@%s", name); - } - claim.setName(name); - } else if (currentClaim != null) { + String name = Helper.getValue(inputChannelName.getText()); + if (!name.startsWith("@")) { + name = String.format("@%s", name); + } + claim.setName(name); + + if (currentClaim != null) { claim.setClaimId(currentClaim.getClaimId()); } diff --git a/app/src/main/java/io/lbry/browser/ui/channel/ChannelFragment.java b/app/src/main/java/io/lbry/browser/ui/channel/ChannelFragment.java index 27a6f726..ddd41dcd 100644 --- a/app/src/main/java/io/lbry/browser/ui/channel/ChannelFragment.java +++ b/app/src/main/java/io/lbry/browser/ui/channel/ChannelFragment.java @@ -437,8 +437,8 @@ public class ChannelFragment extends BaseFragment implements FetchChannelsListen } try { - if (tabPager.getAdapter() == null) { - tabPager.setAdapter(new ChannelPagerAdapter(claim, (MainActivity) getContext())); + if (tabPager.getAdapter() == null && context instanceof MainActivity) { + tabPager.setAdapter(new ChannelPagerAdapter(claim, (MainActivity) context)); } } catch (IllegalStateException ex) { // TODO: Fix why this is happening diff --git a/app/src/main/java/io/lbry/browser/utils/Helper.java b/app/src/main/java/io/lbry/browser/utils/Helper.java index f1c6b58f..69821752 100644 --- a/app/src/main/java/io/lbry/browser/utils/Helper.java +++ b/app/src/main/java/io/lbry/browser/utils/Helper.java @@ -68,7 +68,7 @@ public final class Helper { public static final MediaType FORM_MEDIA_TYPE = MediaType.parse("application/x-www-form-urlencoded"); public static final MediaType JSON_MEDIA_TYPE = MediaType.get("application/json; charset=utf-8"); public static final int CONTENT_PAGE_SIZE = 25; - public static final double MIN_DEPOSIT = 0.01; + public static final double MIN_DEPOSIT = 0.001; public static final String LBC_CURRENCY_FORMAT_PATTERN = "#,###.##"; public static final String FILE_SIZE_FORMAT_PATTERN = "#,###.#"; public static final DecimalFormat LBC_CURRENCY_FORMAT = new DecimalFormat(LBC_CURRENCY_FORMAT_PATTERN); diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 2c981540..345aa671 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -344,7 +344,7 @@ Show advanced Hide advanced Name - 0.01 + 0.001 The content was successfully reposted! The repost name contains invalid characters.