1717import android .widget .Button ;
1818import android .widget .EditText ;
1919import android .widget .LinearLayout ;
20+ import android .widget .Toast ;
2021
2122import androidx .annotation .Nullable ;
2223import androidx .appcompat .app .AlertDialog ;
@@ -98,6 +99,7 @@ public static void showInsertImageOrLinkDialog(
9899 final Button buttonPictureGallery = view .findViewById (R .id .ui__select_path_dialog__gallery_picture );
99100 final Button buttonPictureCamera = view .findViewById (R .id .ui__select_path_dialog__camera_picture );
100101 final Button buttonPictureEdit = view .findViewById (R .id .ui__select_path_dialog__edit_picture );
102+ final Button buttonAudioRecord = view .findViewById (R .id .ui__select_path_dialog__record_audio );
101103
102104 // Extract filepath if using Markdown
103105 if (textFormatId == FormatRegistry .FORMAT_MARKDOWN ) {
@@ -133,6 +135,11 @@ public static void showInsertImageOrLinkDialog(
133135 dialog .setTitle (R .string .insert_image );
134136 browseType = InsertType .IMAGE_BROWSE ;
135137 okType = InsertType .IMAGE_DIALOG ;
138+ } else if (action == AUDIO_ACTION ) {
139+ dialog .setTitle (R .string .audio );
140+ buttonAudioRecord .setVisibility (View .VISIBLE );
141+ browseType = InsertType .AUDIO_BROWSE ;
142+ okType = InsertType .AUDIO_DIALOG ;
136143 } else {
137144 dialog .setTitle (R .string .insert_link );
138145 buttonSelectSpecial .setVisibility (View .VISIBLE );
@@ -148,6 +155,7 @@ public static void showInsertImageOrLinkDialog(
148155 buttonSearch .setOnClickListener (v -> _insertItem .callback (InsertType .LINK_SEARCH ));
149156 buttonPictureCamera .setOnClickListener (b -> _insertItem .callback (InsertType .IMAGE_CAMERA ));
150157 buttonPictureGallery .setOnClickListener (v -> _insertItem .callback (InsertType .IMAGE_GALLERY ));
158+ buttonAudioRecord .setOnClickListener (v -> _insertItem .callback (InsertType .AUDIO_RECORDING ));
151159 buttonPictureEdit .setOnClickListener (v -> _insertItem .callback (InsertType .IMAGE_EDIT ));
152160
153161 dialog .show ();
@@ -400,7 +408,7 @@ private static void insertItem(
400408 }
401409 case AUDIO_RECORDING : {
402410 if (!cu .requestAudioRecording (activity , insertFileLink )) {
403- // noop, OM library is outdated and so voice recording feature removed
411+ Toast . makeText ( activity , "❌" , Toast . LENGTH_SHORT ). show ();
404412 }
405413 break ;
406414 }
0 commit comments