add follow text beside follow icon #1037

Merged
akinwale merged 1 commit from follow-text into master 2020-10-16 07:37:50 +02:00
5 changed files with 48 additions and 13 deletions

View file

@ -83,6 +83,7 @@ public class ChannelFragment extends BaseFragment implements FetchChannelsListen
private View buttonBell; private View buttonBell;
private SolidIconView iconBell; private SolidIconView iconBell;
private int subCount; private int subCount;
private TextView textFollow;
private OutlineIconView iconFollow; private OutlineIconView iconFollow;
private SolidIconView iconUnfollow; private SolidIconView iconUnfollow;
private View layoutNothingAtLocation; private View layoutNothingAtLocation;
@ -112,6 +113,7 @@ public class ChannelFragment extends BaseFragment implements FetchChannelsListen
buttonShare = root.findViewById(R.id.channel_view_share); buttonShare = root.findViewById(R.id.channel_view_share);
buttonTip = root.findViewById(R.id.channel_view_tip); buttonTip = root.findViewById(R.id.channel_view_tip);
buttonFollowUnfollow = root.findViewById(R.id.channel_view_follow_unfollow); 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); iconFollow = root.findViewById(R.id.channel_view_icon_follow);
iconUnfollow = root.findViewById(R.id.channel_view_icon_unfollow); iconUnfollow = root.findViewById(R.id.channel_view_icon_unfollow);
buttonBell = root.findViewById(R.id.channel_view_subscribe_notify); 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 isFollowing = Lbryio.isFollowing(claim);
boolean notificationsDisabled = Lbryio.isNotificationsDisabled(claim); boolean notificationsDisabled = Lbryio.isNotificationsDisabled(claim);
Helper.setViewVisibility(iconFollow, !isFollowing ? View.VISIBLE : View.GONE); 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(iconUnfollow, isFollowing ? View.VISIBLE : View.GONE);
Helper.setViewVisibility(buttonBell, isFollowing ? View.VISIBLE : View.GONE); Helper.setViewVisibility(buttonBell, isFollowing ? View.VISIBLE : View.GONE);

View file

@ -143,7 +143,6 @@ import io.lbry.browser.tasks.lbryinc.ClaimRewardTask;
import io.lbry.browser.tasks.lbryinc.FetchStatCountTask; import io.lbry.browser.tasks.lbryinc.FetchStatCountTask;
import io.lbry.browser.tasks.lbryinc.LogFileViewTask; import io.lbry.browser.tasks.lbryinc.LogFileViewTask;
import io.lbry.browser.ui.BaseFragment; 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.controls.SolidIconView;
import io.lbry.browser.ui.publish.PublishFragment; import io.lbry.browser.ui.publish.PublishFragment;
import io.lbry.browser.utils.Helper; import io.lbry.browser.utils.Helper;
@ -2562,7 +2561,7 @@ public class FileViewFragment extends BaseFragment implements
Context context = getContext(); Context context = getContext();
View root = getView(); View root = getView();
if (context != null && root != null) { 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 iconUnfollow = root.findViewById(R.id.file_view_icon_unfollow);
SolidIconView iconBell = root.findViewById(R.id.file_view_icon_bell); SolidIconView iconBell = root.findViewById(R.id.file_view_icon_bell);
Helper.setViewVisibility(iconFollow, !isFollowing ? View.VISIBLE: View.GONE); Helper.setViewVisibility(iconFollow, !isFollowing ? View.VISIBLE: View.GONE);

View file

@ -208,13 +208,27 @@
android:id="@+id/channel_view_follow_unfollow" android:id="@+id/channel_view_follow_unfollow"
android:background="?attr/selectableItemBackground" android:background="?attr/selectableItemBackground"
android:clickable="true" android:clickable="true"
android:layout_width="36dp" android:layout_width="wrap_content"
android:layout_height="36dp"> 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 <io.lbry.browser.ui.controls.OutlineIconView
android:id="@+id/channel_view_icon_follow" 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_width="24dp"
android:layout_height="24dp" android:layout_height="24dp"
android:layout_marginEnd="6dp"
android:text="@string/fa_heart" android:text="@string/fa_heart"
android:textColor="@color/red" android:textColor="@color/red"
android:textSize="20dp" /> android:textSize="20dp" />

View file

@ -576,10 +576,27 @@
android:orientation="horizontal" android:orientation="horizontal"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_alignParentEnd="true"> android:layout_alignParentEnd="true">
<io.lbry.browser.ui.controls.OutlineIconView <LinearLayout
android:id="@+id/file_view_icon_follow" android:id="@+id/file_view_icon_follow"
android:clickable="true"
android:background="?attr/selectableItemBackground" android:background="?attr/selectableItemBackground"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:orientation="horizontal"
android:clickable="true">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="16dp"
android:fontFamily="@font/inter"
android:text="@string/follow"
android:textSize="12sp"
android:textStyle="bold"
android:textAllCaps="true" />
<io.lbry.browser.ui.controls.OutlineIconView
android:layout_width="24dp" android:layout_width="24dp"
android:layout_height="24dp" android:layout_height="24dp"
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
@ -587,6 +604,7 @@
android:text="@string/fa_heart" android:text="@string/fa_heart"
android:textColor="@color/red" android:textColor="@color/red"
android:textSize="20dp" /> android:textSize="20dp" />
</LinearLayout>
<io.lbry.browser.ui.controls.SolidIconView <io.lbry.browser.ui.controls.SolidIconView
android:id="@+id/file_view_icon_unfollow" android:id="@+id/file_view_icon_unfollow"

View file

@ -474,6 +474,7 @@
<string name="channel_deleted">The channel was successfully deleted.</string> <string name="channel_deleted">The channel was successfully deleted.</string>
<string name="channel_failed_delete">The channel could not be deleted at this time. Please try again later.</string> <string name="channel_failed_delete">The channel could not be deleted at this time. Please try again later.</string>
<string name="description">Description</string> <string name="description">Description</string>
<string name="follow">Follow</string>
<string name="yes">Yes</string> <string name="yes">Yes</string>
<string name="no">No</string> <string name="no">No</string>
<string name="show_optional_fields">Show optional fields</string> <string name="show_optional_fields">Show optional fields</string>