use of ca.etsmtl.applets.etsmobile.ui.adapter.NotificationsAdapter 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<MonETSNotification>());
listView.setAdapter(notificationsAdapter);
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
MonETSNotification item = notificationsAdapter.getItem(position);
String url = item.getUrl();
if (URLUtil.isValidUrl(url)) {
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);
}
}
});
syncAdapterWithDB();
Utility.loadNotifications(this, this);
}
Aggregations