use of android.support.design.widget.BaseTransientBottomBar.BaseCallback in project android_packages_apps_Dialer by LineageOS.
the class PostCall method promptUserToViewSentMessage.
private static void promptUserToViewSentMessage(Activity activity, View rootView) {
LogUtil.i("PostCall.promptUserToViewSentMessage", "returned from sending a post call message, message sent.");
String message = activity.getString(R.string.post_call_message_sent);
String addMessage = activity.getString(R.string.view);
String number = Assert.isNotNull(getPhoneNumber(activity));
OnClickListener onClickListener = v -> {
Logger.get(activity).logImpression(DialerImpression.Type.POST_CALL_PROMPT_USER_TO_VIEW_SENT_MESSAGE_CLICKED);
Intent intent = IntentUtil.getSendSmsIntent(number);
DialerUtils.startActivityWithErrorToast(activity, intent);
};
activeSnackbar = Snackbar.make(rootView, message, Snackbar.LENGTH_LONG).setAction(addMessage, onClickListener).setActionTextColor(activity.getResources().getColor(R.color.dialer_snackbar_action_text_color)).addCallback(new BaseCallback<Snackbar>() {
@Override
public void onDismissed(Snackbar snackbar, int i) {
super.onDismissed(snackbar, i);
clear(snackbar.getContext());
}
});
activeSnackbar.show();
Logger.get(activity).logImpression(DialerImpression.Type.POST_CALL_PROMPT_USER_TO_VIEW_SENT_MESSAGE);
DialerUtils.getDefaultSharedPreferenceForDeviceProtectedStorageContext(activity).edit().remove(KEY_POST_CALL_MESSAGE_SENT).apply();
}
Aggregations