Notify duration, cleanup

This commit is contained in:
Dominik Schürmann 2014-08-20 21:09:46 +02:00
parent 937c91eefa
commit 45706e6534
2 changed files with 4 additions and 9 deletions

View File

@ -155,10 +155,8 @@ public class OperationResultParcel implements Parcelable {
if ((resultType & OperationResultParcel.RESULT_ERROR) == 0) {
if (getLog().containsWarnings()) {
duration = 0;
color = Style.ORANGE;
} else {
duration = SuperToast.Duration.LONG;
color = Style.GREEN;
}
@ -167,7 +165,6 @@ public class OperationResultParcel implements Parcelable {
} else {
duration = 0;
color = Style.RED;
str = "operation failed";
@ -180,8 +177,8 @@ public class OperationResultParcel implements Parcelable {
button ? SuperToast.Type.BUTTON : SuperToast.Type.STANDARD,
Style.getStyle(color, SuperToast.Animations.POPUP));
toast.setText(str);
toast.setDuration(duration);
toast.setIndeterminate(duration == 0);
toast.setDuration(SuperToast.Duration.EXTRA_LONG);
toast.setIndeterminate(false);
toast.setSwipeToDismiss(true);
// If we have a log and it's non-empty, show a View Log button
if (button) {

View File

@ -85,8 +85,6 @@ public class KeyListFragment extends LoaderFragment
private Button mButtonEmptyCreate;
private Button mButtonEmptyImport;
public static final int REQUEST_CODE_CREATE_OR_IMPORT_KEY = 0x00007012;
/**
* Load custom layout with StickyListView from library
*/
@ -105,7 +103,7 @@ public class KeyListFragment extends LoaderFragment
@Override
public void onClick(View v) {
Intent intent = new Intent(getActivity(), CreateKeyActivity.class);
startActivityForResult(intent, REQUEST_CODE_CREATE_OR_IMPORT_KEY);
startActivityForResult(intent, 0);
}
});
mButtonEmptyImport = (Button) view.findViewById(R.id.key_list_empty_button_import);
@ -115,7 +113,7 @@ public class KeyListFragment extends LoaderFragment
public void onClick(View v) {
Intent intent = new Intent(getActivity(), ImportKeysActivity.class);
intent.setAction(ImportKeysActivity.ACTION_IMPORT_KEY_FROM_FILE_AND_RETURN);
startActivityForResult(intent, REQUEST_CODE_CREATE_OR_IMPORT_KEY);
startActivityForResult(intent, 0);
}
});