Changes in CustomTabbedPageRenderer (Droid)
This commit is contained in:
parent
6ee3659f2c
commit
b8d3e2de18
@ -54,9 +54,9 @@ namespace eShopOnContainers.Services
|
||||
|
||||
public async Task NavigateBackAsync()
|
||||
{
|
||||
if (CurrentApplication.MainPage is HomeView)
|
||||
if (CurrentApplication.MainPage is CatalogView)
|
||||
{
|
||||
var mainPage = CurrentApplication.MainPage as HomeView;
|
||||
var mainPage = CurrentApplication.MainPage as CatalogView;
|
||||
await mainPage.Navigation.PopAsync();
|
||||
}
|
||||
else if (CurrentApplication.MainPage != null)
|
||||
@ -148,7 +148,7 @@ namespace eShopOnContainers.Services
|
||||
private void CreatePageViewModelMappings()
|
||||
{
|
||||
_mappings.Add(typeof(CartViewModel), typeof(CartView));
|
||||
_mappings.Add(typeof(ProductsViewModel), typeof(HomeView));
|
||||
_mappings.Add(typeof(CatalogViewModel), typeof(CatalogView));
|
||||
_mappings.Add(typeof(LoginViewModel), typeof(LoginView));
|
||||
_mappings.Add(typeof(MainViewModel), typeof(MainView));
|
||||
_mappings.Add(typeof(OrderDetailViewModel), typeof(OrderDetailView));
|
||||
|
@ -33,7 +33,7 @@ namespace eShopOnContainers.ViewModels.Base
|
||||
|
||||
// view models
|
||||
_unityContainer.RegisterType<CartViewModel>();
|
||||
_unityContainer.RegisterType<ProductsViewModel>();
|
||||
_unityContainer.RegisterType<CatalogViewModel>();
|
||||
_unityContainer.RegisterType<LoginViewModel>();
|
||||
_unityContainer.RegisterType<MainViewModel>();
|
||||
_unityContainer.RegisterType<OrderDetailViewModel>();
|
||||
|
@ -41,7 +41,7 @@ namespace eShopOnContainers.Core.ViewModels
|
||||
|
||||
public override async Task InitializeAsync(object navigationData)
|
||||
{
|
||||
MessagingCenter.Subscribe<ProductsViewModel>(this, MessengerKeys.AddProduct, (sender) =>
|
||||
MessagingCenter.Subscribe<CatalogViewModel>(this, MessengerKeys.AddProduct, (sender) =>
|
||||
{
|
||||
BadgeCount++;
|
||||
});
|
||||
|
@ -8,14 +8,14 @@ using eShopOnContainers.Core.Services.Catalog;
|
||||
|
||||
namespace eShopOnContainers.Core.ViewModels
|
||||
{
|
||||
public class ProductsViewModel : ViewModelBase
|
||||
public class CatalogViewModel : ViewModelBase
|
||||
{
|
||||
private ObservableCollection<CatalogItem> _products;
|
||||
private CatalogItem _product;
|
||||
|
||||
private ICatalogService _productsService;
|
||||
|
||||
public ProductsViewModel(ICatalogService productsService)
|
||||
public CatalogViewModel(ICatalogService productsService)
|
||||
{
|
||||
_productsService = productsService;
|
||||
}
|
@ -1,12 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
x:Class="eShopOnContainers.Core.Views.HomeView"
|
||||
x:Class="eShopOnContainers.Core.Views.CatalogView"
|
||||
xmlns:templates="clr-namespace:eShopOnContainers.Core.Views.Templates;assembly=eShopOnContainers.Core"
|
||||
xmlns:views="clr-namespace:eShopOnContainers.Core.Views;assembly=eShopOnContainers.Core"
|
||||
xmlns:animations="clr-namespace:eShopOnContainers.Core.Animations;assembly=eShopOnContainers.Core"
|
||||
xmlns:triggers="clr-namespace:eShopOnContainers.Core.Triggers;assembly=eShopOnContainers.Core"
|
||||
Title="Products">
|
||||
Title="Catalog">
|
||||
<ContentPage.Resources>
|
||||
<ResourceDictionary>
|
||||
|
||||
@ -68,7 +68,7 @@
|
||||
NumberOfTapsRequired="1" />
|
||||
</Grid.GestureRecognizers>
|
||||
</Grid>
|
||||
<!-- PRODUCTS -->
|
||||
<!-- CATALOG -->
|
||||
<ListView
|
||||
x:Name="Products"
|
||||
Grid.Row="1"
|
@ -4,9 +4,9 @@ using Xamarin.Forms;
|
||||
|
||||
namespace eShopOnContainers.Core.Views
|
||||
{
|
||||
public partial class HomeView : ContentPage, IMenuContainerPage
|
||||
public partial class CatalogView : ContentPage, IMenuContainerPage
|
||||
{
|
||||
public HomeView()
|
||||
public CatalogView()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
@ -7,35 +7,35 @@
|
||||
BarBackgroundColor="{StaticResource DarkGreenColor}"
|
||||
BackgroundColor="{StaticResource BackgroundColor}"
|
||||
Title="eShop on Containers">
|
||||
<views:HomeView
|
||||
<views:CatalogView
|
||||
x:Name="HomeView">
|
||||
<views:HomeView.Icon>
|
||||
<views:CatalogView.Icon>
|
||||
<OnPlatform
|
||||
x:TypeArguments="FileImageSource"
|
||||
Android="menu_filter"
|
||||
iOS="menu_filter"
|
||||
WinPhone="Assets\menu_filter.png"/>
|
||||
</views:HomeView.Icon>
|
||||
</views:HomeView>
|
||||
</views:CatalogView.Icon>
|
||||
</views:CatalogView>
|
||||
<views:ProfileView
|
||||
x:Name="ProfileView">
|
||||
<views:HomeView.Icon>
|
||||
<views:ProfileView.Icon>
|
||||
<OnPlatform
|
||||
x:TypeArguments="FileImageSource"
|
||||
Android="menu_profile"
|
||||
iOS="menu_profile"
|
||||
WinPhone="Assets\menu_profile.png"/>
|
||||
</views:HomeView.Icon>
|
||||
</views:ProfileView.Icon>
|
||||
</views:ProfileView>
|
||||
<views:CartView
|
||||
x:Name="CartView"
|
||||
controls:CustomTabbedPage.BadgeText="{Binding BadgeCount}">
|
||||
<views:HomeView.Icon>
|
||||
<views:CartView.Icon>
|
||||
<OnPlatform
|
||||
x:TypeArguments="FileImageSource"
|
||||
Android="menu_cart"
|
||||
iOS="menu_cart"
|
||||
WinPhone="Assets\menu_cart.png"/>
|
||||
</views:HomeView.Icon>
|
||||
</views:CartView.Icon>
|
||||
</views:CartView>
|
||||
</TabbedPage>
|
@ -15,7 +15,7 @@ namespace eShopOnContainers.Core.Views
|
||||
{
|
||||
base.OnAppearing();
|
||||
|
||||
var homeViewModel = ViewModelLocator.Instance.Resolve<ProductsViewModel>();
|
||||
var homeViewModel = ViewModelLocator.Instance.Resolve<CatalogViewModel>();
|
||||
await homeViewModel.InitializeAsync(null);
|
||||
HomeView.BindingContext = homeViewModel;
|
||||
|
||||
|
@ -76,7 +76,7 @@
|
||||
<Compile Include="ViewModels\Base\ViewModelBase.cs" />
|
||||
<Compile Include="ViewModels\Base\ViewModelLocator.cs" />
|
||||
<Compile Include="ViewModels\CartViewModel.cs" />
|
||||
<Compile Include="ViewModels\ProductsViewModel.cs" />
|
||||
<Compile Include="ViewModels\CatalogViewModel.cs" />
|
||||
<Compile Include="ViewModels\LoginViewModel.cs" />
|
||||
<Compile Include="ViewModels\MainViewModel.cs" />
|
||||
<Compile Include="ViewModels\OrderDetailViewModel.cs" />
|
||||
@ -90,8 +90,8 @@
|
||||
<Compile Include="Views\FiltersView.xaml.cs">
|
||||
<DependentUpon>FiltersView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\HomeView.xaml.cs">
|
||||
<DependentUpon>HomeView.xaml</DependentUpon>
|
||||
<Compile Include="Views\CatalogView.xaml.cs">
|
||||
<DependentUpon>CatalogView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\LoginView.xaml.cs">
|
||||
<DependentUpon>LoginView.xaml</DependentUpon>
|
||||
@ -190,7 +190,7 @@
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Views\HomeView.xaml">
|
||||
<EmbeddedResource Include="Views\CatalogView.xaml">
|
||||
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
|
@ -1,8 +1,8 @@
|
||||
|
||||
using Android.App;
|
||||
using Android.OS;
|
||||
using Android.Content.PM;
|
||||
using Android.Views;
|
||||
using Xamarin.Forms.Platform.Android;
|
||||
|
||||
namespace eShopOnContainers.Droid.Activities
|
||||
{
|
||||
@ -12,15 +12,20 @@ namespace eShopOnContainers.Droid.Activities
|
||||
Theme = "@style/MainTheme",
|
||||
MainLauncher = true,
|
||||
ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
|
||||
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
|
||||
public class MainActivity : FormsAppCompatActivity
|
||||
{
|
||||
protected override void OnCreate(Bundle bundle)
|
||||
{
|
||||
TabLayoutResource = Resource.Layout.Tabbar;
|
||||
ToolbarResource = Resource.Layout.Toolbar;
|
||||
FormsAppCompatActivity.ToolbarResource = Resource.Layout.Toolbar;
|
||||
FormsAppCompatActivity.TabLayoutResource = Resource.Layout.Tabs;
|
||||
|
||||
base.OnCreate(bundle);
|
||||
|
||||
SupportActionBar.SetDisplayShowHomeEnabled(true); // Show or hide the default home button
|
||||
SupportActionBar.SetDisplayHomeAsUpEnabled(true);
|
||||
SupportActionBar.SetDisplayShowCustomEnabled(true); // Enable overriding the default toolbar layout
|
||||
SupportActionBar.SetDisplayShowTitleEnabled(false);
|
||||
|
||||
global::Xamarin.Forms.Forms.Init(this, bundle);
|
||||
LoadApplication(new App());
|
||||
|
||||
|
@ -10,6 +10,9 @@ using Xamarin.Forms.Platform.Android;
|
||||
using eShopOnContainers.Droid.Extensions;
|
||||
using eShopOnContainers.Core.Controls;
|
||||
using eShopOnContainers.Droid.Renderers;
|
||||
using Android.Support.V4.View;
|
||||
using Android.Graphics;
|
||||
using static Android.Widget.ImageView;
|
||||
|
||||
[assembly: ExportRenderer(typeof(TabbedPage), typeof(CustomTabbedPageRenderer))]
|
||||
namespace eShopOnContainers.Droid.Renderers
|
||||
@ -20,6 +23,9 @@ namespace eShopOnContainers.Droid.Renderers
|
||||
protected readonly Dictionary<Element, BadgeView> BadgeViews = new Dictionary<Element, BadgeView>();
|
||||
private TabLayout _tabLayout;
|
||||
private TabLayout.SlidingTabStrip _tabStrip;
|
||||
private ViewPager _viewPager;
|
||||
private TabbedPage _tabbedPage;
|
||||
private bool _firstTime = true;
|
||||
|
||||
protected override void OnElementChanged(ElementChangedEventArgs<TabbedPage> e)
|
||||
{
|
||||
@ -33,6 +39,32 @@ namespace eShopOnContainers.Droid.Renderers
|
||||
return;
|
||||
}
|
||||
|
||||
_tabbedPage = e.NewElement as TabbedPage;
|
||||
_viewPager = (ViewPager)GetChildAt(0);
|
||||
|
||||
_tabLayout.TabSelected += (s, a) =>
|
||||
{
|
||||
var page = _tabbedPage.Children[a.Tab.Position];
|
||||
|
||||
if (page is TabbedPage)
|
||||
{
|
||||
var tabPage = (TabbedPage)page;
|
||||
SetTab(a.Tab, tabPage.Icon.File);
|
||||
}
|
||||
|
||||
_viewPager.SetCurrentItem(a.Tab.Position, false);
|
||||
};
|
||||
|
||||
_tabLayout.TabUnselected += (s, a) =>
|
||||
{
|
||||
var page = _tabbedPage.Children[a.Tab.Position];
|
||||
|
||||
if (page is TabbedPage)
|
||||
{
|
||||
SetTab(a.Tab, page.Icon.File);
|
||||
}
|
||||
};
|
||||
|
||||
_tabStrip = _tabLayout.FindChildOfType<TabLayout.SlidingTabStrip>();
|
||||
|
||||
for (var i = 0; i < _tabLayout.TabCount; i++)
|
||||
@ -44,6 +76,56 @@ namespace eShopOnContainers.Droid.Renderers
|
||||
Element.ChildRemoved += OnTabRemoved;
|
||||
}
|
||||
|
||||
|
||||
private void SetTab(TabLayout.Tab tab, string name)
|
||||
{
|
||||
try
|
||||
{
|
||||
int id = Resources.GetIdentifier(name, "drawable", Context.PackageName);
|
||||
tab.CustomView.FindViewById<ImageView>(Resource.Id.tab_icon).SetImageResource(id);
|
||||
tab.SetCustomView(Resource.Layout.TabLayout);
|
||||
tab.SetIcon(null);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine(ex.StackTrace);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void DispatchDraw(Canvas canvas)
|
||||
{
|
||||
base.DispatchDraw(canvas);
|
||||
|
||||
if (!_firstTime)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < _tabLayout.TabCount; i++)
|
||||
{
|
||||
var tab = _tabLayout.GetTabAt(i);
|
||||
var page = _tabbedPage.Children[tab.Position];
|
||||
|
||||
if (page is TabbedPage)
|
||||
{
|
||||
var tabbedPage = (TabbedPage)page;
|
||||
|
||||
SetTab(tab, tabbedPage.Icon.File);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetTab(tab, page.Icon.File);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(_tabbedPage.Title))
|
||||
{
|
||||
tab.SetText(string.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
_firstTime = false;
|
||||
}
|
||||
|
||||
private void AddTabBadge(int tabIndex)
|
||||
{
|
||||
var element = Element.Children[tabIndex];
|
||||
@ -71,11 +153,12 @@ namespace eShopOnContainers.Droid.Renderers
|
||||
|
||||
// Set color if not default
|
||||
var tabColor = CustomTabbedPage.GetBadgeColor(element);
|
||||
if (tabColor != Color.Default)
|
||||
|
||||
if (tabColor != Xamarin.Forms.Color.Default)
|
||||
{
|
||||
badgeView.BadgeColor = tabColor.ToAndroid();
|
||||
}
|
||||
|
||||
|
||||
element.PropertyChanged += OnTabbedPagePropertyChanged;
|
||||
}
|
||||
|
||||
@ -114,6 +197,7 @@ namespace eShopOnContainers.Droid.Renderers
|
||||
await Task.Delay(DeleayBeforeTabAdded);
|
||||
|
||||
var page = e.Element as Page;
|
||||
|
||||
if (page == null)
|
||||
return;
|
||||
|
||||
|
@ -5,7 +5,7 @@ using System;
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms.Platform.Android;
|
||||
|
||||
[assembly: ExportRenderer(typeof(HomeView), typeof(SlideDownMenuPageRenderer))]
|
||||
[assembly: ExportRenderer(typeof(CatalogView), typeof(SlideDownMenuPageRenderer))]
|
||||
namespace eShopOnContainers.Droid.Renderers
|
||||
{
|
||||
public class SlideDownMenuPageRenderer : PageRenderer, ISlideOverKitPageRendererDroid
|
||||
|
@ -1166,32 +1166,32 @@ namespace eShopOnContainers.Droid
|
||||
public partial class Color
|
||||
{
|
||||
|
||||
// aapt resource value: 0x7f0b0048
|
||||
public const int abc_background_cache_hint_selector_material_dark = 2131427400;
|
||||
|
||||
// aapt resource value: 0x7f0b0049
|
||||
public const int abc_background_cache_hint_selector_material_light = 2131427401;
|
||||
public const int abc_background_cache_hint_selector_material_dark = 2131427401;
|
||||
|
||||
// aapt resource value: 0x7f0b004a
|
||||
public const int abc_color_highlight_material = 2131427402;
|
||||
public const int abc_background_cache_hint_selector_material_light = 2131427402;
|
||||
|
||||
// aapt resource value: 0x7f0b004b
|
||||
public const int abc_color_highlight_material = 2131427403;
|
||||
|
||||
// aapt resource value: 0x7f0b0004
|
||||
public const int abc_input_method_navigation_guard = 2131427332;
|
||||
|
||||
// aapt resource value: 0x7f0b004b
|
||||
public const int abc_primary_text_disable_only_material_dark = 2131427403;
|
||||
|
||||
// aapt resource value: 0x7f0b004c
|
||||
public const int abc_primary_text_disable_only_material_light = 2131427404;
|
||||
public const int abc_primary_text_disable_only_material_dark = 2131427404;
|
||||
|
||||
// aapt resource value: 0x7f0b004d
|
||||
public const int abc_primary_text_material_dark = 2131427405;
|
||||
public const int abc_primary_text_disable_only_material_light = 2131427405;
|
||||
|
||||
// aapt resource value: 0x7f0b004e
|
||||
public const int abc_primary_text_material_light = 2131427406;
|
||||
public const int abc_primary_text_material_dark = 2131427406;
|
||||
|
||||
// aapt resource value: 0x7f0b004f
|
||||
public const int abc_search_url_text = 2131427407;
|
||||
public const int abc_primary_text_material_light = 2131427407;
|
||||
|
||||
// aapt resource value: 0x7f0b0050
|
||||
public const int abc_search_url_text = 2131427408;
|
||||
|
||||
// aapt resource value: 0x7f0b0005
|
||||
public const int abc_search_url_text_normal = 2131427333;
|
||||
@ -1202,11 +1202,11 @@ namespace eShopOnContainers.Droid
|
||||
// aapt resource value: 0x7f0b0007
|
||||
public const int abc_search_url_text_selected = 2131427335;
|
||||
|
||||
// aapt resource value: 0x7f0b0050
|
||||
public const int abc_secondary_text_material_dark = 2131427408;
|
||||
|
||||
// aapt resource value: 0x7f0b0051
|
||||
public const int abc_secondary_text_material_light = 2131427409;
|
||||
public const int abc_secondary_text_material_dark = 2131427409;
|
||||
|
||||
// aapt resource value: 0x7f0b0052
|
||||
public const int abc_secondary_text_material_light = 2131427410;
|
||||
|
||||
// aapt resource value: 0x7f0b0008
|
||||
public const int accent_material_dark = 2131427336;
|
||||
@ -1406,11 +1406,11 @@ namespace eShopOnContainers.Droid
|
||||
// aapt resource value: 0x7f0b003b
|
||||
public const int switch_thumb_disabled_material_light = 2131427387;
|
||||
|
||||
// aapt resource value: 0x7f0b0052
|
||||
public const int switch_thumb_material_dark = 2131427410;
|
||||
|
||||
// aapt resource value: 0x7f0b0053
|
||||
public const int switch_thumb_material_light = 2131427411;
|
||||
public const int switch_thumb_material_dark = 2131427411;
|
||||
|
||||
// aapt resource value: 0x7f0b0054
|
||||
public const int switch_thumb_material_light = 2131427412;
|
||||
|
||||
// aapt resource value: 0x7f0b003c
|
||||
public const int switch_thumb_normal_material_dark = 2131427388;
|
||||
@ -1418,6 +1418,9 @@ namespace eShopOnContainers.Droid
|
||||
// aapt resource value: 0x7f0b003d
|
||||
public const int switch_thumb_normal_material_light = 2131427389;
|
||||
|
||||
// aapt resource value: 0x7f0b0048
|
||||
public const int white = 2131427400;
|
||||
|
||||
static Color()
|
||||
{
|
||||
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
|
||||
@ -2299,8 +2302,8 @@ namespace eShopOnContainers.Droid
|
||||
// aapt resource value: 0x7f0200a8
|
||||
public const int mr_ic_play_light = 2130837672;
|
||||
|
||||
// aapt resource value: 0x7f0200ad
|
||||
public const int notification_template_icon_bg = 2130837677;
|
||||
// aapt resource value: 0x7f0200ae
|
||||
public const int notification_template_icon_bg = 2130837678;
|
||||
|
||||
// aapt resource value: 0x7f0200a9
|
||||
public const int product_add = 2130837673;
|
||||
@ -2314,6 +2317,9 @@ namespace eShopOnContainers.Droid
|
||||
// aapt resource value: 0x7f0200ac
|
||||
public const int splash_drawable = 2130837676;
|
||||
|
||||
// aapt resource value: 0x7f0200ad
|
||||
public const int user_profile = 2130837677;
|
||||
|
||||
static Drawable()
|
||||
{
|
||||
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
|
||||
@ -2711,8 +2717,8 @@ namespace eShopOnContainers.Droid
|
||||
// aapt resource value: 0x7f070013
|
||||
public const int showTitle = 2131165203;
|
||||
|
||||
// aapt resource value: 0x7f07009c
|
||||
public const int sliding_tabs = 2131165340;
|
||||
// aapt resource value: 0x7f07009d
|
||||
public const int sliding_tabs = 2131165341;
|
||||
|
||||
// aapt resource value: 0x7f07006c
|
||||
public const int snackbar_action = 2131165292;
|
||||
@ -2750,6 +2756,9 @@ namespace eShopOnContainers.Droid
|
||||
// aapt resource value: 0x7f07000d
|
||||
public const int tabMode = 2131165197;
|
||||
|
||||
// aapt resource value: 0x7f07009c
|
||||
public const int tab_icon = 2131165340;
|
||||
|
||||
// aapt resource value: 0x7f070099
|
||||
public const int text = 2131165337;
|
||||
|
||||
@ -2771,8 +2780,8 @@ namespace eShopOnContainers.Droid
|
||||
// aapt resource value: 0x7f070048
|
||||
public const int title_template = 2131165256;
|
||||
|
||||
// aapt resource value: 0x7f07009d
|
||||
public const int toolbar = 2131165341;
|
||||
// aapt resource value: 0x7f07009e
|
||||
public const int toolbar = 2131165342;
|
||||
|
||||
// aapt resource value: 0x7f070032
|
||||
public const int top = 2131165234;
|
||||
@ -3051,10 +3060,13 @@ namespace eShopOnContainers.Droid
|
||||
public const int support_simple_spinner_dropdown_item = 2130903097;
|
||||
|
||||
// aapt resource value: 0x7f03003a
|
||||
public const int Tabbar = 2130903098;
|
||||
public const int TabLayout = 2130903098;
|
||||
|
||||
// aapt resource value: 0x7f03003b
|
||||
public const int Toolbar = 2130903099;
|
||||
public const int Tabs = 2130903099;
|
||||
|
||||
// aapt resource value: 0x7f03003c
|
||||
public const int Toolbar = 2130903100;
|
||||
|
||||
static Layout()
|
||||
{
|
||||
|
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center">
|
||||
<ImageView
|
||||
android:id="@+id/tab_icon"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="center"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:background="@android:color/transparent" />
|
||||
</RelativeLayout>
|
@ -1,11 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.design.widget.TabLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/sliding_tabs"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/colorPrimary"
|
||||
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
|
||||
app:tabIndicatorColor="@android:color/white"
|
||||
app:tabGravity="fill"
|
||||
app:tabMode="fixed" />
|
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.design.widget.TabLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/sliding_tabs"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/colorPrimary"
|
||||
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
|
||||
app:tabIndicatorColor="@android:color/white"
|
||||
app:tabGravity="fill"
|
||||
app:tabMode="fixed" />
|
@ -1,9 +1,12 @@
|
||||
<android.support.v7.widget.Toolbar
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/colorPrimary"
|
||||
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
|
||||
android:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
|
||||
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.v7.widget.Toolbar
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:minHeight="?attr/actionBarSize"
|
||||
android:background="?attr/colorPrimary"
|
||||
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
|
||||
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
|
||||
app:layout_scrollFlags="scroll|enterAlways" />
|
@ -0,0 +1,3 @@
|
||||
<resources>
|
||||
<color name="white">#FFFFFF</color>
|
||||
</resources>
|
@ -3,6 +3,7 @@
|
||||
|
||||
<style name="MainTheme" parent="MainTheme.Base">
|
||||
</style>
|
||||
|
||||
<!-- Base theme applied no matter what API -->
|
||||
<style name="MainTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
|
||||
<!--If you are using revision 22.1 please use just windowNoTitle. Without android:-->
|
||||
|
@ -206,6 +206,15 @@
|
||||
<None Include="packages.config" />
|
||||
<None Include="Resources\AboutResources.txt" />
|
||||
<None Include="Assets\AboutAssets.txt" />
|
||||
<AndroidResource Include="Resources\layout\Tabs.axml">
|
||||
<SubType>Designer</SubType>
|
||||
</AndroidResource>
|
||||
<AndroidResource Include="Resources\layout\Toolbar.axml">
|
||||
<SubType>Designer</SubType>
|
||||
</AndroidResource>
|
||||
<AndroidResource Include="Resources\layout\TabLayout.axml">
|
||||
<SubType>Designer</SubType>
|
||||
</AndroidResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable\icon.png" />
|
||||
@ -217,8 +226,6 @@
|
||||
<None Include="Properties\AndroidManifest.xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\layout\Tabbar.axml" />
|
||||
<AndroidResource Include="Resources\layout\Toolbar.axml" />
|
||||
<AndroidResource Include="Resources\values\styles.xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@ -275,6 +282,15 @@
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable-hdpi\product_add.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable-xxxhdpi\user_profile.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\values\colors.xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable-xxxhdpi\menu_cart.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
|
||||
<Import Project="..\..\packages\Xamarin.Android.Support.Vector.Drawable.23.3.0\build\Xamarin.Android.Support.Vector.Drawable.targets" Condition="Exists('..\..\packages\Xamarin.Android.Support.Vector.Drawable.23.3.0\build\Xamarin.Android.Support.Vector.Drawable.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
|
Loading…
x
Reference in New Issue
Block a user