Search code examples
androiduser-interfaceelementinteraction

Android custom interactions and objects


For the apps that create their own objects and the way one interacts with them inside an android application, what language or approach do those apps use?

I can create a listview and a scrolable page within an android application, and I can have my own animations for them, I understand, but what if I wanted the elements within my application to react to different user inputs. For example, the Facebook messenger application has the dragable circles that one can move around, and other applications have elements (or objects?) that the user can drag and drop, sort of like a game, and the application responds to this movement.

Are those apps using game engines? or is there an underlying secret world to android that goes beyond developer.android.com?

The reason I am asking this is that I would like to create an interface where the there is a list view, but instead of clicking the list object to open its content, the user swipes it to the left. I imagine that this is UI and design intensive, or it requires a modification of android's animations and touch responses. Any guidelines or references I should look at?

Thank you for your help!


Solution

  • For different appearances, you're talking about making a custom View. Doing so just gives you a canvas you can draw to, and you can make it do anything you want. This is just normal Java code.

    For different interactions, you register a TouchEventListener to a view and code in the behavior you want. For some particular things like listViews you may also need to override onInterceptTouchEvent. GestureDetector may be a useful class here.