@@ -124,7 +124,7 @@ private void setupViews(@NonNull View view) {
124
124
private void addViewEvents (@ NotNull View view ) {
125
125
btnRun .setOnClickListener (v -> clickRun ());
126
126
127
- View btnCopy = view .findViewById (R .id .btn_copy );
127
+ View btnCopy = view .findViewById (R .id .symja_prgm_btn_copy );
128
128
btnCopy .setOnClickListener (v -> {
129
129
final Context context = getContext ();
130
130
String content = inputView .getText ().toString ();
@@ -133,7 +133,7 @@ private void addViewEvents(@NotNull View view) {
133
133
ViewUtils .showToast (context , R .string .symja_prgm_message_copied , ViewUtils .LENGTH_SHORT );
134
134
}
135
135
});
136
- view .findViewById (R .id .btn_paste ).setOnClickListener (v -> {
136
+ view .findViewById (R .id .symja_prgm_btn_paste ).setOnClickListener (v -> {
137
137
final Context context = getContext ();
138
138
CharSequence clipboard = ClipboardCompat .getClipboard (context );
139
139
if (clipboard != null ) {
@@ -144,13 +144,13 @@ private void addViewEvents(@NotNull View view) {
144
144
ViewUtils .showKeyboard (context , inputView );
145
145
}
146
146
});
147
- View btnUndo = view .findViewById (R .id .btn_undo );
147
+ View btnUndo = view .findViewById (R .id .symja_prgm_btn_undo );
148
148
btnUndo .setOnClickListener (v -> {
149
149
if (inputView .canUndo ()) {
150
150
inputView .undo ();
151
151
}
152
152
});
153
- View btnRedo = view .findViewById (R .id .btn_redo );
153
+ View btnRedo = view .findViewById (R .id .symja_prgm_btn_redo );
154
154
btnRedo .setOnClickListener (v -> {
155
155
if (inputView .canRedo ()) {
156
156
inputView .redo ();
@@ -369,9 +369,9 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat
369
369
}
370
370
});
371
371
372
- txtErrorLabel = view .findViewById (R .id .txt_error_message );
373
- errorContainer = view .findViewById (R .id .error_container );
374
- btnCloseError = view .findViewById (R .id .btn_close_error_message );
372
+ txtErrorLabel = view .findViewById (R .id .symja_prgm_txt_error_message );
373
+ errorContainer = view .findViewById (R .id .symja_prgm_error_container );
374
+ btnCloseError = view .findViewById (R .id .symja_prgm_btn_close_error_message );
375
375
errorContainer .setVisibility (View .GONE );
376
376
btnCloseError .setOnClickListener (v -> errorContainer .setVisibility (View .GONE ));
377
377
@@ -383,15 +383,15 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat
383
383
listResultView .setAdapter (adapter );
384
384
listResultView .setHasFixedSize (true );
385
385
386
- btnRun = view .findViewById (R .id .btn_run );
386
+ btnRun = view .findViewById (R .id .symja_prgm_btn_run );
387
387
progressBar = view .findViewById (R .id .progress_bar );
388
388
progressBar .setVisibility (View .GONE );
389
389
390
390
setupViews (view );
391
391
addViewEvents (view );
392
392
setupSymbolViews (view .findViewById (R .id .container_symbol ), view );
393
393
394
- ImageView resizeInputButton = view .findViewById (R .id .btn_resize_input );
394
+ ImageView resizeInputButton = view .findViewById (R .id .symja_prgm_btn_resize_input );
395
395
resizeInputButton .setOnClickListener (v -> inputExpanded .postValue (Boolean .FALSE .equals (inputExpanded .getValue ())));
396
396
397
397
inputExpanded .observe (this .getViewLifecycleOwner (), expanded -> {
@@ -420,7 +420,7 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat
420
420
inputExpanded .postValue (PreferenceManager .getDefaultSharedPreferences (requireContext ())
421
421
.getBoolean (this .getTag () + ".inputExpanded" , true ));
422
422
423
- view .findViewById (R .id .btn_open_menu ).setOnClickListener (this ::openMenu );
423
+ view .findViewById (R .id .symja_prgm_btn_open_menu ).setOnClickListener (this ::openMenu );
424
424
}
425
425
426
426
private void openMenu (View v ) {
@@ -431,17 +431,19 @@ private void openMenu(View v) {
431
431
popupMenu .inflate (R .menu .symja_prgm_menu_programming_console , v );
432
432
popupMenu .setOnMenuItemClickListener (item -> {
433
433
int itemId = item .getItemId ();
434
- if (itemId == R .id .action_clear_all_items ) {
434
+ if (itemId == R .id .symja_prgm_action_clear_all_items ) {
435
435
clickClearAll ();
436
436
return true ;
437
437
}
438
- if (itemId == R .id .action_clear_input ) {
438
+ if (itemId == R .id .symja_prgm_action_clear_input ) {
439
439
final Context context = requireContext ();
440
440
inputView .setText ("" );
441
441
inputView .requestFocus ();
442
- ViewUtils .showKeyboard (context , inputView );
442
+ inputView .postDelayed (() -> {
443
+ ViewUtils .showKeyboard (context , inputView );
444
+ }, 500 );
443
445
return true ;
444
- } else if (itemId == R .id .action_import_text_file ) {
446
+ } else if (itemId == R .id .symja_prgm_action_import_text_file ) {
445
447
importTextFile ();
446
448
return true ;
447
449
}
0 commit comments