aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--res/values-large/integers.xml1
-rw-r--r--res/values/integers.xml1
-rw-r--r--src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java7
3 files changed, 6 insertions, 3 deletions
diff --git a/res/values-large/integers.xml b/res/values-large/integers.xml
index 93883e2a..be82d55a 100644
--- a/res/values-large/integers.xml
+++ b/res/values-large/integers.xml
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<integer name="Grid.Columns">3</integer>
+ <integer name="TextDescriptionLength">10</integer>
</resources> \ No newline at end of file
diff --git a/res/values/integers.xml b/res/values/integers.xml
index 729cf1cd..48561512 100644
--- a/res/values/integers.xml
+++ b/res/values/integers.xml
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<integer name="Grid.Columns">2</integer>
+ <integer name="TextDescriptionLength">10</integer>
</resources> \ No newline at end of file
diff --git a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java
index d13d9fa5..6d94327c 100644
--- a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java
+++ b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java
@@ -1385,7 +1385,8 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter
}
artistView.setText(spanned);
artistView.setSingleLine(false);
- artistView.setLines(5);
+ final int minLines = context.getResources().getInteger(R.integer.TextDescriptionLength);
+ artistView.setLines(minLines);
artistView.setTextAppearance(context, android.R.style.TextAppearance_Small);
final Spanned spannedText = spanned;
@@ -1393,7 +1394,7 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
@Override
public void onClick(View v) {
- if(artistView.getMaxLines() == 5) {
+ if(artistView.getMaxLines() == minLines) {
// Use LeadingMarginSpan2 to try to make text flow around image
Display display = context.getWindowManager().getDefaultDisplay();
View coverArtView = header.findViewById(R.id.select_album_art);
@@ -1424,7 +1425,7 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter
vlp = (ViewGroup.MarginLayoutParams) titleView.getLayoutParams();
vlp.leftMargin = width;
} else {
- artistView.setMaxLines(5);
+ artistView.setMaxLines(minLines);
if(albumList instanceof HeaderGridView) {
HeaderGridView headerGridView = (HeaderGridView) albumList;