Skip to content

Commit

Permalink
Merge pull request #17 from Aftermoon-dev/master
Browse files Browse the repository at this point in the history
Update README.md for Version 1.1.0
  • Loading branch information
jungh0 authored Oct 25, 2019
2 parents 1455b5e + 23e1760 commit 0106380
Showing 1 changed file with 55 additions and 1 deletion.
56 changes: 55 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ allprojects {
And add a dependency code to your module's `build.gradle` file.
```
dependencies {
implementation 'com.github.BlueCat-Community:View404:v1.0.0'
implementation 'com.github.BlueCat-Community:View404:v1.1.0'
}
```

## Usage

### Use Layout XML File
Make Layout XML File for Showing Error inside your project's res/layout.
```xml
<?xml version="1.0" encoding="utf-8"?>
Expand Down Expand Up @@ -87,6 +89,58 @@ if(view404 != null) {
view404 = null
}
```

### Use Simple Custom Layout
View404 supports Custom Layout Class for More Simple!

First, Add Error Layout Space in Your Layout.
```xml
<RelativeLayout
android:id="@+id/errorLayout"
android:background="#000000"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="50dp" />
```

Write Import following Package inside your Class.
```kotlin
import com.bluecat.view404.View404
import com.bluecat.view404.show404
import com.bluecat.view404.View404CustomLayout
```

Make Variable for View404 & View404CustomLayout.
```kotlin
private var view404: View404? = null
private var view404CustomLayout: View404CustomLayout? = null
```

Write getInstance in View404CustomLayout.
```kotlin
view404CustomLayout = View404CustomLayout.getInstance(
context = applicationContext, // Context
bgColor = Color.parseColor("#ffffff"), // Background Color
errMsg = "Error!" // Error Message
)
```

If you want to overlay 'not found' View on your ViewGroup,
```kotlin
if(view404 == null) {
view404 = View404(this, view404CustomLayout?.inflate()!!)
errorLayout.show404(view404!!, R.anim.view404_fade_in_default)
}
```

If you want to dismiss 'not found' View on your ViewGroup,
```kotlin
if(view404 != null) {
view404?.dismiss(R.anim.view404_fade_out_default)
view404 = null
}
```

# License
```
Copyright 2019 Team Mulro in BlueCat-Community
Expand Down

0 comments on commit 0106380

Please sign in to comment.