Skip to content

Commit

Permalink
remove log statements
Browse files Browse the repository at this point in the history
  • Loading branch information
Okuro3499 committed Nov 24, 2023
1 parent f7f5b4a commit d0d0ba8
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.util.Log;

import androidx.core.app.NotificationCompat;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
Expand Down Expand Up @@ -65,7 +64,6 @@ protected void onHandleIntent(Intent intent) {
Notification noti = notificationBuilder.setSmallIcon(R.mipmap.ic_launcher).setContentTitle("OLE Download").setContentText("Downloading File...").setAutoCancel(true).build();
notificationManager.notify(0, noti);
urls = intent.getStringArrayListExtra("urls");
Log.d("urls", String.valueOf(urls));
realmConfig();
for (int i = 0; i < urls.size(); i++) {
url = urls.get(i);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import static org.ole.planet.myplanet.MainApplication.context;

import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand Down Expand Up @@ -41,6 +40,7 @@
import io.noties.markwon.MarkwonPlugin;
import io.noties.markwon.image.ImagesPlugin;
import io.noties.markwon.image.file.FileSchemeHandler;
import io.noties.markwon.movement.MovementMethodPlugin;
import io.realm.Case;
import io.realm.Realm;
import io.realm.RealmResults;
Expand All @@ -55,6 +55,7 @@ public class CourseStepFragment extends BaseContainerFragment implements CameraU
List<RealmStepExam> stepExams;
RealmUserModel user;
int stepNumber;
private Markwon markwon;

public CourseStepFragment() {
}
Expand All @@ -67,6 +68,18 @@ public void onCreate(@Nullable Bundle savedInstanceState) {
stepNumber = getArguments().getInt("stepNumber");
}
setUserVisibleHint(false);
markwon = Markwon.builder(context)
.usePlugin(ImagesPlugin.create())
.usePlugin(MovementMethodPlugin.none())
.usePlugin(new AbstractMarkwonPlugin() {
@Override
public void configure(@NonNull MarkwonPlugin.Registry registry) {
registry.require(ImagesPlugin.class, imagesPlugin ->
imagesPlugin.addSchemeHandler(FileSchemeHandler.create())
);
}
})
.build();
}

@Override
Expand Down Expand Up @@ -121,19 +134,7 @@ public void onActivityCreated(@Nullable Bundle savedInstanceState) {
hideTestIfNoQuestion();
fragmentCourseStepBinding.tvTitle.setText(step.getStepTitle());
String markdownContentWithLocalPaths = prependBaseUrlToImages(step.getDescription(), "file://" + MainApplication.context.getExternalFilesDir(null) + "/ole/");
Markwon markwon = Markwon.builder(context)
.usePlugin(ImagesPlugin.create())
.usePlugin(new AbstractMarkwonPlugin() {
@Override
public void configure(@NonNull MarkwonPlugin.Registry registry) {
registry.require(ImagesPlugin.class, imagesPlugin ->
imagesPlugin.addSchemeHandler(FileSchemeHandler.create())
);
}
})
.build();
markwon.setMarkdown(fragmentCourseStepBinding.description, markdownContentWithLocalPaths);
Log.d("markdownContent", markdownContentWithLocalPaths);
if (!RealmMyCourse.isMyCourse(user.getId(), step.getCourseId(), mRealm)) {
fragmentCourseStepBinding.btnTakeTest.setVisibility(View.INVISIBLE);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ public static ProgressDialog getProgressDialog(final Context context) {
prgDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
prgDialog.setCancelable(false);
prgDialog.setButton(DialogInterface.BUTTON_POSITIVE, context.getString(R.string.finish), (dialogInterface, i) -> prgDialog.dismiss());
prgDialog.setButton(DialogInterface.BUTTON_NEGATIVE, context.getString(R.string.stop_download),
(dialogInterface, i) -> context.stopService(new Intent(context, MyDownloadService.class)));
prgDialog.setButton(DialogInterface.BUTTON_NEGATIVE, context.getString(R.string.stop_download), (dialogInterface, i) -> context.stopService(new Intent(context, MyDownloadService.class)));
return prgDialog;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ public static File getSDPathFromUrl(String url) {
}

public static boolean checkFileExist(String url) {
Log.d("", getFileNameFromUrl(url));
if (url == null || url.isEmpty()) return false;
File f = createFilePath(SD_PATH + "/" + getIdFromUrl(url), getFileNameFromUrl(url));
return f.exists();
Expand Down

0 comments on commit d0d0ba8

Please sign in to comment.