Created
May 5, 2015 21:22
-
-
Save ahornerr/d3e1fe3f5f1bc54946d4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void doMySearch(String query) { | |
if (query.equalsIgnoreCase("sttubkcid") || query.equalsIgnoreCase("ttubkcid")) { | |
toggleLoadingIndicator(); | |
} | |
} | |
public static void toggleLoadingIndicator() { | |
boolean currentValue = getSharedPrefs().getBoolean(PrefsEnums.KEY_LOADING_INDICATOR.toString(), false); | |
SharedPreferences.Editor editor = getSharedPrefs().edit(); | |
editor.putBoolean(PrefsEnums.KEY_LOADING_INDICATOR.toString(), !currentValue); | |
editor.apply(); | |
campusActivity.toggleLoadingIndicator(!currentValue); | |
String message = "Congratulations, you found Andy's Easter Egg! "; | |
message += ((!currentValue) ? "En" : "Dis") + "abling it now."; | |
Toast.makeText(campusActivity, message, Toast.LENGTH_SHORT).show(); | |
} | |
//CampusActivity | |
public void toggleLoadingIndicator(boolean enabled) { | |
if (progressView != null) { | |
progressView.setVisibility(View.GONE); | |
} | |
progressView = findViewById((enabled) ? R.id.custom_progress_overlay : R.id.progress_overlay); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment