Archives

now browsing by author

 

is it possible to add an scriptable image as the shortcut icon persistently?

is it possible to add an scriptable image as the shortcut icon persistently?

I tried with:

itm.setDefaultIcon(img);

itm.setCustomIcon(img);

itm.setImage(img);

Only the setImage seems to be working. But according to the documentation it’s not persistent, and the image I got was cramped into 1×1 cell (the size of the default android icon), when the the size of the shortcut was 3×1.

So far I have been able to successfully get the scriptable image working using:

itm.setBoxBackground(img, “ns”, true);

but, it’s not persistent neither.

if doing the scriptable icon persistent is not possible, how can I make the box background persistent or act in a persistent like behavior?

Is this a common problem/bug?

Is this a common problem/bug?

I’m creating a shortcut and toggling the icon via script, it is reflected in the settings, but not on the launcher.

It also happens with the label font size, but it changes after running the script twice, the icon stays there until I restart the phone or restart LL.

Is it possible to run multiple scripts as functions from one “main” script?

Is it possible to run multiple scripts as functions from one “main” script?

something like,

var returnedData1 = LL.runScript(“my first script”, “data”);

var returnedData2 = LL.runScript(“my other script”, “data”);

I know that it’s, at least, somewhat possible applying self to the function script, which I don’t know how exactly it works but it works, however, when I tried to apply it to multiple scripts as functions, it wasn’t that reliable and LL usually throw me an error of not having one of the functions, which was on a second script called/initialized the same way.

If what’s wrong with the self method could be explained, that would be even better than my first simple suggestion, because, to my knowledge, using the self behaves more like a class, so multiple functions can be added in one script vs having one function per script.

Tasker Functions

Tasker Functions

About the script

Purpose: This is a script with useful Tasker functions.

Author: jorgepr13

How to use it:

1. Single variables

change %My_Var with the varaible that you need, and the value with the value that you need

setTaskerVariable(“%My_Var”, value);

getTaskerVariable(“%My_Var”);

2. Multiple variables

getTaskerVariable([“%BLUE”,”%LOCN”,”%AIR”,”%LOC”,”%SCREEN”,”%WIFI”,”%GPS”]);

3. Optional

You can have your Tasker “class” as an individual script and “import” it with the following code.

try {eval(getScriptByName(“Tasker_Functions”).getText());} catch (e) {Toast.makeText(getActiveScreen().getContext(), “One of the required scripts couldn’t be loaded.\nPlease try again.\n\n” + e, Toast.LENGTH_LONG).show(); return null;}

Where “Tasker_Functions” is the name of the script.

Additional

runTaskerTask(name, wait)

Where:

“name” is the task name

“wait” is the boolean to wait for the task completion

* References *

http://www.lightninglauncher.com/wiki/doku.php?id=script_music_metadata

http://mobileorchard.com/android-app-development-using-intents-to-pass-data-and-return-results-between-activities/

