Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create README.md #1

Merged
merged 1 commit into from Dec 2, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
60 changes: 60 additions & 0 deletions README.md
@@ -0,0 +1,60 @@
# URLEmbeddedView

[![Build Status](https://travis-ci.org/joemccann/dillinger.svg?branch=master)](https://facebook.com/nguyencse)

URLEmbeddedView is a Android library which alows you show preview data of your URL.

### You can also:
Pass URL to view and you can load some data of this URL to preview.
And of course URLEmbeddedView itself is open source forever.

### Requirements
- OS: Android
- minSdkVersion: 15

### Installation
Just add the dependency to your `build.gradle`:

```groovy
dependencies {
implementation 'com.github.nguyencse:urlembeddedview:1.0.2'
}
```

And DO NOT forget add internet permission in manifest if already not present

```groovy
<uses-permission android:name="android.permission.INTERNET" />
```

### Usage
In xml file:
```groovy
<com.nguyencse.URLEmbeddedView
android:id="@+id/uev"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:title="Title"
app:description="Description"
app:host="abc.com"
app:favor="@drawable/ic_url"
app:thumbnail="@drawable/ic_url"/>
```
In code:

```groovy
URLEmbeddedView urlEmbeddedView = findViewById(R.id.uev);

urlEmbeddedView.setURL("stackoverflow.com", new URLEmbeddedView.OnLoadURLListener() {
@Override
public void onLoadURLCompleted(URLEmbeddedData data) {
urlEmbeddedView.title(data.getTitle());
urlEmbeddedView.description(data.getDescription());
urlEmbeddedView.host(data.getHost());
urlEmbeddedView.thumbnail(data.getThumbnailURL());
urlEmbeddedView.favor(data.getFavorURL());
}
});
```

![Demo](screenshots/stackoverflow.png)