Skip to content

Commit c311358

Browse files
committed
🎨 Supports append text by shortcuts to the dailynote doc on Android siyuan-note/siyuan#14414
1 parent f863f71 commit c311358

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

app/src/main/java/org/b3log/siyuan/ShortcutActivity.java

+6-3
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import androidx.annotation.Nullable;
2828
import androidx.appcompat.app.AppCompatActivity;
2929

30+
import com.blankj.utilcode.util.KeyboardUtils;
3031
import com.blankj.utilcode.util.StringUtils;
3132

3233
import org.apache.commons.io.FileUtils;
@@ -58,7 +59,6 @@ public void onNewIntent(final Intent intent) {
5859
private void handleIntent(final Intent intent) {
5960
final String data = intent.getDataString();
6061
if (StringUtils.equals(data, "appendDailynote")) {
61-
Log.i("shortcut", "Append to daily note");
6262
setupFullScreenInput();
6363
return;
6464
}
@@ -68,7 +68,10 @@ private void handleIntent(final Intent intent) {
6868

6969
private void setupFullScreenInput() {
7070
final EditText input = findViewById(R.id.full_screen_input);
71-
input.requestFocus();
71+
this.runOnUiThread(() -> {
72+
input.requestFocus();
73+
KeyboardUtils.showSoftInput(this);
74+
});
7275

7376
final Button submitButton = findViewById(R.id.submit_button);
7477
submitButton.setOnClickListener(v -> {
@@ -78,7 +81,7 @@ private void setupFullScreenInput() {
7881
}
7982

8083
final long now = System.currentTimeMillis();
81-
final String dailynotesDir = getExternalFilesDir(null).getAbsolutePath() + "/home/shortcuts/ailynotes/";
84+
final String dailynotesDir = getExternalFilesDir(null).getAbsolutePath() + "/home/.config/siyuan/shortcuts/dailynotes/";
8285
new File(dailynotesDir).mkdirs();
8386
final File f = new File(dailynotesDir, now + ".md");
8487
try {

0 commit comments

Comments
 (0)