You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

257 lines
9.8 KiB

//
// Eumn.swift
// FireBoltt
//
// Created by lemo. on 2020/3/28.
// Copyright © 2020 Sheldon. All rights reserved.
//
import Foundation
enum FunctionTypeFireBoltt {
case findPhone, handUp, callRemind, messageRemind, remoteCamera, notice, heartCheck,
dialPush, firmwareUpgrade, unBinding, notDisturb, alarmClock, sedentary, drinkRemind, heartRateMonitor, tempeartureCheck, wechatSport,telephoneBook,businessCard,theWallet,music
func title() -> String {
switch self {
case .findPhone: return MultiLanguageKey_FB.findDeviceFB.localized
case .handUp: return MultiLanguageKey_FB.handUpFB.localized
case .callRemind: return MultiLanguageKey_FB.callRemindFB.localized
case .messageRemind: return MultiLanguageKey_FB.messageRemindFB.localized
case .remoteCamera: return MultiLanguageKey_FB.remoteCameraFB.localized
case .notice: return MultiLanguageKey_FB.noticeFB.localized
case .heartCheck: return MultiLanguageKey_FB.heartCheckFB.localized
case .dialPush: return MultiLanguageKey_FB.dialPushFB.localized
case .firmwareUpgrade: return MultiLanguageKey_FB.firmwareUpgradeFB.localized
case .unBinding: return MultiLanguageKey_FB.unBindingFB.localized
case .notDisturb: return MultiLanguageKey_FB.notDisturbFB.localized
case .alarmClock: return MultiLanguageKey_FB.alarmClockFB.localized
case .sedentary: return MultiLanguageKey_FB.sedentaryFB.localized
case .drinkRemind: return MultiLanguageKey_FB.drinkRemindFB.localized
case .tempeartureCheck: return MultiLanguageKey_FB.temperatureCheckFB.localized
case .wechatSport: return MultiLanguageKey_FB.wechatSportFB.localized
case .telephoneBook: return MultiLanguageKey_FB.telephoneBookFB.localized
case .businessCard: return MultiLanguageKey_FB.businessCardFB.localized
case .theWallet: return MultiLanguageKey_FB.theWalletFB.localized
case .music: return MultiLanguageKey_FB.musicFB.localized
default: return ""
}
}
func imgName() -> String {
switch self {
case .findPhone: return "icon_find" ///
case .handUp: return "icon_bright_screen" ///
case .callRemind: return "icon_call_notification" ///
case .messageRemind: return "icon_message_notification" ///
case .remoteCamera: return "icon_camera" ///
case .notice: return "icon_app_notification" ///
case .heartCheck: return "icon_hr" ///
case .dialPush: return "icon_devide_dial" ///
case .firmwareUpgrade: return "icon_version" ///
//case .unBinding: return "" ///
case .notDisturb: return "icon_DND" ///
case .alarmClock: return "icon_remind" ///
case .sedentary: return "icon_sedentary" ///
case .drinkRemind: return "icon_drink" ///
case .tempeartureCheck: return "icon_temperature" ///
case .wechatSport: return "fb_icon_wechat" ///
case .telephoneBook: return "icon_phonebook" ///
case .businessCard: return "icon_card" ///
case .theWallet: return "icon_wallet" ///
case .music: return "icon_music" ///
default: return ""
}
}
func isSwitch() -> Bool {
switch self {
case .handUp, .callRemind, .messageRemind:
return true
default:
return false
}
}
}
enum PushType: Int {
case call, message, qq, wechat, whatsapp, messenger,
twitter, linkedin, instagram, facebook, line, viber, skype, outlook, others
case all
///
/// - Parameters:
/// - currenValue:
/// - type:
/// - isOn:
func tranfromPushValue(currenValue: Int, isOn: Bool) -> Int {
//
if self == .all { return isOn ? 65535 : 0 }
if isOn {
return 1 << rawValue | currenValue
}
return ~(1 << rawValue) & currenValue
}
///
/// - Parameter currenValue:
func getSwitchState(currenValue: Int) -> Bool {
if self == .all { return currenValue == 65535 }
return ((currenValue & (1 << self.rawValue)) >> rawValue) == 1
}
var title: String {
switch self {
case .call: return MultiLanguageKey_FB.callRemindFB.localized
case .message: return MultiLanguageKey_FB.messageRemindFB.localized
case .qq: return MultiLanguageKey_FB.qqRemindFB.localized
case .wechat: return MultiLanguageKey_FB.wechatRemindFB.localized
case .whatsapp: return MultiLanguageKey_FB.whatsappRemindFB.localized
case .messenger: return MultiLanguageKey_FB.messengerRemindFB.localized
case .twitter: return MultiLanguageKey_FB.twitterRemindFB.localized
case .linkedin: return MultiLanguageKey_FB.linkedinRemindFB.localized
case .instagram: return MultiLanguageKey_FB.instagramRemindFB.localized
case .facebook: return MultiLanguageKey_FB.facebookRemindFB.localized
case .line: return MultiLanguageKey_FB.lineRemindFB.localized
case .viber: return MultiLanguageKey_FB.viberRemindFB.localized
case .skype: return MultiLanguageKey_FB.skypeRemindFB.localized
case .outlook: return MultiLanguageKey_FB.outlookRemindFB.localized
case .all: return MultiLanguageKey_FB.allSelectFB.localized
case .others: return MultiLanguageKey_FB.othersRemindFB.localized
}
}
}
fileprivate let sportTypeNameArr: [String] = ["所有运动", "健走", "户外跑", "室内跑", "爬山", "越野跑", "半马", "全马", "跳绳", "羽毛球", "篮球", "骑行", "滑冰", "健身房", "瑜伽", "网球", "乒乓球", "足球", "游泳", "性爱", "室内骑行", "室内健走", "自由训练"]
enum SportType: Int {
// hasvalue+1
case placeholder = 0
/// 1
case walkTraining
/// 2
case runTraining
// 3
case runInsideTraining
/// 4
case climbingTraining
/// "" 5
case crossRunTraining
/// 6
case halfHorseTraining
/// 7
case marathonTraining
/// 8
case jumpRopeTraining
/// 9
case badmintonTraining
/// 10
case basketballTraning
/// 11
case cyclingTraining
/// 12
case skatingTraining
/// 13
case fitnessTraining
/// 14
case yogaTraining
/// 15
case tennisTraining
/// 16
case pingpongTraining
/// 17
case footballTraining
/// 18
case swimmingTraining
/// 19
case sexTraining
/// 20
case indoorCyclingTraining
/// 21
case indoorWalkTraining
/// 22
case freeTraining
}
extension SportType {
///
var sportTypeName: String {
return sportTypeNameArr[self.rawValue]
}
///
var sportImg: UIImage? {
switch self {
/// 1
case .walkTraining: return R.image.fb_icon_walk()
/// 2
case .runTraining: return R.image.fb_icon_run()
// 3
case .runInsideTraining: return R.image.fb_icon_runindoor()
/// 4
case .climbingTraining: return R.image.fb_icon_climb()
/// 5
case .crossRunTraining: return R.image.fb_icon_yyp()
/// 6
case .halfHorseTraining: return R.image.fb_icon_bm()
/// 7
case .marathonTraining: return R.image.fb_icon_qm()
/// 8
case .jumpRopeTraining: return R.image.fb_icon_skipping()
/// 9
case .badmintonTraining: return R.image.fb_icon_badminton()
/// 10
case .basketballTraning: return R.image.fb_icon_basketball()
/// 11
case .cyclingTraining: return R.image.fb_icon_bike()
/// 12
case .skatingTraining: return R.image.fb_icon_skating()
/// 13
case .fitnessTraining: return R.image.fb_icon_gym()
/// 14
case .yogaTraining: return R.image.fb_icon_yoga()
/// 15
case .tennisTraining: return R.image.fb_icon_tennis()
/// 16
case .pingpongTraining: return R.image.fb_icon_pingpong()
/// 17
case .footballTraining: return R.image.fb_icon_football()
/// 18
case .swimmingTraining: return R.image.fb_icon_swim()
/// 19
case .sexTraining: return R.image.fb_icon_sex()
/// 20
case .indoorCyclingTraining: return R.image.fb_icon_indoor_cycling()
/// 21
case .indoorWalkTraining: return R.image.fb_icon_indoor_walking()
/// 22
case .freeTraining: return R.image.fb_icon_free()
default:
return nil
}
}
}
enum HealthType {
case step
case sleep
case heartRate
case sport
case temperature
case bloodPressure
case bloodOxygen
var titleLocalized: String {
switch self {
case .step: return MultiLanguageKey_FB.stepFB.localized
case .sleep: return MultiLanguageKey_FB.sleepFB.localized
case .heartRate: return MultiLanguageKey_FB.heartRateFB.localized
case .sport: return MultiLanguageKey_FB.sportFB.localized
case .temperature: return MultiLanguageKey_FB.temperatureFB.localized
case .bloodPressure: return MultiLanguageKey_FB.bloodPressureFB.localized
case .bloodOxygen: return MultiLanguageKey_FB.bloodOxygenFB.localized
}
}
}