Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nguyencse/URLEmbeddedView
Preview URL for Android
https://github.com/nguyencse/URLEmbeddedView
Last synced: 3 months ago
JSON representation
Preview URL for Android
- Host: GitHub
- URL: https://github.com/nguyencse/URLEmbeddedView
- Owner: nguyencse
- License: apache-2.0
- Created: 2018-11-28T02:42:21.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-08-05T03:36:50.000Z (over 5 years ago)
- Last Synced: 2024-07-01T13:54:23.391Z (4 months ago)
- Language: Java
- Homepage:
- Size: 246 KB
- Stars: 120
- Watchers: 3
- Forks: 9
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- Android-Awesome-Resources - URLEmbeddedView
README
# URLEmbeddedView
[![Build Status](https://travis-ci.org/joemccann/dillinger.svg?branch=master)](https://facebook.com/nguyencse)
URLEmbeddedView is a Android library which allows 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 to add internet permission in manifest if already not present
```groovy
```### Usage
In xml file:
```groovy
```
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());
}
});
```
Or you can use your layout to custom it:
```groovy
URLEmbeddedTask urlTask = new URLEmbeddedTask(new URLEmbeddedTask.OnLoadURLListener() {
@Override
public void onLoadURLCompleted(URLEmbeddedData data) {
// handle your code here
}
});
urlTask.execute(url);
```![Demo](screenshots/stackoverflow.png)