Giter Club home page Giter Club logo

gldiedemo's Introduction

GlideDemo

A demo describes how to load images by using Glide

一个展示了如何使用Glide加载图片的示例

###最简单的加载方式

ImageView targetImageView = (ImageView) findViewById(R.id.imageView);
String internetUrl = "http://i.imgur.com/idojSYm.jpg";
Glide.with(context)
     .load(internetUrl)
     .into(targetImageView);

.with(Context context),此处的context就是你熟悉的context,没啥不一样的。就是有一点,里面可以是fragment。

.load(String imageUrl),你要加载的图片地址,当然也可以是uri或者file,亦或是R.drawable.xxxx。

.into(ImageView targetImageView),你要加载的Imageview控件,当然也可以一个view。

###从不同的数据源加载图片

.load(String string) string可以为一个文件路径、uri或者url

.load(Uri uri) uri类型

.load(File file) 文件

.load(Integer resourceId) 资源Id,R.drawable.xxx或者R.mipmap.xxx

.load(byte[] model) byte[]类型

.load(T model) 自定义类型

gldiedemo's People

Contributors

dfshizhiqiang avatar

Watchers

James Cloos avatar 吴忠谦 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.