Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to show/hide the icon #32

Merged
merged 2 commits into from
Mar 6, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
* Remove showIcon field
* Update CHANGELOG and version
  • Loading branch information
riclage committed Mar 6, 2017
commit d14dfd74b1890f055b3eec7f99ae485647d8b679
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Change Log
All notable changes to this project will be documented in this file.

## 1.0.5 - 2017-03-06
* Add ability to hide the icon.

## 1.0.3 - 2017-02-21
- Back Ported to API Level 9
- Updated BinTray uploading in build script
Expand Down
2 changes: 1 addition & 1 deletion alerter/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ apply plugin: "maven-publish"
apply from: rootProject.file('quality.gradle')

def final String PACKAGE_NAME = "com.tapadoo.android"
def final String VERSION = "1.0.4"
def final String VERSION = "1.0.5"
def final String DESCRIPTION = "An Android Alerting Library"
def final String GITHUB_URL = "https://github.com/Tapadoo/Alerter"

Expand Down
5 changes: 1 addition & 4 deletions alerter/src/main/java/com/tapadoo/alerter/Alert.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ public class Alert extends FrameLayout implements View.OnClickListener, Animatio
private boolean enableIconPulse = true;
private boolean enableInfiniteDuration;

private boolean showIcon = true;

/**
* Flag to ensure we only set the margins once
*/
Expand Down Expand Up @@ -178,7 +176,7 @@ public void onAnimationStart(final Animation animation) {
@Override
public void onAnimationEnd(final Animation animation) {
//Start the Icon Animation once the Alert is settled
if (enableIconPulse && showIcon) {
if (enableIconPulse && ivIcon.getVisibility() == VISIBLE) {
try {
ivIcon.startAnimation(AnimationUtils.loadAnimation(getContext(), R.anim.alerter_pulse));
} catch (Exception ex) {
Expand Down Expand Up @@ -349,7 +347,6 @@ public void setIcon(@DrawableRes final int iconId) {
* @param showIcon True to show the icon, false otherwise
*/
public void showIcon(final boolean showIcon) {
this.showIcon = showIcon;
ivIcon.setVisibility(showIcon ? View.VISIBLE : View.GONE);
}

Expand Down