mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2026-04-09 17:36:03 +00:00
Fix small icon mode
This commit is contained in:
@@ -54,8 +54,8 @@ public class AppGridAdapter extends GenericGridAdapter<AppView.AppObject> {
|
||||
private SSLContext sslContext;
|
||||
private final HashMap<ImageView, Future> pendingRequests = new HashMap<ImageView, Future>();
|
||||
|
||||
public AppGridAdapter(Context context, double gridScaleFactor, boolean listMode, ComputerDetails computer, String uniqueId) throws NoSuchAlgorithmException, KeyManagementException {
|
||||
super(context, listMode ? R.layout.simple_row : R.layout.app_grid_item, R.drawable.image_loading, gridScaleFactor);
|
||||
public AppGridAdapter(Context context, boolean listMode, boolean small, ComputerDetails computer, String uniqueId) throws NoSuchAlgorithmException, KeyManagementException {
|
||||
super(context, listMode ? R.layout.simple_row : (small ? R.layout.app_grid_item_small : R.layout.app_grid_item), R.drawable.image_loading);
|
||||
|
||||
this.computer = computer;
|
||||
this.uniqueId = uniqueId;
|
||||
|
||||
@@ -18,13 +18,11 @@ public abstract class GenericGridAdapter<T> extends BaseAdapter {
|
||||
protected int layoutId;
|
||||
protected ArrayList<T> itemList = new ArrayList<T>();
|
||||
protected LayoutInflater inflater;
|
||||
protected double gridSizeFactor;
|
||||
|
||||
public GenericGridAdapter(Context context, int layoutId, int defaultImageRes, double gridSizeFactor) {
|
||||
public GenericGridAdapter(Context context, int layoutId, int defaultImageRes) {
|
||||
this.context = context;
|
||||
this.layoutId = layoutId;
|
||||
this.defaultImageRes = defaultImageRes;
|
||||
this.gridSizeFactor = gridSizeFactor;
|
||||
|
||||
this.inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
}
|
||||
@@ -66,26 +64,11 @@ public abstract class GenericGridAdapter<T> extends BaseAdapter {
|
||||
if (!populateImageView(imgView, itemList.get(i))) {
|
||||
imgView.setImageResource(defaultImageRes);
|
||||
}
|
||||
|
||||
ViewGroup.LayoutParams params = imgView.getLayoutParams();
|
||||
params.width *= gridSizeFactor;
|
||||
params.height *= gridSizeFactor;
|
||||
imgView.setLayoutParams(params);
|
||||
}
|
||||
if (!populateTextView(txtView, itemList.get(i))) {
|
||||
txtView.setText(itemList.get(i).toString());
|
||||
|
||||
ViewGroup.LayoutParams params = txtView.getLayoutParams();
|
||||
params.width *= gridSizeFactor;
|
||||
params.height *= gridSizeFactor;
|
||||
txtView.setLayoutParams(params);
|
||||
}
|
||||
if (overlayView != null) {
|
||||
ViewGroup.LayoutParams params = overlayView.getLayoutParams();
|
||||
params.width *= gridSizeFactor;
|
||||
params.height *= gridSizeFactor;
|
||||
overlayView.setLayoutParams(params);
|
||||
|
||||
if (!populateOverlayView(overlayView, itemList.get(i))) {
|
||||
overlayView.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
|
||||
@@ -13,8 +13,8 @@ import java.util.Comparator;
|
||||
|
||||
public class PcGridAdapter extends GenericGridAdapter<PcView.ComputerObject> {
|
||||
|
||||
public PcGridAdapter(Context context, double gridScaleFactor, boolean listMode) {
|
||||
super(context, listMode ? R.layout.simple_row : R.layout.pc_grid_item, R.drawable.computer, gridScaleFactor);
|
||||
public PcGridAdapter(Context context, boolean listMode, boolean small) {
|
||||
super(context, listMode ? R.layout.simple_row : (small ? R.layout.pc_grid_item_small : R.layout.pc_grid_item), R.drawable.computer);
|
||||
}
|
||||
|
||||
public void addComputer(PcView.ComputerObject computer) {
|
||||
|
||||
Reference in New Issue
Block a user