From 9244f5c2407c82e33d790778b446a9e7dfd9dc09 Mon Sep 17 00:00:00 2001 From: velichkomarija Date: Tue, 13 Oct 2020 18:47:43 +0300 Subject: [PATCH] [android] Deleted unuse DescriptionViewHolder. --- .../mapswithme/maps/bookmarks/Holders.java | 82 ------------------- 1 file changed, 82 deletions(-) diff --git a/android/src/com/mapswithme/maps/bookmarks/Holders.java b/android/src/com/mapswithme/maps/bookmarks/Holders.java index 508934d494..b49359f569 100644 --- a/android/src/com/mapswithme/maps/bookmarks/Holders.java +++ b/android/src/com/mapswithme/maps/bookmarks/Holders.java @@ -403,86 +403,4 @@ public class Holders mView.setText(sectionsDataSource.getTitle(position.getSectionIndex(), mView.getResources())); } } - -// TODO (@velichkomarija): Reuse this code. - -// static class DescriptionViewHolder extends BaseBookmarkHolder -// { -// static final float SPACING_MULTIPLE = 1.0f; -// static final float SPACING_ADD = 0.0f; -// @NonNull -// private final TextView mTitle; -// @NonNull -// private final TextView mAuthor; -// @NonNull -// private final TextView mDescText; -// @NonNull -// private final View mMoreBtn; -// -// DescriptionViewHolder(@NonNull View itemView, @NonNull BookmarkCategory category) -// { -// super(itemView); -// mDescText = itemView.findViewById(R.id.text); -// mTitle = itemView.findViewById(R.id.title); -// mAuthor = itemView.findViewById(R.id.author); -// -// mMoreBtn = itemView.findViewById(R.id.more_btn); -// boolean isEmptyDesc = TextUtils.isEmpty(category.getDescription()); -// UiUtils.hideIf(isEmptyDesc, mMoreBtn); -// mMoreBtn.setOnClickListener(v -> onMoreBtnClicked(v, category)); -// } -// -// private void onMoreBtnClicked(@NonNull View v, @NonNull BookmarkCategory category) -// { -// int lineCount = calcLineCount(mDescText, category.getDescription()); -// mDescText.setMaxLines(lineCount); -// mDescText.setText(Html.fromHtml(category.getDescription())); -// v.setVisibility(View.GONE); -// } -// -// @Override -// void bind(@NonNull BookmarkListAdapter.SectionPosition position, -// @NonNull BookmarkListAdapter.SectionsDataSource sectionsDataSource) -// { -// mTitle.setText(sectionsDataSource.getCategory().getName()); -// bindAuthor(sectionsDataSource.getCategory()); -// bindDescriptionIfEmpty(sectionsDataSource.getCategory()); -// } -// -// private void bindDescriptionIfEmpty(@NonNull BookmarkCategory category) -// { -// if (TextUtils.isEmpty(mDescText.getText())) -// { -// String desc = TextUtils.isEmpty(category.getAnnotation()) -// ? category.getDescription() -// : category.getAnnotation(); -// -// Spanned spannedDesc = Html.fromHtml(desc); -// mDescText.setText(spannedDesc); -// } -// } -// -// private void bindAuthor(@NonNull BookmarkCategory category) -// { -// BookmarkCategory.Author author = category.getAuthor(); -// Context c = itemView.getContext(); -// CharSequence authorName = author == null -// ? null -// : BookmarkCategory.Author.getRepresentation(c, author); -// mAuthor.setText(authorName); -// } -// -// private static int calcLineCount(@NonNull TextView textView, @NonNull String src) -// { -// StaticLayout staticLayout = new StaticLayout(src, -// textView.getPaint(), -// textView.getWidth(), -// Layout.Alignment.ALIGN_NORMAL, -// SPACING_MULTIPLE, -// SPACING_ADD, -// true); -// -// return staticLayout.getLineCount(); -// } -// } }