File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77import android .view .View ;
88import android .view .ViewGroup ;
99import android .view .Window ;
10+ import android .widget .LinearLayout ;
1011
1112import 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 ) {
Original file line number Diff line number Diff line change 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
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
You can’t perform that action at this time.
0 commit comments