WIP: [android] Improve bookmarks description #7156

Draft
Jean-BaptisteC wants to merge 2 commits from Jean-BaptisteC/linkify_desc into master
7 changed files with 96 additions and 68 deletions

View file

@ -429,14 +429,9 @@ public class BookmarkListAdapter extends RecyclerView.Adapter<Holders.BaseBookma
View desc = inflater.inflate(R.layout.item_category_description, parent, false);
TextView moreBtn = desc.findViewById(R.id.more_btn);
TextView text = desc.findViewById(R.id.text);
TextView title = desc.findViewById(R.id.title);
TextView author = desc.findViewById(R.id.author);
setMoreButtonVisibility(text, moreBtn);
holder = new Holders.DescriptionViewHolder(desc, mSectionsDataSource.getCategory());
text.setOnClickListener(v -> onMoreButtonClicked(text, moreBtn));
moreBtn.setOnClickListener(v -> onMoreButtonClicked(text, moreBtn));
title.setOnClickListener(v -> onMoreButtonClicked(text, moreBtn));
author.setOnClickListener(v -> onMoreButtonClicked(text, moreBtn));
break;
}
@ -542,12 +537,12 @@ public class BookmarkListAdapter extends RecyclerView.Adapter<Holders.BaseBookma
if (text.getMaxLines() == MAX_VISIBLE_LINES)
{
text.setMaxLines(Integer.MAX_VALUE);
moreBtn.setVisibility(View.GONE);
moreBtn.setText(R.string.placepage_less_button);
}
else
{
text.setMaxLines(MAX_VISIBLE_LINES);
moreBtn.setVisibility(View.VISIBLE);
moreBtn.setText(R.string.placepage_more_button);
}
}
}

View file

@ -439,22 +439,18 @@ public class Holders
static final float SPACING_MULTIPLE = 1.0f;
static final float SPACING_ADD = 0.0f;
@NonNull
private final TextView mTitle;
@NonNull
private final TextView mDescText;
DescriptionViewHolder(@NonNull View itemView, @NonNull BookmarkCategory category)
{
super(itemView);
mDescText = itemView.findViewById(R.id.text);
mTitle = itemView.findViewById(R.id.title);
}
@Override
void bind(@NonNull SectionPosition position,
@NonNull BookmarkListAdapter.SectionsDataSource sectionsDataSource)
{
mTitle.setText(sectionsDataSource.getCategory().getName());
bindDescriptionIfEmpty(sectionsDataSource.getCategory());
}

View file

@ -17,7 +17,7 @@
android:orientation="vertical">
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/edit_bookmark_name_input"
style="?fontBody1"
style="@style/MwmWidget.Editor.CustomTextInput"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColorHint="?android:textColorSecondary"
@ -83,7 +83,7 @@
tools:src="@drawable/ic_bookmark_none" />
</RelativeLayout>
<com.google.android.material.textfield.TextInputLayout
style="?fontBody1"
style="@style/MwmWidget.Editor.CustomTextInput"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/rl__bookmark_set"

View file

@ -24,7 +24,6 @@
android:contentDescription="@string/save" />
</androidx.appcompat.widget.Toolbar>
<FrameLayout
style="@style/MwmWidget.FrameLayout.Elevation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/toolbar">

View file

@ -3,21 +3,14 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/margin_base">
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="@style/MwmTextAppearance.Body2.Primary"
app:layout_constraintTop_toTopOf="parent" />
android:padding="@dimen/margin_half">
<TextView
android:id="@+id/author"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="@style/MwmTextAppearance.Body3"
app:layout_constraintTop_toBottomOf="@id/title" />
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:layout_width="match_parent"
@ -37,12 +30,12 @@
android:id="@+id/more_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start|bottom"
android:layout_gravity="end|bottom"
android:background="@android:color/transparent"
android:clickable="true"
android:gravity="start|top"
android:gravity="end|top"
android:padding="@dimen/margin_base"
android:text="@string/category_desc_more"
android:text="@string/placepage_more_button"
android:textColor="?attr/colorAccent"
android:layout_marginTop="2dp" />
</LinearLayout>

View file

@ -7,8 +7,9 @@
android:layout_height="wrap_content"
android:background="?windowBackgroundForced"
android:gravity="start|center_vertical"
android:textSize="18sp"
android:paddingStart="@dimen/margin_base"
android:paddingTop="@dimen/margin_base_plus"
android:paddingTop="@dimen/margin_half_plus"
android:paddingEnd="@dimen/margin_base"
android:paddingBottom="@dimen/margin_half_plus"
android:text="@string/bookmarks" />

View file

@ -3960,48 +3960,48 @@
[description]
comment = Notes field in Bookmarks view
tags = android
en = Notes
af = Notas
ar = ملاحظات
az = Qeydlər
be = Нататкі
bg = Бележки
ca = Notes
cs = Poznámky
da = Noter
de = Notizen
el = Σημειώσεις
es = Notas
et = Märkmed
eu = Oharrak
fa = یادداشت‌ها
fi = Muistiinpanot
fr = Notes
he = הערות
hi = टिप्पणियाँ
en = Description
af = Beskrywing
ar = وصف
az = Təsvir
be = Апісанне
bg = Описание
ca = Descripció
cs = Popis
da = Beskrivelse
de = Beschreibung
el = Περιγραφή
es = Descripción
et = Kirjeldus
eu = Deskribapena
fa = شرح
fi = Kuvaus
fr = Description
he = תיאור
hi = विवरण
hu = Jegyzetek
id = Catatan
it = Informazioni
ja = メモ
ko = 메모
lt = Užrašai
mr = चिठ्ठया
mt = Noti
nb = Merknader
nl = Notities
pl = Notatki
pt = Notas
pt-BR = Anotações
ro = Detalii
ru = Примечание
sk = Poznámky
sv = Anteckningar
th = บันทึก
tr = Notlar
uk = Примітка
vi = Ghi chú
zh-Hans = 注释
zh-Hant = 註釋
id = Deskripsi
it = Descrizione
ja = 説明
ko = 설명
lt = Aprašymas
mr = वर्णन
nb = Beskrivelse
nl = Beschrijving
pl = Opis
pt = Descrição
pt-BR = Descrição
ro = Descriere
ru = Описание
sk = Popis
sv = Beskrivning
sw = Maelezo
th = คำอธิบาย
tr = ıklama
uk = Опис
vi = Sự miêu tả
zh-Hans = 说明
zh-Hant = 描述
[share_bookmarks_email_subject]
comment = Email Subject when sharing bookmark list
@ -31478,3 +31478,47 @@
vi = Khôi phục tất cả
zh-Hans = 全部恢复
zh-Hant = 全部恢復
[placepage_less_button]
tags = android
en = Less
af = Minder
ar = أقل
az = Daha az
be = Менш
bg = По-малко
ca = Menys
cs = Méně
da = Mindre
de = Weniger
el = Λιγότερο
es = Menos
et = Vähem
eu = Gutxiago
fa = کمتر
fi = Vähemmän
fr = Moins
he = פחות
hi = कम
hu = Kevesebb
id = Kurang
it = Meno
ja = より少ない
ko = 더 적은
lt = Mažiau
mr = कमी
nb = Mindre
nl = Minder
pl = Mniej
pt = Menos
ro = Mai puțin
ru = Меньше
sk = Menej
sv = Mindre
sw = Chini
th = น้อย
tr = Daha az
uk = Менше
vi = Ít hơn
zh-Hans = 更少
zh-Hant = 較少的