Finger sliding activity change

It’s interesting how to change activity using a finger slide or move your finger from right to left and change the action, as we saw photos on smartphones.

Somebody knows?

Cumpz

+7
source share
4 answers
+5
source

I wrote a demo at https://github.com/chenjishi/SlideActivity , all you have to do is expand the SlidingActivity in the project and get the slide effect, here is a screenshot: enter image description here

#### old method

1. Make transparent activity

<style name="Theme.Transparent" parent="@android:style/Theme.Translucent.NoTitleBar"> <item name="android:windowAnimationStyle">@style/activityAnimation</item> </style> 

2.use SlidingPaneLayout

 <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.SlidingPaneLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/slide_panel" android:layout_width="match_parent" android:layout_height="match_parent"> <View android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="left"/> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:background="#E6E6E6" android:orientation="vertical"> </LinearLayout> 

3.so here you want enter image description here

you can slide your finger to move the activity, and you can also destroy it by sliding to the right on most screens.

+3
source

Use ViewPager to achieve what you are looking for. Here is a tutorial .

+1
source

its implementation of the "pager" is presented in Android 4.0 / 3.0.
In earlier versions, you can implement it using the Android compatibility pack.
Uses fragments to implement them.
You can find the demo project in the SDK itself.

0
source

All Articles