Skip to content

Commit

Permalink
fix warning svreen overlay
Browse files Browse the repository at this point in the history
  • Loading branch information
nethical6 committed Jul 1, 2024
1 parent ad42ab2 commit 86fadd8
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 15 deletions.
16 changes: 8 additions & 8 deletions .androidide/editor/openedFiles.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
"allFiles": [
{
"file": "/storage/emulated/0/AndroidIDEProjects/digi-paws/app/src/main/java/nethical/digipaws/services/BlockerService.java",
"file": "/storage/emulated/0/AndroidIDEProjects/digi-paws/app/src/main/java/nethical/digipaws/utils/OverlayManager.java",
"selection": {
"end": {
"column": 8,
"index": 1168,
"line": 32
"column": 42,
"index": 3915,
"line": 108
},
"start": {
"column": 8,
"index": 1168,
"line": 32
"column": 42,
"index": 3915,
"line": 108
}
}
}
],
"selectedFile": "/storage/emulated/0/AndroidIDEProjects/digi-paws/app/src/main/java/nethical/digipaws/services/BlockerService.java"
"selectedFile": "/storage/emulated/0/AndroidIDEProjects/digi-paws/app/src/main/java/nethical/digipaws/utils/OverlayManager.java"
}
28 changes: 21 additions & 7 deletions app/src/main/java/nethical/digipaws/utils/OverlayManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,24 +64,29 @@ public void showOverlay(int difficulty,OnProceedClicked proceed, OnCloseClicked

});

String msg = sp.getString(DigiConstants.PREF_WARN_MESSAGE,"");
String titleT = sp.getString(DigiConstants.PREF_WARN_TITLE,"Are you sure?");

if(difficulty == DigiConstants.DIFFICULTY_LEVEL_NORMAL){
int crnt_coins = CoinManager.getCoinCount(context);

textTitle.setText(R.string.buy_20_mins);
textDescription.setText(R.string.desc_sd_overlay);
textDescription.append("\n"+"BALANCE: " + String.valueOf(crnt_coins) +"\n\n");
textDescription.append(sp.getString(DigiConstants.PREF_WARN_MESSAGE,""));
textDescription.append("\n"+"BALANCE: " + String.valueOf(crnt_coins) +"\n");
textDescription.append(titleT + "\n");
textDescription.append(msg);
proceedButton.setText(R.string.proceed + " (1 Aura)");
} else {
textTitle.setText(sp.getString(DigiConstants.PREF_WARN_TITLE,"Are you sure?"));
textDescription.setText(sp.getString(DigiConstants.PREF_WARN_MESSAGE,""));
textTitle.setText(titleT);
textDescription.setText(msg);
}
windowManager.addView(overlayView, params);


}

public void showNoCoinsOverlay(OnProceedClicked proceed, OnCloseClicked close){

SharedPreferences sp = context.getSharedPreferences(DigiConstants.PREF_WARN_FILE,Context.MODE_PRIVATE);
closeButton.setOnClickListener(v -> {
close.onCloseClicked();
});
Expand All @@ -93,10 +98,19 @@ public void showNoCoinsOverlay(OnProceedClicked proceed, OnCloseClicked close){
removeOverlay();
proceed.onProceedClicked();
});

String msg = sp.getString(DigiConstants.PREF_WARN_MESSAGE,"");
String titleT = sp.getString(DigiConstants.PREF_WARN_TITLE,"Are you sure?");


textTitle.setText(R.string.no_coins_title);
textDescription.setText(R.string.desc_no_coins_overlay);

textDescription.setText(titleT + "\n");
textDescription.append(msg + "\n\n");
textDescription.append(context.getString(R.string.desc_no_coins_overlay));
textDescription.append("\n"+"BALANCE: " + String.valueOf(CoinManager.getCoinCount(context)));


proceedButton.setText("Perform Quest");
windowManager.addView(overlayView, params);
}

Expand Down

0 comments on commit 86fadd8

Please sign in to comment.