luowei / LWThemeManager

LWThemeManager,万能输入法的主题管理组件.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LWThemeManager

CI Status Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Usage in macro substitution

#define FloatValueFromThemeKey(key) (((NSNumber *)[LWThemeManager sharedInstance].theme[(key)]).floatValue)
#define StringValueFromThemeKey(key) ((NSString *)[LWThemeManager sharedInstance].theme[(key)])
#define UIColorValueFromThemeKey(key) ([UIColor theme_colorWithRGBAString:((NSString *)[LWThemeManager sharedInstance].theme[(key)])])
#define CGColorValueFromThemeKey(key) ([UIColor theme_colorWithRGBAString:((NSString *)[LWThemeManager sharedInstance].theme[(key)])].CGColor)

#define FloatValueToThemeFileByKey(fValue,key) ([[LWThemeManager sharedInstance] setThemeValue:(fValue) forKey:(key)])
#define StringValueToThemeFileByKey(strValue,key) ([[LWThemeManager sharedInstance] setThemeValue:(strValue) forKey:(key)])
#define UIColorValueToThemeFileByKey(uicolor,key) ([[LWThemeManager sharedInstance] setThemeValue:([UIColor theme_rgbaStringFromUIColor:uicolor]) forKey:(key)])
#define CGColorValueToThemeFileByKey(cgcolor,key) ([[LWThemeManager sharedInstance] setThemeValue:([UIColor theme_rgbaStringFromUIColor:[[UIColor alloc] initWithCGColor:cgcolor]]) forKey:(key)])

update theme

[[LWThemeManager sharedInstance] updateThemeWithName:skinName];

[[LWThemeManager sharedInstance] removeThemeWithName:name];

[[LWThemeManager sharedInstance] copyANewThemeWithName:idString];

[[LWThemeManager sharedInstance] updateThemeWithName:idString value:idString forKey:@"inputView.backgroundImage"];

[[LWThemeManager sharedInstance] recoverDefaultTheme];

get resources file path

NSString *filePath = [LWThemeManager pathInBundleWithFileName:imgName];

Requirements

Installation

LWThemeManager is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'LWThemeManager'

Carthage

github "luowei/LWThemeManager"

Author

luowei, luowei@wodedata.com

License

LWThemeManager is available under the MIT license. See the LICENSE file for more info.

About

LWThemeManager,万能输入法的主题管理组件.

License:MIT License


Languages

Language:Objective-C 81.5%Language:Ruby 9.8%Language:Shell 8.7%