Ejemplo n.º 1
0
 // 加载视频列表,update--是自动加载还是手动刷新
 private void initVideoList(boolean update) {
   String videoFolderPath = Utils.getWeiXinVideoPath();
   File file_VideoFolderPath = new File(videoFolderPath);
   ArrayList<File> videoPath_Found = new ArrayList<>();
   if (file_VideoFolderPath.exists()) {
     File[] files = file_VideoFolderPath.listFiles();
     if (files.length > 0) {
       for (File file1 : files) {
         if (file1.isDirectory() && file1.getName().length() == 32 && file1.canRead()) {
           File file = new File(file1.getAbsolutePath() + "/video");
           if (file.exists() && file.isDirectory() && file.canRead()) {
             videoPath_Found.add(file);
           }
         }
       }
     }
   }
   if (videoPath_Found.size() == 0) {
     SnackBarToast.showDefaultSnackBarToast_Short(
         mListView, getString(R.string.Video_Folder_NoFound));
     return;
   }
   new ListVideoThread(
           getActivity(), mVideoListHandler, videoPath_Found, Utils.MSG_ARG_ALL_VIDEO, update)
       .start();
 }
Ejemplo n.º 2
0
 @Override
 public void saveSelected() {
   if (getSelectedVideo().size() == 0) {
     SnackBarToast.showDefaultSnackBarToast_Short(
         mListView, getString(R.string.Please_Select_Output_Video));
     return;
   }
   new SaveVideoThread(getSelectedVideo(), CApplication.getMainHandler()).start();
 }
Ejemplo n.º 3
0
 @Override
 public void handleMessage(Message msg, AllVideo_Fragment allVideo_fragment) {
   if (msg.arg1 == Utils.MSG_ARG_ALL_VIDEO) {
     allVideo_fragment.mVideoInfoList =
         GetVideoInfoListFromMsg.getVideoInfoListFromMsg(msg, Utils.MSG_CONTENT_VIDEO_INFO_LIST);
     allVideo_fragment.mListView.setAdapter(
         new AllVideoAdapter(
             allVideo_fragment.getActivity(),
             allVideo_fragment.mVideoInfoList,
             Utils.MSG_ARG_ALL_VIDEO));
     allVideo_fragment.updateTitle();
     if (msg.getData().getBoolean(Utils.MSG_IS_UPDATE)) {
       SnackBarToast.showDefaultSnackBarToast_Short(
           allVideo_fragment.mListView,
           allVideo_fragment.getString(R.string.Update_VideoList_Successed));
     }
   }
 }