Fix row count and max pictures count on cast grid view
This commit is contained in:
parent
00c6e3d300
commit
7936b8f2a3
|
@ -28,9 +28,6 @@ public interface Settings {
|
|||
// public static final long DB_UPDATE_INTERVAL = 12 * DateUtils.HOUR_IN_MILLIS;
|
||||
public static final long DB_UPDATE_INTERVAL = 5 * DateUtils.MINUTE_IN_MILLIS;
|
||||
|
||||
// Maximum pictures to show on cast list (-1 to show all)
|
||||
public static final int DEFAULT_MAX_CAST_PICTURES = 12;
|
||||
|
||||
// Sort orders
|
||||
public static final int SORT_BY_NAME = 0,
|
||||
SORT_BY_DATE_ADDED = 1;
|
||||
|
|
|
@ -249,14 +249,14 @@ public class UIUtils {
|
|||
|
||||
castListView.removeAllViews();
|
||||
int numColumns = castListView.getColumnCount();
|
||||
int numRows = resources.getInteger(R.integer.cast_grid_view_rows);
|
||||
int maxCastPictures = numColumns * numRows;
|
||||
|
||||
int layoutMarginPx = 2 * resources.getDimensionPixelSize(R.dimen.remote_content_hmargin);
|
||||
int imageMarginPx = 2 * resources.getDimensionPixelSize(R.dimen.image_grid_margin);
|
||||
int imageWidth = (displayMetrics.widthPixels - layoutMarginPx - numColumns * imageMarginPx) / numColumns;
|
||||
int imageHeight = (int)(imageWidth * 1.5);
|
||||
|
||||
int maxCastPictures = Settings.DEFAULT_MAX_CAST_PICTURES;
|
||||
|
||||
for (int i = 0; i < Math.min(castList.size(), maxCastPictures); i++) {
|
||||
VideoType.Cast actor = castList.get(i);
|
||||
|
||||
|
|
|
@ -16,4 +16,5 @@
|
|||
-->
|
||||
<resources>
|
||||
<integer name="cast_grid_view_columns">5</integer>
|
||||
<integer name="cast_grid_view_rows">2</integer>
|
||||
</resources>
|
|
@ -16,4 +16,5 @@
|
|||
-->
|
||||
<resources>
|
||||
<integer name="cast_grid_view_columns">6</integer>
|
||||
<integer name="cast_grid_view_rows">2</integer>
|
||||
</resources>
|
|
@ -16,4 +16,5 @@
|
|||
-->
|
||||
<resources>
|
||||
<integer name="cast_grid_view_columns">4</integer>
|
||||
<integer name="cast_grid_view_rows">3</integer>
|
||||
</resources>
|
|
@ -22,5 +22,6 @@
|
|||
<integer name="button_touch_animation_duration">50</integer>
|
||||
|
||||
<integer name="cast_grid_view_columns">3</integer>
|
||||
<integer name="cast_grid_view_rows">3</integer>
|
||||
<integer name="description_max_lines">3</integer>
|
||||
</resources>
|
Loading…
Reference in New Issue