use of ca.etsmtl.applets.etsmobile.util.NotificationManager in project ETSMobile-Android2 by ApplETS.
the class NotificationActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_notifications);
securePreferences = new SecurePreferences(this);
progressBar = (ProgressBar) findViewById(R.id.progressBar_notifications);
listView = (ListView) findViewById(R.id.listView_notifications);
progressBar.getIndeterminateDrawable().setColorFilter(getResources().getColor(R.color.ets_red_fonce), PorterDuff.Mode.MULTIPLY);
progressBar.setVisibility(View.VISIBLE);
notificationsAdapter = new NotificationsAdapter(this, R.layout.row_notification, new ArrayList<>());
listView.setAdapter(notificationsAdapter);
listView.setOnItemClickListener((parent, view, position, id) -> {
MonETSNotification item = notificationsAdapter.getItem(position);
String url = item.getUrl();
if (URLUtil.isValidUrl(url)) {
Utility.openChromeCustomTabs(NotificationActivity.this, url);
}
});
syncAdapterWithDB();
DataManager datamanager = DataManager.getInstance(this);
NotificationManager manager = new NotificationManager(this, datamanager.getMonETSService(), this);
manager.updateNotifications();
}
Aggregations