use of com.kiminonawa.mydiary.entries.DiaryActivity in project MyDiary by erttyy8821.
the class DiaryViewerDialogFragment method onViewCreated.
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
callback = (DiaryViewerCallback) getTargetFragment();
diaryId = getArguments().getLong("diaryId", -1L);
if (diaryId != -1) {
if (isEditMode) {
diaryViewerHandler = new DiaryViewerHandler(this);
diaryFileManager = new FileManager(getActivity(), FileManager.DIARY_EDIT_CACHE_DIR);
diaryFileManager.clearDir();
PB_diary_item_content_hint.setVisibility(View.VISIBLE);
mTask = new CopyDiaryToEditCacheTask(getActivity(), diaryFileManager, this);
//Make ths ProgressBar show 0.7s+.
loadDiaryHandler = new Handler();
initHandlerOrTaskIsRunning = true;
loadDiaryHandler.postDelayed(new Runnable() {
@Override
public void run() {
//Copy the file into editCash
mTask.execute(((DiaryActivity) getActivity()).getTopicId(), diaryId);
}
}, 700);
} else {
diaryFileManager = new FileManager(getActivity(), ((DiaryActivity) getActivity()).getTopicId(), diaryId);
initData();
}
}
}
Aggregations