-
Notifications
You must be signed in to change notification settings - Fork 73
Fix: Add Toast "Press BACK to exit" for exit #374
Conversation
@Chromicle can you help me I don't get this Circleci work? |
There are some checkstyle violation to solve that please run I don't know this is a valid approach or not, I am just giving you a suggestion to solve that error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great change! Thanks so much for the contribution, I have some little suggestions and you can have a look when you have time.
@@ -7,7 +7,7 @@ buildscript { | |||
jcenter() | |||
} | |||
dependencies { | |||
classpath 'com.android.tools.build:gradle:3.5.1' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The file should not be change, since this is another issue to update the gradle.
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same above.
@@ -292,4 +294,22 @@ private void setUpLoader() { | |||
} | |||
} | |||
} | |||
|
|||
// Add toast "Press BACK to exit" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment is self-explanatory, no need here.
return; | ||
} | ||
BACK_FLAG = true; | ||
Toast.makeText(getApplicationContext(),"Press BACK to exit",Toast.LENGTH_SHORT).show(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Press BACK to exit
should be something like Press BACK again to exit program
, and put the string in string.xml
.
public void run() { | ||
BACK_FLAG = false; | ||
} | ||
},2000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the delay time 2000
is static, is better to use a static variable to present.
@huangyz0918 Thanks for the suggestion, I make changes and make a new pull request @Chromicle I run ./gradlew checkout but It still gives me error- "Do not use Windows line endings" in all files even in all lines and can help me how to add new commits in this PR. |
I'm a bit confused why you need a new PR? @pritsahkar |
In this PR, my commit is in an unknown repository, now I try to add commit but this time code is in the master branch so this forces me to new PR and apologizes me for a push into the master branch |
Closes #372
What has been done to verify that this works as intended?
I tested it on Android 9.0.
Why is this the best possible solution? Were any other approaches considered?
As comments in this issue, I figure out that exit confirmation is good, but not by dialog so I'm doing this by an easy approach.
How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?
No regression risks
Before submitting this PR, please make sure you have:
./gradlew checkCode
and confirmed all checks still pass OR confirm CircleCI build passes