зеркало из https://github.com/mozilla/gecko-dev.git
Bug 974454 - Allow showing only description in panel items (r=margaret)
This commit is contained in:
Родитель
3eccbde559
Коммит
8e3d7eee0b
|
@ -42,20 +42,23 @@ class PanelItemView extends LinearLayout {
|
|||
|
||||
// Only show title if the item has one
|
||||
final boolean hasTitle = !TextUtils.isEmpty(title);
|
||||
mTitleDescContainer.setVisibility(hasTitle ? View.VISIBLE : View.GONE);
|
||||
mTitle.setVisibility(hasTitle ? View.VISIBLE : View.GONE);
|
||||
if (hasTitle) {
|
||||
mTitle.setText(title);
|
||||
|
||||
int descriptionIndex = cursor.getColumnIndexOrThrow(HomeItems.DESCRIPTION);
|
||||
final String description = cursor.getString(descriptionIndex);
|
||||
|
||||
final boolean hasDescription = !TextUtils.isEmpty(description);
|
||||
mDescription.setVisibility(hasDescription ? View.VISIBLE : View.GONE);
|
||||
if (hasDescription) {
|
||||
mDescription.setText(description);
|
||||
}
|
||||
}
|
||||
|
||||
int descriptionIndex = cursor.getColumnIndexOrThrow(HomeItems.DESCRIPTION);
|
||||
final String description = cursor.getString(descriptionIndex);
|
||||
|
||||
// Only show description if the item has one
|
||||
final boolean hasDescription = !TextUtils.isEmpty(description);
|
||||
mDescription.setVisibility(hasDescription ? View.VISIBLE : View.GONE);
|
||||
if (hasDescription) {
|
||||
mDescription.setText(description);
|
||||
}
|
||||
|
||||
mTitleDescContainer.setVisibility(hasTitle || hasDescription ? View.VISIBLE : View.GONE);
|
||||
|
||||
int imageIndex = cursor.getColumnIndexOrThrow(HomeItems.IMAGE_URL);
|
||||
final String imageUrl = cursor.getString(imageIndex);
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
android:layout_width="54dp"
|
||||
android:layout_height="44dp"
|
||||
android:layout_marginTop="10dip"
|
||||
android:layout_marginBottom="10dip"
|
||||
android:layout_marginLeft="10dip"
|
||||
android:scaleType="centerCrop"/>
|
||||
|
||||
|
@ -34,6 +35,7 @@
|
|||
android:layout_width="fill_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="2"
|
||||
android:gravity="center_vertical"
|
||||
android:maxLength="1024"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
android:layout_width="fill_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginTop="3dp"
|
||||
android:gravity="center_vertical"
|
||||
android:singleLine="true"
|
||||
android:maxLength="1024"/>
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче