The autocomplete and The keyboard
See original GitHub issue1.The autocomplete box is in the wrong position 2.The keyboard blocks the input box
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
`
<?xml version="1.0" encoding="utf-8"?><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:
- Created a year ago
- Reactions:2
- Comments:10 (7 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Looks better !
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