• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java Snacky类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中de.mateware.snacky.Snacky的典型用法代码示例。如果您正苦于以下问题:Java Snacky类的具体用法?Java Snacky怎么用?Java Snacky使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

Snacky类属于de.mateware.snacky包,在下文中一共展示了Snacky类的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: onSyncNeeded

点赞 3

import de.mateware.snacky.Snacky; //导入依赖的package包/类
@Override
public void onSyncNeeded(DCActivityRecord[] records) {
    if (records != null && !syncWarningVisible) {
        syncWarningVisible = true;
        Snacky.builder().setActivty(this).setText(R.string.dashboard_warning_sync_needed).warning().setAction(R.string.txt_yes, new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                DCDashboardDataProvider.getInstance().sync(false);
            }
        }).setDuration(Snacky.LENGTH_INDEFINITE).addCallback(new BaseTransientBottomBar.BaseCallback<Snackbar>() {
            @Override
            public void onDismissed(Snackbar transientBottomBar, int event) {
                super.onDismissed(transientBottomBar, event);
                syncWarningVisible = false;
            }
        }).show();
    }
}
 

开发者ID:Dentacoin,
项目名称:aftercare-app-android,
代码行数:19,
代码来源:DCDashboardActivity.java

示例2: navigateBack

点赞 3

import de.mateware.snacky.Snacky; //导入依赖的package包/类
private void navigateBack(@NonNull String message) {
    Snacky.builder()
            .setActivty(BixbyEditActivity.this)
            .setText(message)
            .setDuration(Snacky.LENGTH_INDEFINITE)
            .success()
            .show();

    new Handler().postDelayed(() -> {
        NavigationService.NavigationResult navigationResult = NavigationService.getInstance().GoBack(BixbyEditActivity.this);
        if (navigationResult != NavigationService.NavigationResult.SUCCESS) {
            Logger.getInstance().Error(TAG, String.format(Locale.getDefault(), "Navigation failed! navigationResult is %s!", navigationResult));
            displayErrorSnackBar("Failed to navigate back! Please contact LucaHome support!");
        }
    }, 1500);
}
 

开发者ID:GuepardoApps,
项目名称:LucaHome-AndroidApplication,
代码行数:17,
代码来源:BixbyEditActivity.java

示例3: navigateBack

点赞 3

import de.mateware.snacky.Snacky; //导入依赖的package包/类
private void navigateBack(@NonNull String message) {
    Snacky.builder()
            .setActivty(MovieEditActivity.this)
            .setText(message)
            .setDuration(Snacky.LENGTH_INDEFINITE)
            .success()
            .show();

    new Handler().postDelayed(() -> {
        NavigationService.NavigationResult navigationResult = NavigationService.getInstance().GoBack(MovieEditActivity.this);
        if (navigationResult != NavigationService.NavigationResult.SUCCESS) {
            Logger.getInstance().Error(TAG, String.format(Locale.getDefault(), "Navigation failed! navigationResult is %s!", navigationResult));
            displayErrorSnackBar("Failed to navigate back! Please contact LucaHome support!");
        }
    }, 1500);
}
 

开发者ID:GuepardoApps,
项目名称:LucaHome-AndroidApplication,
代码行数:17,
代码来源:MovieEditActivity.java

示例4: navigateBack

点赞 3

import de.mateware.snacky.Snacky; //导入依赖的package包/类
private void navigateBack(@NonNull String message) {
    Snacky.builder()
            .setActivty(ShoppingListEditActivity.this)
            .setText(message)
            .setDuration(Snacky.LENGTH_INDEFINITE)
            .success()
            .show();

    new Handler().postDelayed(() -> {
        NavigationService.NavigationResult navigationResult = NavigationService.getInstance().GoBack(ShoppingListEditActivity.this);
        if (navigationResult != NavigationService.NavigationResult.SUCCESS) {
            Logger.getInstance().Error(TAG, String.format(Locale.getDefault(), "Navigation failed! navigationResult is %s!", navigationResult));
            displayErrorSnackBar("Failed to navigate back! Please contact LucaHome support!");
        }
    }, 1500);
}
 

开发者ID:GuepardoApps,
项目名称:LucaHome-AndroidApplication,
代码行数:17,
代码来源:ShoppingListEditActivity.java

示例5: navigateBack

点赞 3

