Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class customSwipeAdapter extends PagerAdapter {
- @Override
- public Object instantiateItem(ViewGroup container, int position) {
- layoutInflator = (LayoutInflater)
- ctx.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
- final View item_view = layoutInflator.inflate(R.layout.swipe_layout, container, false);
- final EasyFlipView mYourFlipView = (EasyFlipView) item_view.findViewById(R.id.flipView);
- ImageView imageView_Front = (ImageView) item_view.findViewById(R.id.imageView_Front);
- imageView_Front.setImageResource(frontImages[position]);
- ImageView imageView_Back = (ImageView) item_view.findViewById(R.id.imageView_Back);
- container.addView(item_view);
- return item_view;
- }
- public class savedImagesViewController extends AppCompatActivity {
- ViewPager viewPager;
- customSwipeAdapter adapter;
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_saved_Images_view_controller);
- viewPager = (ViewPager) findViewById(R.id.view_pager);
- adapter = new customSwipeAdapter(this);
- viewPager.setAdapter(adapter);
- viewPager.setPageTransformer(false, new DefaultTransformer());
- }
- <?xml version="1.0" encoding="utf-8"?>
- <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/rootView"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- tools:context="com.project_bc.project_bc.savedImagesViewController">
- <com.project_bc.project_bc.CustomViewPager xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- android:id="@+id/view_pager"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- app:swipe_orientation="vertical" >
- </com.project_bc.project_bc.CustomViewPager>
- <android.support.design.widget.NavigationView
- android:id="@+id/startNav"
- android:background="@color/QRCodeBg"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:layout_gravity="start" >
- <RelativeLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent">
- <TextView
- android:id="@+id/textView4"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_alignParentLeft="true"
- android:layout_alignParentStart="true"
- android:layout_alignParentTop="true"
- android:layout_marginTop="5dp"
- android:text="@string/currentImageText"
- android:textAlignment="center"
- android:textColor="#41C8FF"
- android:textSize="36sp" />
- <TextView
- android:id="@+id/currentImageName"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_alignParentLeft="true"
- android:layout_alignParentStart="true"
- android:layout_below="@+id/textView4"
- android:layout_marginTop="10dp"
- android:textAlignment="center"
- android:textColor="#ffffff"
- android:textSize="24sp" />
- <Button
- android:id="@+id/favorite"
- android:layout_width="match_parent"
- android:layout_height="40dp"
- android:layout_below="@+id/share"
- android:layout_centerHorizontal="true"
- android:layout_marginLeft="20dp"
- android:layout_marginRight="20dp"
- android:layout_marginTop="20dp"
- android:background="@drawable/deletecurrentImageborder"
- android:onClick="onClick_FavoriteImage"
- android:text="@string/favCurrentImageText"
- android:textAllCaps="false"
- android:textColor="#FF69B4"
- android:textSize="24sp" />
- <Button
- android:id="@+id/share"
- android:layout_width="match_parent"
- android:layout_height="40dp"
- android:layout_alignParentLeft="true"
- android:layout_alignParentStart="true"
- android:layout_centerVertical="true"
- android:layout_marginLeft="20dp"
- android:layout_marginRight="20dp"
- android:background="@drawable/deletecurrentImageborder"
- android:onClick="onClick_ShareImage"
- android:text="@string/shareCurrentCardText"
- android:textAllCaps="false"
- android:textColor="#41C8FF"
- android:textSize="24sp" />
- <Button
- android:id="@+id/delete"
- android:layout_width="match_parent"
- android:layout_height="40dp"
- android:layout_alignParentEnd="true"
- android:layout_alignParentRight="true"
- android:layout_below="@+id/favorite"
- android:layout_marginLeft="20dp"
- android:layout_marginRight="20dp"
- android:layout_marginTop="20dp"
- android:background="@drawable/deletecurrentImageborder"
- android:onClick="onClick_DeleteCurrentImageBtn"
- android:text="normal"
- android:textAllCaps="false"
- android:textColor="#ff0000"
- android:textSize="24sp" />
- <EditText
- android:id="@+id/shareCurrentImageWith"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_centerHorizontal="true"
- android:layout_centerVertical="true"
- android:layout_marginLeft="20dp"
- android:layout_marginRight="20dp"
- android:backgroundTint="#ffffff"
- android:ems="10"
- android:hint="@string/shareImageWIth_Hint"
- android:imeOptions="flagNoExtractUi"
- android:inputType="textPersonName"
- android:paddingLeft="10dp"
- android:textColor="#ffffff"
- android:textColorHint="#1441C8FF"
- android:textStyle="italic" />
- </RelativeLayout>
- </android.support.design.widget.NavigationView>
- <android.support.design.widget.NavigationView
- android:id="@+id/endNav"
- android:background="@color/QRCodeBg"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:layout_gravity="end" >
- <RelativeLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent">
- <Button
- android:id="@+id/goToMyImageButton"
- android:layout_width="match_parent"
- android:layout_height="35dp"
- android:layout_alignParentTop="true"
- android:layout_centerHorizontal="true"
- android:layout_marginLeft="30dp"
- android:layout_marginRight="30dp"
- android:layout_marginTop="28dp"
- android:background="@drawable/myImagebtnborder"
- android:onClick="onClick_GoToMyImage"
- android:text="@string/myImageBtn"
- android:textAlignment="center"
- android:textAllCaps="false"
- android:textSize="14sp" />
- <!--<ImageView-->
- <!--android:id="@+id/previewSearchUser"-->
- <!--android:layout_width="180dp"-->
- <!--android:layout_height="80dp"-->
- <!--android:layout_above="@+id/editText"-->
- <!--android:layout_centerHorizontal="true"-->
- <!--android:background="@drawable/previewImageborder"-->
- <!--android:scaleType="fitXY"-->
- <!--android:visibility="invisible" />-->
- <TextView
- android:id="@+id/troubleScanningText"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_above="@+id/editText"
- android:layout_alignParentEnd="true"
- android:layout_alignParentRight="true"
- android:layout_marginBottom="3dp"
- android:layout_marginLeft="25dp"
- android:layout_marginRight="25dp"
- android:text="@string/trouble"
- android:textColor="#ffffff"
- android:textSize="18sp"
- tools:text="@string/trouble" />
- <EditText
- android:id="@+id/editText"
- style="@android:style/Widget.AutoCompleteTextView"
- android:layout_width="wrap_content"
- android:layout_height="45dp"
- android:layout_alignParentBottom="true"
- android:layout_alignParentEnd="true"
- android:layout_alignParentLeft="true"
- android:layout_alignParentRight="true"
- android:layout_alignParentStart="true"
- android:layout_marginBottom="15dp"
- android:layout_marginLeft="25dp"
- android:layout_marginRight="25dp"
- android:ems="10"
- android:hint="@string/EditTxtPlaceHolder"
- android:imeOptions="flagNoExtractUi"
- android:inputType="text"
- android:onClick="showKeyBoard"
- android:paddingLeft="7dp"
- android:backgroundTint="#ffffff"
- android:textColor="#ffffff"
- android:textColorHint="#1441C8FF"
- android:textSize="18sp" />
- <ImageView
- android:id="@+id/cameraButtonImage"
- android:layout_width="110dp"
- android:layout_height="110dp"
- android:layout_below="@+id/goToMyImageButton"
- android:layout_centerHorizontal="true"
- android:layout_marginTop="21dp"
- android:background="@drawable/camerabtnborder"
- app:srcCompat="@drawable/qrcodebtn" />
- <Button
- android:id="@+id/cameraButton"
- android:layout_width="110dp"
- android:layout_height="110dp"
- android:layout_alignTop="@+id/cameraButtonImage"
- android:layout_centerHorizontal="true"
- android:background="@null"
- android:onClick="onClick_GoToCamera"
- android:text="@null" />
- </RelativeLayout>
- </android.support.design.widget.NavigationView>
- </android.support.v4.widget.DrawerLayout>
- <?xml version="1.0" encoding="utf-8"?>
- <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- xmlns:app="http://schemas.android.com/apk/res-auto">
- <com.wajahatkarim3.easyflipview.EasyFlipView
- android:id="@+id/flipView"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:foregroundGravity="center"
- android:gravity="center"
- app:flipOnTouch="true"
- app:flipEnabled="true"
- app:flipDuration="500" >
- <!-- Back Layout Goes Here -->
- <include layout="@layout/flash_card_layout_back"/>
- <!-- Front Layout Goes Here -->
- <include layout="@layout/flash_card_layout_front" />
- </com.wajahatkarim3.easyflipview.EasyFlipView>
- </RelativeLayout>
- <?xml version="1.0" encoding="utf-8"?>
- <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- android:orientation="vertical"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
- <ImageView
- android:id="@+id/imageView_Back"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_margin="15dp"
- android:background="@drawable/cardborder"
- android:scaleType="fitXY"
- app:srcCompat="@drawable/backimage" />
- </RelativeLayout>
- <?xml version="1.0" encoding="utf-8"?>
- <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- xmlns:app="http://schemas.android.com/apk/res-auto">
- <com.wajahatkarim3.easyflipview.EasyFlipView
- android:id="@+id/flipView"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:foregroundGravity="center"
- android:gravity="center"
- app:flipOnTouch="true"
- app:flipEnabled="true"
- app:flipDuration="500" >
- <!-- Back Layout Goes Here -->
- <include layout="@layout/flash_card_layout_back"/>
- <!-- Front Layout Goes Here -->
- <include layout="@layout/flash_card_layout_front" />
- </com.wajahatkarim3.easyflipview.EasyFlipView>
- </RelativeLayout>
- <?xml version="1.0" encoding="utf-8"?>
- <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- xmlns:app="http://schemas.android.com/apk/res-auto">
- <com.wajahatkarim3.easyflipview.EasyFlipView
- android:id="@+id/flipView"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- app:flipOnTouch="true"
- app:flipEnabled="true"
- app:flipDuration="500"
- android:layout_marginRight="100dp"
- android:layout_marginLeft="100dp" >
- <!-- Back Layout Goes Here -->
- <include layout="@layout/flash_card_layout_back"/>
- <!-- Front Layout Goes Here -->
- <include
- layout="@layout/flash_card_layout_front" />
- </com.wajahatkarim3.easyflipview.EasyFlipView>
- </RelativeLayout>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement