question-mark

Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The autocomplete and The keyboard

See original GitHub issue

Issue Description

1.The autocomplete box is in the wrong position 2.The keyboard blocks the input box

https://user-images.githubusercontent.com/103302052/166631466-4a09586d-2e0a-437e-8a43-2ad2aa8ee682.mp4

android version:6.0.1

Codes:

MainActivity.java

` @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main);

    // Your language keywords
    String[] languageKeywords = {"hello","world"};
// List item custom layout 
     
// TextView id on your custom layout to put suggestion on it
    CodeView codeView = findViewById(R.id.codeView);
    
    codeView.setEnableLineNumber(true);
    codeView.setLineNumberTextColor(Color.GRAY);
    codeView.enablePairComplete(true);
    codeView.enablePairCompleteCenterCursor(true);
    Map<Character, Character> pairCompleteMap = new HashMap<>();
    pairCompleteMap.put('{', '}');
    pairCompleteMap.put('[', ']');
    pairCompleteMap.put('(', ')');
    pairCompleteMap.put('<', '>');
    pairCompleteMap.put('"', '"');
    codeView.setPairCompleteMap(pairCompleteMap);
    codeView.addSyntaxPattern(Pattern.compile("[0-9]+") , Color.RED);
    codeView.setLineNumberTextSize(15);
    
    
    
// Create ArrayAdapter object that contain all information
    ArrayAdapter<String> adapter = new ArrayAdapter<>(this, R.layout.list,R.id.v_m_c, languageKeywords);
// Set the adapter on CodeView object
    codeView.setAdapter(adapter);
    
    Snackbar.make(codeView,"By Ds",Snackbar.LENGTH_SHORT).show();
}

`

activity_main.xml

`

<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android=“http://schemas.android.com/apk/res/android” xmlns:app=“http://schemas.android.com/apk/res-auto” android:layout_width=“match_parent” android:layout_height=“match_parent”>

    <com.amrdeveloper.codeview.CodeView
        android:id="@+id/codeView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/colo"
        android:dropDownWidth="150dp"
        android:dropDownHorizontalOffset="0dp"
        android:dropDownSelector="@color/colo"
        android:gravity="top|start" />

</androidx.coordinatorlayout.widget.CoordinatorLayout>

`

Issue Analytics

  • State:closed
  • Created 9 months ago
  • Reactions:2
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
m-anshuman2166commented, May 12, 2022

image Looks better !

2reactions
AmrDevelopercommented, May 7, 2022

The problem is from vertical offset calculation, i will modify it and test it first with many devices and versions before release it

Thanks bro Amr Hesham

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is there an autocomplete keyboard on desktops like ... - Quora
First, let me point out that autocompletion is not a feature of the phone, but of the keyboard. Of course, all keyboards on...
Read more >
Keyboard auto-completion - HelpNDoc
Keyboard auto-completion · Enter any text in the filter field to filter the list and show only relevant items · Use the Up...
Read more >
How to Autocomplete Text with Keyboard Tools & Widgets
How to Autocomplete Text with Keyboard Tools & Widgets · 1. TextExpander · 2. Autocomplete in your browser · 3. Autosuggest in search...
Read more >
Autocomplete - Wikipedia
Autocomplete, or word completion, is a feature in which an application predicts the rest of a word a user is typing. In Android...
Read more >
Autocomplete Presents the Best Version of You - WIRED
Type the phrase "In 2019, I'll ..." and let your smartphone's keyboard predict the rest. Depending on what else you've typed recently, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found