Skip to content

Commit

Permalink
feat: support destructive dialogs
Browse files Browse the repository at this point in the history
  • Loading branch information
hansemannn committed Mar 1, 2019
1 parent 658cc7b commit af9c9ce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion android/manifest
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# this is your module manifest and used by Titanium
# during compilation, packaging, distribution, etc.
#
version: 1.0.0
version: 1.0.1
apiversion: 4
architectures: arm64-v8a armeabi-v7a x86
description: titanium-android-bottom-sheet
Expand Down
6 changes: 6 additions & 0 deletions android/src/ti/bottomsheet/OptionDialogProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public class OptionDialogProxy extends KrollProxy
private String title;
private String[] options;
private boolean cancelable;
private int destructive;

// Handle creation options
@Override
Expand All @@ -50,6 +51,7 @@ public void handleCreationDict(KrollDict args)
title = args.getString("title");
options = TiConvert.toStringArray((Object[]) args.get("options"));
cancelable = args.optBoolean("cancelable", true);
destructive = args.optInt("destructive", -1);
}

// Methods
Expand All @@ -63,6 +65,10 @@ public void show() {
// TODO: Export all styles
builder.setStyle(BottomSheet.Style.LIST);

if (destructive > -1) {
builder.setTitleColor(TiConvert.toColor("red"));
}

int i = 0;

for (String option : options) {
Expand Down

0 comments on commit af9c9ce

Please sign in to comment.