Skip to content

Commit

Permalink
Fix bug in status of Business
Browse files Browse the repository at this point in the history
  • Loading branch information
Dev4Mod committed May 2, 2024
1 parent f22fa35 commit 95cb8dd
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,31 @@ public void onCreate(@Nullable Bundle savedInstanceState) {
@Override
public void onReceive(Context context, Intent intent) {
try {
receiverBroadcastWpp(context, intent);
if (MainFeatures.PACKAGE_WPP.equals(intent.getStringExtra("PKG")))
receiverBroadcastWpp(context, intent);
else
receiverBroadcastBusiness(context, intent);
} catch (Exception e) {
}
}
}, intentFilter, ContextCompat.RECEIVER_EXPORTED);
}

private void receiverBroadcastBusiness(Context context, Intent intent) {
binding.statusTitle3.setText(R.string.business_in_background);
var version = intent.getStringExtra("VERSION");
var supported_list = Arrays.asList(context.getResources().getStringArray(R.array.supported_versions_wpp));
if (supported_list.contains(version)) {
binding.statusSummary3.setText(String.format(getString(R.string.version_s), version));
binding.status3.setCardBackgroundColor(context.getColor(rikka.material.R.color.material_green_500));
}else {
binding.statusSummary3.setText(String.format(getString(R.string.version_s_not_listed), version));
binding.status3.setCardBackgroundColor(context.getColor(rikka.material.R.color.material_yellow_500));
}
binding.statusSummary3.setVisibility(View.VISIBLE);
binding.statusIcon3.setImageResource(R.drawable.ic_round_check_circle_24);
}

private void receiverBroadcastWpp(Context context, Intent intent) {
binding.statusTitle2.setText(R.string.whatsapp_in_background);
var version = intent.getStringExtra("VERSION");
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-ar/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -179,4 +179,5 @@
<string name="show_button_to_send_blue_tick">Show Button to send blue tick</string>
<string name="show_button_to_send_blue_tick_sum">Show Button to send blue tick</string>
<string name="send_blue_tick">Send Blue Tick</string>
<string name="business_in_background">Business in background</string>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -179,4 +179,5 @@
<string name="show_button_to_send_blue_tick">Show Button to send blue tick</string>
<string name="show_button_to_send_blue_tick_sum">Show Button to send blue tick</string>
<string name="send_blue_tick">Send Blue Tick</string>
<string name="business_in_background">Business in background</string>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -179,4 +179,5 @@
<string name="show_button_to_send_blue_tick">Show Button to send blue tick</string>
<string name="show_button_to_send_blue_tick_sum">Show Button to send blue tick</string>
<string name="send_blue_tick">Send Blue Tick</string>
<string name="business_in_background">Business in background</string>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -179,4 +179,5 @@
<string name="show_button_to_send_blue_tick">Show Button to send blue tick</string>
<string name="show_button_to_send_blue_tick_sum">Show Button to send blue tick</string>
<string name="send_blue_tick">Send Blue Tick</string>
<string name="business_in_background">Business in background</string>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values-id/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -185,4 +185,5 @@ Anda perlu mengaktifkan dan mengatur ulang kembali</string>
<string name="show_button_to_send_blue_tick">Show Button to send blue tick</string>
<string name="show_button_to_send_blue_tick_sum">Show Button to send blue tick</string>
<string name="send_blue_tick">Send Blue Tick</string>
<string name="business_in_background">Business in background</string>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values-it/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -179,4 +179,5 @@
<string name="show_button_to_send_blue_tick">Show Button to send blue tick</string>
<string name="show_button_to_send_blue_tick_sum">Show Button to send blue tick</string>
<string name="send_blue_tick">Send Blue Tick</string>
<string name="business_in_background">Business in background</string>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values-pt/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -179,4 +179,5 @@
<string name="show_button_to_send_blue_tick">Show Button to send blue tick</string>
<string name="show_button_to_send_blue_tick_sum">Show Button to send blue tick</string>
<string name="send_blue_tick">Send Blue Tick</string>
<string name="business_in_background">Business in background</string>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -179,4 +179,5 @@
<string name="show_button_to_send_blue_tick">Show Button to send blue tick</string>
<string name="show_button_to_send_blue_tick_sum">Show Button to send blue tick</string>
<string name="send_blue_tick">Send Blue Tick</string>
<string name="business_in_background">Business in background</string>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values-tr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -178,4 +178,5 @@
<string name="show_button_to_send_blue_tick">Show Button to send blue tick</string>
<string name="show_button_to_send_blue_tick_sum">Show Button to send blue tick</string>
<string name="send_blue_tick">Send Blue Tick</string>
<string name="business_in_background">Business in background</string>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -183,4 +183,5 @@
<string name="show_button_to_send_blue_tick">Show Button to send blue tick</string>
<string name="show_button_to_send_blue_tick_sum">Show Button to send blue tick</string>
<string name="send_blue_tick">Send Blue Tick</string>
<string name="business_in_background">Business in background</string>
</resources>

0 comments on commit 95cb8dd

Please sign in to comment.