Skip to content

Commit

Permalink
fixed image not visible in top card issue(commons-app#2354) (commons-…
Browse files Browse the repository at this point in the history
…app#2355)

* fixed image not visible in top card issue(commons-app#2354)

* some minor changes
  • Loading branch information
cypherop authored and maskaravivek committed Jan 27, 2019
1 parent f23cf3e commit e82e3b9
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package fr.free.nrw.commons.upload;

import android.net.Uri;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand All @@ -8,6 +9,8 @@
import com.facebook.drawee.view.SimpleDraweeView;
import com.pedrogomez.renderers.Renderer;

import java.io.File;

import fr.free.nrw.commons.R;

class UploadThumbnailRenderer extends Renderer<UploadModel.UploadItem> {
Expand Down Expand Up @@ -40,7 +43,8 @@ protected void hookListeners(View rootView) {
@Override
public void render() {
UploadModel.UploadItem content = getContent();
background.setImageURI(content.mediaUri);
Uri uri = Uri.parse(content.mediaUri.toString());
background.setImageURI(Uri.fromFile(new File(String.valueOf(uri))));
background.setAlpha(content.selected ? 1.0f : 0.5f);
space.setVisibility(content.first ? View.VISIBLE : View.GONE);
error.setVisibility(content.visited && content.error ? View.VISIBLE : View.GONE);
Expand Down

0 comments on commit e82e3b9

Please sign in to comment.