How to Sliding to New Layout in Full Screen View?

CastielTR 141 Reputation points
2022-04-12T11:52:03.243+00:00

I am working on an application. The problem is, I'm using full screen view for the first time and I want to slide between layouts, horizontally I want a new page to come up every time the user scrolls. In the form of a loop.

Let me show you an example picture:192323-visible.png

My layout codes:

<?xml version="1.0" encoding="utf-8"?>  
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"  
    xmlns:tools="http://schemas.android.com/tools"  
    android:layout_width="match_parent"  
    android:layout_height="match_parent"  
    android:background="#FFC300"  
    android:theme="@style/ThemeOverlay.ProjectAgilis1.FullscreenContainer"  
    tools:context=".FullscreenActivity">  



<TextView  
    android:id="@+id/fullscreen_content"  
    android:layout_width="match_parent"  
    android:layout_height="match_parent"  
    android:gravity="center"  
    android:keepScreenOn="true"  
    android:textColor="?attr/fullscreenTextColor"  
    android:textSize="50sp"  
    android:textStyle="bold" />  

<AnalogClock  

    android:layout_width="190dp"  
    android:layout_height="wrap_content"  
    android:layout_gravity="center_horizontal"  
    android:layout_marginTop="20dp" />`  
Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,294 questions
0 comments No comments
{count} votes

Accepted answer
  1. JessieZhang-MSFT 7,706 Reputation points Microsoft Vendor
    2022-04-13T05:57:18.24+00:00

    Hello,

    According to your description, ViewPager should better meet your needs.

    ViewPager is a layout manager that lets you implement gestural navigation. Gestural navigation allows the user to swipe left and right to step through pages of data.

    ViewPager uses an adapter pattern to provide it with the views to display. The adapter used here is conceptually similar to that used by RecyclerView – you supply an implementation of PagerAdapter to generate the pages that the ViewPager displays to the user. The pages displayed by ViewPager can be Views or Fragments. When Views are displayed, the adapter subclasses Android's PagerAdapter base class. If Fragments are displayed, the adapter subclasses Android's FragmentPagerAdapter.

    To use ViewPager in your app project, you must install the Android Support Library v4 package.

    For more, you can check document https://learn.microsoft.com/en-us/xamarin/android/user-interface/controls/view-pager/ .

    And there are samples included in above document, you can check them here:

    https://learn.microsoft.com/en-us/samples/xamarin/monodroid-samples/userinterface-treepager/

    https://learn.microsoft.com/en-us/samples/xamarin/monodroid-samples/userinterface-flashcardpager/

    Best Regards,
    Jessie Zhang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful