From ce71bb54ef0be9809824e9bdf7e6adbc7c12707e Mon Sep 17 00:00:00 2001 From: liyujiang Date: Sun, 18 Dec 2016 14:02:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8C=89=E9=92=AE=E6=B7=BB=E5=8A=A0=E5=86=85?= =?UTF-8?q?=E8=BE=B9=E8=B7=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 +--- .../main/java/cn/qqtheme/framework/popup/ConfirmPopup.java | 7 +++++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e466d46b..3ac7b39a 100755 --- a/README.md +++ b/README.md @@ -116,8 +116,6 @@ dependencies { 选择器内嵌到其他视图容器: ```java final CarNumberPicker picker = new CarNumberPicker(this); - picker.setWidth(picker.getScreenWidthPixels() / 2); - picker.setLineConfig(new WheelView.LineConfig(0));//使用最长的分割线 picker.setOnWheelListener(new CarNumberPicker.OnWheelListener() { @Override public void onFirstWheeled(int index, String item) { @@ -217,7 +215,7 @@ dependencies { picker.show(); ``` -星座选择器(参见ConstellationPicker): +星座选择器: ```java boolean isChinese = Locale.getDefault().getDisplayLanguage().contains("中文"); OptionPicker picker = new OptionPicker(this, diff --git a/library/Common/src/main/java/cn/qqtheme/framework/popup/ConfirmPopup.java b/library/Common/src/main/java/cn/qqtheme/framework/popup/ConfirmPopup.java index af3c7b73..306ddfb9 100755 --- a/library/Common/src/main/java/cn/qqtheme/framework/popup/ConfirmPopup.java +++ b/library/Common/src/main/java/cn/qqtheme/framework/popup/ConfirmPopup.java @@ -226,14 +226,16 @@ protected View makeHeaderView() { topButtonLayout.setBackgroundColor(topBackgroundColor); topButtonLayout.setGravity(Gravity.CENTER_VERTICAL); + int padding = ConvertUtils.toPx(activity, 10); Button cancelButton = new Button(activity); cancelButton.setVisibility(cancelVisible ? View.VISIBLE : View.GONE); - RelativeLayout.LayoutParams cancelButtonLayoutParams = new RelativeLayout.LayoutParams(WRAP_CONTENT, WRAP_CONTENT); + RelativeLayout.LayoutParams cancelButtonLayoutParams = new RelativeLayout.LayoutParams(WRAP_CONTENT, MATCH_PARENT); cancelButtonLayoutParams.addRule(RelativeLayout.ALIGN_PARENT_LEFT, RelativeLayout.TRUE); cancelButtonLayoutParams.addRule(RelativeLayout.CENTER_VERTICAL, RelativeLayout.TRUE); cancelButton.setLayoutParams(cancelButtonLayoutParams); cancelButton.setBackgroundColor(Color.TRANSPARENT); cancelButton.setGravity(Gravity.CENTER); + cancelButton.setPadding(padding, 0, padding, 0); if (!TextUtils.isEmpty(cancelText)) { cancelButton.setText(cancelText); } @@ -269,12 +271,13 @@ public void onClick(View v) { topButtonLayout.addView(titleView); Button submitButton = new Button(activity); - RelativeLayout.LayoutParams submitButtonLayoutParams = new RelativeLayout.LayoutParams(WRAP_CONTENT, WRAP_CONTENT); + RelativeLayout.LayoutParams submitButtonLayoutParams = new RelativeLayout.LayoutParams(WRAP_CONTENT, MATCH_PARENT); submitButtonLayoutParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT, RelativeLayout.TRUE); submitButtonLayoutParams.addRule(RelativeLayout.CENTER_VERTICAL, RelativeLayout.TRUE); submitButton.setLayoutParams(submitButtonLayoutParams); submitButton.setBackgroundColor(Color.TRANSPARENT); submitButton.setGravity(Gravity.CENTER); + submitButton.setPadding(padding, 0, padding, 0); if (!TextUtils.isEmpty(submitText)) { submitButton.setText(submitText); }