peoplecallhistoryglobal.luac.lua
来自「htc manila 2 sourcecode」· LUA 代码 · 共 560 行 · 第 1/2 页
LUA
560 行
-- Decompiled using luadec 0.6 by sztupy (http://winmo.sztupy.hu)
-- Command line was: -l ;;;;;;;0,0,6,26;;;;;;;;;7;0,4,8,12,16;0,4,8,12,16,20;0,0,9,13,17,21,25,29,33,37,41,45,63,84,86,225;;0,4,8,12,16,20,24,28,32;;0,6,10;;;1,6,10;;0,6;6;6;0,1;0,1; 4865719f_manila.luac
trace("Load peoplecallhistoryglobal")
require("machine_status_svc")
require("contacts_database_svc")
require("ScrollPhysics")
require("theme")
require("people\\PeopleImageLoader")
require("transitions")
require("MyFaves_manager_v1_5_svc")
widthPeopleItem = 480
screenWidth = 480
heightPeopleItem = 80
CallHistoryFilter = 0
machineStatus = nil
PicLoader = nil
ListPhysics = nil
PageIsDestroyed = false
objs3D = {}
objs3D[1] = Camera3D
setOffScreen()
OnNavigateOut = function(l_1_0)
PageIsDestroyed = true
machineStatus.TwentyFourHourTime.OnValueChanged:disconnect(HandleTimeChange)
machineStatus = nil
_request.NavigateOutTo:disconnect(OnNavigateOut)
Shell_ClearSystemMissedCallNotification()
CallHistory_CancelAllAsyncRequest()
if PicLoader ~= nil then
PicLoader:StopThread()
PicLoader = nil
end
if ListPhysics ~= nil then
ListPhysics:DisconnectMouseEvents()
ListPhysics = nil
end
CallHistoryListview:GetGenerator().ItemCreated:disconnect(HandleItemCreated)
CallHistoryListview:GetGenerator().ItemDestroyed:disconnect(HandleItemDestroyed)
Transition(l_1_0, "Out")
end
OnNavigateIn = function(l_2_0)
_request.NavigateInFrom:disconnect(OnNavigateIn)
Transition(l_2_0, "In")
Shell_ClearSystemMissedCallNotification()
end
_request.NavigateOutTo:connect(OnNavigateOut)
_request.NavigateInFrom:connect(OnNavigateIn)
CallHistory_ListPhysicsScrollBehaviorCallback = function(l_3_0)
if PageIsDestroyed then
return
end
trace(" CallHistory behavior = " .. l_3_0)
if l_3_0 == GESTURE_PAN_END then
CallHistory_UpdatePicture()
end
collectgarbage("collect")
end
CallHistory_UpdatePicture = function()
if CallHistoryListview == nil then
return
end
local cgl = CallHistoryListview:GetLayout()
if cgl == nil then
return
end
local cgg = CallHistoryListview:GetGenerator()
if cgg == nil then
return
end
local cghl = cgl:GetVisibleHeadIndex()
local cgvc = cgl:GetVisibleCount()
local sth = cghl + cgvc - 1
for i = cghl, sth do
local item = cgg:GetItem(i)
if item ~= nil and item.Tag ~= nil and item.Tag.Oid ~= nil and item.Tag.Oid ~= "0" then
local oid = item.Tag.Oid;
if item.Tag.Pic == nil then
item.Tag.Pic = PeopleImageLoader(AsyncPicLoader_CreateInstance(PicLoader), item.Namespace:FindName("HeaderIcon"), oid)
end
end
end
end
CallHistory_CancelAllAsyncRequest = function()
if CallHistoryListview == nil then
return
end
local cgl = CallHistoryListview:GetLayout()
if cgl == nil then
return
end
local cgg = CallHistoryListview:GetGenerator()
if cgg == nil then
return
end
local cghl = cgl:GetVisibleHeadIndex()
local cgvc = cgl:GetVisibleCount()
local sth = cghl + cgvc - 1
for i = cghl, sth do
local item = cgg:GetItem(i)
if item ~= nil then
HandleItemDestroyed(item)
end
end
end
FakeFunctionDialogReturned = function(l_6_0)
trace("[PeopleAllGlobal] FakeFunctionDialogReturned")
l_6_0.OnExit:disconnect(FakeFunctionDialogReturned)
if l_6_0.Result.ExitType ~= DialogExitType_Cancel then
-- Warning: missing end command somewhere! Added here
end
end
FakeFunctionDialog = function(l_7_0, l_7_1)
trace("[PeopleAllGlobal] FakeFunctionDialog")
local l_7_2 = URL("Manila://Confirmation.dialog")
l_7_2.Parameters:AddParameter("Title", l_7_0)
l_7_2.Parameters:AddParameter("ContentString", l_7_1)
l_7_2.Parameters:AddParameter("Type", "OK")
local l_7_3 = _application.DialogManager:GetDialog(l_7_2)
l_7_3.OnExit:connect(FakeFunctionDialogReturned)
l_7_3:Show()
end
ClearCallHistory = function()
PIDatabase:DeleteAllSystemCallLogs()
end
FilterAll = function()
CallHistoryFilter = 0
_application.Navigation.Title = Locale:GetString("IDS_PEOPLEBROWSER_CALLHISTORYALLTITLE")
CreateListView()
end
FilterMissed = function()
CallHistoryFilter = 1
_application.Navigation.Title = Locale:GetString("IDS_PEOPLEBROWSER_CALLHISTORYMISSEDTITLE")
CreateListView()
end
FilterOutgoing = function()
CallHistoryFilter = 2
_application.Navigation.Title = Locale:GetString("IDS_PEOPLEBROWSER_CALLHISTORYOUTGOINGTITLE")
CreateListView()
end
FilterIncoming = function()
CallHistoryFilter = 3
_application.Navigation.Title = Locale:GetString("IDS_PEOPLEBROWSER_CALLHISTORYINCOMINGTITLE")
CreateListView()
end
DeleteHistoryDialog_Callback = function(l_13_0)
if l_13_0.Result.ExitType ~= DialogExitType_Cancel then
ClearCallHistory()
end
end
MainMenuExitCallback = function(l_14_0)
if l_14_0.Result.ExitType ~= DialogExitType_Cancel then
if l_14_0.Result.UserValue == "Clear Call Logs" then
local url = URL("Manila://Confirmation.dialog")
url.Parameters:AddParameter("Title", Locale:GetString("IDS_DELETE_ALL_DLG_TITLE"))
url.Parameters:AddParameter("ContentString", Locale:GetString("IDS_DELETE_ALL_DLG_MSG"))
local dlg = _application.DialogManager:GetDialog(url)
dlg.OnExit:connect(DeleteHistoryDialog_Callback)
dlg:Show()
else
if l_14_0.Result.UserValue == "All" then
FilterAll()
else
if l_14_0.Result.UserValue == "Missed" then
FilterMissed()
else
if l_14_0.Result.UserValue == "Outgoing" then
FilterOutgoing()
else
if l_14_0.Result.UserValue == "Incoming" then
FilterIncoming()
end
end
end
end
end
end
end
DoLSK = function()
_application.Navigation:NavigateBack()
end
DoRSK = function()
local l_16_0 = _application.DialogManager:GetDialog(URL("Manila://people-callhistory-menu.dialog"))
l_16_0.OnExit:connect(MainMenuExitCallback)
l_16_0:Show()
end
ItemSelectedFunc = function(l_17_0)
local l_17_1 = l_17_0.Namespace:FindName("ContactName")
local l_17_2 = l_17_0.Namespace:FindName("Number")
local l_17_3 = l_17_0.Namespace:FindName("Time")
local l_17_4 = l_17_0.Namespace:FindName("Selector")
l_17_4._visible = true
if l_17_1 ~= nil then
l_17_1.Color = GetMainTextSelectedColor()
end
if l_17_2 ~= nil then
l_17_2.Color = GetSubTextSelectedColor()
end
if l_17_3 ~= nil then
l_17_3.Color = GetSubTextSelectedColor()
end
end
ItemDeselectedFunc = function(l_18_0)
local l_18_1 = l_18_0.Namespace:FindName("ContactName")
local l_18_2 = l_18_0.Namespace:FindName("Number")
local l_18_3 = l_18_0.Namespace:FindName("Time")
local l_18_4 = l_18_0.Namespace:FindName("Selector")
local l_18_5 = l_18_0.Namespace:FindName("Selector")
l_18_5._visible = false
if l_18_1 ~= nil then
l_18_1.Color = GetMainTextUnselectedColor()
end
if l_18_2 ~= nil then
l_18_2.Color = Color(153, 153, 153, 255)
end
if l_18_3 ~= nil then
l_18_3.Color = Color(153, 153, 153, 255)
end
end
HandleItemCreated = function(l_19_0, l_19_1)
trace("[PeopleCallHistoryGlobal] HandleItemCreated, Index= " .. l_19_0)
local l_19_2 = l_19_1.Namespace:FindName("HeaderIcon")
local l_19_3 = l_19_1.Namespace:FindName("PhotoFrame")
local l_19_4 = l_19_1.Namespace:FindName("ContactName")
local l_19_5 = l_19_1.Namespace:FindName("Number")
local l_19_6 = l_19_1.Namespace:FindName("FacebookMessage")
local l_19_7 = l_19_1.Namespace:FindName("BubbleIcon")
local l_19_8 = l_19_1.Namespace:FindName("DirectionIcon")
local l_19_9 = l_19_1.Namespace:FindName("Time")
local l_19_10 = CallLog:GetItem(l_19_0)
local l_19_11 = PIDatabase:GetCallLogInfoInstance(l_19_10)
trace("[PeopleCallHistoryGlobal] HandleItemCreated, ID: " .. l_19_11:GetCallerId() .. ", Name: " .. l_19_11:GetCallerName() .. ", Duration: " .. l_19_11:GetDuration() .. ", Status: " .. l_19_11:GetStatus())
l_19_2._visible = false
local l_19_12 = l_19_11:GetCallerName()
if l_19_12:len() == 0 then
l_19_4.String = Locale:GetString("IDS_UNKOWNPERSON")
else
l_19_4.String = l_19_12
trace("[PeopleCallHistoryGlobal] HandleItemCreated, Str CALLER " .. l_19_12)
end
l_19_4._visible = true
l_19_1.Tag = {}
local l_19_13 = l_19_11:GetOidStr()
local l_19_14 = l_19_11:GetContactTypeByPhoneNumber()
l_19_1.Tag.Oid = l_19_13
if l_19_14 == 1 then
trace("sim")
l_19_2:SetTextureRef("ContactTypeSIM")
l_19_2.TextureCoords:set(0.046875, 0.046875, 0.5546875, 0.5546875)
l_19_2._visible = true
l_19_3._visible = true
elseif l_19_14 == 0 then
trace("device")
local thumb = l_19_11:GetThumbnail()
if thumb:HasValue() and thumb:GetValue():IsValid() then
l_19_2:SetTexture(thumb:GetValue().Texture)
l_19_2.TextureCoords.value = thumb:GetValue().UV
thumb:GetValue():Clear()
else
l_19_2:SetTextureRef("PeoplePlaceholder")
l_19_2.TextureCoords:set(0, 0, 0.92578125, 0.92578125)
end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?