add icons for progress tiles
This commit is contained in:
parent
1421dca35f
commit
f23ae091cc
|
@ -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");
|
||||
|
|
|
@ -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));
|
||||
|
||||
|
|
|
@ -196,11 +196,22 @@ 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();
|
||||
}
|
||||
|
||||
|
||||
public static boolean isDownloadDirectoryAvailble(Context context) {
|
||||
return isDirectoryAvailble(NewPipeSettings.getVideoDownloadPath(context));
|
||||
}
|
||||
|
@ -213,14 +224,6 @@ public class Utility
|
|||
i.putExtra(FilePickerActivity.EXTRA_MODE, AbstractFilePickerFragment.MODE_DIR);
|
||||
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);
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 28 KiB |
Binary file not shown.
After Width: | Height: | Size: 23 KiB |
Loading…
Reference in New Issue