use maxlines to limit excerpt size instead of manual ellipsizing
This commit is contained in:
parent
57942e84e3
commit
a30364872c
@ -32,8 +32,6 @@ public class CommonActivity extends ActionBarActivity {
|
|||||||
public final static String THEME_AMBER = "THEME_AMBER";
|
public final static String THEME_AMBER = "THEME_AMBER";
|
||||||
public final static String THEME_DEFAULT = CommonActivity.THEME_LIGHT;
|
public final static String THEME_DEFAULT = CommonActivity.THEME_LIGHT;
|
||||||
|
|
||||||
public static final int EXCERPT_MAX_SIZE = 200;
|
|
||||||
|
|
||||||
private SQLiteDatabase m_readableDb;
|
private SQLiteDatabase m_readableDb;
|
||||||
private SQLiteDatabase m_writableDb;
|
private SQLiteDatabase m_writableDb;
|
||||||
|
|
||||||
|
@ -795,9 +795,6 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
|
|||||||
} else {
|
} else {
|
||||||
String excerpt = Jsoup.parse(articleContent).text();
|
String excerpt = Jsoup.parse(articleContent).text();
|
||||||
|
|
||||||
if (excerpt.length() > CommonActivity.EXCERPT_MAX_SIZE)
|
|
||||||
excerpt = excerpt.substring(0, CommonActivity.EXCERPT_MAX_SIZE) + "...";
|
|
||||||
|
|
||||||
holder.excerptView.setTextSize(TypedValue.COMPLEX_UNIT_SP, headlineFontSize);
|
holder.excerptView.setTextSize(TypedValue.COMPLEX_UNIT_SP, headlineFontSize);
|
||||||
holder.excerptView.setText(excerpt);
|
holder.excerptView.setText(excerpt);
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,6 @@ import android.widget.ListView;
|
|||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import org.fox.ttrss.CommonActivity;
|
|
||||||
import org.fox.ttrss.GlobalState;
|
import org.fox.ttrss.GlobalState;
|
||||||
import org.fox.ttrss.R;
|
import org.fox.ttrss.R;
|
||||||
import org.fox.ttrss.util.TypefaceCache;
|
import org.fox.ttrss.util.TypefaceCache;
|
||||||
@ -647,9 +646,6 @@ public class OfflineHeadlinesFragment extends Fragment implements OnItemClickLis
|
|||||||
} else {
|
} else {
|
||||||
String excerpt = Jsoup.parse(article.getString(article.getColumnIndex("content"))).text();
|
String excerpt = Jsoup.parse(article.getString(article.getColumnIndex("content"))).text();
|
||||||
|
|
||||||
if (excerpt.length() > CommonActivity.EXCERPT_MAX_SIZE)
|
|
||||||
excerpt = excerpt.substring(0, CommonActivity.EXCERPT_MAX_SIZE) + "...";
|
|
||||||
|
|
||||||
holder.excerptView.setTextSize(TypedValue.COMPLEX_UNIT_SP, headlineFontSize);
|
holder.excerptView.setTextSize(TypedValue.COMPLEX_UNIT_SP, headlineFontSize);
|
||||||
holder.excerptView.setText(excerpt);
|
holder.excerptView.setText(excerpt);
|
||||||
}
|
}
|
||||||
|
@ -115,6 +115,8 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:lineSpacingExtra="2sp"
|
android:lineSpacingExtra="2sp"
|
||||||
android:paddingTop="3dp"
|
android:paddingTop="3dp"
|
||||||
|
android:maxLines="5"
|
||||||
|
android:ellipsize="end"
|
||||||
android:text="Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
|
android:text="Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
|
||||||
android:textColor="?headlineExcerptTextColor"
|
android:textColor="?headlineExcerptTextColor"
|
||||||
android:textSize="13sp"
|
android:textSize="13sp"
|
||||||
|
@ -116,6 +116,8 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:lineSpacingExtra="2sp"
|
android:lineSpacingExtra="2sp"
|
||||||
android:paddingTop="3dp"
|
android:paddingTop="3dp"
|
||||||
|
android:maxLines="5"
|
||||||
|
android:ellipsize="end"
|
||||||
android:text="Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
|
android:text="Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
|
||||||
android:textColor="?headlineSelectedExcerptTextColor"
|
android:textColor="?headlineSelectedExcerptTextColor"
|
||||||
android:textSize="13sp"
|
android:textSize="13sp"
|
||||||
|
@ -117,6 +117,8 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:lineSpacingExtra="2sp"
|
android:lineSpacingExtra="2sp"
|
||||||
android:paddingTop="3dp"
|
android:paddingTop="3dp"
|
||||||
|
android:maxLines="5"
|
||||||
|
android:ellipsize="end"
|
||||||
android:text="Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
|
android:text="Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
|
||||||
android:textColor="?headlineSelectedExcerptTextColor"
|
android:textColor="?headlineSelectedExcerptTextColor"
|
||||||
android:textSize="13sp"
|
android:textSize="13sp"
|
||||||
|
@ -116,6 +116,8 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:lineSpacingExtra="2sp"
|
android:lineSpacingExtra="2sp"
|
||||||
android:paddingTop="3dp"
|
android:paddingTop="3dp"
|
||||||
|
android:maxLines="5"
|
||||||
|
android:ellipsize="end"
|
||||||
android:text="Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
|
android:text="Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
|
||||||
android:textColor="?headlineExcerptTextColor"
|
android:textColor="?headlineExcerptTextColor"
|
||||||
android:textSize="13sp"
|
android:textSize="13sp"
|
||||||
|
Loading…
Reference in New Issue
Block a user