import de.mateware.snacky.Snacky; //导入依赖的package包/类
private void navigateBack(@NonNull String message) {
    Snacky.builder()
            .setActivty(WirelessSwitchEditActivity.this)
            .setText(message)
            .setDuration(Snacky.LENGTH_INDEFINITE)
            .success()
            .show();

    new Handler().postDelayed(() -> {
        NavigationService.NavigationResult navigationResult = NavigationService.getInstance().GoBack(WirelessSwitchEditActivity.this);
        if (navigationResult != NavigationService.NavigationResult.SUCCESS) {
            Logger.getInstance().Error(TAG, String.format(Locale.getDefault(), "Navigation failed! navigationResult is %s!", navigationResult));
            displayErrorSnackBar("Failed to navigate back! Please contact LucaHome support!");
        }
    }, 1500);
}
 

开发者ID:GuepardoApps,
项目名称:LucaHome-AndroidApplication,
代码行数:17,
代码来源:WirelessSwitchEditActivity.java

示例6: navigateBack

点赞 3

import de.mateware.snacky.Snacky; //导入依赖的package包/类
private void navigateBack(@NonNull String message) {
    Snacky.builder()
            .setActivty(ScheduleEditActivity.this)
            .setText(message)
            .setDuration(Snacky.LENGTH_INDEFINITE)
            .success()
            .show();

    new Handler().postDelayed(() -> {
        NavigationService.NavigationResult navigationResult = NavigationService.getInstance().GoBack(ScheduleEditActivity.this);
        if (navigationResult != NavigationService.NavigationResult.SUCCESS) {
            Logger.getInstance().Error(TAG, String.format(Locale.getDefault(), "Navigation failed! navigationResult is %s!", navigationResult));
            displayErrorSnackBar("Failed to navigate back! Please contact LucaHome support!");
        }
    }, 1500);
}
 

开发者ID:GuepardoApps,
项目名称:LucaHome-AndroidApplication,
代码行数:17,
代码来源:ScheduleEditActivity.java

示例7: onKeyDown

点赞 3

import de.mateware.snacky.Snacky; //导入依赖的package包/类
@Override
public boolean onKeyDown(int keyCode, KeyEvent keyEvent) {
    Logger.getInstance().Debug(TAG, String.format(Locale.getDefault(), "onKeyDown with KeyCode %d and KeyEvent %s", keyCode, keyEvent));
    if (keyCode == KeyEvent.KEYCODE_BACK) {
        Snacky.builder()
                .setActivty(BootActivity.this)
                .setText("Do you really want to exit during boot?")
                .setDuration(Snacky.LENGTH_LONG)
                .setActionText(android.R.string.ok)
                .setActionClickListener(view -> {
                    if (_mainServiceBinder != null) {
                        _mainServiceBinder.Cancel();
                    }
                    finish();
                })
                .warning()
                .show();
        return true;
    }

    return super.onKeyDown(keyCode, keyEvent);
}
 

开发者ID:GuepardoApps,
项目名称:LucaHome-AndroidApplication,
代码行数:23,
代码来源:BootActivity.java

示例8: navigateBack

点赞 3

import de.mateware.snacky.Snacky; //导入依赖的package包/类
private void navigateBack(@NonNull String message) {
    Snacky.builder()
            .setActivty(WirelessSocketEditActivity.this)
            .setText(message)
            .setDuration(Snacky.LENGTH_INDEFINITE)
            .success()
            .show();

    new Handler().postDelayed(() -> {
        NavigationService.NavigationResult navigationResult = NavigationService.getInstance().GoBack(WirelessSocketEditActivity.this);
        if (navigationResult != NavigationService.NavigationResult.SUCCESS) {
            Logger.getInstance().Error(TAG, String.format(Locale.getDefault(), "Navigation failed! navigationResult is %s!", navigationResult));
            displayErrorSnackBar("Failed to navigate back! Please contact LucaHome support!");
        }
    }, 1500);
}
 

开发者ID:GuepardoApps,
项目名称:LucaHome-AndroidApplication,
代码行数:17,
代码来源:WirelessSocketEditActivity.java

示例9: navigateBack

点赞 3

