Merge pull request #1037 from lbryio/follow-text

add follow text beside follow icon
This commit is contained in:
Akinwale Ariwodola 2020-10-16 06:37:50 +01:00 committed by GitHub
commit b8e4fcff92
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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 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);

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.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);

View file

@ -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">
<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
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_height="24dp"
android:layout_marginEnd="6dp"
android:text="@string/fa_heart"
android:textColor="@color/red"
android:textSize="20dp" />

View file

@ -576,17 +576,35 @@
android:orientation="horizontal"
android:layout_centerVertical="true"
android:layout_alignParentEnd="true">
<io.lbry.browser.ui.controls.OutlineIconView
<LinearLayout
android:id="@+id/file_view_icon_follow"
android:clickable="true"
android:background="?attr/selectableItemBackground"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:text="@string/fa_heart"
android:textColor="@color/red"
android:textSize="20dp" />
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_height="24dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:text="@string/fa_heart"
android:textColor="@color/red"
android:textSize="20dp" />
</LinearLayout>
<io.lbry.browser.ui.controls.SolidIconView
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_failed_delete">The channel could not be deleted at this time. Please try again later.</string>
<string name="description">Description</string>
<string name="follow">Follow</string>
<string name="yes">Yes</string>
<string name="no">No</string>
<string name="show_optional_fields">Show optional fields</string>