How to approach to this design.
want to design the viewpager activity on top of other activity. It should be have blackish scream background.
Below Screenshot is similar to my requirements.
Asked
Active
Viewed 1,645 times
2

AskQ
- 4,215
- 7
- 34
- 61
-
Did you try transparent background of viewpager and parent layout of activity? – Khemraj Sharma Dec 21 '17 at 17:01
-
This can be possible with view pager inside Dialog with circular indicater. – Farhana Naaz Ansari Dec 22 '17 at 06:05
-
So what is the issue bro – Khemraj Sharma Dec 23 '17 at 16:08
2 Answers
2
Option 1. Make a normal Activity
and set its Theme
as
<activity android:theme="@android:style/Theme.Dialog" />
Option 2. Make an Activity
whose onCreate
method is just showing a Dialog
and then set the theme to be:
<activity android:theme="@android:style/Theme.Translucent.NoTitleBar"/>

Xenolion
- 12,035
- 7
- 33
- 48
0
This is a simple implementation of the layout you require.
Yo need to keep in mind that parent layout of activity has transparent black background, fragment child of view pager and view pager has transparent background.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#cb000000"
android:orientation="vertical">
<ImageView
android:layout_margin="40dp"
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@color/colorRed" />
<android.support.v4.view.ViewPager
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:background="#00000000" />
<LinearLayout
android:layout_marginTop="50dp"
android:id="@+id/viewPagerCountDots"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:gravity="center"
android:orientation="horizontal" />
</LinearLayout>

Khemraj Sharma
- 57,232
- 27
- 203
- 212