Skip to content

Commit faaa835

Browse files
committed
修改样式问题
1 parent f61dbfd commit faaa835

2 files changed

Lines changed: 17 additions & 10 deletions

File tree

library/src/main/java/com/h3c/shengshiqu/ShengShiQuDialog.java

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import android.view.View;
88
import android.view.ViewGroup;
99
import android.view.Window;
10+
import android.widget.LinearLayout;
1011

1112
import com.h3c.shengshiqu.widget.ShengShiQuPicker;
1213

@@ -38,14 +39,20 @@ public void initView(View view) {
3839
picker = (ShengShiQuPicker) view.findViewById(R.id.dialog_SSQPicker);
3940
}
4041

41-
// @Override
42-
// public void onResume() {
43-
// ViewGroup.LayoutParams params = getDialog().getWindow().getAttributes();
44-
// params.width = LinearLayout.LayoutParams.MATCH_PARENT;
45-
// getDialog().getWindow().setAttributes((android.view.WindowManager.LayoutParams) params);
46-
//
47-
// super.onResume();
48-
// }
42+
@Override
43+
public void onResume() {
44+
if(isMatchParentWidth()) {
45+
ViewGroup.LayoutParams params = getDialog().getWindow().getAttributes();
46+
params.width = LinearLayout.LayoutParams.MATCH_PARENT;
47+
getDialog().getWindow().setAttributes((android.view.WindowManager.LayoutParams) params);
48+
}
49+
50+
super.onResume();
51+
}
52+
53+
public boolean isMatchParentWidth() {
54+
return true;
55+
}
4956

5057
@Override
5158
public void onClick(View view) {

library/src/main/res/layout/layout_shengshiqu.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
android:layout_height="wrap_content" />
1313

1414
<View
15-
android:layout_width="15dp"
15+
android:layout_width="5dp"
1616
android:layout_height="wrap_content" />
1717

1818
<com.h3c.shengshiqu.widget.SSQCustomPicker
@@ -22,7 +22,7 @@
2222
android:layout_height="wrap_content" />
2323

2424
<View
25-
android:layout_width="15dp"
25+
android:layout_width="5dp"
2626
android:layout_height="wrap_content" />
2727

2828
<com.h3c.shengshiqu.widget.SSQCustomPicker

0 commit comments

Comments
 (0)