Could someone help me out in changing a dialog box ListView font color and item background color (not the whole…

Could someone help me out in changing a dialog box ListView font color and item background color (not the whole dialog box background color)?

I have been messing around with the dialog boxes, trying to change most of their properties via code, not xml, or layout external files.

So far I have been able to change the title (font size, color, margins), the whole dialog box background, the buttons (font size, color and background color). But no luck so far with the items in a ListView. On my searches, it mostly came down to modifying the ArrayAdapter getView method, but I don’t know how to apply it in LL.

Below is the code for one of my dialog box ListView.

—————————————————————————-

bindClass(“android.app.Dialog”);

bindClass(“android.app.AlertDialog”);

bindClass(“android.content.DialogInterface”);

bindClass(“android.graphics.drawable.ColorDrawable”);

bindClass(“android.view.Gravity”);

//LL.bindClass(“android.R.color”);

//LL.bindClass(“android.graphics.Color”);

//LL.bindClass(“android.app.Activity”);

//LL.bindClass(“android.view.Window”);

//LL.bindClass(“android.view.WindowManager”);

//LL.bindClass(“android.view.ViewGroup.LayoutParams”);

LL.bindClass(“android.widget.LinearLayout”);

LL.bindClass(“android.widget.TextView”);

LL.bindClass(“android.widget.EditText”);

LL.bindClass(“android.text.InputType”);

//LL.bindClass(“android.widget.Adapter”);

LL.bindClass(“android.widget.ArrayAdapter”);

LL.bindClass(“android.widget.ListView”);

LL.bindClass(“android.widget.AdapterView”);

var context = LL.getContext();

var colorBg = 0xAA99AAFF;

var itemsMenu = [“Message”,”List”,”Checkbox List”,”Text Input”,”Custom List”];

var itemsMenuDialog = [dialogMessageShow,dialogListShow,dialogCheckboxShow,dialogTextInputShow,dialogCListShow];

//var myItemsState = [];

var myItems = [“Easy”,”Medium”,”Hard”,”Very Hard”];

//for(var i=0; i

//myItemsState[2] = true;

dialogMenuShow();

//Android.makeNewToast(“done”, true).show();

//var dialog = new AlertDialog.Builder(context).setMessage(“Hello world”).show();

function dialogButtonHandler(button){

var msg = “”;

switch (button) {

case Dialog.BUTTON_POSITIVE: msg = “positive”;

break;

case Dialog.BUTTON_NEGATIVE: msg = “negative”;

break;

case Dialog.BUTTON_NEUTRAL: msg = “neutral”;

break;

}

msg = button + ” | ” + msg + ” ” + “\n” + “Running again”;

Android.makeNewToast(msg,true).show();

}

function myText(text){

if (typeof text == undefined){var text=””;}

var myTV = new TextView(context);

myTV.setText(text);

myTV.setTextColor(0xDD00FF99);

myTV.setTextSize(22);

//title.setBackgroundResource(R.drawable.gradient);

myTV.setPadding(10, 10, 10, 10);

myTV.setGravity(Gravity.CENTER);

return myTV;

}

function dialogMenuShow(){

var dialogExit = false;

var builder = new AlertDialog.Builder(context);

//builder.setTitle(“Select the Dialog to show”);

builder.setCustomTitle(myText(“Select the Dialog to show:”));

builder.setItems(itemsMenu,new DialogInterface.OnClickListener(){

onClick:function(dialog, indexSelected) {dialog.cancel();

//Android.makeNewToast(itemsMenu[indexSelected],true).show();

//itemsMenuDialog[indexSelected]();

//itemsMenuDialog[indexSelected](myItems,myItemsState);

switch (indexSelected) {

case 0: itemsMenuDialog[indexSelected](myItems.join(“, “));

break; //Message

case 1: itemsMenuDialog[indexSelected](myItems);

break; //List

case 2: //itemsMenuDialog[indexSelected](myItems,myItemsState);

itemsMenuDialog[indexSelected](myItems);

break; //Checkbox

case 3: itemsMenuDialog[indexSelected](“Input some text:”,”sample text”);

break; //Text Input

case 4: itemsMenuDialog[indexSelected](myItems);

break; //Custom List

}

}

});

builder.setPositiveButton(“OK”, new DialogInterface.OnClickListener() {

onClick:function(dialog, buttonId) {dialogButtonHandler(buttonId);}

});

builder.setNeutralButton(“Test”, new DialogInterface.OnClickListener() {

onClick:function(dialog, buttonId) {dialogButtonHandler(buttonId);}

});

builder.setNegativeButton(“Close”, new DialogInterface.OnClickListener() {

onClick:function(dialog, buttonId) {dialog.cancel();dialogButtonHandler(buttonId);}

});

builder.setOnCancelListener(new DialogInterface.OnCancelListener() {

onCancel:function(dialog) {dialogExit = true;}

});

builder.setOnDismissListener(new DialogInterface.OnDismissListener() {

onDismiss:function(dialog) {

if (dialogExit) {//dialogMenuShow();{}

} else {dialogMenuShow();}

//setTimeout(dialogListShow(),0);//shows the list again. On a timeout so the startActivity() is correctly launched before

//cancell is called when explicit set, pressing the back key / default action is dismiss / after cancel, dissmiss gets called too

}

});

var dialog = builder.create();

//dialog.setCancelable(true); //dialog.setCancelable(false);

//dialog.setCanceledOnTouchOutside(false); //default = true

var window = dialog.getWindow();

window.setBackgroundDrawable(new ColorDrawable(colorBg));

//window.setGravity(Gravity.FILL_VERTICAL);

//window.setGravity(Gravity.CENTER);

//window.setTextColor(Color.LTGRAY);

//window.setTextSize(24);

dialog.show();

dialog.getButton(Dialog.BUTTON_POSITIVE).setTextSize(24);

dialog.getButton(Dialog.BUTTON_POSITIVE).setTextColor(0xBBDDDDDD);

dialog.getButton(Dialog.BUTTON_POSITIVE).setBackgroundColor(0xFF556644);

dialog.getButton(Dialog.BUTTON_NEGATIVE).setTextSize(12);

//dialog.getButton(Dialog.BUTTON_NEGATIVE).setCustomText(title);

//dialog.getButton(Dialog.BUTTON_NEGATIVE).setText(title);

//dialog.getButton(Dialog.BUTTON_NEGATIVE).setView(title); //not available

dialog.getButton(Dialog.BUTTON_NEUTRAL).setTextSize(24);

dialog.getButton(Dialog.BUTTON_NEUTRAL).setTextColor(0xFF0000AA);

}

When adding multiple actions to launch with one touch via the app method (no scripting), I noticed that it launches…

When adding multiple actions to launch with one touch via the app method (no scripting), I noticed that it launches one action at a time which I’m fine with it.

My problem is that I if I have a #Tasker action running before another action, and Tasker is disabled, the second action never runs.

Is there a way to bypass this, by identifying if #Tasker is enabled, and then skipping the #Tasker action if not enabled?

#llx #tasker #launch #actions

Hi, I recently bought a ZGPAX S8 (Android smart watch phone), I installed Lightning launcher on it, it runs pretty…

Hi, I recently bought a ZGPAX S8 (Android smart watch phone), I installed Lightning launcher on it, it runs pretty good, all the good stuff of a normal phone but,

I can’t see the notification/status bar nor I can’t pull it.

I already tried most or all the settings related with the notification/status/system bar and it doesn’t show. In the picture, you can see the red color for the notification/status bar, but nothing is shown there.

The default launcher (Android launcher) shows the notification/status bar, but (I don’t like it!) it lack all the “customizablility”, organization, etc. of Lightning launcher.