Skip to content
This repository was archived by the owner on Mar 24, 2023. It is now read-only.

Commit cd0f3a8

Browse files
Show a snackbar when profile description is empty
Signed-off-by: sunilpaulmathew <[email protected]>
1 parent 82f64cd commit cd0f3a8

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

app/src/main/java/com/smartpack/kernelprofiler/utils/CreateProfileActivity.java

+3
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
5454
mSave.setOnClickListener(v -> {
5555
if (Utils.checkWriteStoragePermission(this)) {
5656
if (mProfileDetailsHint.getText() != null && !mProfileDetailsHint.getText().toString().equals("")) {
57+
if (mProfileDescriptionHint.getText() == null || mProfileDescriptionHint.getText().toString().equals("")) {
58+
Utils.snackbar(mTitle, getString(R.string.profile_description_empty));
59+
}
5760
createProfile();
5861
} else {
5962
Utils.snackbar(mTitle, getString(R.string.profile_details_empty));

app/src/main/res/values/strings.xml

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
<string name="press_back">Press back again to exit</string>
5151
<string name="profile_applied_success">%s applied successfully!</string>
5252
<string name="profile_description">Profile Description</string>
53+
<string name="profile_description_empty">Adding a short description for this profile is highly recommended!</string>
5354
<string name="profile_description_summary">Add description here!</string>
5455
<string name="profile_details">Profile Details</string>
5556
<string name="profile_details_empty">Profile Details shouldn\'t be empty! Aborting.</string>

0 commit comments

Comments
 (0)