private void checkPermissionStatus() { if (ContextCompat.CheckSelfPermission(this, Manifest.Permission.ReadContacts) == (int)Permission.Granted) { contactsButton.SetBackgroundResource(Resource.Drawable.roundbutton_settings); contactsButton.SetTextColor(Color.Black); } if (ContextCompat.CheckSelfPermission(this, Manifest.Permission.SendSms) == (int)Permission.Granted) { SMSButton.SetBackgroundResource(Resource.Drawable.roundbutton_settings); SMSButton.SetTextColor(Color.Black); } if (ContextCompat.CheckSelfPermission(this, Manifest.Permission.Camera) == (int)Permission.Granted) { cameraButton.SetBackgroundResource(Resource.Drawable.roundbutton_settings); cameraButton.SetTextColor(Color.Black); } if (ContextCompat.CheckSelfPermission(this, Manifest.Permission.AccessFineLocation) == (int)Permission.Granted && ContextCompat.CheckSelfPermission(this, Manifest.Permission.AccessCoarseLocation) == (int)Permission.Granted) { locationButton.SetBackgroundResource(Resource.Drawable.roundbutton_settings); locationButton.SetTextColor(Color.Black); } if (ContextCompat.CheckSelfPermission(this, Manifest.Permission.CallPhone) == (int)Permission.Granted) { telephoneButton.SetBackgroundResource(Resource.Drawable.roundbutton_settings); telephoneButton.SetTextColor(Color.Black); } }
private void setColors() { if (ContextCompat.CheckSelfPermission(this, Manifest.Permission.CallPhone) != (int)Permission.Granted) { telephoneButton.SetBackgroundResource(Resource.Drawable.roundbutton_settings_red); telephoneButton.SetTextColor(Color.White); } if (ContextCompat.CheckSelfPermission(this, Manifest.Permission.AccessFineLocation) != (int)Permission.Granted) { locationButton.SetBackgroundResource(Resource.Drawable.roundbutton_settings_red); locationButton.SetTextColor(Color.White); } if (ContextCompat.CheckSelfPermission(this, Manifest.Permission.Camera) != (int)Permission.Granted) { cameraButton.SetBackgroundResource(Resource.Drawable.roundbutton_settings_red); cameraButton.SetTextColor(Color.White); } if (ContextCompat.CheckSelfPermission(this, Manifest.Permission.SendSms) != (int)Permission.Granted) { SMSButton.SetBackgroundResource(Resource.Drawable.roundbutton_settings_red); SMSButton.SetTextColor(Color.White); } if (ContextCompat.CheckSelfPermission(this, Manifest.Permission.ReadContacts) != (int)Permission.Granted) { contactsButton.SetBackgroundResource(Resource.Drawable.roundbutton_settings_red); contactsButton.SetTextColor(Color.White); } }
void ReleaseDesignerOutlets() { if (CallButton != null) { CallButton.Dispose(); CallButton = null; } if (CategoryLabel != null) { CategoryLabel.Dispose(); CategoryLabel = null; } if (CommunityLabel != null) { CommunityLabel.Dispose(); CommunityLabel = null; } if (DayCountLabel != null) { DayCountLabel.Dispose(); DayCountLabel = null; } if (EmailButton != null) { EmailButton.Dispose(); EmailButton = null; } if (ProspectLabel != null) { ProspectLabel.Dispose(); ProspectLabel = null; } if (SMSButton != null) { SMSButton.Dispose(); SMSButton = null; } if (TaskDueLabel != null) { TaskDueLabel.Dispose(); TaskDueLabel = null; } if (TaskLabel != null) { TaskLabel.Dispose(); TaskLabel = null; } }