diff --git a/app/build.gradle b/app/build.gradle index a910adea2..11d1f4dee 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -23,4 +23,5 @@ dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.1.1' + compile 'com.github.bumptech.glide:glide:3.7.0' } diff --git a/app/src/main/java/gallery/simplemobiletools/com/DirectoryAdapter.java b/app/src/main/java/gallery/simplemobiletools/com/DirectoryAdapter.java index 67322cbf8..9f241f94e 100644 --- a/app/src/main/java/gallery/simplemobiletools/com/DirectoryAdapter.java +++ b/app/src/main/java/gallery/simplemobiletools/com/DirectoryAdapter.java @@ -5,15 +5,20 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; +import android.widget.ImageView; import android.widget.TextView; +import com.bumptech.glide.Glide; + import java.util.List; public class DirectoryAdapter extends BaseAdapter { + private final Context context; private final List dirs; private final LayoutInflater inflater; public DirectoryAdapter(Context context, List dirs) { + this.context = context; this.dirs = dirs; this.inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); } @@ -32,6 +37,7 @@ public class DirectoryAdapter extends BaseAdapter { Directory dir = dirs.get(position); holder.dirName.setText(dir.getName()); holder.photoCnt.setText(String.valueOf(dir.getPhotoCnt())); + Glide.with(context).load(dir.getThumbnail()).centerCrop().crossFade().into(holder.dirThumbnail); return view; } @@ -54,10 +60,12 @@ public class DirectoryAdapter extends BaseAdapter { static class ViewHolder { TextView dirName; TextView photoCnt; + ImageView dirThumbnail; public ViewHolder(View view) { dirName = (TextView) view.findViewById(R.id.dir_name); photoCnt = (TextView) view.findViewById(R.id.photo_cnt); + dirThumbnail = (ImageView) view.findViewById(R.id.dir_thumbnail); } } } diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 729fd3ca3..d0eb062f9 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -10,9 +10,9 @@ android:layout_height="wrap_content" android:background="@android:color/black" android:columnWidth="@dimen/photo_size" - android:horizontalSpacing="1dp" + android:horizontalSpacing="2dp" android:numColumns="auto_fit" android:stretchMode="columnWidth" - android:verticalSpacing="1dp"/> + android:verticalSpacing="2dp"/> diff --git a/app/src/main/res/layout/photo_item.xml b/app/src/main/res/layout/photo_item.xml index 78a038662..c522a2ce9 100644 --- a/app/src/main/res/layout/photo_item.xml +++ b/app/src/main/res/layout/photo_item.xml @@ -5,7 +5,7 @@ android:layout_height="match_parent"> @@ -14,7 +14,7 @@ android:layout_width="match_parent" android:layout_height="50dp" android:layout_alignParentBottom="true" - android:background="#44444444" + android:background="#55000000" android:paddingBottom="4dp" android:paddingLeft="8dp" android:paddingRight="8dp"