Ejemplo n.º 1
0
    @Override
    public void onLongPress(MotionEvent event) {
      if (!QuranFileUtils.haveAyaPositionFile(getActivity())
          || !QuranFileUtils.hasArabicSearchDatabase(getActivity())) {
        Activity activity = getActivity();
        if (activity != null) {
          PagerActivity pagerActivity = (PagerActivity) activity;
          pagerActivity.showGetRequiredFilesDialog();
          return;
        }
      }

      if (mCoordinateData == null) {
        mCurrentTask = new QueryAyahCoordsTask(event).execute();
      } else {
        handleLongPress(event);
      }
    }
Ejemplo n.º 2
0
 private boolean checkCoordinateData(MotionEvent event, EventType eventType) {
   // Check files downloaded
   if (!QuranFileUtils.haveAyaPositionFile(getActivity())
       || !QuranFileUtils.hasArabicSearchDatabase(getActivity())) {
     Activity activity = getActivity();
     if (activity != null) {
       PagerActivity pagerActivity = (PagerActivity) activity;
       pagerActivity.showGetRequiredFilesDialog();
       return false;
     }
   }
   // Check we fetched the data
   if (mCoordinatesData == null) {
     mCurrentTask = new GetAyahCoordsTask(getActivity(), event, eventType).execute(pageNumber);
     return false;
   }
   // All good
   return true;
 }