⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 peopledetail.luac.lua

📁 htc manila 2 sourcecode
💻 LUA
📖 第 1 页 / 共 3 页
字号:
   l_24_1:Show()
end

OnConfirmationSaveReturned = function(l_25_0)
   l_25_0.OnExit:disconnect(OnConfirmationDeleteReturned)
   if l_25_0.Result.ExitType ~= DialogExitType_Cancel then
      local l_25_1 = ContactDisplayName.String
      local l_25_2 = ContactObj.ContactInfo:GetMobilePhoneNum()
      ContactObj.PeopleEngine:ImportSIMContact2Contact(l_25_1, l_25_2)
   end
end


SIMDialogReturned = function(l_26_0)
   l_26_0.OnExit:disconnect(SIMDialogReturned)
end

SIMConfirmationDialog = function(l_27_0, l_27_1)
   local l_27_2 = URL("Manila://Confirmation.dialog")
   l_27_2.Parameters:AddParameter("Title", l_27_0)
   l_27_2.Parameters:AddParameter("ContentString", l_27_1)
   l_27_2.Parameters:AddParameter("Type", "OK")
   local l_27_3 = _application.DialogManager:GetDialog(l_27_2)
   l_27_3.OnExit:connect(SIMDialogReturned)
   l_27_3:Show()
end

CheckSIMCardReady = function()
   local l_28_0 = (SIMUtilities())
   local l_28_1, l_28_2 = nil, nil
   if l_28_0 == nil then
      l_28_1 = Locale:GetString("IDS_SIM_ERROR")
      l_28_2 = Locale:GetString("IDS_SIM_ERROR_DESP")
      SIMConfirmationDialog(l_28_1, l_28_2)
      return false
   end
   if l_28_0.bIsSIMPresent ~= true then
      l_28_1 = Locale:GetString("IDS_NOSIMCARD")
      l_28_2 = Locale:GetString("IDS_NOSIMCARD_DESP")
      SIMConfirmationDialog(l_28_1, l_28_2)
      return fasle
   end
   if l_28_0.bIsRadioOn ~= true then
      l_28_1 = Locale:GetString("IDS_RADIO_OFF")
      l_28_2 = Locale:GetString("IDS_RADIO_OFF_DESP")
      SIMConfirmationDialog(l_28_1, l_28_2)
      return fasle
   end
   if l_28_0.bIsSIMReady ~= true then
      l_28_0:OpenPINCodeDialog()
      return fasle
   end
   return true
end


IsMyFavesNum = function(l_29_0, l_29_1)
   if l_29_0 == l_29_1 then
     return true
   else
     return false
   end
end

ContactObject = class()
ContactObject.__init = function(l_30_0)
   l_30_0.PeopleEngine = PeopleEngine_Instance()
   l_30_0.ContactInfo = PersonInfo()
   l_30_0.ContactList = LvDetail(DetailListView)
   l_30_0.IsUpdate = false
   local l_30_1 = l_30_0.PeopleEngine:GetPersonInfo(l_30_0.ContactInfo)
   if l_30_1 == false then
      return 
   end
   if MyFavesUtilityObj:IsMyFavesTurnOn() then
      g_IsMyFavesContact = MyFavesUtilityObj:IsMyFavesContactyIDForLua(l_30_0.ContactInfo:GetIDForLua())
      if g_IsMyFavesContact == true then
         trace("MyFaves on")
      end
   end
   l_30_0.ContactInfo.OnContactChanged:connect(l_30_0.Update, l_30_0)
   l_30_0.ContactChangedConnected = true
   ContactDisplayName.String = l_30_0.ContactInfo:GetName()
   l_30_0:SetContactPicture()
end

ContactObject.Update = function(l_31_0)
   l_31_0.IsUpdate = true
end