import de.mateware.snacky.Snacky; //导入依赖的package包/类
private void navigateBack(@NonNull String message) {
    Snacky.builder()
            .setActivty(MoneyMeterDataEditActivity.this)
            .setText(message)
            .setDuration(Snacky.LENGTH_INDEFINITE)
            .success()
            .show();

    new Handler().postDelayed(() -> {
        NavigationService.NavigationResult navigationResult = _navigationService.GoBack(MoneyMeterDataEditActivity.this);
        if (navigationResult != NavigationService.NavigationResult.SUCCESS) {
            Logger.getInstance().Error(TAG, String.format(Locale.getDefault(), "Navigation failed! navigationResult is %s!", navigationResult));
            displayErrorSnackBar("Failed to navigate back! Please contact LucaHome support!");
        }
    }, 1500);
}
 

开发者ID:GuepardoApps,
项目名称:LucaHome-AndroidApplication,
代码行数:17,
代码来源:MoneyMeterDataEditActivity.java

示例10: navigateBack

点赞 3

import de.mateware.snacky.Snacky; //导入依赖的package包/类
private void navigateBack(@NonNull String message) {
    Snacky.builder()
            .setActivty(MeterDataEditActivity.this)
            .setText(message)
            .setDuration(Snacky.LENGTH_INDEFINITE)
            .success()
            .show();

    new Handler().postDelayed(() -> {
        NavigationService.NavigationResult navigationResult = NavigationService.getInstance().GoBack(MeterDataEditActivity.this);
        if (navigationResult != NavigationService.NavigationResult.SUCCESS) {
            Logger.getInstance().Error(TAG, String.format(Locale.getDefault(), "Navigation failed! navigationResult is %s!", navigationResult));
            displayErrorSnackBar("Failed to navigate back! Please contact LucaHome support!");
        }
    }, 1500);
}
 

开发者ID:GuepardoApps,
项目名称:LucaHome-AndroidApplication,
代码行数:17,
代码来源:MeterDataEditActivity.java

示例11: onReceive

点赞 3

import de.mateware.snacky.Snacky; //导入依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
    ObjectChangeFinishedContent result = (ObjectChangeFinishedContent) intent.getSerializableExtra(UserService.UserCheckedFinishedBundle);
    if (!result.Success) {
        Snacky.builder()
                .setActivty(SettingsActivity.this)
                .setText("Could not validate user!")
                .setDuration(Snacky.LENGTH_INDEFINITE)
                .setActionText(android.R.string.ok)
                .error()
                .show();
    } else {
        Snacky.builder()
                .setActivty(SettingsActivity.this)
                .setText("Successfully validated user!")
                .setDuration(Snacky.LENGTH_LONG)
                .setActionText(android.R.string.ok)
                .success()
                .show();
    }
}
 

开发者ID:GuepardoApps,
项目名称:LucaHome-AndroidApplication,
代码行数:22,
代码来源:SettingsActivity.java

示例12: navigateBack

点赞 3

import de.mateware.snacky.Snacky; //导入依赖的package包/类
private void navigateBack(@NonNull String message) {
    Snacky.builder()
            .setActivty(BirthdayEditActivity.this)
            .setText(message)
            .setDuration(Snacky.LENGTH_INDEFINITE)
            .success()
            .show();

    new Handler().postDelayed(() -> {
        NavigationService.NavigationResult navigationResult = NavigationService.getInstance().GoBack(BirthdayEditActivity.this);
        if (navigationResult != NavigationService.NavigationResult.SUCCESS) {
            Logger.getInstance().Error(TAG, String.format(Locale.getDefault(), "Navigation failed! navigationResult is %s!", navigationResult));
            displayErrorSnackBar("Failed to navigate back! Please contact LucaHome support!");
        }
    }, 1500);
}
 

开发者ID:GuepardoApps,
项目名称:LucaHome-AndroidApplication,
代码行数:17,
代码来源:BirthdayEditActivity.java

示例13: navigateBack

点赞 3

import de.mateware.snacky.Snacky; //导入依赖的package包/类
private void navigateBack(@NonNull String message) {
    Snacky.builder()
            .setActivty(PuckJsEditActivity.this)
            .setText(message)
            .setDuration(Snacky.LENGTH_INDEFINITE)
            .success()
            .show();

    new Handler().postDelayed(() -> {
        NavigationService.NavigationResult navigationResult = NavigationService.getInstance().GoBack(PuckJsEditActivity.this);
        if (navigationResult != NavigationService.NavigationResult.SUCCESS) {
            Logger.getInstance().Error(TAG, String.format(Locale.getDefault(), "Navigation failed! navigationResult is %s!", navigationResult));
            displayErrorSnackBar("Failed to navigate back! Please contact LucaHome support!");
        }
    }, 1500);
}
 

