Here are the examples of the java api android.app.NotificationManager.from() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
7 Examples
19
Source : ZenModeSettingsBase.java
with MIT License
from ric96
with MIT License
from ric96
protected void setZenMode(int zenMode, Uri conditionId) {
NotificationManager.from(mContext).setZenMode(zenMode, conditionId, TAG);
}
19
Source : ZenModeSettingsBase.java
with MIT License
from ric96
with MIT License
from ric96
private ZenModeConfig getZenModeConfig() {
return NotificationManager.from(mContext).getZenModeConfig();
}
18
Source : ZenModeSettingsBase.java
with MIT License
from ric96
with MIT License
from ric96
protected static boolean isScheduleSupported(Context context) {
return NotificationManager.from(context).isSystemConditionProviderEnabled(ZenModeConfig.SCHEDULE_PATH);
}
18
Source : LockdownVpnTracker.java
with Apache License 2.0
from lulululbj
with Apache License 2.0
from lulululbj
private void hideNotification() {
NotificationManager.from(mContext).cancel(null, SystemMessage.NOTE_VPN_STATUS);
}
17
Source : ZenModeVoiceActivity.java
with MIT License
from ric96
with MIT License
from ric96
private void setZenModeConfig(int mode, Condition condition) {
if (condition != null) {
NotificationManager.from(this).setZenMode(mode, condition.id, TAG);
} else {
NotificationManager.from(this).setZenMode(mode, null, TAG);
}
}
17
Source : SoundSettings.java
with MIT License
from ric96
with MIT License
from ric96
private void updateEffectsSuppressor() {
final ComponentName suppressor = NotificationManager.from(mContext).getEffectsSuppressor();
if (Objects.equals(suppressor, mSuppressor))
return;
mSuppressor = suppressor;
if (mRingPreference != null) {
final String text = suppressor != null ? mContext.getString(com.android.internal.R.string.muted_by, getSuppressorCaption(suppressor)) : null;
mRingPreference.setSuppressionText(text);
}
updateRingPreference();
}
16
Source : LockdownVpnTracker.java
with Apache License 2.0
from lulululbj
with Apache License 2.0
from lulululbj
private void showNotification(int replacedleRes, int iconRes) {
final Notification.Builder builder = new Notification.Builder(mContext, SystemNotificationChannels.VPN).setWhen(0).setSmallIcon(iconRes).setContentreplacedle(mContext.getString(replacedleRes)).setContentText(mContext.getString(R.string.vpn_lockdown_config)).setContentIntent(mConfigIntent).setOngoing(true).addAction(R.drawable.ic_menu_refresh, mContext.getString(R.string.reset), mResetIntent).setColor(mContext.getColor(com.android.internal.R.color.system_notification_accent_color));
NotificationManager.from(mContext).notify(null, SystemMessage.NOTE_VPN_STATUS, builder.build());
}