Skip to content

Commit

Permalink
Added: Add app widget id in toast shown when refreshing widget
Browse files Browse the repository at this point in the history
  • Loading branch information
agnostic-apollo committed Sep 22, 2021
1 parent 01ad073 commit 15b3698
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,10 @@ public void onReceive(Context context, Intent intent) {
}

int appWidgetId = intent.getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, AppWidgetManager.INVALID_APPWIDGET_ID);
if (appWidgetId == AppWidgetManager.INVALID_APPWIDGET_ID) return;
AppWidgetManager.getInstance(context).notifyAppWidgetViewDataChanged(appWidgetId, R.id.widget_list);

Toast toast = Toast.makeText(context, R.string.msg_scripts_reloaded, Toast.LENGTH_SHORT);
Toast toast = Toast.makeText(context, context.getString(R.string.msg_scripts_reloaded, appWidgetId), Toast.LENGTH_SHORT);
toast.setGravity(Gravity.CENTER, 0, 0);
toast.show();
break;
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<string name="title_single_shortcut_name">&TERMUX_APP_NAME; shortcut</string>
<string name="title_termux_shortcuts">&TERMUX_APP_NAME; Shortcuts</string>

<string name="msg_scripts_reloaded">&TERMUX_APP_NAME; shortcuts reloaded</string>
<string name="msg_scripts_reloaded">&TERMUX_APP_NAME; shortcuts reloaded (%1$d)</string>
<string name="msg_no_shortcut_scripts">No files in\n&TERMUX_SHORTCUT_SCRIPTS_DIR_PATH_SHORT;</string>
<string name="msg_bad_token">This shortcut is invalid - remove and add again.</string>
<string name="msg_executing_task">Executing task: \"%1$s\"</string>
Expand Down

0 comments on commit 15b3698

Please sign in to comment.