开发者ID:GuepardoApps,
项目名称:LucaHome-AndroidApplication,
代码行数:17,
代码来源:PuckJsEditActivity.java

示例14: navigateBack

点赞 3

import de.mateware.snacky.Snacky; //导入依赖的package包/类
private void navigateBack(@NonNull String message) {
    Snacky.builder()
            .setActivty(TimerEditActivity.this)
            .setText(message)
            .setDuration(Snacky.LENGTH_INDEFINITE)
            .success()
            .show();

    new Handler().postDelayed(() -> {
        NavigationService.NavigationResult navigationResult = NavigationService.getInstance().GoBack(TimerEditActivity.this);
        if (navigationResult != NavigationService.NavigationResult.SUCCESS) {
            Logger.getInstance().Error(TAG, String.format(Locale.getDefault(), "Navigation failed! navigationResult is %s!", navigationResult));
            displayErrorSnackBar("Failed to navigate back! Please contact LucaHome support!");
        }
    }, 1500);
}
 

开发者ID:GuepardoApps,
项目名称:LucaHome-AndroidApplication,
代码行数:17,
代码来源:TimerEditActivity.java

示例15: navigateBack

点赞 3

import de.mateware.snacky.Snacky; //导入依赖的package包/类
private void navigateBack(@NonNull String message) {
    Snacky.builder()
            .setActivty(MenuEditActivity.this)
            .setText(message)
            .setDuration(Snacky.LENGTH_INDEFINITE)
            .success()
            .show();

    new Handler().postDelayed(() -> {
        NavigationService.NavigationResult navigationResult = NavigationService.getInstance().GoBack(MenuEditActivity.this);
        if (navigationResult != NavigationService.NavigationResult.SUCCESS) {
            Logger.getInstance().Error(TAG, String.format(Locale.getDefault(), "Navigation failed! navigationResult is %s!", navigationResult));
            displayErrorSnackBar("Failed to navigate back! Please contact LucaHome support!");
        }
    }, 1500);
}
 

开发者ID:GuepardoApps,
项目名称:LucaHome-AndroidApplication,
代码行数:17,
代码来源:MenuEditActivity.java

示例16: navigateBack

点赞 3

import de.mateware.snacky.Snacky; //导入依赖的package包/类
private void navigateBack(@NonNull String message) {
    Snacky.builder()
            .setActivty(CoinEditActivity.this)
            .setText(message)
            .setDuration(Snacky.LENGTH_INDEFINITE)
            .success()
            .show();

    new Handler().postDelayed(() -> {
        NavigationService.NavigationResult navigationResult = NavigationService.getInstance().GoBack(CoinEditActivity.this);
        if (navigationResult != NavigationService.NavigationResult.SUCCESS) {
            Logger.getInstance().Error(TAG, String.format(Locale.getDefault(), "Navigation failed! navigationResult is %s!", navigationResult));
            displayFailSnacky("Failed to navigate back! Please contact LucaHome support!");
        }
    }, 1500);
}
 

开发者ID:GuepardoApps,
项目名称:LucaHome-AndroidApplication,
代码行数:17,
代码来源:CoinEditActivity.java

示例17: onClick

点赞 2

import de.mateware.snacky.Snacky; //导入依赖的package包/类
@Override
public void onClick(View view) {
    switch (view.getId()) {
        case R.id.btn_emergency_send:
            if (etEmergencyMessage.getText().length() < 10) {
                Snacky.builder().setActivty(getActivity()).error().setText(R.string.error_txt_message_too_short).show();
            } else {
                ((DCEmergencyActivity) getActivity()).sendEmail(etEmergencyMessage.getText().toString(), tietEmergencyPhone.getText().toString());
            }
            break;
    }
}
 

开发者ID:Dentacoin,
项目名称:aftercare-app-android,
代码行数:13,
代码来源:DCSendMessageFragment.java

示例18: onDashboardError

点赞 2

import de.mateware.snacky.Snacky; //导入依赖的package包/类
@Override
public void onDashboardError(DCError error) {
    loadingFragment.dismissAllowingStateLoss();
    btnCollect.setEnabled(true);
    Snacky.builder().setActivty(getActivity()).error().setAction(R.string.txt_try_again, new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            DCDashboardDataProvider.getInstance().updateDashboard(true);
        }
    }).setText(R.string.collect_error_retrieving_data).setDuration(Snacky.LENGTH_INDEFINITE).show();
}
 

