mirror of
				https://github.com/bspeice/UNCCGameDay
				synced 2025-10-30 17:00:39 -04:00 
			
		
		
		
	Add basic handling to the checkbox click events in Alerts settings.
This commit is contained in:
		| @ -2,42 +2,49 @@ package com.uncc.gameday.activities; | |||||||
|  |  | ||||||
| import com.uncc.gameday.R; | import com.uncc.gameday.R; | ||||||
|  |  | ||||||
|  | import android.content.Context; | ||||||
| import android.os.Bundle; | import android.os.Bundle; | ||||||
| import android.view.View; | import android.view.View; | ||||||
| import android.widget.CheckBox; | import android.widget.CheckBox; | ||||||
|  | import android.widget.Toast; | ||||||
|  |  | ||||||
| public class Alerts extends MenuActivity { | public class Alerts extends MenuActivity { | ||||||
| 	 | 	 | ||||||
|  | 	Context ctx; | ||||||
|  |  | ||||||
| 	protected void onCreate(Bundle savedInstanceState) { | 	protected void onCreate(Bundle savedInstanceState) { | ||||||
| 		super.onCreate(savedInstanceState); | 		super.onCreate(savedInstanceState); | ||||||
|  | 		this.ctx = getApplicationContext(); | ||||||
| 		setContentView(R.layout.activity_alerts); | 		setContentView(R.layout.activity_alerts); | ||||||
| 	} | 	} | ||||||
| 	 | 	 | ||||||
| 	public void onClickTimedAlerts(View view) { | 	public void onClickTimedAlerts(View view) { | ||||||
|  | 		int toastDuration = Toast.LENGTH_SHORT; | ||||||
| 		if (((CheckBox) view).isChecked()) | 		if (((CheckBox) view).isChecked()) | ||||||
| 			// Enable Timed alerts | 			// Enable Timed alerts | ||||||
| 			; | 			Toast.makeText(this.ctx, "Timed alerts enabled.", toastDuration).show(); | ||||||
| 		else | 		else | ||||||
| 			// Disable Timed alerts | 			// Disable Timed alerts | ||||||
| 			; | 			Toast.makeText(this.ctx, "Timed alerts disabled.", toastDuration).show(); | ||||||
| 	} | 	} | ||||||
| 	 | 	 | ||||||
| 	public void onClickOrganizationAlerts(View view) { | 	public void onClickOrganizationAlerts(View view) { | ||||||
|  | 		int toastDuration = Toast.LENGTH_SHORT; | ||||||
| 		if (((CheckBox) view).isChecked()) | 		if (((CheckBox) view).isChecked()) | ||||||
| 			// Enable Organization alerts | 			// Enable Organization alerts | ||||||
| 			; | 			Toast.makeText(this.ctx, "Organization alerts enabled.", toastDuration).show(); | ||||||
| 		else | 		else | ||||||
| 			// Disable Organization alerts | 			// Disable Organization alerts | ||||||
| 			; | 			Toast.makeText(this.ctx, "Organization alerts disabled.", toastDuration).show(); | ||||||
| 	} | 	} | ||||||
| 	 | 	 | ||||||
| 	public void onClickUniversityAlerts(View view) { | 	public void onClickUniversityAlerts(View view) { | ||||||
|  | 		int toastDuration = Toast.LENGTH_SHORT; | ||||||
| 		if (((CheckBox) view).isChecked()) | 		if (((CheckBox) view).isChecked()) | ||||||
| 			// Enable University alerts | 			// Enable University alerts | ||||||
| 			; | 			Toast.makeText(this.ctx, "University alerts enabled.", toastDuration).show(); | ||||||
| 		else | 		else | ||||||
| 			// Disable University alerts | 			// Disable University alerts | ||||||
| 			; | 			Toast.makeText(this.ctx, "University alerts disabled.", toastDuration).show(); | ||||||
| 	} |  | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 bspeice
					bspeice