Sunday 15 September 2013

android - Galaxy S4: onHover/Airview for Input Method not working -


Airview is not working in InputMethod

I use the Samsung Galaxy S4's new airwave facility I'm trying to, especially on-hover-event

  • Providing an On-Hover Event Listener
  • Setting Intentional Filter for it
  • Com.sec.android.airview.HOVER

    Now I want to use it for an input method. My problem is that the footage of the input method does not get any on-hover event, even if I set the airview filter also Done:

    The Android Manifest. Excerpt from XML:

      & lt; Application Android: label = "@ string / ime_name" & lt; Service Android: name = "com.example.keyboard" Android: permission = "android.permission.BIND_INPUT_METHOD" & gt; & Lt; Intent-Filter & gt; & Lt; Action Android: name = "android.view.InputMethod" /> & Lt; / Intent-Filter & gt; & Lt; Intent-Filter & gt; & Lt; Action Android: name = "com.sec.android.airview.HOVER" /> & Lt; / Intent-Filter & gt; & Lt; Meta-Data Android: name = "android.view.im" Android: resource = "@xml / method" /> & Lt; / Services & gt; & Lt; / Application & gt;   

    For this moment, my input method layout has a simple linearlayout with a single button:

      And lieutenant; Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; LinearLayout xmlns: Android = "http://schemas.android.com/apk/res/android" Android: layout_width = "match_parent" Android: layout_height = "match_parent" Android: orientation = "vertical" & gt; & Lt; Android: layout_width = "wrap_content" android: layout_height = "wrap_content" android: text = "hover button" Android: id = "@ + id / hoverbutton2" /> & Lt; / LinearLayout & gt;   

    The event listener is set to:

      button hoverButton = (button) mInputView.findViewById (R. Id.hoverbutton2); HoverButton.setOnHoverListener (see the new OnHoverListener) {@ Override Public Boolean Onhover (see V, Motion Event Event) {Log D. (Tag, "Hoverbutton 2: Onhouse"); Return Return;}});   

    In the same fashion there is an onclick listener set, as intended.

    Any hint?

    I had the same problem I found that the solution posted on xda dev on FireBox 92: < / P>

    1. First of all, setting the DEVICE to DEVICE ensures that all its on airview is set even when its setting is turned on.

    2. Next to the Android Manifest:

        Android Application: allowBackup = "true" android: icon = "@drawable / ic_luncher" android: labels = "@ String / app_name" Android: Theme = "@ Style / Aaptim" & gt; & Lt; Meta-Data Android: name = "com.sec.android.airview.enable" android: value = "true" /> & Lt; Intent-Filter & gt; & Lt; Action Android: name = "com.sec.android.airview.HOVER" /> & Lt; / Intent-Filter & gt; & Lt; Activity Android: name = "edu.uanl.secondapp.MainActivity" Android: label = "@ string / app_name" & gt; & Lt; Intent-Filter & gt; & Lt; Action Android: name = "android.intent.action.MAIN" /> & Lt; Category android: name = "android.intent.category.LAUNCHER" /> & Lt; / Intent-Filter & gt; & Lt; Intent-Filter & gt; & Lt; Action Android: name = "com.sec.android.airview.HOVER" /> & Lt; / Intent-Filter & gt; & Lt; / Activity & gt; & Lt; / Application & gt;    
    3. In your code:

        textView.setOnHoverListener (see the new. OnHoverListener () {@override Public Boolean On Hover ( See) Motion Event SpeedAvent {switch (motionEvent.getAction ()) {Case MotionEvent.ACTION_HOVER_ENTER: // Enter Hovered Cases MotionEvent.ACTION_HOVER_EXIT: // View Hovered View Set padded background color (color relative); View.setScaleX (float) 1.0); View.setScaleY (Float) 1.0); Break; Case Motion Avent Action_HOVMOvA: // On Hover View Setbackgram Coiler (Color. RD); Scene .Set Scallex (Float) 2.0); VisualSetScale Y (Float) 2.0); Break;} log. Wtf ("some", "is happening" + + motionEvent.getAction ()); Return back;}}); TextView.setHovered (right);      

  • No comments:

    Post a Comment