Git Product home page Git Product logo

urlembeddedview's Introduction

URLEmbeddedView

Build Status

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:

dependencies {
    implementation 'com.github.storm:urlembeddedview:1.0.2'
}

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

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

Usage

In xml file:

   <storm.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:

   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:

   URLEmbeddedTask urlTask = new URLEmbeddedTask(new URLEmbeddedTask.OnLoadURLListener() {
       @Override
       public void onLoadURLCompleted(URLEmbeddedData data) {
           // handle your code here
       }
   });
   urlTask.execute(url);

Demo

urlembeddedview's People

Contributors

7storm7 avatar nguyencse avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.