按照UI提的修改UI
This commit is contained in:
@@ -19,6 +19,7 @@ import java.util.List;
|
||||
public class NineGridLayout extends FrameLayout {
|
||||
|
||||
private Context mContext;
|
||||
private int fullWidth1;
|
||||
private int mWidth1;
|
||||
private int mWidth2;
|
||||
private int mWidth3;
|
||||
@@ -35,6 +36,9 @@ public class NineGridLayout extends FrameLayout {
|
||||
private List<?> mDataList;
|
||||
private Boolean onIsFUll = false;
|
||||
|
||||
public void setOnIsFUll(Boolean onIsFUll) {
|
||||
this.onIsFUll = onIsFUll;
|
||||
}
|
||||
|
||||
public NineGridLayout(Context context) {
|
||||
this(context, null);
|
||||
@@ -58,11 +62,10 @@ public class NineGridLayout extends FrameLayout {
|
||||
DisplayMetrics dm = context.getResources().getDisplayMetrics();
|
||||
float scale = dm.density;
|
||||
int width = dm.widthPixels - space;
|
||||
fullWidth1= width;
|
||||
|
||||
mDividerWidth = dividerWidth;
|
||||
if (onIsFUll){
|
||||
|
||||
}
|
||||
mWidth1 = (int) (scale * 220 + 0.5f);
|
||||
|
||||
|
||||
@@ -106,7 +109,12 @@ public class NineGridLayout extends FrameLayout {
|
||||
if (dataSize == 1) {
|
||||
RoundedImageView imageView = mViewList.get(0);
|
||||
if (mLayoutParams00 == null) {
|
||||
mLayoutParams00 = new LayoutParams(mWidth1, mWidth1);
|
||||
if (onIsFUll){
|
||||
mLayoutParams00 = new LayoutParams(fullWidth1, fullWidth1);
|
||||
}else {
|
||||
mLayoutParams00 = new LayoutParams(mWidth1, mWidth1);
|
||||
}
|
||||
|
||||
}
|
||||
if (imageView.getLayoutParams() != mLayoutParams00) {
|
||||
imageView.setLayoutParams(mLayoutParams00);
|
||||
@@ -114,7 +122,12 @@ public class NineGridLayout extends FrameLayout {
|
||||
if (imageView.getVisibility() != VISIBLE) {
|
||||
imageView.setVisibility(VISIBLE);
|
||||
}
|
||||
setHeight(mWidth1);
|
||||
if (onIsFUll){
|
||||
setHeight(fullWidth1);
|
||||
}else {
|
||||
setHeight(mWidth1);
|
||||
}
|
||||
|
||||
if (mActionListener != null) {
|
||||
mActionListener.displayImage(list.get(0), imageView);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user