| Línea 7... |
Línea 7... |
| 7 |
import android.widget.ImageView;
|
7 |
import android.widget.ImageView;
|
| 8 |
import android.widget.TextView;
|
8 |
import android.widget.TextView;
|
| Línea 9... |
Línea 9... |
| 9 |
|
9 |
|
| Línea 10... |
Línea -... |
| 10 |
import androidx.recyclerview.widget.RecyclerView;
|
- |
|
| 11 |
|
- |
|
| 12 |
import com.bumptech.glide.Glide;
|
- |
|
| 13 |
import com.bumptech.glide.load.engine.DiskCacheStrategy;
|
- |
|
| 14 |
import com.bumptech.glide.load.model.GlideUrl;
|
- |
|
| - |
|
10 |
import androidx.recyclerview.widget.RecyclerView;
|
| 15 |
import com.bumptech.glide.load.model.LazyHeaders;
|
11 |
|
| 16 |
import com.bumptech.glide.request.RequestOptions;
|
12 |
|
| - |
|
13 |
import com.cesams.twogetskills.inconcert.Constants;
|
| 17 |
import com.cesams.twogetskills.inconcert.Constants;
|
14 |
import com.cesams.twogetskills.inconcert.R;
|
| 18 |
import com.cesams.twogetskills.inconcert.R;
|
15 |
import com.cesams.twogetskills.inconcert.library.ImageService;
|
| 19 |
import com.cesams.twogetskills.inconcert.library.MD5;
|
16 |
import com.cesams.twogetskills.inconcert.library.MD5;
|
| 20 |
import com.cesams.twogetskills.inconcert.viewdata.UserProfileViewData;
|
17 |
import com.cesams.twogetskills.inconcert.viewdata.UserProfileViewData;
|
| Línea 58... |
Línea 55... |
| 58 |
public void onBindViewHolder(RecyclerView.ViewHolder holder, UserProfileViewData userProfileViewData) {
|
55 |
public void onBindViewHolder(RecyclerView.ViewHolder holder, UserProfileViewData userProfileViewData) {
|
| 59 |
HeaderViewHolder mHolder = (HeaderViewHolder) holder;
|
56 |
HeaderViewHolder mHolder = (HeaderViewHolder) holder;
|
| Línea 60... |
Línea 57... |
| 60 |
|
57 |
|
| 61 |
|
- |
|
| 62 |
mHolder.mItem.setText(userProfileViewData.getLabelOrCompanyName());
|
- |
|
| 63 |
|
- |
|
| 64 |
TimeZone timeZone = TimeZone.getTimeZone("UTC");
|
- |
|
| 65 |
Calendar calendar = Calendar.getInstance(timeZone);
|
- |
|
| 66 |
TimeZone tz = calendar.getTimeZone();
|
- |
|
| 67 |
int created = (int) (calendar.getTimeInMillis() / 1000);
|
- |
|
| 68 |
|
- |
|
| 69 |
Random random = new Random(created);
|
- |
|
| 70 |
int rand = 1000 + random.nextInt(8999);
|
- |
|
| 71 |
|
- |
|
| 72 |
|
- |
|
| 73 |
String deviceUuid = iTwoGetSkills.getPreference().getDeviceUuid();
|
- |
|
| 74 |
String password = iTwoGetSkills.getPreference().getPassword();
|
- |
|
| 75 |
|
- |
|
| 76 |
|
- |
|
| 77 |
String secret = MD5.generar(password + ':' + created + ':' + rand);
|
58 |
|
| 78 |
|
- |
|
| 79 |
GlideUrl url = new GlideUrl(userProfileViewData.getValueOrImage(), new LazyHeaders.Builder()
|
- |
|
| 80 |
.addHeader(Constants.HTTP_HEADER_ACCEPT, Constants.HTTP_HEADER_ACCEPT_VALUE)
|
- |
|
| 81 |
.addHeader(Constants.HTTP_HEADER_SECURITY_TOKEN, deviceUuid)
|
- |
|
| 82 |
.addHeader(Constants.HTTP_HEADER_SECURITY_SECRET, secret)
|
- |
|
| 83 |
.addHeader(Constants.HTTP_HEADER_SECURITY_CREATED, String.valueOf(created))
|
- |
|
| 84 |
.addHeader(Constants.HTTP_HEADER_SECURITY_RAND, String.valueOf(rand))
|
- |
|
| 85 |
.build());
|
- |
|
| 86 |
|
- |
|
| 87 |
RequestOptions options = new RequestOptions()
|
- |
|
| 88 |
.diskCacheStrategy(DiskCacheStrategy.ALL);
|
- |
|
| 89 |
|
- |
|
| 90 |
Glide.with(mContext).load(url)
|
- |
|
| 91 |
.thumbnail()
|
- |
|
| Línea 92... |
Línea 59... |
| 92 |
.apply(options)
|
59 |
mHolder.mItem.setText(userProfileViewData.getLabelOrCompanyName());
|
| Línea 93... |
Línea 60... |
| 93 |
.into(mHolder.mImage);
|
60 |
ImageService.retrieve(mContext, userProfileViewData.getValueOrImage(), mHolder.mImage);
|
| 94 |
|
61 |
|