Git Product home page Git Product logo

android-global-touchevent's Introduction

Android Detect Global Touch Event

Sidebar and Glovebox Apps become popular overnight because of only one functionality. They provide global menu which can be open from left or right edge of mobile screen. As developer when I show this apps,first thing that comes in my mind was "NDK". Then after I start looking for the solution. Logically I figure out that IF I can detect "Global onTouch Event" then It's posible to display side menu like sidebar or glovebox.

Alt text Alt text Alt text

Problem 1: Detect Global Touch Event Problem 2 : Display Sliding Menu.

Solution For Problem 1:

  1. Create service to detect touch event.
  2. Fetch WindowManager object from system service
  3. Create LinearLayout having 30 px width and fill_parent height
  4. Add LinearLayout to WindowManager
  5. set LinearLayout on left edge of screen / window.

Why I need to Service ? Because we can't get event when activity goes in background or close.

What if I make LinearLayout width more then 30 px ? The control or activity which display in background will not get onTouch event.

android-global-touchevent's People

Contributors

kpbird avatar

Watchers

Jim Liu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.