开发者ID:Dentacoin,
项目名称:aftercare-app-android,
代码行数:12,
代码来源:DCCollectDCNFragment.java

示例19: onActivityResult

点赞 2

import de.mateware.snacky.Snacky; //导入依赖的package包/类
@Override
public void onActivityResult(final int requestCode, final int resultCode, final Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (requestCode == REQUEST_CODE_CAMERA_QR_SCAN) {
        if (data != null) {
            String wallet = data.getStringExtra(DCQRScannerActivity.KEY_SCANNED_WALLET);
            if (wallet != null) {
                etCollectWallet.setText(wallet);
                Snacky.builder().setActivty(getActivity()).success().setText(R.string.collect_txt_wallet_copied).setDuration(Snacky.LENGTH_SHORT).show();
            }
        }
    }
}
 

开发者ID:Dentacoin,
项目名称:aftercare-app-android,
代码行数:14,
代码来源:DCCollectWalletFragment.java

示例20: show

点赞 2

import de.mateware.snacky.Snacky; //导入依赖的package包/类
public boolean show(Activity activity, int duration) {
    String message = getMessage(activity);
    if (message != null) {
        Snacky.builder().setActivty(activity).setText(message).error().setDuration(duration > 0 ? duration : Snacky.LENGTH_SHORT).show();
        return true;
    }
    return false;
}
 

开发者ID:Dentacoin,
项目名称:aftercare-app-android,
代码行数:9,
代码来源:DCError.java

示例21: displayErrorSnackBar

点赞 2

import de.mateware.snacky.Snacky; //导入依赖的package包/类
@Override
protected void displayErrorSnackBar(@NonNull String message) {
    Snacky.builder()
            .setActivty(MeterDataActivity.this)
            .setText(message)
            .setDuration(Snacky.LENGTH_INDEFINITE)
            .setActionText(android.R.string.ok)
            .error()
            .show();
}
 

开发者ID:GuepardoApps,
项目名称:LucaHome-AndroidApplication,
代码行数:11,
代码来源:MeterDataActivity.java

示例22: displayErrorSnackBar

点赞 2

import de.mateware.snacky.Snacky; //导入依赖的package包/类
@Override
protected void displayErrorSnackBar(@NonNull String message) {
    Snacky.builder()
            .setActivty(MoneyMeterDataActivity.this)
            .setText(message)
            .setDuration(Snacky.LENGTH_INDEFINITE)
            .setActionText(android.R.string.ok)
            .error()
            .show();
}
 

开发者ID:GuepardoApps,
项目名称:LucaHome-AndroidApplication,
代码行数:11,
代码来源:MoneyMeterDataActivity.java

示例23: displayErrorSnackBar

点赞 2

import de.mateware.snacky.Snacky; //导入依赖的package包/类
@Override
protected void displayErrorSnackBar(@NonNull String message) {
    Snacky.builder()
            .setActivty(ShoppingListActivity.this)
            .setText(message)
            .setDuration(Snacky.LENGTH_INDEFINITE)
            .setActionText(android.R.string.ok)
            .error()
            .show();
}
 

开发者ID:GuepardoApps,
项目名称:LucaHome-AndroidApplication,
代码行数:11,
代码来源:ShoppingListActivity.java

示例24: displayErrorSnackBar

点赞 2

import de.mateware.snacky.Snacky; //导入依赖的package包/类
private void displayErrorSnackBar(@NonNull String message) {
    Snacky.builder()
            .setActivty(BixbyEditActivity.this)
            .setText(message)
            .setDuration(Snacky.LENGTH_INDEFINITE)
            .setActionText(android.R.string.ok)
            .error()
            .show();
}
 

开发者ID:GuepardoApps,
项目名称:LucaHome-AndroidApplication,
代码行数:10,
代码来源:BixbyEditActivity.java

示例25: displayErrorSnackBar

点赞 2

import de.mateware.snacky.Snacky; //导入依赖的package包/类
private void displayErrorSnackBar(@NonNull String message) {
    Snacky.builder()
            .setActivty(MovieEditActivity.this)
            .setText(message)
            .setDuration(Snacky.LENGTH_INDEFINITE)
            .setActionText(android.R.string.ok)
            .error()
            .show();
}
 

开发者ID:GuepardoApps,
项目名称:LucaHome-AndroidApplication,
代码行数:10,
代码来源:MovieEditActivity.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)