Internal storage display method in file manager
Technical Field
The invention relates to the technical field of intelligent terminal memory display, in particular to an internal storage display method in a file manager.
Background
Nowadays, a mobile phone is not only a communication device, but under the trend of an intelligent system, the mobile phone becomes an intelligent mobile terminal of multimedia, and people like to play a microblog on the mobile phone and watch a webpage; people like listening to songs, taking pictures and playing games; some people use a mobile phone to schedule and work, and the like. This results in a very large system with many files and folders, and it is very difficult for us to find some files or folders in the file manager that need but do not know the name. The most used files at ordinary times include Bluetooth transmission files, picture files, downloaded files, video files and music files, and other system files and application installation files are basically not used and are not used for settlement. Based on this need, we have changed the display of the internal storage device root directory.
Disclosure of Invention
In view of the above-mentioned shortcomings in the art, the present invention provides a method for displaying internal storage in a file manager by changing the display of an internal storage root directory.
In order to achieve the above object, the present invention provides an internal storage display method in a file manager, comprising the following steps:
confirming a folder name to be displayed in a file manager;
creating an array system DefaultPath to judge whether the folder name is corresponding to the folder name to be displayed;
entering the internal storage of a file manager to acquire all file information of the root directory;
judging whether the file or folder information in the root directory is matched with a certain folder in the system DefaultPath array;
if the files or the folders are matched, adding the files or the folders into displayed folders, and displaying the files or the folders;
if the data information is not matched with the data information, the display operation is not carried out, the data information is hidden as a non-default file or folder, and the corresponding data information is counted;
creating a virtual folder according to the statistical information, and displaying the internal file quantity, the creation time and the modification time obtained through statistics;
clicking the virtual folder, and displaying the files and folders which are hidden as non-default before.
The real file of the system is stored in a root directory of the file manager in a KbxLocalFile type mode, and when whether the real file is matched with a certain folder in a systemDefaultPath array is confirmed, whether the following files or information of the folders are matched is judged:
private java.lang.string mFilePath; // file path;
private com.kanbox.filemgr.kbxlcacalfile.filetype mFileType; // file type;
private long mFileSize; // file size;
private long mLastModifyTime; // file last modified time;
private long mCreateTime; // time of creation of file;
private java.lang.string mappnname; // file name;
private java.lang.string mshownname; // file display name;
private int mSubfileCount; // how many files inside the folder;
private coolean m IsFolder; // is a folder.
The method comprises the steps of judging whether the file name of an incoming file list is matched with one folder in a systemDefaultPath array or not, if so, adding file information into the file list of the folders in the systemDefaultPath array, if not, recording the number of the lists of the systemDefaultPath, the size of a file, the last modification time of the file and the creation time of the file, and when the last folder in the incoming file list is transmitted, counting the number of the files to create a virtual folder, adding the data into the incoming file list, and displaying the data in the incoming file list, wherein only the folder corresponding to the file name of the incoming file list is arranged below a root folder.
When the virtual folder is clicked, setting the systemFolder to false, simultaneously entering a root file path, obtaining a root file data list, and distinguishing whether the content of the system folder or the content of the six folders is displayed by judging whether the systemFolder is false; when the systemFolder is false, judging whether the file name of the file list of the virtual folder is the same as one of systemDefaultPath, if so, not adding the file information into the file list of the virtual folder, and if not, adding the file information into the file list of the virtual folder for displaying;
the systemFolder is defined as a flag bit, and is true if the incoming is a root file and false if the incoming is a system folder.
Wherein, the folder names confirmed to be displayed in the file manager include a bluetooth folder, a photo folder, a download folder, a video folder, a music folder, and a system folder.
The specific way of creating the array system DefaultPath is as follows:
private static final String[]systemDefaultPath = {
"bluetooth","DCIM",
"Download","Movies",
"Music","System"}。
system defaultpath is the default folder path for the system;
the systemFolder is a flag bit of a system folder;
KbxLocalFile is a mapping of the virtual local file.
The invention has the beneficial effects that:
compared with the prior art, the internal storage display method in the file manager has the advantages that the effect of the file manager is only the display effect is changed, and the path of the file is not effectively modified, so that only the display effect is changed when the requirement is selected to be realized, and the path of the file is not directly modified. The internal storage only displays the folder names to be displayed corresponding to the array system DefaultPath, so that all files can be displayed on one page, and the file display method is clear at a glance and can meet the requirement of a user for quickly searching the files. The display is only convenient for the user and does not change any file path. When the internal storage is connected to other devices, all folders are normally displayed.
Drawings
FIG. 1 is a flow chart illustrating an internal storage display method in a document manager according to the present invention.
Detailed Description
In order to more clearly describe the present invention, the present invention will be further described with reference to the accompanying drawings.
Since the effect of the file manager is only to change the display effect and no effective path for modifying the file is performed, the effect of the display can only be changed when the requirement is selected to be achieved, and the path of the file cannot be directly modified. The display files of the file manager can be known by observing the codes to obtain corresponding lists of files to be displayed and folders by screening the information of the converted files, so that the files to be displayed and the folders are required to be displayed.
Referring to fig. 1, the internal storage display method in a file manager of the present invention includes the following implementation steps:
confirming a folder name to be displayed in a file manager;
creating an array system DefaultPath to judge whether the folder name is corresponding to the folder name to be displayed;
entering the internal storage of a file manager to acquire all file information of the root directory;
judging whether the file or folder information in the root directory is matched with a certain folder in the system DefaultPath array;
if the files or the folders are matched, adding the files or the folders into displayed folders, and displaying the files or the folders;
if the data information is not matched with the data information, the display operation is not carried out, the data information is hidden as a non-default file or folder, and the corresponding data information is counted;
creating a virtual folder according to the statistical information, and displaying the internal file quantity, the creation time and the modification time obtained through statistics;
clicking the virtual folder, and displaying the files and folders which are hidden as non-default before.
The data of the folder list of the system is displayed by a function of acquiring each row of data through a file category list adapter, but the total data of the file category list adapter is the total data of the current path acquired by the function of acquiring the file category list adapter of the file management core, but not all the total data are displayed, and the file list and the file information thereof are displayed by selecting and converting file information; and adding the file into a display file list.
system defaultpath is the default folder path for the system;
the systemFolder is a flag bit of a system folder;
KbxLocalFile is a mapping of the virtual local file.
Compared with the prior art, the internal storage display method in the file manager has the advantages that the effect of the file manager is only the display effect is changed, and the path of the file is not effectively modified, so that only the display effect is changed when the requirement is selected to be realized, and the path of the file is not directly modified. The internal storage only displays the folder names to be displayed corresponding to the array system DefaultPath, so that all files can be displayed on one page, and the file display method is clear at a glance and can meet the requirement of a user for quickly searching the files. The display is only convenient for the user and does not change any file path. When the internal storage is connected to other devices, all folders are normally displayed.
In this embodiment, the real file of the system is stored in the root directory of the file manager in a form of a KbxLocalFile class, and when it is determined whether the real file matches with a certain folder in the system defaultpath array, it is determined whether the following files or folders have matching information:
private java.lang.string mFilePath; // file path;
private com.kanbox.filemgr.kbxlcacalfile.filetype mFileType; // file type;
private long mFileSize; // file size;
private long mLastModifyTime; // file last modified time;
private long mCreateTime; // time of creation of file;
private java.lang.string mappnname; // file name;
private java.lang.string mshownname; // file display name;
private int mSubfileCount; // how many files inside the folder;
private coolean m IsFolder; // is a folder.
In this embodiment, by determining whether the file name of the incoming file list matches one folder in the embodiment in the systemDefaultPath array, if so, the file information is added to the file list of the folder in the systemDefaultPath array, if not, the list number of the systemDefaultPath, the file size, the file last modification time and the file creation time which are not so recorded, and when the last file in the incoming file list is transmitted, the number which is not so recorded is counted to create a virtual folder, and the data is added and displayed in the incoming file list, and only the corresponding desired folder is located under the root folder.
In this embodiment, when a virtual folder is clicked, the systemFolder is set to false, a root file path is entered at the same time, a root file data list is obtained, and whether the content of the system folder is displayed or the contents of the six folders are distinguished by judging whether the systemFolder is false; when the system folder is false, judging whether the file name of the file list of the virtual folder is the same as that of the system DefaultPath in the embodiment, if so, not adding the file information into the file list of the virtual folder, and if not, adding the file information into the file list of the virtual folder for displaying;
the systemFolder is defined as a flag bit, and is true if the incoming is a root file and false if the incoming is a system folder.
In the present embodiment, it is confirmed in the file manager that the folder names to be displayed include a bluetooth folder, a photo folder, a download folder, a video folder, a music folder, and a system folder.
In this embodiment, the specific way to create the array system defaultpath is as follows:
private static final String[]systemDefaultPath = {
"bluetooth","DCIM",
"Download","Movies",
"Music","System"}。
the above disclosure is only for a few specific embodiments of the present invention, but the present invention is not limited thereto, and any variations that can be made by those skilled in the art are intended to fall within the scope of the present invention.