add icons for progress tiles

This commit is contained in:
Christian Schabesberger 2016-05-25 23:35:27 +02:00
parent 1421dca35f
commit f23ae091cc
5 changed files with 14 additions and 10 deletions

View File

@ -97,6 +97,7 @@ public class MainActivity extends AppCompatActivity implements AdapterView.OnIte
try {
//noinspection ConstantConditions
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
} catch(Exception e) {
Log.d(TAG, "Could not get SupportActionBar");

View File

@ -95,7 +95,7 @@ public class MissionAdapter extends RecyclerView.Adapter<MissionAdapter.ViewHold
Utility.FileType type = Utility.getFileType(ms.name);
//h.icon.setImageResource(Utility.getIconForFileType(type));
h.icon.setImageResource(Utility.getIconForFileType(type));
h.name.setText(ms.name);
h.size.setText(Utility.formatBytes(ms.length));

View File

@ -196,6 +196,17 @@ public class Utility
}
}
public static int getIconForFileType(FileType type) {
switch(type) {
case MUSIC:
return R.drawable.music;
case VIDEO:
return R.drawable.video;
default:
return R.drawable.video;
}
}
public static boolean isDirectoryAvailble(String path) {
File dir = new File(path);
return dir.exists() && dir.isDirectory();
@ -214,14 +225,6 @@ public class Utility
activity.startActivityForResult(i, 233);
}
public static void checkAndReshow(Activity activity){
if (!isDownloadDirectoryAvailble(activity)){
Toast.makeText(activity.getApplicationContext(),
R.string.no_available_dir, Toast.LENGTH_LONG).show();
showDirectoryChooser(activity);
}
}
public static void copyToClipboard(Context context, String str) {
ClipboardManager cm = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
cm.setPrimaryClip(ClipData.newPlainText("text", str));

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB