From b79f0f4820fa0dabe4aba4c87452546e2e6d7809 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Fri, 16 Oct 2020 06:36:36 +0100 Subject: [PATCH] add follow text beside follow icon --- .../browser/ui/channel/ChannelFragment.java | 3 ++ .../ui/findcontent/FileViewFragment.java | 3 +- app/src/main/res/layout/fragment_channel.xml | 18 ++++++++-- .../main/res/layout/fragment_file_view.xml | 36 ++++++++++++++----- app/src/main/res/values/strings.xml | 1 + 5 files changed, 48 insertions(+), 13 deletions(-) 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 722b84c9..aa18ff43 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 @@ -83,6 +83,7 @@ public class ChannelFragment extends BaseFragment implements FetchChannelsListen private View buttonBell; private SolidIconView iconBell; private int subCount; + private TextView textFollow; private OutlineIconView iconFollow; private SolidIconView iconUnfollow; private View layoutNothingAtLocation; @@ -112,6 +113,7 @@ 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); @@ -319,6 +321,7 @@ public class ChannelFragment extends BaseFragment implements FetchChannelsListen 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); diff --git a/app/src/main/java/io/lbry/browser/ui/findcontent/FileViewFragment.java b/app/src/main/java/io/lbry/browser/ui/findcontent/FileViewFragment.java index b53e5833..178542f3 100644 --- a/app/src/main/java/io/lbry/browser/ui/findcontent/FileViewFragment.java +++ b/app/src/main/java/io/lbry/browser/ui/findcontent/FileViewFragment.java @@ -143,7 +143,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; @@ -2562,7 +2561,7 @@ public class FileViewFragment extends BaseFragment implements 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); SolidIconView iconBell = root.findViewById(R.id.file_view_icon_bell); Helper.setViewVisibility(iconFollow, !isFollowing ? View.VISIBLE: View.GONE); diff --git a/app/src/main/res/layout/fragment_channel.xml b/app/src/main/res/layout/fragment_channel.xml index 84797cb4..fa688fa6 100644 --- a/app/src/main/res/layout/fragment_channel.xml +++ b/app/src/main/res/layout/fragment_channel.xml @@ -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"> + diff --git a/app/src/main/res/layout/fragment_file_view.xml b/app/src/main/res/layout/fragment_file_view.xml index d62cbbfc..810a81ff 100644 --- a/app/src/main/res/layout/fragment_file_view.xml +++ b/app/src/main/res/layout/fragment_file_view.xml @@ -576,17 +576,35 @@ android:orientation="horizontal" android:layout_centerVertical="true" android:layout_alignParentEnd="true"> - + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:paddingTop="8dp" + android:paddingBottom="8dp" + android:orientation="horizontal" + android:clickable="true"> + + + + The channel was successfully deleted. The channel could not be deleted at this time. Please try again later. Description + Follow Yes No Show optional fields