mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2025-02-17 03:14:23 +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);
|
mGridView.setOnTouchListener(this);
|
||||||
mIsSnackbarShown = false;
|
mIsSnackbarShown = false;
|
||||||
|
|
||||||
final String dirName = Utils.Companion.getFilename(mPath);
|
final String dirName = Utils.Companion.getFilename(this, mPath);
|
||||||
setTitle(dirName);
|
setTitle(dirName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,12 +21,13 @@ import java.util.*
|
||||||
|
|
||||||
class Utils {
|
class Utils {
|
||||||
companion object {
|
companion object {
|
||||||
fun getFilename(path: String) = path.substring(path.lastIndexOf("/") + 1)
|
fun getFilename(context: Context, path: String): String {
|
||||||
|
val humanized = context.humanizePath(path)
|
||||||
fun showToast(context: Context, resId: Int) {
|
return humanized.substring(humanized.lastIndexOf("/") + 1)
|
||||||
context.toast(resId)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun showToast(context: Context, resId: Int) = context.toast(resId)
|
||||||
|
|
||||||
fun getActionBarHeight(context: Context, res: Resources): Int {
|
fun getActionBarHeight(context: Context, res: Resources): Int {
|
||||||
val tv = TypedValue()
|
val tv = TypedValue()
|
||||||
var height = 0
|
var height = 0
|
||||||
|
|
|
@ -63,7 +63,7 @@ class GetDirectoriesAsynctask(val context: Context, val isPickVideo: Boolean, va
|
||||||
directory.mediaCnt = newImageCnt
|
directory.mediaCnt = newImageCnt
|
||||||
directory.addSize(file.length())
|
directory.addSize(file.length())
|
||||||
} else if (!mToBeDeleted.contains(parentDir)) {
|
} else if (!mToBeDeleted.contains(parentDir)) {
|
||||||
var dirName = Utils.getFilename(parentDir)
|
var dirName = Utils.getFilename(context, parentDir)
|
||||||
if (mConfig.getIsFolderHidden(parentDir)) {
|
if (mConfig.getIsFolderHidden(parentDir)) {
|
||||||
dirName += " ${context.resources.getString(R.string.hidden)}"
|
dirName += " ${context.resources.getString(R.string.hidden)}"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue