SHARE
TWEET

main activity

a guest Mar 24th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.gorsek.filip.glideexample;
  2.  
  3. import android.support.v7.app.AppCompatActivity;
  4. import android.os.Bundle;
  5. import android.widget.ImageView;
  6.  
  7. import com.bumptech.glide.Glide;
  8. import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
  9. import com.bumptech.glide.request.RequestOptions;
  10.  
  11. public class MainActivity extends AppCompatActivity {
  12.  
  13.     private ImageView imageOne;
  14.     private ImageView imageTwo;
  15.     private ImageView imageThree;
  16.  
  17.  
  18.     @Override
  19.     protected void onCreate(Bundle savedInstanceState) {
  20.         super.onCreate(savedInstanceState);
  21.         setContentView(R.layout.activity_main);
  22.         initWidgets();
  23.         initPhoto();
  24.  
  25.     }
  26.  
  27.     private void initWidgets() {
  28.         imageOne = findViewById(R.id.imageOne);
  29.         imageTwo = findViewById(R.id.imageTwo);
  30.         imageThree = findViewById(R.id.imageThree);
  31.  
  32.     }
  33.  
  34.     private void initPhoto() {
  35.  
  36.         Glide.with(this)
  37.                 .load("https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTbDzdSrbTF8y-ZRexVu0ysXU9yZISZdR-p-0WcVWW3rgpmqM1j")
  38.                 .placeholder(R.drawable.holder)
  39.                 .error(R.drawable.error)
  40.                 .into(imageOne);
  41.  
  42.  
  43.         Glide.with(this)
  44.                 .load("https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSZqQCY1q-UIhJqvr5A5CcVh9nlw-3K63gtDPwIQ-eO9B3G020PAA")
  45.                 .apply(RequestOptions.circleCropTransform())
  46.                 .placeholder(R.drawable.holder)
  47.                 .error(R.drawable.error)
  48.                 .into(imageTwo);
  49.  
  50.         Glide.with(this)
  51.                 .load("https://fsa.zobj.net/crop.php?r=olUEuqlmpAdiGf4XAOv1cfxXmLUtTUQewc68y0t2ElkitpkIOIHg1KUREt9dv0KYfWk5REy" +
  52.                         "tnJiA-kOqLqbKYBiWugKF4lQrka3ekggCJf-AYjLGG7NKZ1QE9AAQEYOfjFQVOBqFoW3Sm4ZCl0Ar5q7KXP1Y85LyM-u_1y7F-tku5BT3ZcU0Orqv4lI")
  53.                 .apply(RequestOptions.centerCropTransform())
  54.                 .placeholder(R.drawable.holder)
  55.                 .error(R.drawable.error)
  56.                 .into(imageThree);
  57.     }
  58.  
  59. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top