Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.gorsek.filip.glideexample;
- import android.support.v7.app.AppCompatActivity;
- import android.os.Bundle;
- import android.widget.ImageView;
- import com.bumptech.glide.Glide;
- import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
- import com.bumptech.glide.request.RequestOptions;
- public class MainActivity extends AppCompatActivity {
- private ImageView imageOne;
- private ImageView imageTwo;
- private ImageView imageThree;
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
- initWidgets();
- initPhoto();
- }
- private void initWidgets() {
- imageOne = findViewById(R.id.imageOne);
- imageTwo = findViewById(R.id.imageTwo);
- imageThree = findViewById(R.id.imageThree);
- }
- private void initPhoto() {
- Glide.with(this)
- .load("https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTbDzdSrbTF8y-ZRexVu0ysXU9yZISZdR-p-0WcVWW3rgpmqM1j")
- .placeholder(R.drawable.holder)
- .error(R.drawable.error)
- .into(imageOne);
- Glide.with(this)
- .load("https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSZqQCY1q-UIhJqvr5A5CcVh9nlw-3K63gtDPwIQ-eO9B3G020PAA")
- .apply(RequestOptions.circleCropTransform())
- .placeholder(R.drawable.holder)
- .error(R.drawable.error)
- .into(imageTwo);
- Glide.with(this)
- .load("https://fsa.zobj.net/crop.php?r=olUEuqlmpAdiGf4XAOv1cfxXmLUtTUQewc68y0t2ElkitpkIOIHg1KUREt9dv0KYfWk5REy" +
- "tnJiA-kOqLqbKYBiWugKF4lQrka3ekggCJf-AYjLGG7NKZ1QE9AAQEYOfjFQVOBqFoW3Sm4ZCl0Ar5q7KXP1Y85LyM-u_1y7F-tku5BT3ZcU0Orqv4lI")
- .apply(RequestOptions.centerCropTransform())
- .placeholder(R.drawable.holder)
- .error(R.drawable.error)
- .into(imageThree);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement