Skip to content

Commit

Permalink
Resolved conflictwq
Browse files Browse the repository at this point in the history
  • Loading branch information
harshad1 committed Nov 9, 2024
2 parents fdcde72 + 9ff073a commit 41f59fc
Show file tree
Hide file tree
Showing 10 changed files with 68 additions and 280 deletions.
1 change: 0 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ dependencies {
// UI libs
implementation 'com.github.Pixplicity:gene-rate:v1.1.8'
implementation 'com.github.AppIntro:AppIntro:6.2.0'
implementation 'com.github.kailash09dabhi:OmRecorder:1.1.5'
implementation 'com.github.mertakdut:EpubParser:1.0.95'
implementation 'com.github.martin-stone:hsv-alpha-color-picker-android:3.1.0'

Expand Down
1 change: 0 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.INSTALL_SHORTCUT" />
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />

<uses-permission
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import net.gsantner.markor.model.AppSettings;
import net.gsantner.markor.util.MarkorContextUtils;
import net.gsantner.opoc.format.GsTextUtils;
import net.gsantner.opoc.frontend.GsAudioRecordOmDialog;
import net.gsantner.opoc.frontend.filebrowser.GsFileBrowserOptions;
import net.gsantner.opoc.util.GsFileUtils;
import net.gsantner.opoc.wrapper.GsCallback;
Expand Down Expand Up @@ -99,7 +98,6 @@ public static void showInsertImageOrLinkDialog(
final Button buttonPictureGallery = view.findViewById(R.id.ui__select_path_dialog__gallery_picture);
final Button buttonPictureCamera = view.findViewById(R.id.ui__select_path_dialog__camera_picture);
final Button buttonPictureEdit = view.findViewById(R.id.ui__select_path_dialog__edit_picture);
final Button buttonAudioRecord = view.findViewById(R.id.ui__select_path_dialog__record_audio);

// Extract filepath if using Markdown
if (textFormatId == FormatRegistry.FORMAT_MARKDOWN) {
Expand Down Expand Up @@ -135,11 +133,6 @@ public static void showInsertImageOrLinkDialog(
dialog.setTitle(R.string.insert_image);
browseType = InsertType.IMAGE_BROWSE;
okType = InsertType.IMAGE_DIALOG;
} else if (action == AUDIO_ACTION) {
dialog.setTitle(R.string.audio);
buttonAudioRecord.setVisibility(View.VISIBLE);
browseType = InsertType.AUDIO_BROWSE;
okType = InsertType.AUDIO_DIALOG;
} else {
dialog.setTitle(R.string.insert_link);
buttonSelectSpecial.setVisibility(View.VISIBLE);
Expand All @@ -155,7 +148,6 @@ public static void showInsertImageOrLinkDialog(
buttonSearch.setOnClickListener(v -> _insertItem.callback(InsertType.LINK_SEARCH));
buttonPictureCamera.setOnClickListener(b -> _insertItem.callback(InsertType.IMAGE_CAMERA));
buttonPictureGallery.setOnClickListener(v -> _insertItem.callback(InsertType.IMAGE_GALLERY));
buttonAudioRecord.setOnClickListener(v -> _insertItem.callback(InsertType.AUDIO_RECORDING));
buttonPictureEdit.setOnClickListener(v -> _insertItem.callback(InsertType.IMAGE_EDIT));

dialog.show();
Expand Down Expand Up @@ -368,7 +360,7 @@ private static void insertItem(
if (GsTextUtils.isNullOrEmpty(nameEdit.getText())) {
nameEdit.setText(pathEdit.getText());
}
} else {
} else {
if (pathEdit != null) {
pathEdit.setText(GsFileUtils.relativePath(currentFile, file));
}
Expand Down Expand Up @@ -408,7 +400,7 @@ private static void insertItem(
}
case AUDIO_RECORDING: {
if (!cu.requestAudioRecording(activity, insertFileLink)) {
GsAudioRecordOmDialog.showAudioRecordDialog(activity, R.string.record_audio, insertFileLink);
// noop, OM library is outdated and so voice recording feature removed
}
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ private boolean runHighlight(final boolean recompute) {
private void updateHighlighting() {
if (runHighlight(false)) {
// Do not batch as we do not want to reflow
_hl.clearDynamic().applyDynamic(hlRegion());
_hl.clearDynamic().applyDynamic(hlRegion());
_oldHlRect.set(_hlRect);
}
}
Expand Down Expand Up @@ -704,7 +704,12 @@ public void draw(final Canvas canvas) {
final int count = layout.getLineCount();
final int offsetY = _editor.getPaddingTop();
for (; i < count; i++) {
final int start = layout.getLineStart(i);
int start;
try {
start = layout.getLineStart(i);
} catch (IndexOutOfBoundsException ex) {
break; // Even though the drawing is against count, might throw IndexOutOfBounds during drawing
}
if (start == 0 || text.charAt(start - 1) == '\n') {
final int y = layout.getLineBaseline(i);
if (y > _lineNumbersArea.bottom) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ public SyntaxHighlighterBase applyStatic() {

boolean hasStatic = false;
for (final SpanGroup group : _groups) {
if (group.isStatic) {
if (group != null && group.isStatic) {
hasStatic = true;
_spannable.setSpan(group.span, group.start, group.end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@ public Map<File, File> getVirtualFolders() {
}

for (final File file : ContextCompat.getExternalFilesDirs(_context, null)) {
//noinspection DataFlowIssue
if (file == null || file.getParentFile() == null) {
continue;
}
final File remap = new File(VIRTUAL_STORAGE_ROOT, "AppData (" + file.getParentFile().toString().replace("/", "-").substring(1) + ")");
map.put(remap, file);
}
Expand Down Expand Up @@ -615,6 +617,12 @@ public void onLayoutChange(View v, int l, int t, int r, int b, int ol, int ot, i
});
}

private void postScrollToAndFlash(final File file) {
if (_recyclerView != null && file != null) {
_recyclerView.post(() -> scrollToAndFlash(file));
}
}

/**
* Scroll to a file in current folder and flash
*
Expand Down Expand Up @@ -675,6 +683,11 @@ private void loadFolder(final File folder, final File show) {

// This function is not called on the main thread, so post to the UI thread
private synchronized void _loadFolder(final @NonNull File folder, final @Nullable File toShow) {

if (_recyclerView == null) {
return;
}

final boolean folderChanged = !folder.equals(_currentFolder);
final List<File> newData = new ArrayList<>();

Expand All @@ -696,7 +709,6 @@ private synchronized void _loadFolder(final @NonNull File folder, final @Nullabl
newData.add(new File(folder, "0"));
}


if (folder.equals(VIRTUAL_STORAGE_RECENTS)) {
newData.addAll(_dopt.recentFiles);
} else if (folder.equals(VIRTUAL_STORAGE_POPULAR)) {
Expand Down Expand Up @@ -762,18 +774,18 @@ private synchronized void _loadFolder(final @NonNull File folder, final @Nullabl
_layoutManager.onRestoreInstanceState(_folderScrollMap.remove(_currentFolder));
}

_recyclerView.post(() -> scrollToAndFlash(toShow));
postScrollToAndFlash(toShow);
});
} else {
_recyclerView.post(() -> scrollToAndFlash(toShow));
postScrollToAndFlash(toShow);
}

if (_dopt.listener != null) {
_dopt.listener.onFsViewerDoUiUpdate(GsFileBrowserListAdapter.this);
}
});
} else {
_recyclerView.post(() -> scrollToAndFlash(toShow));
postScrollToAndFlash(toShow);
}
}

Expand Down
Loading

0 comments on commit 41f59fc

Please sign in to comment.