技术工具箱安卓端效果实现方法
Youreln前端效果实现lua
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135
| require "import"
import "android.os.*"
import "android.widget.*"
import "android.view.*"
import "android.content.*"
import "android.net.*"
function onDrawerListItemClick(data, recyclerView, listIndex, itemIndex)
local listData = data.get(listIndex);
local itemData = listData.get(itemIndex);
local itemTitle = itemData.getTitle();
print("Click: " .. itemTitle)
end
function onSearchEvent(keyword)
print("Search keyword: " .. keyword)
end
function onMenuItemClick(title)
switch(title) do
case "清除缓存并重新进入"
clearCache()
restartApplication()
case "用户手册"
openUserManual()
default
print("Click: " .. title)
end
end
function clearCache()
end
function restartApplication()
local intent = activity.getPackageManager().getLaunchIntentForPackage(activity.getPackageName())
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
activity.startActivity(intent)
activity.finish()
end
function openUserManual()
local url = "https://youreln.gitee.io/2023/06/26/%E7%94%A8%E6%88%B7%E6%8C%87%E5%8D%97/"
local intent = Intent(Intent.ACTION_VIEW, Uri.parse(url))
activity.startActivity(intent)
end
function openOldVersion()
local url = "https://youreln.gitee.io/youreln-toolbox/app-h5.html"
local intent = Intent(activity, activity.getClass());
intent.setData(Uri.parse(url));
activity.startActivity(intent)
end
function onFloatingActionButtonClick(v)
local url = "https://youreln.gitee.io/youreln-toolbox/"
local intent = Intent(Intent.ACTION_VIEW, Uri.parse(url))
activity.startActivity(intent)
end
|
在Fusion app里写的具体见下




app-longterm是因为我不想写了,剩下都留给你们了,源码我网站和Gitee还有Github都有,自取。
须知在我网站有