Skip to content

Commit b84b80c

Browse files
committed
bug fixes
1 parent 8457c98 commit b84b80c

File tree

6 files changed

+22
-27
lines changed

6 files changed

+22
-27
lines changed

code/gen/com/baoyz/actionsheet/R.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ public static final class style {
142142
*/
143143
public static final int AppBaseTheme=0x7f040002;
144144
/** Application theme.
145-
All customizations that are NOT specific to a particular API-level can go here.
146145
*/
147146
public static final int AppTheme=0x7f040003;
148147
}

code/res/values/styles.xml

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
1-
<resources>
2-
3-
<!--
4-
Base application theme, dependent on API level. This theme is replaced
5-
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
6-
-->
7-
<style name="AppBaseTheme" parent="@android:style/Theme.Light.NoTitleBar">
8-
<!--
9-
Theme customizations available in newer API levels can go in
10-
res/values-vXX/styles.xml, while customizations related to
11-
backward-compatibility can go here.
12-
-->
13-
</style>
14-
15-
<!-- Application theme. -->
16-
<style name="AppTheme" parent="AppBaseTheme">
17-
<item name="actionSheetStyle">@style/ActionSheetStyleIOS6</item>
18-
<item name="actionSheetStyle">@style/ActionSheetStyleIOS7</item>
19-
</style>
20-
21-
</resources>
1+
<resources>
2+
3+
<!--
4+
Base application theme, dependent on API level. This theme is replaced
5+
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
6+
-->
7+
<style name="AppBaseTheme" parent="@android:style/Theme.Light.NoTitleBar">
8+
<!--
9+
Theme customizations available in newer API levels can go in
10+
res/values-vXX/styles.xml, while customizations related to
11+
backward-compatibility can go here.
12+
-->
13+
</style>
14+
15+
<!-- Application theme. -->
16+
<style name="AppTheme" parent="AppBaseTheme">
17+
<!-- <item name="actionSheetStyle">@style/ActionSheetStyleIOS6</item> -->
18+
</style>
19+
20+
</resources>

code/src/com/baoyz/actionsheet/ActionSheet.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
7575
mView = createView();
7676
mGroup = (ViewGroup) getActivity().getWindow().getDecorView();
7777

78-
// create view items
7978
createItems();
8079

8180
mGroup.addView(mView);
@@ -219,7 +218,6 @@ public void run() {
219218

220219
private Attributes readAttribute() {
221220
Attributes attrs = new Attributes(getActivity());
222-
// read style
223221
TypedArray a = getActivity().getTheme().obtainStyledAttributes(null,
224222
R.styleable.ActionSheet, R.attr.actionSheetStyle, 0);
225223
Drawable background = a
@@ -289,7 +287,6 @@ public void setActionSheetListener(ActionSheetListener listener) {
289287
@Override
290288
public void onClick(View v) {
291289
if (v.getId() == BG_VIEW_ID) {
292-
// click background
293290
return;
294291
}
295292
dismiss();
@@ -308,7 +305,6 @@ private static class Attributes {
308305

309306
public Attributes(Context context) {
310307
mContext = context;
311-
// default value
312308
this.background = new ColorDrawable(Color.TRANSPARENT);
313309
this.cancelButtonBackground = new ColorDrawable(Color.BLACK);
314310
ColorDrawable gray = new ColorDrawable(Color.GRAY);
@@ -325,7 +321,6 @@ public Attributes(Context context) {
325321
}
326322

327323
public Drawable getOtherButtonMiddleBackground() {
328-
// if is a selector, need create a new drawable object
329324
if (otherButtonMiddleBackground instanceof StateListDrawable) {
330325
TypedArray a = mContext.getTheme().obtainStyledAttributes(null,
331326
R.styleable.ActionSheet, R.attr.actionSheetStyle, 0);

code/src/com/baoyz/actionsheet/MainActivity.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@ protected void onCreate(Bundle savedInstanceState) {
2626
public void onClick(View v) {
2727
switch (v.getId()) {
2828
case R.id.ios6:
29+
// 请在styles.xml中配置
2930
setTheme(R.style.ActionSheetStyleIOS6);
3031
break;
3132
case R.id.ios7:
33+
// 请在styles.xml中配置
3234
setTheme(R.style.ActionSheetStyleIOS7);
3335
break;
3436
}

screenshot-1.png

-121 Bytes
Loading

screenshot-2.png

-34 Bytes
Loading

0 commit comments

Comments
 (0)