package com.uncc.gameday.activities; import com.uncc.gameday.R; import android.content.Context; import android.os.Bundle; import android.view.View; import android.widget.CheckBox; import android.widget.Toast; public class Alerts extends MenuActivity { Context ctx; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.ctx = getApplicationContext(); setContentView(R.layout.activity_alerts); } public void fetchAlerts() { // Fetch all alerts. Responsible for discovering what sources need to be fetched. if (((CheckBox)findViewById(R.id.alerts_check_timed)).isChecked()) // Fetch timed alerts this.fetchTimedAlerts(); else if (((CheckBox)findViewById(R.id.alerts_check_organizations)).isChecked()) // Fetch organization alerts this.fetchOrganizationAlerts(); else if (((CheckBox)findViewById(R.id.alerts_check_university)).isChecked()) // Fetch university alerts this.fetchUniversityAlerts(); // And always fetch alerts made by us. Period. this.fetchGamedayAlerts(); } private void fetchTimedAlerts() { // Process the rules for all timed alerts. } private void fetchOrganizationAlerts() { // Process fetching organization alerts (alerts retweeted by us) } private void fetchUniversityAlerts() { // Process fetching university alerts } private void fetchGamedayAlerts() { // Process fetching alerts generated by staff of UNCCGameDay } public void onClickTimedAlerts(View view) { int toastDuration = Toast.LENGTH_SHORT; if (((CheckBox) view).isChecked()) // Enable Timed alerts Toast.makeText(this.ctx, "Timed alerts enabled.", toastDuration).show(); else // Disable Timed alerts Toast.makeText(this.ctx, "Timed alerts disabled.", toastDuration).show(); } public void onClickOrganizationAlerts(View view) { int toastDuration = Toast.LENGTH_SHORT; if (((CheckBox) view).isChecked()) // Enable Organization alerts Toast.makeText(this.ctx, "Organization alerts enabled.", toastDuration).show(); else // Disable Organization alerts Toast.makeText(this.ctx, "Organization alerts disabled.", toastDuration).show(); } public void onClickUniversityAlerts(View view) { int toastDuration = Toast.LENGTH_SHORT; if (((CheckBox) view).isChecked()) // Enable University alerts Toast.makeText(this.ctx, "University alerts enabled.", toastDuration).show(); else // Disable University alerts Toast.makeText(this.ctx, "University alerts disabled.", toastDuration).show(); } }