Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement back key emulation on Tecla HUD #53

Closed
ijdoc opened this issue Mar 14, 2013 · 17 comments · Fixed by #58 or #74
Closed

Implement back key emulation on Tecla HUD #53

ijdoc opened this issue Mar 14, 2013 · 17 comments · Fixed by #58 or #74

Comments

@ijdoc
Copy link
Contributor

ijdoc commented Mar 14, 2013

This should be done through a Tecla IME Service class inside the framework library. Eventually, the target IME will extend this custom class instead of the standard IME Service.

@ijdoc
Copy link
Contributor Author

ijdoc commented Mar 17, 2013

Back end method created, still need to hook up to HUD

@ericwan78
Copy link
Contributor

Side button highlighting is required to use the method at the front end.

@ijdoc
Copy link
Contributor Author

ijdoc commented Mar 18, 2013

Will create the resource ASAP

@sagar-chandarana
Copy link
Contributor

I guess I will create a resource layout xml with the back button, that will resolve this issue and #60 .

@ijdoc
Copy link
Contributor Author

ijdoc commented Mar 19, 2013

The resource is already created, what has not been created is a highlight for it. @sagarchandarana123 how comfortable are you with inkscape?

@sagar-chandarana
Copy link
Contributor

@jorgeSilva I have never used inkspace. But I think the same type of tasks are done by inkspace and photoshop. I am quite familiar with photoshop. What exactly is to be done here? I will get my hands on inkspace, too.

@ericwan78
Copy link
Contributor

@sagarchandarana123 inkscape is an excellent free tool for vector graphics. You may also want to try gimp, which is another good free tool for editting layed graphics. If you don't mind purchasing photoshop, it's fine using that.

@sagar-chandarana
Copy link
Contributor

@ericwan78 Well currently I am using photoshop in trial mode! I went through some tools of inkspace and it's amazing. Moreover, there are thousands of tutorial available on the internet for inkspace. I think it's one of the most favorite tools for all when it comes to vector graphics. I will try out gimp too. Thanks!

@ericwan78
Copy link
Contributor

The current structure created a circular dependency. The back key method cannot be used, possibly due to build issue. Please verify this problem

@ijdoc
Copy link
Contributor Author

ijdoc commented Apr 2, 2013

Any branch or additional detail of what the problem is?

Can we obtain an instance of the running IME in the framework and use that instance to run the methods within?

@ericwan78
Copy link
Contributor

@jorgeSilva you are correct. The method did not return an instance of the IME. I got a null pointer exception. How is the IME object normally created?

@ijdoc
Copy link
Contributor Author

ijdoc commented Apr 2, 2013

Which method? IMEs cannot be instantiated, we have to keep a reference to the class itself... we should provide some kind of static method to keep the instance after the IME onCreate method. This has to be done within some class that we know is running at the time the IME is created so that the A11y service can access it. We may have to add an Application class to the framework for this.

@ijdoc
Copy link
Contributor Author

ijdoc commented Apr 2, 2013

Also @ericwan78 please provide links to the code you are referring to (or at least the branch) in your issue comments

@ericwan78
Copy link
Contributor

@jorgeSilva please first refer to java/src/ca/idrc/tecla/framework/TeclaIME.java in the develop branch.
The TeclaIME.getInstance method returns an instance of TeclaIME, which is assigned in the TeclaIME.onCreate method.
java/src/com/android/inputmethod/latin/LatinIME.java in the develop branch of tecla-LatinIME extends TeclaIME which allows us to track an instance of LatinIME. It requires tecla-LatinIME to use the current project as a library.
If we need to an instance of LatinIME in the current project, we can either use tecla-LatinIME as a library, or import tecla-LatinIME in the build path as an external library. Either way, a circular dependency is created.

From what I observed here, the TeclaIME class needs to be outside of tecla-framework. Do you have a suggestion that allows TeclaIME to stay in the current project?

@sagar-chandarana
Copy link
Contributor

@ericwan78 I used the following trick in Flash once.

Suppose in the current project(tecla-framework) we have a class ABC.java, which requires the instance of LatinIME.

  1. Create a static variable ABC.latinIME_Instance.
  2. Everytime a new instance of LatinIME is created, we can assign a reference of this new instance to ABC.latinIME_Instance, as ABC will always be accessible in 'tecla-LatinIME' project. As you said within the method onCreate(), a new instance is generated. At that time we can assign the new instance.
    This way, in the current project we can use just the local var which will always contain the latest instance.
  3. And if it's necessary to interrupt the current work done by ABC class when a new instance of LatinIME is generated, we can write a static method ABC.onLatinIME_Changed() which will trigger the necessary actions.

Hope this helps.

@ericwan78
Copy link
Contributor

thank you. Yes, it helps.

@ijdoc
Copy link
Contributor Author

ijdoc commented Apr 4, 2013

Closed with 408a30a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants