mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-22 20:48:00 +01:00
display proper directory names at storage root folders
This commit is contained in:
parent
4d324e491e
commit
09231c516c
3 changed files with 7 additions and 6 deletions
|
@ -127,7 +127,7 @@ public class MediaActivity extends SimpleActivity
|
|||
mGridView.setOnTouchListener(this);
|
||||
mIsSnackbarShown = false;
|
||||
|
||||
final String dirName = Utils.Companion.getFilename(mPath);
|
||||
final String dirName = Utils.Companion.getFilename(this, mPath);
|
||||
setTitle(dirName);
|
||||
}
|
||||
|
||||
|
|
|
@ -21,12 +21,13 @@ import java.util.*
|
|||
|
||||
class Utils {
|
||||
companion object {
|
||||
fun getFilename(path: String) = path.substring(path.lastIndexOf("/") + 1)
|
||||
|
||||
fun showToast(context: Context, resId: Int) {
|
||||
context.toast(resId)
|
||||
fun getFilename(context: Context, path: String): String {
|
||||
val humanized = context.humanizePath(path)
|
||||
return humanized.substring(humanized.lastIndexOf("/") + 1)
|
||||
}
|
||||
|
||||
fun showToast(context: Context, resId: Int) = context.toast(resId)
|
||||
|
||||
fun getActionBarHeight(context: Context, res: Resources): Int {
|
||||
val tv = TypedValue()
|
||||
var height = 0
|
||||
|
|
|
@ -63,7 +63,7 @@ class GetDirectoriesAsynctask(val context: Context, val isPickVideo: Boolean, va
|
|||
directory.mediaCnt = newImageCnt
|
||||
directory.addSize(file.length())
|
||||
} else if (!mToBeDeleted.contains(parentDir)) {
|
||||
var dirName = Utils.getFilename(parentDir)
|
||||
var dirName = Utils.getFilename(context, parentDir)
|
||||
if (mConfig.getIsFolderHidden(parentDir)) {
|
||||
dirName += " ${context.resources.getString(R.string.hidden)}"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue