📄 peopledetail.luac.lua
字号:
local l_38_9 = l_38_0.ContactList.collection:GetCount()
l_38_0.ContactList.ContactData[l_38_9] = l_38_8
l_38_0.ContactList.collection:push_back(l_38_9)
return l_38_4
end
return
end
ContactObject.DeleteContact = function(l_39_0)
l_39_0.PeopleEngine:DeleteAPerson(l_39_0.ContactInfo)
end
HandleVisibilityChanged = function()
trace("[PeopleDetailGlobal] HandleVisibilityChanged")
if _application.Visibility == true and ContactObj.IsUpdate == true then
ContactObj:OnContactDataChange()
end
end
LvDetail = class()
LvDetail.__init = function(l_41_0, l_41_1)
l_41_0.listview = l_41_1
l_41_0.collection = VectorNotifyint()
l_41_0.ContactData = nil
local l_41_2 = SequentialLayout()
l_41_2:SetItemSize(screenWidth, 80, 0)
l_41_2:SetHeaderSize(screenWidth, 40, 0)
l_41_2.DisableVirtualization = true
l_41_0.listview:SetLayout(l_41_2)
local l_41_3 = SequentialLibraryGeneratorint(l_41_0.collection, l_41_0.listview:GetMovie(), l_41_0.listview.ComponentLibraryName, l_41_0.listview.ComponentLibraryID)
l_41_3.RecycleItems = true
l_41_3:SetHeaderComponent(l_41_0.listview:GetMovie(), l_41_0.listview.ComponentLibraryName, 2)
l_41_3.GroupFunction:connect(l_41_0.Detail_CompareItems, l_41_0)
l_41_3.HeaderCreated:connect(l_41_0.Detail_HandleHeaderCreated, l_41_0)
l_41_3.ItemCreated:connect(l_41_0.HandleItemCreated, l_41_0)
l_41_3.ItemDestroyed:connect(l_41_0.HandleItemDestroyed, l_41_0)
l_41_3.ExtendInternalGetItemSize:connect(l_41_0.HandleExtendInternalGetItemSize, l_41_0)
l_41_3.RecycleItems = true
l_41_3.RecycleHeaders = true
l_41_0.listview:SetGenerator(l_41_3)
l_41_0.listview:ForceLayout()
l_41_0.listview:Focus()
l_41_0.ListPhysics = ScrollPhysics(l_41_0.listview, l_41_0.listview, HandleSelection, true)
l_41_0.ListPhysics:ConnectMouseEvents()
l_41_0.FocusIndex = 0
end
LvDetail.SetViewPort = function(l_42_0, l_42_1, l_42_2, l_42_3)
l_42_0.listview.Viewport.x = l_42_1
l_42_0.listview.Viewport.y = l_42_2
l_42_0.listview.Viewport.z = l_42_3
end
GetAddrTextHeight = function(l_43_0, l_43_1)
local l_43_2 = 0
if l_43_1 == nil then
return 0
end
l_43_2 = TextHelper_GetStringHeight(l_43_0, l_43_1)
return l_43_2
end
ParseAddr = function(l_44_0)
local x = nil
if l_44_0 == nil then
return nil
end
x = string.gsub(l_44_0, "\r\n", ", ")
return x
end
LvDetail.HandleExtendInternalGetItemSize = function(l_45_0, l_45_1, l_45_2, l_45_3, l_45_4, l_45_5, l_45_6)
trace("[LvDetail:HandleExtendInternalGetItemSize]")
local l_45_7 = ContactObj.ContactList.listview:GetGenerator():GetItem(l_45_4)
local l_45_8 = l_45_7.Namespace:FindName("dottedline")
local l_45_9 = l_45_7.Namespace:FindName("DetailData")
local l_45_10 = l_45_7.Tag.Type
local l_45_11 = l_45_9.String
local l_45_12 = 0
if l_45_10 == ContactType.Address or l_45_10 == ContactType.Map then
l_45_9.String = ParseAddr(l_45_11)
end
l_45_12 = GetAddrTextHeight(l_45_9, l_45_9.String)
if l_45_12 > 28 then
l_45_5.value.y = 80 + (l_45_12 - 32)
l_45_2.y = l_45_5.value.y
l_45_8.Position.y = 1 - l_45_2.y
l_45_9.Size.height = l_45_12
SetSelectorHight(l_45_2.y)
else
l_45_5.value.y = 80
l_45_2.y = 80
l_45_9.Size.height = 32
end
l_45_5.value.x = 480
l_45_5.value.z = 0
l_45_6.value = true
end
LvDetail.Detail_HandleHeaderCreated = function(l_46_0, l_46_1, l_46_2)
local l_46_3 = l_46_0.ContactData[l_46_1].Group
if l_46_3 == 0 then
l_46_2.Namespace:FindName("HeaderText").String = Locale:GetString("IDS_CONTACT_COM")
elseif l_46_3 == 1 then
l_46_2.Namespace:FindName("HeaderText").String = Locale:GetString("IDS_CONTACT_INFO")
end
l_46_2.Namespace:FindName("HeaderBackground").Size.width = screenWidth
l_46_2.Namespace:FindName("HeaderBackground").TextureCoords.width = screenWidth / 2
end
LvDetail.HandleItemCreated = function(l_47_0, l_47_1, l_47_2)
local l_47_3 = l_47_0.ContactData[l_47_1]
local l_47_4 = l_47_2.Namespace
local l_47_5 = l_47_4:FindName("DetailTitle")
local l_47_6 = l_47_4:FindName("DetailData")
local l_47_7 = l_47_4:FindName("ListIcon")
local l_47_8 = l_47_4:FindName("Info")
local l_47_9 = l_47_4:FindName("dottedline")
l_47_2.Tag = l_47_3
l_47_5.String = l_47_3.Title
l_47_6.String = l_47_3.Value
if l_47_3.Icon ~= nil then
l_47_5.Position.x = 80
l_47_6.Position.x = 80
local x = l_47_3.Icon .. "_Up"
l_47_7:SetTextureRef(x)
l_47_7._visible = true
else
l_47_5.Position.x = 10
l_47_6.Position.x = 10
l_47_7._visible = false
end
l_47_9.Size.width = screenWidth
l_47_9.TextureCoords.width = screenWidth / 2
if l_47_3.Info ~= nil then
l_47_8.String = l_47_3.Info
l_47_8._visible = true
else
l_47_8._visible = false
end
if g_IsMyFavesContact == true then
local mfi = l_47_4:FindName("MyFavesIcon")
if l_47_3.MyFavesIcon == true then
mfi._visible = true
mfi.Position.x = screenWidth - 55
else
mfi._visible = false
end
if l_47_2.Tag.Type == ContactType.IM then
l_47_5.Size.height = 80
l_47_6.String = ""
end
end
l_47_2.Focusable = true
local l_47_10 = l_47_2.Tag.Type
if l_47_0.ContactData[l_47_1].Group == 0 or l_47_10 == ContactType.More or l_47_10 == ContactType.Add then
l_47_2.OnSelected:connect(l_47_0.HandleItemSelected, l_47_0)
l_47_2.OnDeselected:connect(l_47_0.HandleItemDeselected, l_47_0)
end
end
LvDetail.HandleItemSelected = function(l_48_0, l_48_1)
local l_48_2 = l_48_1.Namespace:FindName("Selector")
local l_48_3 = l_48_1.Namespace:FindName("DetailTitle")
local l_48_4 = l_48_1.Namespace:FindName("DetailData")
l_48_3.Color = GetMainTextSelectedColor()
l_48_4.Color = GetSubTextSelectedColor()
l_48_2._visible = true
if l_48_1.Tag.Icon ~= nil then
local l_48_5 = l_48_1.Namespace:FindName("ListIcon")
l_48_5:SetTextureRef(l_48_1.Tag.Icon .. "_Dn")
end
end
LvDetail.HandleItemDeselected = function(l_49_0, l_49_1)
local l_49_2 = l_49_1.Namespace:FindName("Selector")
local l_49_3 = l_49_1.Namespace:FindName("DetailTitle")
local l_49_4 = l_49_1.Namespace:FindName("DetailData")
l_49_3.Color = GetMainTextUnselectedColor()
l_49_4.Color = GetSubTextUnselectedColor()
l_49_2._visible = false
if l_49_1.Tag.Icon ~= nil then
local l_49_5 = l_49_1.Namespace:FindName("ListIcon")
l_49_5:SetTextureRef(l_49_1.Tag.Icon .. "_Up")
end
end
LvDetail.HandleItemDestroyed = function(l_50_0, l_50_1)
l_50_1.OnSelected:disconnect(l_50_0.HandleItemSelected, l_50_0)
l_50_1.OnDeselected:disconnect(l_50_0.HandleItemDeselected, l_50_0)
end
LvDetail.Detail_CompareItems = function(l_51_0, l_51_1, l_51_2)
local l_51_3 = 0
if l_51_0.ContactData[l_51_1].Group ~= l_51_0.ContactData[l_51_2].Group then
l_51_3 = -1
end
return l_51_3
end
HandleSelection = function(l_52_0)
if l_52_0 >= 0 then
local l_52_1 = ContactObj.ContactList.listview:GetGenerator():GetItem(l_52_0)
if l_52_1.Tag ~= nil then
local l_52_2 = l_52_1.Tag.Type
if ContactType.Mobile <= l_52_2 and l_52_2 <= ContactType.Assistant then
Shell_MakeAPhoneCall(l_52_1.Tag.Value, ContactDisplayName.String)
elseif ContactType.Pager <= l_52_2 and l_52_2 <= ContactType.Radio then
Shell_MakeAPhoneCall(l_52_1.Tag.Value, ContactDisplayName.String)
elseif l_52_2 == ContactType.SMS then
Shell_ComposeMessage("SMS", l_52_1.Tag.Value)
elseif l_52_2 == ContactType.Email then
if not CheckAccount(l_52_1.Tag.Value) then
Shell_SendAnEmail(ContactDisplayName.String, l_52_1.Tag.Value)
end
elseif l_52_2 == ContactType.Map then
Shell_OpenGoogleMap("\\Program Files\\GoogleMaps\\GoogleMaps.exe", l_52_1.Tag.Value)
elseif l_52_2 == ContactType.Add then
ContactObj.ContactInfo:OpenContactEditor()
elseif l_52_2 == ContactType.More then
ContactObj.IsUpdate = true
ContactObj.ContactInfo:ShowMSDetailCard()
elseif g_IsMyFavesContact == true and l_52_2 == ContactType.IM then
MyFavesUtilityObj:LaunchIM()
end
end
end
end
CheckAccount = function(l_53_0)
local l_53_1 = MailAccountDatabase(_application:GetScopedLog("email"))
local l_53_2 = l_53_1:Select(nil, nil)
if l_53_2:GetCount() == 1 then
local l_53_3 = l_53_2:GetItem(0)
local l_53_4 = l_53_3:GetAccountName()
local l_53_5 = l_53_4 .. "\" -to \"" .. l_53_0
trace("commandString=" .. l_53_5)
Shell_NavigateTo(ShellLocation_Email, l_53_5)
l_53_1 = nil
l_53_2 = nil
l_53_3 = nil
l_53_4 = nil
return true
end
return false
end
SetSelectorHight = function(l_54_0)
SelectorLeft.Size.height = l_54_0
SelectorRight.Size.height = l_54_0
SelectorMain.Size.height = l_54_0
highlightLeft.Size.height = l_54_0
SelectorHightRight.Size.height = l_54_0
SelectorHightLeft.Size.height = l_54_0
highlightRight.Size.height = l_54_0
end
_request.PostPageInit:connect(OnPostPageInit)
_request.NavigateOutTo:connect(OnNavigateOut)
_request.NavigateInFrom:connect(OnNavigateIn)
if _application.Store:GetStringValue(Lifetime_Permanent,"EnableLandscape") == "true" then
trace("[peopleDetail] : EnableLandscape")
require("people\\peopleDetail_Landscape")
_peopleDetail_ScreenRotation = peopleDetail_ScreenRotation(DetailListView, Camera_2D, Camera_3D, peopleDetail_Mask)
gbRequireLandscape = true
end
_application.OnVisibilityChanged:connect(HandleVisibilityChanged)
MyFavesUtilityObj = MyFavesUtility()
ContactObj = ContactObject()
if _peopleDetail_ScreenRotation then
_peopleDetail_ScreenRotation:OnScreenRotation()
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -