Skip to content

Commit

Permalink
修改样式问题
Browse files Browse the repository at this point in the history
  • Loading branch information
h3clikejava committed Aug 23, 2016
1 parent f61dbfd commit faaa835
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
23 changes: 15 additions & 8 deletions library/src/main/java/com/h3c/shengshiqu/ShengShiQuDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.widget.LinearLayout;

import com.h3c.shengshiqu.widget.ShengShiQuPicker;

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

// @Override
// public void onResume() {
// ViewGroup.LayoutParams params = getDialog().getWindow().getAttributes();
// params.width = LinearLayout.LayoutParams.MATCH_PARENT;
// getDialog().getWindow().setAttributes((android.view.WindowManager.LayoutParams) params);
//
// super.onResume();
// }
@Override
public void onResume() {
if(isMatchParentWidth()) {
ViewGroup.LayoutParams params = getDialog().getWindow().getAttributes();
params.width = LinearLayout.LayoutParams.MATCH_PARENT;
getDialog().getWindow().setAttributes((android.view.WindowManager.LayoutParams) params);
}

super.onResume();
}

public boolean isMatchParentWidth() {
return true;
}

@Override
public void onClick(View view) {
Expand Down
4 changes: 2 additions & 2 deletions library/src/main/res/layout/layout_shengshiqu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
android:layout_height="wrap_content" />

<View
android:layout_width="15dp"
android:layout_width="5dp"
android:layout_height="wrap_content" />

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

<View
android:layout_width="15dp"
android:layout_width="5dp"
android:layout_height="wrap_content" />

<com.h3c.shengshiqu.widget.SSQCustomPicker
Expand Down

0 comments on commit faaa835

Please sign in to comment.