微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 手机设计讨论 > MTK手机平台交流 > 当文件夹路径从n层按back键退回到n-19层的时候,...

当文件夹路径从n层按back键退回到n-19层的时候,...

时间:10-02 整理:3721RD 点击:
[DESCRIPTION]
当文件夹路径从n层按back键退回到n-19层的时候,file manager自动退出,比如在63层按back 键退回到44层的时候,file manager自动退出。
[SOLUTION]
1.FileManager默认设计, FileManager种只记录最多20条操作路径的记录, 如果超出就会把最早加入的记录删除. 贵司
可以参考alps/mediatek/packages/apps/FileManager/src/com/mediatek/filemanager/FileInfoManager.java中这部
分的代码.
/** Max history size */
private static final int MAX_LIST_SIZE = 20;
private final List<NavigationRecord> mNavigationList = new LinkedList<NavigationRecord>();
/**
* This method gets the previous navigation directory path
*
* @return the previous navigation path
*/
protected NavigationRecord getPrevNavigation() {
while (!mNavigationList.isEmpty()) {
NavigationRecord navRecord = mNavigationList.get(mNavigationList.size() - 1);
removeFROMNavigationList();
String path = navRecord.getRecordPath();
if (!TextUtils.isEmpty(path)) {
if (new File(path).exists() || MountPointManager.getInstance().isrootPath(path)) {
return navRecord;
}
}
}
return null;
}
/**
* This method adds a navigationRecord to the navigation history
*
* @param navigationRecord the Record
*/
protected void addToNavigationList(NavigationRecord navigationRecord) {
if (mNavigationList.size() <= MAX_LIST_SIZE) {
mNavigationList.add(navigationRecord);
} else {
mNavigationList.remove(0);
mNavigationList.add(navigationRecord);
}
}
/**
* This method removes a directory path from the navigation history
*/
protected void removeFromNavigationList() {
if (!mNavigationList.isEmpty()) {
mNavigationList.remove(mNavigationList.size() - 1);
}
}
2.对于20条操作路径的history record, 贵司可以修改,只需要把FileInfo.Manager.java中的MAX_LIST_SIZE设为需要
的最大路径记录数。这样修改带来的影响是,file manager APK可能会用到更多的内存,因为List<NavigationRecord>
mNavigationList需要记录更多的路径数。
alps/mediatek/packages/apps/FileManager/src/com/mediatek/filemanager/FileInfoManager.java中这部分的代码

/** Max history size */
private static final int MAX_LIST_SIZE = xxx;

谢谢分享

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top