ContactObject.OnContactDataChange = function(l_32_0)
   l_32_0.PeopleEngine:GetPersonInfo(l_32_0.ContactInfo)
   local l_32_1 = l_32_0.ContactList.collection:GetCount()
   for i = 1, l_32_1 do
      l_32_0.ContactList.collection:pop_back()
   end
   if MyFavesUtilityObj:IsMyFavesTurnOn() then
      g_IsMyFavesContact = MyFavesUtilityObj:IsMyFavesContactyIDForLua(l_32_0.ContactInfo:GetIDForLua())
      if g_IsMyFavesContact == true then
         trace("MyFaves on")
      end
   end
   ContactDisplayName.String = l_32_0.ContactInfo:GetName()
   l_32_0:SetContactPicture()
   l_32_0:PreparePersonInfoData()
   l_32_0.IsUpdate = false
end

ContactObject.PrepareSIMInfoData = function(l_33_0)
   l_33_0.ContactList.ContactData = {}
   local l_33_1 = nil
   l_33_1 = l_33_0:GetPropertyObj(0, Locale:GetString("IDS_CONTACT_MOBIL"), "CallMobile", l_33_0.ContactInfo:GetMobilePhoneNum(), ContactType.Mobile)
   if l_33_1 ~= nil then
      l_33_0:GetPropertyObj(0, Locale:GetString("IDS_CONTACT_SMS"), "SendSMS", l_33_1, ContactType.SMS)
   end
   l_33_0:GetPropertyObj(0, Locale:GetString("IDS_CONTACT_EMAIL"), "SendEmail", l_33_0.ContactInfo:GetEmailAddress1(), ContactType.Email)
end
  

ContactObject.PrepareUnknowInfoData = function(l_34_0)
   l_34_0.ContactList.ContactData = {}
   local l_34_1 = nil
   l_34_1 = l_34_0:GetPropertyObj(0, Locale:GetString("IDS_NUKNOW_CONTACT"), "CallMobile", l_34_0.ContactInfo:GetUnknownPhoneNumber(), ContactType.Mobile)
   if l_34_1 ~= nil then
      l_34_0:GetPropertyObj(0, Locale:GetString("IDS_CONTACT_SMS"), "SendSMS", l_34_1, ContactType.SMS)
   end
end


ContactObject.PreparePersonInfoData = function(l_35_0)
   l_35_0.ContactList.ContactData = {}
   local l_35_1, l_35_2, l_35_3, l_35_4, l_35_5, l_35_6 = nil, nil, nil, nil, nil, nil
   if l_35_0.ContactInfo:GetContactType() == 1 then
      l_35_0:PrepareSIMInfoData()
      return 
   else
      if l_35_0.ContactInfo:GetContactType() == -1 then
         l_35_0:PrepareUnknowInfoData()
         return 
      end
   end
   if g_IsMyFavesContact == true then
      ContactType = ContactType_MyFaves
      l_35_5 = MyFavesUtilityObj:GetMyFavesPhoneType(l_35_0.ContactInfo:GetIDForLua())
      l_35_6 = l_35_0:GetPropertyObj(0, Locale:GetString("IDS_CONTACT_MOBIL"), "CallMobile", l_35_0.ContactInfo:GetMobilePhoneNum(), ContactType.Mobile, IsMyFavesNum(MY5_PEOPLE_PHON_MOBILE, l_35_5))
      l_35_0:GetPropertyObj(0, Locale:GetString("IDS_CONTACT_COMPANY"), "Company", l_35_0.ContactInfo:GetCompanyPhoneNum(), ContactType.Company, IsMyFavesNum(MY5_PEOPLE_PHON_COMPANY, l_35_5), index)
      l_35_0:GetPropertyObj(0, Locale:GetString("IDS_CONTACT_WORK"), "Callwork", l_35_0.ContactInfo:GetWork1PhoneNum(), ContactType.Work, IsMyFavesNum(MY5_PEOPLE_PHON_BUSINESS, l_35_5))
      l_35_0:GetPropertyObj(0, Locale:GetString("IDS_CONTACT_WORK") .. " 2", "Callwork", l_35_0.ContactInfo:GetWork2PhoneNum(), ContactType.Work, IsMyFavesNum(MY5_PEOPLE_PHON_BUSINESS2, l_35_5))
      l_35_0:GetPropertyObj(0, Locale:GetString("IDS_CONTACT_HOME"), "Callhome", l_35_0.ContactInfo:GetHome1PhoneNum(), ContactType.Home, IsMyFavesNum(MY5_PEOPLE_PHON_HOME, l_35_5))
      l_35_0:GetPropertyObj(0, Locale:GetString("IDS_CONTACT_HOME") .. " 2", "Callhome", l_35_0.ContactInfo:GetHome2PhoneNum(), ContactType.Home, IsMyFavesNum(MY5_PEOPLE_PHON_HOME2, l_35_5))
      l_35_0:GetPropertyObj(0, Locale:GetString("IDS_CONTACT_CAR"), "Car", l_35_0.ContactInfo:GetCarPhoneNum(), ContactType.Car, IsMyFavesNum(MY5_PEOPLE_PHON_CAR, l_35_5))
      l_35_0:GetPropertyObj(0, Locale:GetString("IDS_CONTACT_ASSISTANT"), "Assistant", l_35_0.ContactInfo:GetAssistantPhoneNum(), ContactType.Assistant, IsMyFavesNum(MY5_PEOPLE_PHON_ASSISTANT, l_35_5))
      l_35_0:GetPropertyObj(0, Locale:GetString("IDS_CONTACT_PAGER"), "CallMobile", l_35_0.ContactInfo:GetPegerPhoneNum(), ContactType.Pager, IsMyFavesNum(MY5_PEOPLE_PHONE_PAGER, l_35_5))
      l_35_0:GetPropertyObj(0, Locale:GetString("IDS_CONTACT_RADIO"), "CallMobile", l_35_0.ContactInfo:GetRadioPhoneNum(), ContactType.Radio, IsMyFavesNum(MY5_PEOPLE_PHONE_RADIOTELE, l_35_5))
   else
      l_35_6 = l_35_0:GetPropertyObj(0, Locale:GetString("IDS_CONTACT_MOBIL"), "CallMobile", l_35_0.ContactInfo:GetMobilePhoneNum(), ContactType.Mobile)
      l_35_0:GetPropertyObj(0, Locale:GetString("IDS_CONTACT_COMPANY"), "Company", l_35_0.ContactInfo:GetCompanyPhoneNum(), ContactType.Company, false, index)
      l_35_0:GetPropertyObj(0, Locale:GetString("IDS_CONTACT_WORK"), "Callwork", l_35_0.ContactInfo:GetWork1PhoneNum(), ContactType.Work)
      l_35_0:GetPropertyObj(0, Locale:GetString("IDS_CONTACT_WORK") .. " 2", "Callwork", l_35_0.ContactInfo:GetWork2PhoneNum(), ContactType.Work)
      l_35_0:GetPropertyObj(0, Locale:GetString("IDS_CONTACT_HOME"), "Callhome", l_35_0.ContactInfo:GetHome1PhoneNum(), ContactType.Home)
      l_35_0:GetPropertyObj(0, Locale:GetString("IDS_CONTACT_HOME") .. " 2", "Callhome", l_35_0.ContactInfo:GetHome2PhoneNum(), ContactType.Home)
      l_35_0:GetPropertyObj(0, Locale:GetString("IDS_CONTACT_CAR"), "Car", l_35_0.ContactInfo:GetCarPhoneNum(), ContactType.Car)
      l_35_0:GetPropertyObj(0, Locale:GetString("IDS_CONTACT_ASSISTANT"), "Assistant", l_35_0.ContactInfo:GetAssistantPhoneNum(), ContactType.Assistant)
      l_35_0:GetPropertyObj(0, Locale:GetString("IDS_CONTACT_PAGER"), "Pager", l_35_0.ContactInfo:GetPegerPhoneNum(), ContactType.Pager)
      l_35_0:GetPropertyObj(0, Locale:GetString("IDS_CONTACT_RADIO"), "Radio", l_35_0.ContactInfo:GetRadioPhoneNum(), ContactType.Radio)
   end
   if l_35_6 ~= nil then
      l_35_0:GetPropertyObj(0, Locale:GetString("IDS_CONTACT_SMS"), "SendSMS", l_35_6, ContactType.SMS)
   end
   l_35_0:GetPropertyObj(0, Locale:GetString("IDS_CONTACT_EMAIL"), "SendEmail", l_35_0.ContactInfo:GetEmailAddress1(), ContactType.Email)
   l_35_0:GetPropertyObj(0, Locale:GetString("IDS_CONTACT_EMAIL") .. " 2", "SendEmail", l_35_0.ContactInfo:GetEmailAddress2(), ContactType.Email)
   l_35_0:GetPropertyObj(0, Locale:GetString("IDS_CONTACT_EMAIL") .. " 3", "SendEmail", l_35_0.ContactInfo:GetEmailAddress3(), ContactType.Email)
   if g_IsMyFavesContact == true then
      l_35_0:GetPropertyObj(0, Locale:GetString("IDS_CONTACT_IM"), "SendEmail", 0, ContactType.IM)
   end
   l_35_2 = l_35_0:GetPropertyObj(0, Locale:GetString("IDS_CONTACT_OFFICEMAP"), "HomeMap", l_35_0.ContactInfo:GetOfficeAddress(), ContactType.Map)
   l_35_1 = l_35_0:GetPropertyObj(0, Locale:GetString("IDS_CONTACT_HOMEMAP"), "HomeMap", l_35_0.ContactInfo:GetHomeAddress(), ContactType.Map)
   local l_35_7 = l_35_0:GetPropertyObj(1, (Locale:GetString("IDS_CONTACT_INFO_RINGTONE")), nil, l_35_0.ContactInfo:GetRingTone(), ContactType.RingTone)
   if l_35_7 == nil then
      if l_35_3 ~= nil then
         l_35_3 = l_35_3 .. ", " .. Locale:GetString("IDS_CONTACT_INFO_RINGTONE")
      else
         l_35_3 = Locale:GetString("IDS_CONTACT_SETUP") .. " " .. Locale:GetString("IDS_CONTACT_INFO_RINGTONE")
      end
   end
   local l_35_8 = l_35_0.ContactInfo:GetBirthdayDate()
   if l_35_8.Month ~= 0 or l_35_8.Day ~= 0 then
      local gs = l_35_8:GetDateString(Locale:GetString("IDS_CONTACT_BIRTHDAY_FORMAT"))
      local f = string.format(Locale:GetString("IDS_CONTACT_AGE"),l_35_0:GetAge(l_35_8.Year, l_35_8.Month, l_35_8.Day))
      l_35_0:GetPropertyObj(1, 
           (Locale:GetString("IDS_CONTACT_INFO_BIRTHDAY")), nil, 
           gs, 
           ContactType.Birthday, nil,f)
   elseif l_35_3 ~= nil then
      l_35_3 = l_35_3 .. ", " .. Locale:GetString("IDS_CONTACT_INFO_BIRTHDAY")
   else
      l_35_3 = Locale:GetString("IDS_CONTACT_SETUP") .. " " .. Locale:GetString("IDS_CONTACT_INFO_BIRTHDAY")
   end
   l_35_8 = l_35_0.ContactInfo:GetAnniversaryDate()
   if l_35_8.Month ~= 0 or l_35_8.Day ~= 0 then
      l_35_0:GetPropertyObj(1, (Locale:GetString("IDS_CONTACT_INFO_ANNIVERSARY")), nil, l_35_8:GetDateString(Locale:GetString("IDS_CONTACT_BIRTHDAY_FORMAT")), ContactType.Anniversary)
   elseif l_35_3 ~= nil then
      l_35_3 = l_35_3 .. ", " .. Locale:GetString("IDS_CONTACT_INFO_ANNIVERSARY")
   else
      l_35_3 = Locale:GetString("IDS_CONTACT_SETUP") .. " " .. Locale:GetString("IDS_CONTACT_INFO_ANNIVERSARY")
   end
   if l_35_3 ~= nil then
      l_35_3 = Locale:GetString("IDS_CONTACT_INFO_MOREINFODEP")
      l_35_0:GetPropertyObj(1, (Locale:GetString("IDS_PEOPLEDETAILDIALOG_EDIT")), nil, l_35_3, ContactType.Add)
   end
   l_35_0:GetPropertyObj(1, (Locale:GetString("IDS_CONTACT_INFO_MORE")), nil, Locale:GetString("IDS_CONTACT_MOREINFO"), ContactType.More)
