зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1116563 - Fall back to display URL if reading list item has no title. r=rnewman
--HG-- extra : rebase_source : bd72a15c6f7745c86d3ac01e0b3689c6d35d745e
This commit is contained in:
Родитель
ae21ee5c15
Коммит
84e5add744
|
@ -10,10 +10,12 @@ import org.mozilla.gecko.Tab;
|
|||
import org.mozilla.gecko.Tabs;
|
||||
import org.mozilla.gecko.db.BrowserContract.ReadingListItems;
|
||||
import org.mozilla.gecko.home.TwoLinePageRow;
|
||||
import org.mozilla.gecko.util.StringUtils;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.database.Cursor;
|
||||
import android.text.TextUtils;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
import android.widget.LinearLayout;
|
||||
|
@ -55,11 +57,13 @@ public class ReadingListRow extends LinearLayout {
|
|||
return;
|
||||
}
|
||||
|
||||
final int titleIndex = cursor.getColumnIndexOrThrow(ReadingListItems.TITLE);
|
||||
title.setText(cursor.getString(titleIndex));
|
||||
final String url = cursor.getString(cursor.getColumnIndexOrThrow(ReadingListItems.URL));
|
||||
|
||||
final int excerptIndex = cursor.getColumnIndexOrThrow(ReadingListItems.EXCERPT);
|
||||
excerpt.setText(cursor.getString(excerptIndex));
|
||||
final String titleText = cursor.getString(cursor.getColumnIndexOrThrow(ReadingListItems.TITLE));
|
||||
title.setText(TextUtils.isEmpty(titleText) ? StringUtils.stripCommonSubdomains(StringUtils.stripScheme(url)) : titleText);
|
||||
|
||||
final String excerptText = cursor.getString(cursor.getColumnIndexOrThrow(ReadingListItems.EXCERPT));
|
||||
excerpt.setText(TextUtils.isEmpty(excerptText) ? url : excerptText);
|
||||
|
||||
/* Disabled until UX issues are fixed (see bug 1110461).
|
||||
final int lengthIndex = cursor.getColumnIndexOrThrow(ReadingListItems.LENGTH);
|
||||
|
|
Загрузка…
Ссылка в новой задаче