Credits icon (#1021)

* new credits icon
* remove references to LBC
This commit is contained in:
Akinwale Ariwodola 2020-10-05 16:50:39 +01:00 committed by GitHub
parent aab648c3cf
commit eab7bab267
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 61 additions and 57 deletions

View file

@ -225,9 +225,10 @@ public class CreateSupportDialogFragment extends BottomSheetDialogFragment imple
if (!isTip) { if (!isTip) {
sendButton.setText(R.string.send_revocable_support); sendButton.setText(R.string.send_revocable_support);
} else { } else {
String amountString = Helper.getValue(inputAmount.getText()); String amountString = Helper.getValue(inputAmount.getText(), "0");
double parsedAmount = Helper.parseDouble(amountString, 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);
} }
} }

View file

@ -348,6 +348,10 @@ public final class Helper {
return cs != null ? cs.toString().trim() : ""; 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) { public static List<String> buildContentSortOrder(int sortBy) {
List<String> sortOrder = new ArrayList<>(); List<String> sortOrder = new ArrayList<>();
switch (sortBy) { switch (sortBy) {

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View file

@ -72,10 +72,11 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:orientation="horizontal"
android:visibility="invisible"> android:visibility="invisible">
<io.lbry.browser.ui.controls.SolidIconView <ImageView
android:layout_width="18dp" android:layout_width="12dp"
android:layout_height="18dp" android:layout_height="12dp"
android:text="@string/fa_coins" /> android:layout_gravity="center_vertical"
android:src="@drawable/ic_credits" />
<TextView <TextView
android:id="@+id/wallet_inline_balance_value" android:id="@+id/wallet_inline_balance_value"
android:layout_width="wrap_content" android:layout_width="wrap_content"

View file

@ -62,10 +62,11 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:orientation="horizontal"
android:visibility="invisible"> android:visibility="invisible">
<io.lbry.browser.ui.controls.SolidIconView <ImageView
android:layout_width="18dp" android:layout_width="12dp"
android:layout_height="18dp" android:layout_height="12dp"
android:text="@string/fa_coins" /> android:layout_gravity="center_vertical"
android:src="@drawable/ic_credits" />
<TextView <TextView
android:id="@+id/inline_channel_form_inline_balance_value" android:id="@+id/inline_channel_form_inline_balance_value"
android:layout_width="wrap_content" android:layout_width="wrap_content"

View file

@ -103,10 +103,11 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:orientation="horizontal"
android:visibility="invisible"> android:visibility="invisible">
<io.lbry.browser.ui.controls.SolidIconView <ImageView
android:layout_width="18dp" android:layout_width="12dp"
android:layout_height="18dp" android:layout_height="12dp"
android:text="@string/fa_coins" /> android:layout_gravity="center_vertical"
android:src="@drawable/ic_credits" />
<TextView <TextView
android:id="@+id/create_support_inline_balance_value" android:id="@+id/create_support_inline_balance_value"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -158,7 +159,6 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:fontFamily="@font/inter" android:fontFamily="@font/inter"
android:text="@string/send_lbc_tip"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_centerVertical="true" /> android:layout_centerVertical="true" />
</RelativeLayout> </RelativeLayout>

View file

@ -127,10 +127,11 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:orientation="horizontal"
android:visibility="invisible"> android:visibility="invisible">
<io.lbry.browser.ui.controls.SolidIconView <ImageView
android:layout_width="18dp" android:layout_width="12dp"
android:layout_height="18dp" android:layout_height="12dp"
android:text="@string/fa_coins" /> android:layout_gravity="center_vertical"
android:src="@drawable/ic_credits" />
<TextView <TextView
android:id="@+id/repost_inline_balance_value" android:id="@+id/repost_inline_balance_value"
android:layout_width="wrap_content" android:layout_width="wrap_content"

View file

@ -56,13 +56,11 @@
android:paddingBottom="8dp" android:paddingBottom="8dp"
android:paddingStart="12dp" android:paddingStart="12dp"
android:paddingEnd="16dp"> android:paddingEnd="16dp">
<io.lbry.browser.ui.controls.SolidIconView <ImageView
android:layout_width="16dp" android:layout_width="12dp"
android:layout_height="16dp" android:layout_height="12dp"
android:textSize="10dp"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:textColor="@color/white" android:src="@drawable/ic_credits" />
android:text="@string/fa_coins" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"

View file

@ -215,10 +215,11 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:orientation="horizontal"
android:visibility="invisible"> android:visibility="invisible">
<io.lbry.browser.ui.controls.SolidIconView <ImageView
android:layout_width="18dp" android:layout_width="12dp"
android:layout_height="18dp" android:layout_height="12dp"
android:text="@string/fa_coins" /> android:layout_gravity="center_vertical"
android:src="@drawable/ic_credits" />
<TextView <TextView
android:id="@+id/channel_form_inline_balance_value" android:id="@+id/channel_form_inline_balance_value"
android:layout_width="wrap_content" android:layout_width="wrap_content"

View file

@ -84,13 +84,11 @@
android:paddingStart="6dp" android:paddingStart="6dp"
android:paddingEnd="7dp" android:paddingEnd="7dp"
android:visibility="gone"> android:visibility="gone">
<io.lbry.browser.ui.controls.SolidIconView <ImageView
android:layout_width="12dp" android:layout_width="12dp"
android:layout_height="12dp" android:layout_height="12dp"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:textSize="8dp" android:src="@drawable/ic_credits" />
android:text="@string/fa_coins"
android:textColor="@android:color/black" />
<TextView <TextView
android:id="@+id/file_view_fee" android:id="@+id/file_view_fee"
android:layout_width="wrap_content" android:layout_width="wrap_content"

View file

@ -436,10 +436,11 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:orientation="horizontal"
android:visibility="invisible"> android:visibility="invisible">
<io.lbry.browser.ui.controls.SolidIconView <ImageView
android:layout_width="18dp" android:layout_width="12dp"
android:layout_height="18dp" android:layout_height="12dp"
android:text="@string/fa_coins" /> android:layout_gravity="center_vertical"
android:src="@drawable/ic_credits" />
<TextView <TextView
android:id="@+id/publish_form_inline_balance_value" android:id="@+id/publish_form_inline_balance_value"
android:layout_width="wrap_content" android:layout_width="wrap_content"

View file

@ -91,12 +91,11 @@
android:paddingStart="2dp" android:paddingStart="2dp"
android:paddingEnd="2dp" android:paddingEnd="2dp"
android:visibility="gone"> android:visibility="gone">
<io.lbry.browser.ui.controls.SolidIconView <ImageView
android:layout_width="16dp" android:layout_width="12dp"
android:layout_height="16dp" android:layout_height="12dp"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:textSize="12dp" android:src="@drawable/ic_credits" />
android:text="@string/fa_coins" />
<TextView <TextView
android:id="@+id/claim_fee" android:id="@+id/claim_fee"
android:layout_width="wrap_content" android:layout_width="wrap_content"

View file

@ -101,13 +101,11 @@
android:paddingStart="6dp" android:paddingStart="6dp"
android:paddingEnd="7dp" android:paddingEnd="7dp"
android:visibility="gone"> android:visibility="gone">
<io.lbry.browser.ui.controls.SolidIconView <ImageView
android:layout_width="12dp" android:layout_width="12dp"
android:layout_height="12dp" android:layout_height="12dp"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:textSize="8dp" android:src="@drawable/ic_credits" />
android:text="@string/fa_coins"
android:textColor="@android:color/black"/>
<TextView <TextView
android:id="@+id/claim_fee" android:id="@+id/claim_fee"
android:layout_width="wrap_content" android:layout_width="wrap_content"

View file

@ -106,13 +106,11 @@
android:paddingStart="6dp" android:paddingStart="6dp"
android:paddingEnd="7dp" android:paddingEnd="7dp"
android:visibility="gone"> android:visibility="gone">
<io.lbry.browser.ui.controls.SolidIconView <ImageView
android:layout_width="12dp" android:layout_width="12dp"
android:layout_height="12dp" android:layout_height="12dp"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:textSize="8dp" android:src="@drawable/ic_credits" />
android:text="@string/fa_coins"
android:textColor="@android:color/black"/>
<TextView <TextView
android:id="@+id/claim_fee" android:id="@+id/claim_fee"
android:layout_width="wrap_content" android:layout_width="wrap_content"

View file

@ -208,7 +208,7 @@
<string name="cca_nc_nd_4_0_international">Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International</string> <string name="cca_nc_nd_4_0_international">Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International</string>
<string-array name="publish_currencies"> <string-array name="publish_currencies">
<item>LBC</item> <item>LBRY Credits</item>
<item>USD</item> <item>USD</item>
</string-array> </string-array>
@ -227,7 +227,7 @@
<string name="oops_something_went_wrong">Oops! Something went wrong.</string> <string name="oops_something_went_wrong">Oops! Something went wrong.</string>
<string name="installation_id_loaded">Loaded Installation ID.</string> <string name="installation_id_loaded">Loaded Installation ID.</string>
<string name="known_tags_loaded">Loaded local known and followed tags.</string> <string name="known_tags_loaded">Loaded local known and followed tags.</string>
<string name="exchange_rate_loaded">Loaded LBC/USD exchange rate.</string> <string name="exchange_rate_loaded">Loaded LBRY Credits/USD exchange rate.</string>
<string name="user_authenticated">User authenticated.</string> <string name="user_authenticated">User authenticated.</string>
<string name="installation_registered">Installation registered.</string> <string name="installation_registered">Installation registered.</string>
<string name="subscriptions_loaded">Loaded subscriptions.</string> <string name="subscriptions_loaded">Loaded subscriptions.</string>
@ -314,7 +314,7 @@
<string name="manual_backup">&lt;a href="https://lbry.com/faq/how-to-backup-wallet#android"&gt;Manual backup&lt;/a&gt;</string> <string name="manual_backup">&lt;a href="https://lbry.com/faq/how-to-backup-wallet#android"&gt;Manual backup&lt;/a&gt;</string>
<string name="sync_faq">&lt;a href="https://lbry.com/faq/how-to-backup-wallet#sync"&gt;Sync FAQ&lt;/a&gt;</string> <string name="sync_faq">&lt;a href="https://lbry.com/faq/how-to-backup-wallet#sync"&gt;Sync FAQ&lt;/a&gt;</string>
<string name="zero">0</string> <string name="zero">0</string>
<string name="lbc">LBC</string> <string name="lbc" translatable="false">Credits</string>
<string name="account_recommended">Account Recommended</string> <string name="account_recommended">Account Recommended</string>
<string name="wallet_account_desc">A lbry.tv account allows you to earn rewards, backup your wallet, and keep everything in sync.</string> <string name="wallet_account_desc">A lbry.tv account allows you to earn rewards, backup your wallet, and keep everything in sync.</string>
@ -338,7 +338,7 @@
<string name="confirm_unlock_tips">Are you sure you want to unlock all your tips?</string> <string name="confirm_unlock_tips">Are you sure you want to unlock all your tips?</string>
<string name="min_spend_required">Please enter an amount more than 0.0001 credits.</string> <string name="min_spend_required">Please enter an amount more than 0.0001 credits.</string>
<string name="buy_lbc">Buy LBC</string> <string name="buy_lbc">Buy LBRY Credits</string>
<string name="hash_not_supported">Your device does not support the minimum requirements for securing your purchase request.</string> <string name="hash_not_supported">Your device does not support the minimum requirements for securing your purchase request.</string>
<string name="receive_address_not_set">You do not have a wallet address set. Please generate a new address and try again.</string> <string name="receive_address_not_set">You do not have a wallet address set. Please generate a new address and try again.</string>
@ -382,7 +382,10 @@
<string name="channel_to_show_support_as">Channel to show support as</string> <string name="channel_to_show_support_as">Channel to show support as</string>
<string name="make_this_a_tip">Make this a tip</string> <string name="make_this_a_tip">Make this a tip</string>
<string name="send_revocable_support">Send Revocable Support</string> <string name="send_revocable_support">Send Revocable Support</string>
<string name="send_lbc_tip">Send a %1$s LBC Tip</string> <plurals name="send_lbc_tip">
<item quantity="one">Tip %1$s Credit</item>
<item quantity="other">Tip %1$s Credits</item>
</plurals>
<string name="send_tip_info_content">This will appear as a tip for %1$s, which will boost its ability to be discovered while active. &lt;a href="https://lbry.com/faq/tipping"&gt;Learn more&lt;/a&gt;.</string> <string name="send_tip_info_content">This will appear as a tip for %1$s, which will boost its ability to be discovered while active. &lt;a href="https://lbry.com/faq/tipping"&gt;Learn more&lt;/a&gt;.</string>
<string name="send_tip_info_channel">This will appear as a tip for %1$s, which will boost the channel\'s ability to be discovered while active. &lt;a href="https://lbry.com/faq/tipping"&gt;Learn more&lt;/a&gt;.</string> <string name="send_tip_info_channel">This will appear as a tip for %1$s, which will boost the channel\'s ability to be discovered while active. &lt;a href="https://lbry.com/faq/tipping"&gt;Learn more&lt;/a&gt;.</string>
<string name="cancel">Cancel</string> <string name="cancel">Cancel</string>
@ -477,7 +480,7 @@
<string name="title">Title</string> <string name="title">Title</string>
<string name="at">\@</string> <string name="at">\@</string>
<string name="deposit">Deposit</string> <string name="deposit">Deposit</string>
<string name="deposit_remains_yours">This LBC remains yours. It is a deposit to reserve the name and can be undone at any time.</string> <string name="deposit_remains_yours">The credits remains yours. It is a deposit to reserve the name and can be undone at any time.</string>
<string name="storage_permission_rationale_download">LBRY requires access to download content to your device.</string> <string name="storage_permission_rationale_download">LBRY requires access to download content to your device.</string>
<string name="storage_permission_rationale_images">LBRY requires access to load images from your device storage.</string> <string name="storage_permission_rationale_images">LBRY requires access to load images from your device storage.</string>
<string name="select_thumbnail">Select thumbnail</string> <string name="select_thumbnail">Select thumbnail</string>
@ -511,7 +514,7 @@
</plurals> </plurals>
<!-- Rewards --> <!-- Rewards -->
<string name="lbry_credits_allow">LBRY credits allow you to publish or purchase content.</string> <string name="lbry_credits_allow">LBRY Credits allow you to publish or purchase content.</string>
<string name="free_credits_worth">You can obtain free credits worth $%1$s after you provide an email address.</string> <string name="free_credits_worth">You can obtain free credits worth $%1$s after you provide an email address.</string>
<string name="rewards_learn_more">&lt;a href="https://lbry.com/faq/earn-credits"&gt;Learn more&lt;/a&gt;.</string> <string name="rewards_learn_more">&lt;a href="https://lbry.com/faq/earn-credits"&gt;Learn more&lt;/a&gt;.</string>
<string name="get_started">Get started</string> <string name="get_started">Get started</string>