开发者

how to do swipe action in android

开发者 https://www.devze.com 2023-02-28 18:57 出处:网络
in my app when an activity is opened i am have a edit boxes to be filled.When the user fills the edit box, a default music will be played in background. If the user wants to select another song, he ca

in my app when an activity is opened i am have a edit boxes to be filled. When the user fills the edit box, a default music will be played in background. If the user wants to select another song, he can select a song from a list view which shows all the song stored in sd card.

Now i want to show the list view when the user swipe's the screen to left.

I have already written the code for my edit boxes and list of songs separately and they are working good. Now i want to sw开发者_如何学Pythonipe between those activities.

please help me....


Have you seen Fling gesture detection on grid layout

Also note that you'll probably want to swipe between Views, not Activities


I maintain a project that uses swipe actions a lot.

It is open-source, feel free to copy-paste the code: https://github.com/ankidroid/Anki-Android

Especially this class:
https://github.com/ankidroid/Anki-Android/blob/dbbf3ea6549e82dee9e3c0df39bb5c3f74d3e189/AnkiDroid/src/main/java/com/ichi2/anki/AbstractFlashcardViewer.java

0

精彩评论

暂无评论...
验证码 换一张
取 消