end



ContactObject.SetContactPicture = function(l_36_0)
   local l_36_1 = l_36_0.ContactInfo:GetContactType()
   trace("self.ContactInfo:GetContactType " .. tostring(l_36_1))
   if l_36_1 == 1 then
      ContactPhoto:SetTextureRef("ContactTypeSIM")
      ContactPhoto.TextureCoords:set(0.046875, 0.046875, 0.5546875, 0.5546875)
      return 
   elseif l_36_1 == -1 then
      ContactPhoto:SetTextureRef("PeoplePlaceholderSmall")
      ContactPhoto.TextureCoords:set(0, 0, 0.92578125, 0.92578125)
      ContactDisplayName.String = l_36_0.ContactInfo:GetUnknownPhoneNumber()
      return 
   end
   local l_36_2 = l_36_0.ContactInfo:GetPersonPicture()
   if not l_36_2:HasValue() then
      ContactPhoto:SetTextureRef("PeoplePlaceholderSmall")
      ContactPhoto.TextureCoords:set(0, 0, 0.92578125, 0.92578125)
   elseif g_IsMyFavesContact == true and MyFavesUtilityObj:IsCircleStyle() then
      ContactPhoto._visible = false
      ContactPhotoFrame._visible = false
      MyFavesContactPhoto._visible = true
      MyFavesBaseImage:SetTexture(l_36_2:GetValue().Texture)
      MyFavesBaseImage.TextureCoords.value = l_36_2:GetValue().UV
   else
      ContactPhoto._visible = true
      ContactPhotoFrame._visible = true
      MyFavesContactPhoto._visible = false
      ContactPhoto:SetTexture(l_36_2:GetValue().Texture)
      ContactPhoto.TextureCoords.value = l_36_2:GetValue().UV
   end
end

ContactObject.GetAge = function(l_37_0, l_37_1, l_37_2, l_37_3)
   local l_37_4 = Time_GetNow()
   local l_37_5 = l_37_4.Year - l_37_1
   if l_37_2 <= l_37_4.Month then
      if l_37_3 <= l_37_4.Day then
         return l_37_5
      else
         return l_37_5 - 1
      end
   else
      return l_37_5 - 1
   end
end

ContactObject.GetPropertyObj = function(l_38_0, l_38_1, l_38_2, l_38_3, l_38_4, l_38_5, l_38_6, l_38_7)
   trace("[ContactObject:GetPropertyObj] " .. tostring(l_38_2) .. " : " .. tostring(l_38_4))
   if l_38_4 ~= nil and l_38_4 ~= "" then
      local l_38_8 = {}
      l_38_8.Group = l_38_1
      l_38_8.Type = l_38_5
      l_38_8.Value = l_38_4
      l_38_8.Title = l_38_2
      l_38_8.Icon = l_38_3
      if l_38_6 ~= nil then
         l_38_8.MyFavesIcon = l_38_6
      else
         l_38_8.MyFavesIcon = false
      end
      if l_38_7 ~= nil then
         l_38_8.Info = l_38_7
      end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -