BubbleTabs.Xamarin 3.0.0.1

Binding of the library:
BubbleTab

Put some bubble in your tabs and give your apps a supa fresh style!

Install-Package BubbleTabs.Xamarin -Version 3.0.0.1
dotnet add package BubbleTabs.Xamarin --version 3.0.0.1
<PackageReference Include="BubbleTabs.Xamarin" Version="3.0.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add BubbleTabs.Xamarin --version 3.0.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: BubbleTabs.Xamarin, 3.0.0.1"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install BubbleTabs.Xamarin as a Cake Addin
#addin nuget:?package=BubbleTabs.Xamarin&version=3.0.0.1

// Install BubbleTabs.Xamarin as a Cake Tool
#tool nuget:?package=BubbleTabs.Xamarin&version=3.0.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Basic example:

XML:
Style.xml

<resources>
    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
    </style>
</resources>

Main.xml

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <com.github.florent37.bubbletab.BubbleTab
        android:id="@+id/bubbleTab"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:clipToPadding="false"
        android:background="@android:color/white"
        android:elevation="10dp"
        app:bubbleTab_circleColor="@color/colorAccent"
        app:bubbleTab_circleRatio="1.25">
        <ImageView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:padding="16dp"
            android:src="@drawable/icon1" />
        <ImageView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:padding="16dp"
            android:src="@drawable/icon2" />
        <ImageView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:padding="16dp"
            android:src="@drawable/icon3" />
    </com.github.florent37.bubbletab.BubbleTab>

    <androidx.viewpager2.widget.ViewPager2
        android:id="@+id/viewPager"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>
</LinearLayout>

bubblepage_tab.xml

<?xml version="1.0" encoding="utf-8"?>
<androidx.recyclerview.widget.RecyclerView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/recyclerView"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#e9eaed"
    android:orientation="vertical">
</androidx.recyclerview.widget.RecyclerView>

bubbletab_cell.xml

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <androidx.cardview.widget.CardView
        android:layout_width="match_parent"
        android:layout_height="250dp"
        android:layout_margin="5dp"
        app:cardElevation="2dp"/>

</FrameLayout>

C#:

public class MainActivity : AppCompatActivity
{
    protected override void OnCreate(Bundle savedInstanceState)
    {
        base.OnCreate(savedInstanceState);

        // Set our view from the "main" layout resource
        SetContentView(Resource.Layout.Main);
        BubbleTab bubbleTab= FindViewById<BubbleTab>(Resource.Id.bubbleTab);
        ViewPager2 viewPager= FindViewById<ViewPager2>(Resource.Id.viewPager);

        viewPager.Adapter = new FakeAdapter(this);

        bubbleTab.SetupWithViewPager(viewPager);
    }

    public class FakeAdapter : FragmentStateAdapter
    {
        public FakeAdapter(FragmentActivity fragmentActivity) : base(fragmentActivity) { }

        public override ItemCount => 5;

        public override Fragment CreateFragment(int p0)
        {
            switch (p0)
            {
                default:
                    return FakeFragment.NewInstance();
            }
        }
    }

    public class FakeFragment : Fragment
    {
        RecyclerView RecyclerView { get; set; }

        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            return inflater.Inflate(Resource.Layout.bubbletab_page, container, false);
        }

        public override void OnViewCreated(View view, Bundle savedInstanceState)
        {
            RecyclerView = view.FindViewById<RecyclerView>(Resource.Id.recyclerView);
            RecyclerView.SetLayoutManager(new GridLayoutManager(Context, 2));
            RecyclerView.SetAdapter(new RecyclerAdapter());
        }

        public static Fragment NewInstance()
        {
            return new FakeFragment();
        }
    }

    public class RecyclerAdapterViewHolder : RecyclerView.ViewHolder
    {
        public View Cell { get; set; }

        public RecyclerAdapterViewHolder(View c) : base(c)
        {
            Cell = c;
        }
    }
}

Basic example:

XML:
Style.xml

<resources>
    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
    </style>
</resources>

Main.xml

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <com.github.florent37.bubbletab.BubbleTab
        android:id="@+id/bubbleTab"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:clipToPadding="false"
        android:background="@android:color/white"
        android:elevation="10dp"
        app:bubbleTab_circleColor="@color/colorAccent"
        app:bubbleTab_circleRatio="1.25">
        <ImageView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:padding="16dp"
            android:src="@drawable/icon1" />
        <ImageView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:padding="16dp"
            android:src="@drawable/icon2" />
        <ImageView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:padding="16dp"
            android:src="@drawable/icon3" />
    </com.github.florent37.bubbletab.BubbleTab>

    <androidx.viewpager2.widget.ViewPager2
        android:id="@+id/viewPager"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>
</LinearLayout>

bubblepage_tab.xml

<?xml version="1.0" encoding="utf-8"?>
<androidx.recyclerview.widget.RecyclerView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/recyclerView"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#e9eaed"
    android:orientation="vertical">
</androidx.recyclerview.widget.RecyclerView>

bubbletab_cell.xml

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <androidx.cardview.widget.CardView
        android:layout_width="match_parent"
        android:layout_height="250dp"
        android:layout_margin="5dp"
        app:cardElevation="2dp"/>

</FrameLayout>

C#:

public class MainActivity : AppCompatActivity
{
    protected override void OnCreate(Bundle savedInstanceState)
    {
        base.OnCreate(savedInstanceState);

        // Set our view from the "main" layout resource
        SetContentView(Resource.Layout.Main);
        BubbleTab bubbleTab= FindViewById<BubbleTab>(Resource.Id.bubbleTab);
        ViewPager2 viewPager= FindViewById<ViewPager2>(Resource.Id.viewPager);

        viewPager.Adapter = new FakeAdapter(this);

        bubbleTab.SetupWithViewPager(viewPager);
    }

    public class FakeAdapter : FragmentStateAdapter
    {
        public FakeAdapter(FragmentActivity fragmentActivity) : base(fragmentActivity) { }

        public override ItemCount => 5;

        public override Fragment CreateFragment(int p0)
        {
            switch (p0)
            {
                default:
                    return FakeFragment.NewInstance();
            }
        }
    }

    public class FakeFragment : Fragment
    {
        RecyclerView RecyclerView { get; set; }

        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            return inflater.Inflate(Resource.Layout.bubbletab_page, container, false);
        }

        public override void OnViewCreated(View view, Bundle savedInstanceState)
        {
            RecyclerView = view.FindViewById<RecyclerView>(Resource.Id.recyclerView);
            RecyclerView.SetLayoutManager(new GridLayoutManager(Context, 2));
            RecyclerView.SetAdapter(new RecyclerAdapter());
        }

        public static Fragment NewInstance()
        {
            return new FakeFragment();
        }
    }

    public class RecyclerAdapterViewHolder : RecyclerView.ViewHolder
    {
        public View Cell { get; set; }

        public RecyclerAdapterViewHolder(View c) : base(c)
        {
            Cell = c;
        }
    }
}

Release Notes

- Fixed bug with tabs.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
3.0.0.1 126 5/1/2021
3.0.0 43 4/27/2021
2.0.0.1 173 7/31/2020
1.0.2 288 7/3/2019
1.0.0 607 11/15/2017