-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change env install, add feature : search text
- Loading branch information
1 parent
e9dc699
commit ae452f8
Showing
113 changed files
with
338 additions
and
203 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file renamed
BIN
+36.1 MB
app/src/main/resources/lib/arm64-v8a/node → app/src/main/assets/env.tar.xz
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
app/src/main/java/com/pangbai/weblog/editor/SearchHandle.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package com.pangbai.weblog.editor; | ||
|
||
import android.content.Context; | ||
import android.view.View; | ||
|
||
import com.google.android.material.snackbar.Snackbar; | ||
import com.pangbai.weblog.R; | ||
import com.pangbai.weblog.databinding.EditorSearcherBinding; | ||
import com.pangbai.weblog.tool.DialogUtils; | ||
|
||
import io.github.rosemoe.sora.widget.EditorSearcher; | ||
|
||
public class SearchHandle implements View.OnClickListener { | ||
EditorSearcherBinding binding; | ||
EditorSearcher searcher; | ||
|
||
public SearchHandle( EditorSearcher searcher){ | ||
this.searcher=searcher; | ||
} | ||
public void bind( EditorSearcherBinding binding){ | ||
this.binding=binding; | ||
binding.searchNext.setOnClickListener(this); | ||
binding.searchPrevious.setOnClickListener(this); | ||
binding.searchReplace.setOnClickListener(this); | ||
binding.searchClose.setOnClickListener(this); | ||
|
||
} | ||
|
||
|
||
@Override | ||
public void onClick(View v) { | ||
if (v==binding.searchPrevious){ | ||
searcher.gotoPrevious(); | ||
} else if (v==binding.searchNext) { | ||
searcher.gotoNext(); | ||
} else if (v==binding.searchClose) { | ||
stopSearch(); | ||
} else if (v==binding.searchReplace) { | ||
Context context=binding.getRoot().getContext(); | ||
DialogUtils.showInputDialog(context, context.getString(R.string.search_replace),userInput -> { | ||
if (userInput==null) | ||
userInput=""; | ||
searcher.replaceAll(userInput, () -> { | ||
Snackbar.make(binding.getRoot(),"Replacement successful",Snackbar.LENGTH_SHORT).show(); | ||
}); | ||
}); | ||
|
||
} | ||
} | ||
|
||
public void stopSearch(){ | ||
binding.getRoot().setVisibility(View.GONE); | ||
if (searcher.hasQuery()) | ||
searcher.stopSearch(); | ||
} | ||
public boolean isSearching(){ | ||
return searcher.hasQuery(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.