Another notification update question
Posted: 10 Dec 2019 08:41
Is there a way i can display my widget as icon on notifications?
I have my own signil bar (4 x bars)...
I was hoping to use it on a notification!
I have my own signil bar (4 x bars)...
Code: Select all
global_signal_strength_level = signal_strength_level + "%";
//the signal strength in a value from 0 to 4 like the bars on a standard Android device
global_signal_strength_asu = signal_strength_asu;
//the signal strength in ASU (0-31)
global_lte_dbm = lte_dbm;
//the LTE RSRP value in dBm (-1 for unavailable)
global_is_gsm = is_gsm;
//true when GSM
global_gsm_signal_strength = gsm_signal_strength;
//the GSM signal strength (0-31, 99 for unknown, -1 for unavailable)
global_gsm_bit_error_rate = gsm_bit_error_rate;
//the GSM bit error rate (0-7, 99 for unknown, -1 for unavailable)
status = newMapFromValues(
0, "noservice",
1, "poor",
2, "fair",
3, "good",
4, "fullservice");
global_signal_strength_level = status[signal_strength_level];
if (global_signal_strength_level == "noservice"){
setWidgetElementProperty("Signil_strength_bar", "Bar_4", "visible", false);
setWidgetElementProperty("Signil_strength_bar", "Bar_3", "visible", false);
setWidgetElementProperty("Signil_strength_bar", "Bar_2", "visible", false);
setWidgetElementProperty("Signil_strength_bar", "Bar_1", "visible", true);}
else if (global_signal_strength_level == "poor"){
setWidgetElementProperty("Signil_strength_bar", "Bar_4", "visible", false);
setWidgetElementProperty("Signil_strength_bar", "Bar_3", "visible", false);
setWidgetElementProperty("Signil_strength_bar", "Bar_2", "visible", true);
setWidgetElementProperty("Signil_strength_bar", "Bar_1", "visible", true);}
if (global_signal_strength_level == "fair"){
setWidgetElementProperty("Signil_strength_bar", "Bar_4", "visible", false);
setWidgetElementProperty("Signil_strength_bar", "Bar_3", "visible", false);
setWidgetElementProperty("Signil_strength_bar", "Bar_2", "visible", true);
setWidgetElementProperty("Signil_strength_bar", "Bar_1", "visible", true);}
else if (global_signal_strength_level == "good"){
setWidgetElementProperty("Signil_strength_bar", "Bar_4", "visible", false);
setWidgetElementProperty("Signil_strength_bar", "Bar_3", "visible", true);
setWidgetElementProperty("Signil_strength_bar", "Bar_2", "visible", true);
setWidgetElementProperty("Signil_strength_bar", "Bar_1", "visible", true);}
else if (global_signal_strength_level == "fullservice"){
setWidgetElementProperty("Signil_strength_bar", "Bar_4", "visible", true);
setWidgetElementProperty("Signil_strength_bar", "Bar_3", "visible", true);
setWidgetElementProperty("Signil_strength_bar", "Bar_2", "visible", true);
setWidgetElementProperty("Signil_strength_bar", "Bar_1", "visible", true);}