Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
fengjundev committed Jul 17, 2015
1 parent ca33ed1 commit 35d10ec
Showing 1 changed file with 24 additions and 34 deletions.
58 changes: 24 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
# Android-Skin-Loader
# Android-Skin-Loader

> Contact me : [email protected]
> 任何问题,请联系我 : [email protected]
>
> A skin manager load skin from local file dynamically.
> Now support background , text color , list divider and list selector
> 一个通过动态加载本地皮肤包进行换肤的皮肤框架

## Usage

1. Init skin loader in `Application`
## 演示
#### 下载[demo](https://github.com/fengjundev/Android-Skin-Loader/tree/master/apk),将`BlackFantacy.skin`放在SD卡根目录
#### 效果图
![sample](https://raw.githubusercontent.com/fengjundev/Android-Skin-Loader/master/sample/image/screenshot.png)

```java

## 用法

#### `Application`中进行初始化

```java
public class SkinApplication extends Application {
public void onCreate() {
super.onCreate();
Expand All @@ -19,10 +25,11 @@ public class SkinApplication extends Application {
SkinManager.getInstance().load();
}
}
```
```

#### 在布局文件中标识需要换肤的View

2. Tag the view that need to change skin in layout xml files
```xml
```xml
...
xmlns:skin="http://schemas.android.com/android/skin"
...
Expand All @@ -31,12 +38,12 @@ public class SkinApplication extends Application {
...
skin:enable="true"
... />
```
```

3. Extend Acticity from `SkinPluginActivity`
#### 继承`SkinPluginActivity`作为BaseActivity进行开发

4. Set a custom skin from `.skin` file
```java
#### `.skin`文件中设置皮肤
```java
String SKIN_NAME = "BlackFantacy.skin";
String SKIN_DIR = Environment.getExternalStorageDirectory() + File.separator + SKIN_NAME;
File skin = new File(SKIN_DIR);
Expand All @@ -54,32 +61,15 @@ SkinManager.getInstance().load(skin.getAbsolutePath(),
public void onFailed() {
}
});
```
```

5. Restore to default skin
#### 重设默认皮肤

```java
SkinManager.getInstance().restoreDefaultTheme();
```

---

## Sample screenshot

- screenshot-1
![sample-1](https://raw.githubusercontent.com/fengjundev/Android-Skin-Loader/master/sample/image/1.png)

- screenshot-2
![sample-2](https://raw.githubusercontent.com/fengjundev/Android-Skin-Loader/master/sample/image/2.png)

- screenshot-3
![sample-3](https://raw.githubusercontent.com/fengjundev/Android-Skin-Loader/master/sample/image/3.png)

- screenshot-4
![sample-4](https://raw.githubusercontent.com/fengjundev/Android-Skin-Loader/master/sample/image/4.png)

- screenshot-5
![sample-5](https://raw.githubusercontent.com/fengjundev/Android-Skin-Loader/master/sample/image/5.png)
## 注意

- screenshot-6
![sample-5](https://raw.githubusercontent.com/fengjundev/Android-Skin-Loader/master/sample/image/6.png)

0 comments on commit 35d10ec

Please sign in to comment.