├── .gitattributes
├── .gitignore
├── .idea
└── .idea.Naxam.BottomTabbedPage
│ ├── .idea
│ ├── .name
│ ├── contentModel.xml
│ ├── modules.xml
│ ├── vcs.xml
│ └── workspace.xml
│ └── riderModule.iml
├── BottomTabbedPage.Droid
├── BottomTabbedPage.Platform.Droid.csproj
├── BottomTabbedRenderer.Tabs.cs
├── BottomTabbedRenderer.cs
├── Properties
│ └── AssemblyInfo.cs
└── Utils
│ ├── MeasureSpecFactory.cs
│ ├── ResourceManagerEx.cs
│ └── SizeUtils.cs
├── BottomTabbedPage
├── BottomTabbedPage.Forms.csproj
└── Controls
│ └── BottomTabbedPage.cs
├── Demo
└── IconizeDemo.Droid
│ ├── Assets
│ ├── AboutAssets.txt
│ └── architep.ttf
│ ├── IconizeDemo.Droid.csproj
│ ├── MainActivity.cs
│ ├── Properties
│ ├── AndroidManifest.xml
│ └── AssemblyInfo.cs
│ └── Resources
│ ├── AboutResources.txt
│ ├── drawable-hdpi
│ ├── icon.png
│ └── naxam_copyright.png
│ ├── drawable-mdpi
│ └── naxam_copyright.png
│ ├── drawable-xhdpi
│ ├── icon.png
│ └── naxam_copyright.png
│ ├── drawable-xxhdpi
│ ├── icon.png
│ └── naxam_copyright.png
│ ├── drawable-xxxhdpi
│ └── naxam_copyright.png
│ ├── drawable
│ ├── bg_splash.xml
│ ├── bnv_selector.xml
│ └── icon.png
│ ├── layout
│ ├── Tabbar.axml
│ └── Toolbar.axml
│ ├── mipmap-hdpi
│ ├── Icon.png
│ └── ic_launcher.png
│ ├── mipmap-ldpi
│ └── ic_launcher.png
│ ├── mipmap-mdpi
│ ├── Icon.png
│ └── ic_launcher.png
│ ├── mipmap-xhdpi
│ ├── Icon.png
│ └── ic_launcher.png
│ ├── mipmap-xxhdpi
│ ├── Icon.png
│ └── ic_launcher.png
│ ├── mipmap-xxxhdpi
│ ├── Icon.png
│ └── ic_launcher.png
│ └── values
│ ├── Strings.xml
│ └── styles.xml
├── LICENSE
├── Naxam.BottomTabbedPage.0.3.0.2.nupkg_
├── Naxam.BottomTabbedPage.0.3.0.3-pre1.nupkg
├── Naxam.BottomTabbedPage.sln
├── README.md
├── art
├── repo_header.png
├── tab1.png
└── tab5.png
├── bottombar.nuspec
└── demo
├── BottomTabbedPageQs.Droid
├── Assets
│ ├── AboutAssets.txt
│ └── architep.ttf
├── BottomTabbedPageQs.Droid.csproj
├── MainActivity.cs
├── Properties
│ ├── AndroidManifest.xml
│ └── AssemblyInfo.cs
└── Resources
│ ├── AboutResources.txt
│ ├── drawable-hdpi
│ ├── icon.png
│ └── naxam_copyright.png
│ ├── drawable-mdpi
│ └── naxam_copyright.png
│ ├── drawable-xhdpi
│ ├── icon.png
│ └── naxam_copyright.png
│ ├── drawable-xxhdpi
│ ├── icon.png
│ └── naxam_copyright.png
│ ├── drawable-xxxhdpi
│ └── naxam_copyright.png
│ ├── drawable
│ ├── bg_splash.xml
│ ├── bnv_selector.xml
│ ├── ic_audiotrack_black_24dp.xml
│ ├── ic_backup_black_24dp.xml
│ ├── ic_camera_black_24dp.xml
│ ├── ic_favorite_black_24dp.xml
│ ├── ic_visibility_black_24dp.xml
│ └── icon.png
│ ├── layout
│ ├── Tabbar.axml
│ └── Toolbar.axml
│ ├── mipmap-hdpi
│ └── ic_launcher.png
│ ├── mipmap-ldpi
│ └── ic_launcher.png
│ ├── mipmap-mdpi
│ └── ic_launcher.png
│ ├── mipmap-xhdpi
│ └── ic_launcher.png
│ ├── mipmap-xxhdpi
│ └── ic_launcher.png
│ ├── mipmap-xxxhdpi
│ └── ic_launcher.png
│ └── values
│ └── styles.xml
└── BottomTabbedPageQs
├── App.xaml
├── App.xaml.cs
├── BottomTabbedPageQs.csproj
├── TestPage.xaml
└── TestPage.xaml.cs
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Xamarin stuff
2 | Components
3 | [Pp]ackages
4 | *.userprefs
5 | Resource.designer.cs
6 |
7 | ## Ignore Visual Studio temporary files, build results, and
8 | ## files generated by popular Visual Studio add-ons.
9 |
10 | # User-specific files
11 | *.suo
12 | *.user
13 | *.sln.docstates
14 |
15 | # Build results
16 | [Dd]ebug/
17 | [Dd]ebugPublic/
18 | [Rr]elease/
19 | x64/
20 | build/
21 | bld/
22 | [Bb]in/
23 | [Oo]bj/
24 |
25 | # MSTest test Results
26 | [Tt]est[Rr]esult*/
27 | [Bb]uild[Ll]og.*
28 |
29 | #NUNIT
30 | *.VisualState.xml
31 | TestResult.xml
32 |
33 | # Build Results of an ATL Project
34 | [Dd]ebugPS/
35 | [Rr]eleasePS/
36 | dlldata.c
37 |
38 | *_i.c
39 | *_p.c
40 | *_i.h
41 | *.ilk
42 | *.meta
43 | *.obj
44 | *.pch
45 | *.pdb
46 | *.pgc
47 | *.pgd
48 | *.rsp
49 | *.sbr
50 | *.tlb
51 | *.tli
52 | *.tlh
53 | *.tmp
54 | *.tmp_proj
55 | *.log
56 | *.vspscc
57 | *.vssscc
58 | .builds
59 | *.pidb
60 | *.svclog
61 | *.scc
62 |
63 | # Chutzpah Test files
64 | _Chutzpah*
65 |
66 | # Visual C++ cache files
67 | ipch/
68 | *.aps
69 | *.ncb
70 | *.opensdf
71 | *.sdf
72 | *.cachefile
73 |
74 | # Visual Studio profiler
75 | *.psess
76 | *.vsp
77 | *.vspx
78 |
79 | # TFS 2012 Local Workspace
80 | $tf/
81 |
82 | # Guidance Automation Toolkit
83 | *.gpState
84 |
85 | # ReSharper is a .NET coding add-in
86 | _ReSharper*/
87 | *.[Rr]e[Ss]harper
88 | *.DotSettings.user
89 |
90 | # JustCode is a .NET coding addin-in
91 | .JustCode
92 |
93 | # TeamCity is a build add-in
94 | _TeamCity*
95 |
96 | # DotCover is a Code Coverage Tool
97 | *.dotCover
98 |
99 | # NCrunch
100 | *.ncrunch*
101 | _NCrunch_*
102 | .*crunch*.local.xml
103 |
104 | # MightyMoose
105 | *.mm.*
106 | AutoTest.Net/
107 |
108 | # Web workbench (sass)
109 | .sass-cache/
110 |
111 | # Installshield output folder
112 | [Ee]xpress/
113 |
114 | # DocProject is a documentation generator add-in
115 | DocProject/buildhelp/
116 | DocProject/Help/*.HxT
117 | DocProject/Help/*.HxC
118 | DocProject/Help/*.hhc
119 | DocProject/Help/*.hhk
120 | DocProject/Help/*.hhp
121 | DocProject/Help/Html2
122 | DocProject/Help/html
123 |
124 | # Click-Once directory
125 | publish/
126 |
127 | # Publish Web Output
128 | *.[Pp]ublish.xml
129 | *.azurePubxml
130 |
131 | # NuGet Packages Directory
132 | packages/
133 | ## TODO: If the tool you use requires repositories.config uncomment the next line
134 | #!packages/repositories.config
135 |
136 | # Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets
137 | # This line needs to be after the ignore of the build folder (and the packages folder if the line above has been uncommented)
138 | !packages/build/
139 |
140 | # Windows Azure Build Output
141 | csx/
142 | *.build.csdef
143 |
144 | # Windows Store app package directory
145 | AppPackages/
146 |
147 | # Others
148 | sql/
149 | *.Cache
150 | ClientBin/
151 | [Ss]tyle[Cc]op.*
152 | ~$*
153 | *~
154 | *.dbmdl
155 | *.dbproj.schemaview
156 | *.pfx
157 | *.publishsettings
158 | node_modules/
159 |
160 | # RIA/Silverlight projects
161 | Generated_Code/
162 |
163 | # Backup & report files from converting an old project file to a newer
164 | # Visual Studio version. Backup files are not needed, because we have git ;-)
165 | _UpgradeReport_Files/
166 | Backup*/
167 | UpgradeLog*.XML
168 | UpgradeLog*.htm
169 |
170 | # SQL Server files
171 | *.mdf
172 | *.ldf
173 |
174 | # Business Intelligence projects
175 | *.rdl.data
176 | *.bim.layout
177 | *.bim_*.settings
178 |
179 | # Microsoft Fakes
180 | FakesAssemblies/
181 |
182 | *.userprefs
183 |
184 | .DS_Store
185 |
186 | /.vs
187 |
--------------------------------------------------------------------------------
/.idea/.idea.Naxam.BottomTabbedPage/.idea/.name:
--------------------------------------------------------------------------------
1 | Naxam.BottomTabbedPage
--------------------------------------------------------------------------------
/.idea/.idea.Naxam.BottomTabbedPage/.idea/contentModel.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/.idea.Naxam.BottomTabbedPage/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/.idea.Naxam.BottomTabbedPage/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/.idea.Naxam.BottomTabbedPage/.idea/workspace.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 | 1501886056375
146 |
147 |
148 | 1501886056375
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
--------------------------------------------------------------------------------
/.idea/.idea.Naxam.BottomTabbedPage/riderModule.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/BottomTabbedPage.Droid/BottomTabbedPage.Platform.Droid.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | {60AA62D7-8C05-44B5-85EE-95DD36A6C43A}
7 | {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
8 | Library
9 | Naxam.Controls.Platform.Droid
10 | Naxam.BottomTabbedPage.Platform.Droid
11 | v9.0
12 | Resources\Resource.designer.cs
13 | Resource
14 | Resources
15 | Assets
16 | OnOutputUpdated
17 |
18 |
19 |
20 |
21 | true
22 | full
23 | false
24 | bin\Debug
25 | DEBUG;
26 | prompt
27 | 4
28 | None
29 |
30 |
31 | true
32 | pdbonly
33 | true
34 | bin\Release
35 | prompt
36 | 4
37 | true
38 | false
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 | 2.0.4
57 |
58 |
59 | 1.1.1.1
60 |
61 |
62 | 1.1.1.1
63 |
64 |
65 | 1.1.1.1
66 |
67 |
68 | 28.0.0.1
69 |
70 |
71 | 28.0.0.1
72 |
73 |
74 | 28.0.0.1
75 |
76 |
77 | 28.0.0.1
78 |
79 |
80 | 28.0.0.1
81 |
82 |
83 | 28.0.0.1
84 |
85 |
86 | 28.0.0.1
87 |
88 |
89 | 28.0.0.1
90 |
91 |
92 | 28.0.0.1
93 |
94 |
95 | 28.0.0.1
96 |
97 |
98 | 28.0.0.1
99 |
100 |
101 | 28.0.0.1
102 |
103 |
104 | 28.0.0.1
105 |
106 |
107 | 28.0.0.1
108 |
109 |
110 | 28.0.0.1
111 |
112 |
113 | 28.0.0.1
114 |
115 |
116 | 2.5.1.527436
117 |
118 |
119 |
120 |
121 | {B3F20A5F-FB43-4825-BD57-E1B7976020F8}
122 | BottomTabbedPage.Forms
123 |
124 |
125 |
126 |
--------------------------------------------------------------------------------
/BottomTabbedPage.Droid/BottomTabbedRenderer.Tabs.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Android.Content.Res;
3 | using Android.Graphics;
4 | using Android.Support.Design.Internal;
5 | using Android.Views;
6 | using Com.Ittianyu.Bottomnavigationviewex;
7 | using Naxam.Controls.Platform.Droid.Utils;
8 | using Xamarin.Forms.Platform.Android;
9 | using Xamarin.Forms;
10 | using Android.Widget;
11 |
12 | namespace Naxam.Controls.Platform.Droid
13 | {
14 | public partial class BottomTabbedRenderer : BottomNavigationViewEx.IOnNavigationItemSelectedListener
15 | {
16 | public static int? ItemBackgroundResource;
17 | public static ColorStateList ItemIconTintList;
18 | public static ColorStateList ItemTextColor;
19 | public static Android.Graphics.Color? BackgroundColor;
20 | public static Typeface Typeface;
21 | public static float? IconSize;
22 | public static float? FontSize;
23 | public static float ItemSpacing;
24 | public static ItemAlignFlags ItemAlign;
25 | public static Thickness ItemPadding;
26 | public static bool? VisibleTitle;
27 |
28 | internal int CurrentMenuItemId = 0;
29 |
30 | public bool OnNavigationItemSelected(IMenuItem item)
31 | {
32 | this.SwitchPage(item);
33 | return true;
34 | }
35 |
36 | internal void SetupTabItems()
37 | {
38 | this.SetupTabItems(bottomNav);
39 | }
40 |
41 | internal void SetupBottomBar()
42 | {
43 | bottomNav = this.SetupBottomBar(rootLayout, bottomNav, barId);
44 | }
45 | }
46 |
47 | public enum ItemAlignFlags
48 | {
49 | Default, Center, Top, Bottom
50 | }
51 |
52 | }
53 |
--------------------------------------------------------------------------------
/BottomTabbedPage.Droid/BottomTabbedRenderer.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Android.Widget;
3 | using Android.Views;
4 | using Xamarin.Forms;
5 | using Xamarin.Forms.Platform.Android;
6 | using Naxam.Controls.Platform.Droid;
7 | using System.ComponentModel;
8 | using Com.Ittianyu.Bottomnavigationviewex;
9 | using Naxam.Controls.Forms;
10 | using Naxam.Controls.Platform.Droid.Utils;
11 | using Android.Support.Design.Internal;
12 | using Android.Content;
13 |
14 | [assembly: ExportRenderer(typeof(BottomTabbedPage), typeof(BottomTabbedRenderer))]
15 | namespace Naxam.Controls.Platform.Droid
16 | {
17 | using RelativeLayout = Android.Widget.RelativeLayout;
18 | using Platform = Xamarin.Forms.Platform.Android.Platform;
19 |
20 | public partial class BottomTabbedRenderer : VisualElementRenderer
21 | {
22 | public static readonly Action DefaultMenuItemIconSetter = (menuItem, icon, selected) =>
23 | {
24 | var tabIconId = ResourceManagerEx.IdFromTitle(icon, ResourceManager.DrawableClass);
25 | menuItem.SetIcon(tabIconId);
26 | };
27 |
28 | public static bool ShouldUpdateSelectedIcon;
29 | public static Action MenuItemIconSetter;
30 | public static float? BottomBarHeight;
31 |
32 | RelativeLayout rootLayout;
33 | FrameLayout pageContainer;
34 | BottomNavigationViewEx bottomNav;
35 | readonly int barId;
36 |
37 | IPageController TabbedController => Element as IPageController;
38 |
39 | public int LastSelectedIndex { get; internal set; }
40 |
41 | public BottomTabbedRenderer(Context con) : base(con)
42 | {
43 | AutoPackage = false;
44 | barId = GenerateViewId();
45 | }
46 |
47 | protected override void OnElementChanged(ElementChangedEventArgs e)
48 | {
49 | base.OnElementChanged(e);
50 |
51 | if (e.OldElement != null)
52 | {
53 | e.OldElement.ChildAdded -= PagesChanged;
54 | e.OldElement.ChildRemoved -= PagesChanged;
55 | e.OldElement.ChildrenReordered -= PagesChanged;
56 | }
57 |
58 | if (e.NewElement == null)
59 | {
60 | return;
61 | }
62 |
63 | UpdateIgnoreContainerAreas();
64 |
65 | if (rootLayout == null)
66 | {
67 | SetupNativeView();
68 | }
69 |
70 |
71 | this.HandlePagesChanged();
72 | SwitchContent(Element.CurrentPage);
73 |
74 | Element.ChildAdded += PagesChanged;
75 | Element.ChildRemoved += PagesChanged;
76 | Element.ChildrenReordered += PagesChanged;
77 | }
78 |
79 | void PagesChanged(object sender, EventArgs e)
80 | {
81 | this.HandlePagesChanged();
82 | }
83 |
84 | protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
85 | {
86 | base.OnElementPropertyChanged(sender, e);
87 | if (e.PropertyName == nameof(TabbedPage.CurrentPage))
88 | {
89 | SwitchContent(Element.CurrentPage);
90 | }
91 | }
92 |
93 | protected override void OnAttachedToWindow()
94 | {
95 | base.OnAttachedToWindow();
96 | TabbedController?.SendAppearing();
97 | }
98 |
99 | protected override void OnDetachedFromWindow()
100 | {
101 | base.OnDetachedFromWindow();
102 | TabbedController?.SendDisappearing();
103 | }
104 |
105 | protected override void OnLayout(bool changed, int left, int top, int right, int bottom)
106 | {
107 | var width = right - left;
108 | var height = bottom - top;
109 |
110 | base.OnLayout(changed, left, top, right, bottom);
111 |
112 | if (width <= 0 || height <= 0)
113 | {
114 | return;
115 | }
116 |
117 | this.Layout(width, height);
118 | }
119 |
120 | protected override void Dispose(bool disposing)
121 | {
122 | if (disposing && Element != null)
123 | {
124 | Element.ChildAdded -= PagesChanged;
125 | Element.ChildRemoved -= PagesChanged;
126 | Element.ChildrenReordered -= PagesChanged;
127 |
128 | if (rootLayout != null)
129 | {
130 | //TODO Cleanup
131 | RemoveAllViews();
132 | foreach (Page pageToRemove in Element.Children)
133 | {
134 | IVisualElementRenderer pageRenderer = Platform.GetRenderer(pageToRemove);
135 |
136 | if (pageRenderer != null)
137 | {
138 | pageRenderer.View.RemoveFromParent();
139 | pageRenderer.Dispose();
140 | }
141 | }
142 |
143 | if (bottomNav != null)
144 | {
145 | bottomNav.SetOnNavigationItemSelectedListener(null);
146 | bottomNav.Dispose();
147 | bottomNav = null;
148 | }
149 | rootLayout.Dispose();
150 | rootLayout = null;
151 | }
152 | }
153 |
154 | base.Dispose(disposing);
155 | }
156 |
157 | internal void SetupNativeView()
158 | {
159 | rootLayout = this.CreateRoot(barId, GenerateViewId(),out pageContainer);
160 |
161 | AddView(rootLayout);
162 | }
163 |
164 | void SwitchContent(Page page)
165 | {
166 | this.ChangePage(pageContainer, page);
167 | }
168 |
169 | void UpdateIgnoreContainerAreas()
170 | {
171 | foreach (IPageController child in Element.Children)
172 | {
173 | child.IgnoresContainerArea = false;
174 | }
175 | }
176 | }
177 | }
--------------------------------------------------------------------------------
/BottomTabbedPage.Droid/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 |
4 | // Information about this assembly is defined by the following attributes.
5 | // Change them to the values specific to your project.
6 |
7 | [assembly: AssemblyTitle("Naxam.BottomTabbedPage.Platform.Droid")]
8 | [assembly: AssemblyDescription("A library for Xamarin.Forms where BottomNavigationView is used instead of TabLayout.")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("NAXAM CO.,LTD")]
11 | [assembly: AssemblyProduct("X Controls")]
12 | [assembly: AssemblyCopyright("Copyright (c) 2017 NAXAM")]
13 | [assembly: AssemblyTrademark("NAXAM")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
17 | // The form "{Major}.{Minor}.*" will automatically update the build and revision,
18 | // and "{Major}.{Minor}.{Build}.*" will update just the revision.
19 |
20 | [assembly: AssemblyVersion("0.3.0.1")]
21 |
22 | // The following attributes are used to specify the signing key for the assembly,
23 | // if desired. See the Mono documentation for more information about signing.
24 |
25 | //[assembly: AssemblyDelaySign(false)]
26 | //[assembly: AssemblyKeyFile("")]
27 |
--------------------------------------------------------------------------------
/BottomTabbedPage.Droid/Utils/MeasureSpecFactory.cs:
--------------------------------------------------------------------------------
1 | using Android.Views;
2 |
3 | namespace Naxam.Controls.Platform.Droid.Utils
4 | {
5 | internal static class MeasureSpecFactory
6 | {
7 | public static int GetSize(int measureSpec)
8 | {
9 | const int modeMask = 0x3 << 30;
10 | return measureSpec & ~modeMask;
11 | }
12 |
13 | // Literally does the same thing as the android code, 1000x faster because no bridge cross
14 | // benchmarked by calling 1,000,000 times in a loop on actual device
15 | public static int MakeMeasureSpec(int size, MeasureSpecMode mode)
16 | {
17 | return size + (int)mode;
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/BottomTabbedPage.Droid/Utils/ResourceManagerEx.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.IO;
4 | using System.Reflection;
5 |
6 | namespace Naxam.Controls.Platform.Droid.Utils
7 | {
8 | internal static class ResourceManagerEx
9 | {
10 | internal static int IdFromTitle(string title, Type type)
11 | {
12 | string name = Path.GetFileNameWithoutExtension(title);
13 | int id = GetId(type, name);
14 | return id; // Resources.System.GetDrawable (Resource.Drawable.dashboard);
15 | }
16 |
17 | static int GetId(Type type, string propertyName)
18 | {
19 | FieldInfo[] props = type.GetFields();
20 | FieldInfo prop = props.Select(p => p).FirstOrDefault(p => p.Name == propertyName);
21 | if (prop != null)
22 | return (int)prop.GetValue(type);
23 | return 0;
24 | }
25 | }
26 | }
--------------------------------------------------------------------------------
/BottomTabbedPage.Droid/Utils/SizeUtils.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Android.Content;
3 | using Android.Views;
4 | using Android.Widget;
5 | using Xamarin.Forms;
6 | using Xamarin.Forms.Platform.Android;
7 | using Com.Ittianyu.Bottomnavigationviewex;
8 | using Android.Support.Design.Internal;
9 |
10 | namespace Naxam.Controls.Platform.Droid.Utils
11 | {
12 | using RelativeLayout = Android.Widget.RelativeLayout;
13 | using Platform = Xamarin.Forms.Platform.Android.Platform;
14 |
15 | public static class BottomTabbedRendererUtils
16 | {
17 | public static Rectangle CreateRect(this Context context, int width, int height)
18 | {
19 | return new Rectangle(
20 | 0, 0,
21 | context.FromPixels(width),
22 | context.FromPixels(height)
23 | );
24 | }
25 |
26 | public static void HandlePagesChanged(this BottomTabbedRenderer renderer)
27 | {
28 | renderer.SetupBottomBar();
29 | renderer.SetupTabItems();
30 |
31 | if (renderer.Element.Children.Count == 0)
32 | {
33 | return;
34 | }
35 |
36 | EnsureTabIndex(renderer);
37 | }
38 |
39 | static void EnsureTabIndex(BottomTabbedRenderer renderer)
40 | {
41 | var rootLayout = (RelativeLayout)renderer.GetChildAt(0);
42 | var bottomNav = (BottomNavigationViewEx)rootLayout.GetChildAt(1);
43 | var menu = (BottomNavigationMenu)bottomNav.Menu;
44 |
45 | var itemIndex = menu.FindItemIndex(renderer.CurrentMenuItemId);
46 | var pageIndex = renderer.Element.Children.IndexOf(renderer.Element.CurrentPage);
47 | if (pageIndex >= 0 && pageIndex != itemIndex && pageIndex < bottomNav.ItemCount)
48 | {
49 | var menuItem = menu.GetItem(pageIndex);
50 | bottomNav.SelectedItemId = menuItem.ItemId;
51 |
52 | if (BottomTabbedRenderer.ShouldUpdateSelectedIcon && BottomTabbedRenderer.MenuItemIconSetter != null)
53 | {
54 | BottomTabbedRenderer.MenuItemIconSetter?.Invoke(menuItem, renderer.Element.CurrentPage.Icon, true);
55 |
56 | if (renderer.LastSelectedIndex != pageIndex)
57 | {
58 | var lastSelectedPage = renderer.Element.Children[renderer.LastSelectedIndex];
59 | var lastSelectedMenuItem = menu.GetItem(renderer.LastSelectedIndex);
60 | BottomTabbedRenderer.MenuItemIconSetter?.Invoke(lastSelectedMenuItem, lastSelectedPage.Icon, false);
61 | renderer.LastSelectedIndex = pageIndex;
62 | }
63 | }
64 | else if (renderer.LastSelectedIndex != pageIndex)
65 | {
66 | renderer.LastSelectedIndex = pageIndex;
67 | }
68 | }
69 | }
70 |
71 | public static void SwitchPage(this BottomTabbedRenderer renderer, IMenuItem item)
72 | {
73 | var rootLayout = (RelativeLayout)renderer.GetChildAt(0);
74 | var bottomNav = (BottomNavigationViewEx)rootLayout.GetChildAt(1);
75 | var menu = (BottomNavigationMenu)bottomNav.Menu;
76 | renderer.CurrentMenuItemId = item.ItemId;
77 | var index = menu.FindItemIndex(item.ItemId);
78 | var pageIndex = index % renderer.Element.Children.Count;
79 | var currentPageIndex = renderer.Element.Children.IndexOf(renderer.Element.CurrentPage);
80 |
81 | if (pageIndex == currentPageIndex)
82 | {
83 | if (renderer.Element.CurrentPage is NavigationPage nav)
84 | {
85 | nav.Navigation.PopToRootAsync();
86 | }
87 | }
88 | else
89 | {
90 | renderer.Element.CurrentPage = renderer.Element.Children[pageIndex];
91 | }
92 | }
93 |
94 | public static void Layout(this BottomTabbedRenderer renderer, int width, int height)
95 | {
96 | var rootLayout = (RelativeLayout)renderer.GetChildAt(0);
97 | var bottomNav = (BottomNavigationViewEx)rootLayout.GetChildAt(1);
98 |
99 | var Context = renderer.Context;
100 |
101 | rootLayout.Measure(
102 | MeasureSpecFactory.MakeMeasureSpec(width, MeasureSpecMode.Exactly),
103 | MeasureSpecFactory.MakeMeasureSpec(height, MeasureSpecMode.AtMost));
104 |
105 | ((IPageController)renderer.Element).ContainerArea = Context.CreateRect(rootLayout.MeasuredWidth, rootLayout.GetChildAt(0).MeasuredHeight);
106 |
107 | rootLayout.Measure(
108 | MeasureSpecFactory.MakeMeasureSpec(width, MeasureSpecMode.Exactly),
109 | MeasureSpecFactory.MakeMeasureSpec(height, MeasureSpecMode.Exactly));
110 | rootLayout.Layout(0, 0, rootLayout.MeasuredWidth, rootLayout.MeasuredHeight);
111 |
112 | if (renderer.Element.Children.Count == 0)
113 | {
114 | return;
115 | }
116 |
117 | int tabsHeight = bottomNav.MeasuredHeight;
118 |
119 | var item = (ViewGroup)bottomNav.GetChildAt(0);
120 |
121 | item.Measure(
122 | MeasureSpecFactory.MakeMeasureSpec(width, MeasureSpecMode.Exactly),
123 | MeasureSpecFactory.MakeMeasureSpec(tabsHeight, MeasureSpecMode.Exactly));
124 |
125 | item.Layout(0, 0, width, tabsHeight);
126 |
127 |
128 | var menuItems = bottomNav.GetBottomNavigationItemViews();
129 | var count = menuItems.Length;
130 | if (count == 0)
131 | {
132 | return;
133 | }
134 | var itemWidth = width / count;
135 | for (int i = 0; i < count; i++)
136 | {
137 | var menu = menuItems[i];
138 | menu.Measure(
139 | MeasureSpecFactory.MakeMeasureSpec(itemWidth, MeasureSpecMode.Exactly),
140 | MeasureSpecFactory.MakeMeasureSpec(tabsHeight, MeasureSpecMode.Exactly));
141 | menu.Layout(i * itemWidth, 0, itemWidth*(i+1), tabsHeight);
142 | }
143 | }
144 |
145 | public static void SetupTabItems(this BottomTabbedRenderer renderer, BottomNavigationViewEx bottomNav)
146 | {
147 | var Element = renderer.Element;
148 | var menu = (BottomNavigationMenu)bottomNav.Menu;
149 | menu.Clear();
150 | var mPresenterField = Java.Lang.Class.FromType(typeof(BottomNavigationMenuView)).GetDeclaredField("presenter");
151 | mPresenterField.Accessible = true;
152 | var mPresenter = (BottomNavigationPresenter)mPresenterField.Get(bottomNav.BottomNavigationMenuView);
153 | mPresenterField.Accessible = false;
154 |
155 | if (Element.Children.Count == 0)
156 | {
157 | return;
158 | }
159 |
160 | mPresenter.SetUpdateSuspended(true);
161 | var tabsCount = Math.Min(Element.Children.Count, bottomNav.MaxItemCount);
162 | for (int i = 0; i < tabsCount; i++)
163 | {
164 | var page = Element.Children[i];
165 | var menuItem = menu.Add(0, i, 0, page.Title);
166 | var setter = BottomTabbedRenderer.MenuItemIconSetter ?? BottomTabbedRenderer.DefaultMenuItemIconSetter;
167 | setter.Invoke(menuItem, page.Icon, renderer.LastSelectedIndex == i);
168 | }
169 | mPresenter.SetUpdateSuspended(false);
170 | mPresenter.UpdateMenuView(true);
171 |
172 | bottomNav.EnableShiftingMode(false);//remove shifting mode
173 | bottomNav.EnableItemShiftingMode(false);//remove shifting mode
174 | bottomNav.EnableAnimation(false);//remove animation
175 | bottomNav.SetTextVisibility(BottomTabbedRenderer.VisibleTitle.HasValue ? BottomTabbedRenderer.VisibleTitle.Value : true);
176 | if (BottomTabbedRenderer.Typeface != null)
177 | {
178 | bottomNav.SetTypeface(BottomTabbedRenderer.Typeface);
179 | }
180 | if (BottomTabbedRenderer.IconSize.HasValue)
181 | {
182 | bottomNav.SetIconSize(BottomTabbedRenderer.IconSize.Value, BottomTabbedRenderer.IconSize.Value);
183 | }
184 | if (BottomTabbedRenderer.FontSize.HasValue)
185 | {
186 | bottomNav.SetTextSize(BottomTabbedRenderer.FontSize.Value);
187 | }
188 |
189 | bottomNav.TextAlignment = Android.Views.TextAlignment.Center;
190 | }
191 |
192 | public static BottomNavigationViewEx SetupBottomBar(this BottomTabbedRenderer renderer, Android.Widget.RelativeLayout rootLayout, BottomNavigationViewEx bottomNav, int barId)
193 | {
194 | if (bottomNav != null)
195 | {
196 | rootLayout.RemoveView(bottomNav);
197 | bottomNav.SetOnNavigationItemSelectedListener(null);
198 | }
199 |
200 | var barParams = new Android.Widget.RelativeLayout.LayoutParams(
201 | ViewGroup.LayoutParams.MatchParent,
202 | BottomTabbedRenderer.BottomBarHeight.HasValue ? (int)rootLayout.Context.ToPixels(BottomTabbedRenderer.BottomBarHeight.Value) : ViewGroup.LayoutParams.WrapContent);
203 | barParams.AddRule(LayoutRules.AlignParentBottom);
204 | bottomNav = new BottomNavigationViewEx(rootLayout.Context)
205 | {
206 | LayoutParameters = barParams,
207 | Id = barId
208 | };
209 | if (BottomTabbedRenderer.BackgroundColor.HasValue)
210 | {
211 | bottomNav.SetBackgroundColor(BottomTabbedRenderer.BackgroundColor.Value);
212 | }
213 | if (BottomTabbedRenderer.ItemIconTintList != null)
214 | {
215 | bottomNav.ItemIconTintList = BottomTabbedRenderer.ItemIconTintList;
216 | }
217 | if (BottomTabbedRenderer.ItemTextColor != null)
218 | {
219 | bottomNav.ItemTextColor = BottomTabbedRenderer.ItemTextColor;
220 | }
221 | if (BottomTabbedRenderer.ItemBackgroundResource.HasValue)
222 | {
223 | bottomNav.ItemBackgroundResource = BottomTabbedRenderer.ItemBackgroundResource.Value;
224 | }
225 |
226 | bottomNav.SetOnNavigationItemSelectedListener(renderer);
227 | rootLayout.AddView(bottomNav, 1, barParams);
228 |
229 | return bottomNav;
230 | }
231 |
232 | public static void ChangePage(this BottomTabbedRenderer renderer, FrameLayout pageContainer, Page page)
233 | {
234 | renderer.Context.HideKeyboard(renderer);
235 |
236 | if (page == null)
237 | {
238 | return;
239 | }
240 |
241 | if (Platform.GetRenderer(page) == null)
242 | {
243 | Platform.SetRenderer(page, Platform.CreateRendererWithContext(page, renderer.Context));
244 | }
245 | var pageContent = Platform.GetRenderer(page).View;
246 | pageContainer.AddView(pageContent);
247 | if (pageContainer.ChildCount > 1)
248 | {
249 | pageContainer.RemoveViewAt(0);
250 | }
251 |
252 | EnsureTabIndex(renderer);
253 | }
254 |
255 | public static RelativeLayout CreateRoot(this BottomTabbedRenderer renderer, int barId, int pageContainerId, out FrameLayout pageContainer)
256 | {
257 | var rootLayout = new RelativeLayout(renderer.Context)
258 | {
259 | LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent),
260 | };
261 | var pageParams = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);
262 | pageParams.AddRule(LayoutRules.Above, barId);
263 |
264 | pageContainer = new FrameLayout(renderer.Context)
265 | {
266 | LayoutParameters = pageParams,
267 | Id = pageContainerId
268 | };
269 |
270 | rootLayout.AddView(pageContainer, 0, pageParams);
271 |
272 | return rootLayout;
273 | }
274 | }
275 | }
--------------------------------------------------------------------------------
/BottomTabbedPage/BottomTabbedPage.Forms.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Naxam.Controls.Forms
5 | netstandard2.0
6 |
7 | Naxam.BottomTabbedPage.Forms
8 | A library for Xamarin.Forms where BottomNavigationView is used instead of TabLayout.
9 | NAXAM CO.,LTD.
10 | XControls
11 | Copyright (c) 2017-present NAXAM
12 | NAXAM
13 | 0.3.0.1
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/BottomTabbedPage/Controls/BottomTabbedPage.cs:
--------------------------------------------------------------------------------
1 | using Xamarin.Forms;
2 |
3 | namespace Naxam.Controls.Forms
4 | {
5 | public class BottomTabbedPage : TabbedPage
6 | {
7 | }
8 | }
--------------------------------------------------------------------------------
/Demo/IconizeDemo.Droid/Assets/AboutAssets.txt:
--------------------------------------------------------------------------------
1 | Any raw assets you want to be deployed with your application can be placed in
2 | this directory (and child directories) and given a Build Action of "AndroidAsset".
3 |
4 | These files will be deployed with your package and will be accessible using Android's
5 | AssetManager, like this:
6 |
7 | public class ReadAsset : Activity
8 | {
9 | protected override void OnCreate (Bundle bundle)
10 | {
11 | base.OnCreate (bundle);
12 |
13 | InputStream input = Assets.Open ("my_asset.txt");
14 | }
15 | }
16 |
17 | Additionally, some Android functions will automatically load asset files:
18 |
19 | Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
20 |
--------------------------------------------------------------------------------
/Demo/IconizeDemo.Droid/Assets/architep.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NAXAM/bottomtabbedpage-xamarin-forms/61316493e777d7bb946c1b8ca423827b6be639d4/Demo/IconizeDemo.Droid/Assets/architep.ttf
--------------------------------------------------------------------------------
/Demo/IconizeDemo.Droid/IconizeDemo.Droid.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | {ED7EB8E6-2646-471A-A52A-DF93E30F0619}
7 | {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
8 | Library
9 | Naxam.IconizeDemo.Droid
10 | IconizeDemo.Droid
11 | v9.0
12 | True
13 | Resources\Resource.designer.cs
14 | Resource
15 | Properties\AndroidManifest.xml
16 | Resources
17 | Assets
18 |
19 |
20 |
21 |
22 | true
23 | full
24 | false
25 | bin\Debug
26 | DEBUG;
27 | prompt
28 | 4
29 | None
30 | arm64-v8a;armeabi;armeabi-v7a;x86
31 | false
32 | false
33 | false
34 |
35 |
36 | true
37 | pdbonly
38 | true
39 | bin\Release
40 | prompt
41 | 4
42 | true
43 | false
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 | {DEFB4EE7-1350-4DDC-BE1C-2F6BBAD93527}
95 | BottomTabbedPageQs
96 |
97 |
98 | {B3F20A5F-FB43-4825-BD57-E1B7976020F8}
99 | BottomTabbedPage.Forms
100 |
101 |
102 | {60AA62D7-8C05-44B5-85EE-95DD36A6C43A}
103 | BottomTabbedPage.Platform.Droid
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 | 2.0.4
112 |
113 |
114 | 1.0.10
115 |
116 |
117 | 1.0.10
118 |
119 |
120 | 1.1.1.1
121 |
122 |
123 | 1.1.1.1
124 |
125 |
126 | 1.1.1.1
127 |
128 |
129 | 28.0.0.1
130 |
131 |
132 | 28.0.0.1
133 |
134 |
135 | 28.0.0.1
136 |
137 |
138 | 28.0.0.1
139 |
140 |
141 | 28.0.0.1
142 |
143 |
144 | 28.0.0.1
145 |
146 |
147 | 28.0.0.1
148 |
149 |
150 | 28.0.0.1
151 |
152 |
153 | 28.0.0.1
154 |
155 |
156 | 28.0.0.1
157 |
158 |
159 | 28.0.0.1
160 |
161 |
162 | 28.0.0.1
163 |
164 |
165 | 28.0.0.1
166 |
167 |
168 | 28.0.0.1
169 |
170 |
171 | 28.0.0.1
172 |
173 |
174 | 28.0.0.1
175 |
176 |
177 | 2.5.1.527436
178 |
179 |
180 |
181 |
--------------------------------------------------------------------------------
/Demo/IconizeDemo.Droid/MainActivity.cs:
--------------------------------------------------------------------------------
1 |
2 | using Android.App;
3 | using Android.Content.PM;
4 | using Android.Graphics;
5 | using Android.OS;
6 | using Naxam.Controls.Platform.Droid;
7 | using Naxam.Demo;
8 | using Plugin.Iconize;
9 | using Plugin.Iconize.Droid.Controls;
10 |
11 | namespace Naxam.IconizeDemo.Droid
12 | {
13 | [Activity(Label = "IconizedBottomTabbedQs", Icon = "@mipmap/ic_launcher", Theme = "@style/MyTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
14 | public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
15 | {
16 | protected override void OnCreate(Bundle savedInstanceState)
17 | {
18 | TabLayoutResource = Resource.Layout.Tabbar;
19 | ToolbarResource = Resource.Layout.Toolbar;
20 |
21 | SetupBottomTabs();
22 |
23 | base.OnCreate(savedInstanceState);
24 |
25 | global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
26 |
27 | Plugin.Iconize.Iconize
28 | .With(new Plugin.Iconize.Fonts.FontAwesomeModule());
29 |
30 | //Plugin.Iconize.Iconize.Init(Resource.Id.Toolbar, Resource.Id.Tabbar);
31 | LoadApplication(new App());
32 | }
33 |
34 | void SetupBottomTabs()
35 | {
36 | var stateList = new Android.Content.Res.ColorStateList(
37 | new int[][] {
38 | new int[] { Android.Resource.Attribute.StateChecked
39 | },
40 | new int[] { Android.Resource.Attribute.StateEnabled
41 | }
42 | },
43 | new int[] {
44 | Color.Red, //Selected
45 | Color.White //Normal
46 | });
47 |
48 | BottomTabbedRenderer.BackgroundColor = new Color(0x9C, 0x27, 0xB0);
49 | BottomTabbedRenderer.FontSize = 12f;
50 | BottomTabbedRenderer.IconSize = 16;
51 | BottomTabbedRenderer.ItemTextColor = stateList;
52 | BottomTabbedRenderer.ItemIconTintList = stateList;
53 | BottomTabbedRenderer.Typeface = Typeface.CreateFromAsset(this.Assets, "architep.ttf");
54 | BottomTabbedRenderer.ItemBackgroundResource = Resource.Drawable.bnv_selector;
55 | BottomTabbedRenderer.ItemSpacing = 4;
56 | //BottomTabbedRenderer.ItemPadding = new Xamarin.Forms.Thickness(6);
57 | BottomTabbedRenderer.BottomBarHeight = 56;
58 | BottomTabbedRenderer.ItemAlign = ItemAlignFlags.Center;
59 | BottomTabbedRenderer.ShouldUpdateSelectedIcon = true;
60 | BottomTabbedRenderer.MenuItemIconSetter = (menuItem, iconSource, selected) => {
61 | var iconized = Iconize.FindIconForKey(iconSource.File);
62 | if (iconized == null)
63 | {
64 | BottomTabbedRenderer.DefaultMenuItemIconSetter.Invoke(menuItem, iconSource, selected);
65 |
66 | return;
67 | }
68 |
69 | var drawable = new IconDrawable(this, iconized).Color(selected ? Color.Red : Color.White).SizeDp(30);
70 |
71 | menuItem.SetIcon(drawable);
72 | };
73 | }
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/Demo/IconizeDemo.Droid/Properties/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Demo/IconizeDemo.Droid/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using Android.App;
4 |
5 | // Information about this assembly is defined by the following attributes.
6 | // Change them to the values specific to your project.
7 |
8 | [assembly: AssemblyTitle("IconizeDemo.Droid")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("NAXAM COMPANY LIMITED")]
12 | [assembly: AssemblyProduct("")]
13 | [assembly: AssemblyCopyright("Copyright (c) 2017 NAXAM")]
14 | [assembly: AssemblyTrademark("NAXAM")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
18 | // The form "{Major}.{Minor}.*" will automatically update the build and revision,
19 | // and "{Major}.{Minor}.{Build}.*" will update just the revision.
20 |
21 | [assembly: AssemblyVersion("1.0.0")]
22 |
23 | // The following attributes are used to specify the signing key for the assembly,
24 | // if desired. See the Mono documentation for more information about signing.
25 |
26 | //[assembly: AssemblyDelaySign(false)]
27 | //[assembly: AssemblyKeyFile("")]
28 |
--------------------------------------------------------------------------------
/Demo/IconizeDemo.Droid/Resources/AboutResources.txt:
--------------------------------------------------------------------------------
1 | Images, layout descriptions, binary blobs and string dictionaries can be included
2 | in your application as resource files. Various Android APIs are designed to
3 | operate on the resource IDs instead of dealing with images, strings or binary blobs
4 | directly.
5 |
6 | For example, a sample Android app that contains a user interface layout (main.axml),
7 | an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
8 | would keep its resources in the "Resources" directory of the application:
9 |
10 | Resources/
11 | drawable/
12 | icon.png
13 |
14 | layout/
15 | main.axml
16 |
17 | values/
18 | strings.xml
19 |
20 | In order to get the build system to recognize Android resources, set the build action to
21 | "AndroidResource". The native Android APIs do not operate directly with filenames, but
22 | instead operate on resource IDs. When you compile an Android application that uses resources,
23 | the build system will package the resources for distribution and generate a class called "R"
24 | (this is an Android convention) that contains the tokens for each one of the resources
25 | included. For example, for the above Resources layout, this is what the R class would expose:
26 |
27 | public class R {
28 | public class drawable {
29 | public const int icon = 0x123;
30 | }
31 |
32 | public class layout {
33 | public const int main = 0x456;
34 | }
35 |
36 | public class strings {
37 | public const int first_string = 0xabc;
38 | public const int second_string = 0xbcd;
39 | }
40 | }
41 |
42 | You would then use R.drawable.icon to reference the drawable/icon.png file, or R.layout.main
43 | to reference the layout/main.axml file, or R.strings.first_string to reference the first
44 | string in the dictionary file values/strings.xml.
45 |
--------------------------------------------------------------------------------
/Demo/IconizeDemo.Droid/Resources/drawable-hdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NAXAM/bottomtabbedpage-xamarin-forms/61316493e777d7bb946c1b8ca423827b6be639d4/Demo/IconizeDemo.Droid/Resources/drawable-hdpi/icon.png
--------------------------------------------------------------------------------
/Demo/IconizeDemo.Droid/Resources/drawable-hdpi/naxam_copyright.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NAXAM/bottomtabbedpage-xamarin-forms/61316493e777d7bb946c1b8ca423827b6be639d4/Demo/IconizeDemo.Droid/Resources/drawable-hdpi/naxam_copyright.png
--------------------------------------------------------------------------------
/Demo/IconizeDemo.Droid/Resources/drawable-mdpi/naxam_copyright.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NAXAM/bottomtabbedpage-xamarin-forms/61316493e777d7bb946c1b8ca423827b6be639d4/Demo/IconizeDemo.Droid/Resources/drawable-mdpi/naxam_copyright.png
--------------------------------------------------------------------------------
/Demo/IconizeDemo.Droid/Resources/drawable-xhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NAXAM/bottomtabbedpage-xamarin-forms/61316493e777d7bb946c1b8ca423827b6be639d4/Demo/IconizeDemo.Droid/Resources/drawable-xhdpi/icon.png
--------------------------------------------------------------------------------
/Demo/IconizeDemo.Droid/Resources/drawable-xhdpi/naxam_copyright.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NAXAM/bottomtabbedpage-xamarin-forms/61316493e777d7bb946c1b8ca423827b6be639d4/Demo/IconizeDemo.Droid/Resources/drawable-xhdpi/naxam_copyright.png
--------------------------------------------------------------------------------
/Demo/IconizeDemo.Droid/Resources/drawable-xxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NAXAM/bottomtabbedpage-xamarin-forms/61316493e777d7bb946c1b8ca423827b6be639d4/Demo/IconizeDemo.Droid/Resources/drawable-xxhdpi/icon.png
--------------------------------------------------------------------------------
/Demo/IconizeDemo.Droid/Resources/drawable-xxhdpi/naxam_copyright.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NAXAM/bottomtabbedpage-xamarin-forms/61316493e777d7bb946c1b8ca423827b6be639d4/Demo/IconizeDemo.Droid/Resources/drawable-xxhdpi/naxam_copyright.png
--------------------------------------------------------------------------------
/Demo/IconizeDemo.Droid/Resources/drawable-xxxhdpi/naxam_copyright.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NAXAM/bottomtabbedpage-xamarin-forms/61316493e777d7bb946c1b8ca423827b6be639d4/Demo/IconizeDemo.Droid/Resources/drawable-xxxhdpi/naxam_copyright.png
--------------------------------------------------------------------------------
/Demo/IconizeDemo.Droid/Resources/drawable/bg_splash.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | -
8 |
11 |
12 |
13 | -
16 |
19 |
20 |
--------------------------------------------------------------------------------
/Demo/IconizeDemo.Droid/Resources/drawable/bnv_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Demo/IconizeDemo.Droid/Resources/drawable/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NAXAM/bottomtabbedpage-xamarin-forms/61316493e777d7bb946c1b8ca423827b6be639d4/Demo/IconizeDemo.Droid/Resources/drawable/icon.png
--------------------------------------------------------------------------------
/Demo/IconizeDemo.Droid/Resources/layout/Tabbar.axml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/Demo/IconizeDemo.Droid/Resources/layout/Toolbar.axml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/Demo/IconizeDemo.Droid/Resources/mipmap-hdpi/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NAXAM/bottomtabbedpage-xamarin-forms/61316493e777d7bb946c1b8ca423827b6be639d4/Demo/IconizeDemo.Droid/Resources/mipmap-hdpi/Icon.png
--------------------------------------------------------------------------------
/Demo/IconizeDemo.Droid/Resources/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NAXAM/bottomtabbedpage-xamarin-forms/61316493e777d7bb946c1b8ca423827b6be639d4/Demo/IconizeDemo.Droid/Resources/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Demo/IconizeDemo.Droid/Resources/mipmap-ldpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NAXAM/bottomtabbedpage-xamarin-forms/61316493e777d7bb946c1b8ca423827b6be639d4/Demo/IconizeDemo.Droid/Resources/mipmap-ldpi/ic_launcher.png
--------------------------------------------------------------------------------
/Demo/IconizeDemo.Droid/Resources/mipmap-mdpi/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NAXAM/bottomtabbedpage-xamarin-forms/61316493e777d7bb946c1b8ca423827b6be639d4/Demo/IconizeDemo.Droid/Resources/mipmap-mdpi/Icon.png
--------------------------------------------------------------------------------
/Demo/IconizeDemo.Droid/Resources/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NAXAM/bottomtabbedpage-xamarin-forms/61316493e777d7bb946c1b8ca423827b6be639d4/Demo/IconizeDemo.Droid/Resources/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Demo/IconizeDemo.Droid/Resources/mipmap-xhdpi/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NAXAM/bottomtabbedpage-xamarin-forms/61316493e777d7bb946c1b8ca423827b6be639d4/Demo/IconizeDemo.Droid/Resources/mipmap-xhdpi/Icon.png
--------------------------------------------------------------------------------
/Demo/IconizeDemo.Droid/Resources/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NAXAM/bottomtabbedpage-xamarin-forms/61316493e777d7bb946c1b8ca423827b6be639d4/Demo/IconizeDemo.Droid/Resources/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Demo/IconizeDemo.Droid/Resources/mipmap-xxhdpi/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NAXAM/bottomtabbedpage-xamarin-forms/61316493e777d7bb946c1b8ca423827b6be639d4/Demo/IconizeDemo.Droid/Resources/mipmap-xxhdpi/Icon.png
--------------------------------------------------------------------------------
/Demo/IconizeDemo.Droid/Resources/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NAXAM/bottomtabbedpage-xamarin-forms/61316493e777d7bb946c1b8ca423827b6be639d4/Demo/IconizeDemo.Droid/Resources/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Demo/IconizeDemo.Droid/Resources/mipmap-xxxhdpi/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NAXAM/bottomtabbedpage-xamarin-forms/61316493e777d7bb946c1b8ca423827b6be639d4/Demo/IconizeDemo.Droid/Resources/mipmap-xxxhdpi/Icon.png
--------------------------------------------------------------------------------
/Demo/IconizeDemo.Droid/Resources/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NAXAM/bottomtabbedpage-xamarin-forms/61316493e777d7bb946c1b8ca423827b6be639d4/Demo/IconizeDemo.Droid/Resources/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Demo/IconizeDemo.Droid/Resources/values/Strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Hello World, Click Me!
4 | IconizeDemo.Droid
5 |
6 |
--------------------------------------------------------------------------------
/Demo/IconizeDemo.Droid/Resources/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #5DAC48
4 |
6 |
7 |
26 |
29 | #00ffffff
30 | #0Dffffff
31 |
32 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "{}"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright {yyyy} {name of copyright owner}
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/Naxam.BottomTabbedPage.0.3.0.2.nupkg_:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NAXAM/bottomtabbedpage-xamarin-forms/61316493e777d7bb946c1b8ca423827b6be639d4/Naxam.BottomTabbedPage.0.3.0.2.nupkg_
--------------------------------------------------------------------------------
/Naxam.BottomTabbedPage.0.3.0.3-pre1.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NAXAM/bottomtabbedpage-xamarin-forms/61316493e777d7bb946c1b8ca423827b6be639d4/Naxam.BottomTabbedPage.0.3.0.3-pre1.nupkg
--------------------------------------------------------------------------------
/Naxam.BottomTabbedPage.sln:
--------------------------------------------------------------------------------
1 | Microsoft Visual Studio Solution File, Format Version 12.00
2 | # Visual Studio 15
3 | VisualStudioVersion = 15.0.26430.6
4 | MinimumVisualStudioVersion = 10.0.40219.1
5 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BottomTabbedPageQs", "demo\BottomTabbedPageQs\BottomTabbedPageQs.csproj", "{DEFB4EE7-1350-4DDC-BE1C-2F6BBAD93527}"
6 | EndProject
7 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BottomTabbedPageQs.Droid", "demo\BottomTabbedPageQs.Droid\BottomTabbedPageQs.Droid.csproj", "{98E4BF61-0B7E-4F8F-A599-78235D272669}"
8 | EndProject
9 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BottomTabbedPage.Forms", "BottomTabbedPage\BottomTabbedPage.Forms.csproj", "{B3F20A5F-FB43-4825-BD57-E1B7976020F8}"
10 | EndProject
11 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BottomTabbedPage.Platform.Droid", "BottomTabbedPage.Droid\BottomTabbedPage.Platform.Droid.csproj", "{60AA62D7-8C05-44B5-85EE-95DD36A6C43A}"
12 | EndProject
13 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Demo", "Demo", "{27C2731C-B6B4-4015-8DD5-F795AC5B1AE1}"
14 | EndProject
15 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IconizeDemo.Droid", "demo\IconizeDemo.Droid\IconizeDemo.Droid.csproj", "{ED7EB8E6-2646-471A-A52A-DF93E30F0619}"
16 | EndProject
17 | Global
18 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
19 | Debug|Any CPU = Debug|Any CPU
20 | Debug|iPhone = Debug|iPhone
21 | Debug|iPhoneSimulator = Debug|iPhoneSimulator
22 | Release|Any CPU = Release|Any CPU
23 | Release|iPhone = Release|iPhone
24 | Release|iPhoneSimulator = Release|iPhoneSimulator
25 | EndGlobalSection
26 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
27 | {DEFB4EE7-1350-4DDC-BE1C-2F6BBAD93527}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
28 | {DEFB4EE7-1350-4DDC-BE1C-2F6BBAD93527}.Debug|Any CPU.Build.0 = Debug|Any CPU
29 | {DEFB4EE7-1350-4DDC-BE1C-2F6BBAD93527}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
30 | {DEFB4EE7-1350-4DDC-BE1C-2F6BBAD93527}.Debug|iPhone.ActiveCfg = Debug|Any CPU
31 | {DEFB4EE7-1350-4DDC-BE1C-2F6BBAD93527}.Debug|iPhone.Build.0 = Debug|Any CPU
32 | {DEFB4EE7-1350-4DDC-BE1C-2F6BBAD93527}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
33 | {DEFB4EE7-1350-4DDC-BE1C-2F6BBAD93527}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
34 | {DEFB4EE7-1350-4DDC-BE1C-2F6BBAD93527}.Release|Any CPU.ActiveCfg = Release|Any CPU
35 | {DEFB4EE7-1350-4DDC-BE1C-2F6BBAD93527}.Release|Any CPU.Build.0 = Release|Any CPU
36 | {DEFB4EE7-1350-4DDC-BE1C-2F6BBAD93527}.Release|iPhone.ActiveCfg = Release|Any CPU
37 | {DEFB4EE7-1350-4DDC-BE1C-2F6BBAD93527}.Release|iPhone.Build.0 = Release|Any CPU
38 | {DEFB4EE7-1350-4DDC-BE1C-2F6BBAD93527}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
39 | {DEFB4EE7-1350-4DDC-BE1C-2F6BBAD93527}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
40 | {98E4BF61-0B7E-4F8F-A599-78235D272669}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
41 | {98E4BF61-0B7E-4F8F-A599-78235D272669}.Debug|Any CPU.Build.0 = Debug|Any CPU
42 | {98E4BF61-0B7E-4F8F-A599-78235D272669}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
43 | {98E4BF61-0B7E-4F8F-A599-78235D272669}.Debug|iPhone.ActiveCfg = Debug|Any CPU
44 | {98E4BF61-0B7E-4F8F-A599-78235D272669}.Debug|iPhone.Build.0 = Debug|Any CPU
45 | {98E4BF61-0B7E-4F8F-A599-78235D272669}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
46 | {98E4BF61-0B7E-4F8F-A599-78235D272669}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
47 | {98E4BF61-0B7E-4F8F-A599-78235D272669}.Release|Any CPU.ActiveCfg = Release|Any CPU
48 | {98E4BF61-0B7E-4F8F-A599-78235D272669}.Release|Any CPU.Build.0 = Release|Any CPU
49 | {98E4BF61-0B7E-4F8F-A599-78235D272669}.Release|Any CPU.Deploy.0 = Release|Any CPU
50 | {98E4BF61-0B7E-4F8F-A599-78235D272669}.Release|iPhone.ActiveCfg = Release|Any CPU
51 | {98E4BF61-0B7E-4F8F-A599-78235D272669}.Release|iPhone.Build.0 = Release|Any CPU
52 | {98E4BF61-0B7E-4F8F-A599-78235D272669}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
53 | {98E4BF61-0B7E-4F8F-A599-78235D272669}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
54 | {B3F20A5F-FB43-4825-BD57-E1B7976020F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
55 | {B3F20A5F-FB43-4825-BD57-E1B7976020F8}.Debug|Any CPU.Build.0 = Debug|Any CPU
56 | {B3F20A5F-FB43-4825-BD57-E1B7976020F8}.Debug|iPhone.ActiveCfg = Debug|Any CPU
57 | {B3F20A5F-FB43-4825-BD57-E1B7976020F8}.Debug|iPhone.Build.0 = Debug|Any CPU
58 | {B3F20A5F-FB43-4825-BD57-E1B7976020F8}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
59 | {B3F20A5F-FB43-4825-BD57-E1B7976020F8}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
60 | {B3F20A5F-FB43-4825-BD57-E1B7976020F8}.Release|Any CPU.ActiveCfg = Release|Any CPU
61 | {B3F20A5F-FB43-4825-BD57-E1B7976020F8}.Release|Any CPU.Build.0 = Release|Any CPU
62 | {B3F20A5F-FB43-4825-BD57-E1B7976020F8}.Release|iPhone.ActiveCfg = Release|Any CPU
63 | {B3F20A5F-FB43-4825-BD57-E1B7976020F8}.Release|iPhone.Build.0 = Release|Any CPU
64 | {B3F20A5F-FB43-4825-BD57-E1B7976020F8}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
65 | {B3F20A5F-FB43-4825-BD57-E1B7976020F8}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
66 | {60AA62D7-8C05-44B5-85EE-95DD36A6C43A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
67 | {60AA62D7-8C05-44B5-85EE-95DD36A6C43A}.Debug|Any CPU.Build.0 = Debug|Any CPU
68 | {60AA62D7-8C05-44B5-85EE-95DD36A6C43A}.Debug|iPhone.ActiveCfg = Debug|Any CPU
69 | {60AA62D7-8C05-44B5-85EE-95DD36A6C43A}.Debug|iPhone.Build.0 = Debug|Any CPU
70 | {60AA62D7-8C05-44B5-85EE-95DD36A6C43A}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
71 | {60AA62D7-8C05-44B5-85EE-95DD36A6C43A}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
72 | {60AA62D7-8C05-44B5-85EE-95DD36A6C43A}.Release|Any CPU.ActiveCfg = Release|Any CPU
73 | {60AA62D7-8C05-44B5-85EE-95DD36A6C43A}.Release|Any CPU.Build.0 = Release|Any CPU
74 | {60AA62D7-8C05-44B5-85EE-95DD36A6C43A}.Release|iPhone.ActiveCfg = Release|Any CPU
75 | {60AA62D7-8C05-44B5-85EE-95DD36A6C43A}.Release|iPhone.Build.0 = Release|Any CPU
76 | {60AA62D7-8C05-44B5-85EE-95DD36A6C43A}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
77 | {60AA62D7-8C05-44B5-85EE-95DD36A6C43A}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
78 | {ED7EB8E6-2646-471A-A52A-DF93E30F0619}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
79 | {ED7EB8E6-2646-471A-A52A-DF93E30F0619}.Debug|Any CPU.Build.0 = Debug|Any CPU
80 | {ED7EB8E6-2646-471A-A52A-DF93E30F0619}.Debug|iPhone.ActiveCfg = Debug|Any CPU
81 | {ED7EB8E6-2646-471A-A52A-DF93E30F0619}.Debug|iPhone.Build.0 = Debug|Any CPU
82 | {ED7EB8E6-2646-471A-A52A-DF93E30F0619}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
83 | {ED7EB8E6-2646-471A-A52A-DF93E30F0619}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
84 | {ED7EB8E6-2646-471A-A52A-DF93E30F0619}.Release|Any CPU.ActiveCfg = Release|Any CPU
85 | {ED7EB8E6-2646-471A-A52A-DF93E30F0619}.Release|Any CPU.Build.0 = Release|Any CPU
86 | {ED7EB8E6-2646-471A-A52A-DF93E30F0619}.Release|iPhone.ActiveCfg = Release|Any CPU
87 | {ED7EB8E6-2646-471A-A52A-DF93E30F0619}.Release|iPhone.Build.0 = Release|Any CPU
88 | {ED7EB8E6-2646-471A-A52A-DF93E30F0619}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
89 | {ED7EB8E6-2646-471A-A52A-DF93E30F0619}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
90 | EndGlobalSection
91 | GlobalSection(SolutionProperties) = preSolution
92 | HideSolutionNode = FALSE
93 | EndGlobalSection
94 | GlobalSection(NestedProjects) = preSolution
95 | {DEFB4EE7-1350-4DDC-BE1C-2F6BBAD93527} = {27C2731C-B6B4-4015-8DD5-F795AC5B1AE1}
96 | {98E4BF61-0B7E-4F8F-A599-78235D272669} = {27C2731C-B6B4-4015-8DD5-F795AC5B1AE1}
97 | {ED7EB8E6-2646-471A-A52A-DF93E30F0619} = {27C2731C-B6B4-4015-8DD5-F795AC5B1AE1}
98 | EndGlobalSection
99 | EndGlobal
100 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | # BottomTabbedPage
4 | A Xamarin.Forms control brings BottomNavigationView for bottom navigation on Android
5 |
6 | |||
7 | |:---:|:---:|
8 |
9 | ## About
10 | This project is maintained by Naxam Co.,Ltd.
11 | We specialize in developing mobile applications using Xamarin and native technology stack.
12 |
13 | **Looking for developers for your project?**
14 |
15 |
16 |
17 |
18 | ## What's inside
19 | BottomNavigationView is a new control since Android Support Design v25. This source code demonstrate the way to bring it into Xamarin.Forms.
20 |
21 | However, BottomNavigationView is very limited from customizing, we have to employ library BottomNavigationViewEx as a patch.
22 |
23 | In this code, we have
24 | - A custom BottomTabbedPage
25 | - A custom BottomTabbedRenderer
26 |
27 | We could
28 | - change color of background, text of the bar, each item
29 | - chagne the height of the bar
30 | - change text typeface
31 |
32 | # Depedendencies
33 |
34 | - BottomNavigationViewEx [nuget](https://www.nuget.org/packages/Naxam.Ittianyu.BottomNavExtension/)
35 |
36 | ## How to use
37 |
38 | ### Install NUGET package
39 | ```
40 | Install-Package Naxam.BottomTabbedPage
41 | ```
42 |
43 | ### Add XML namespace in your XAML
44 | ```xml
45 | xmlns:naxam="clr-namespace:Naxam.Controls.Forms;assembly=Naxam.Controls.Forms"
46 | ```
47 |
48 | ### Change the root element to BottomTabbedPage (change the code behind as well)
49 | ```xml
50 |
56 |
57 |
58 |
59 |
60 |
61 |
62 | ```
63 |
64 | ### Change the colors/heights in your activity class
65 | ```c#
66 | BottomTabbedRenderer.BackgroundColor = new Android.Graphics.Color(23, 31, 50);
67 | BottomTabbedRenderer.FontSize = 10;
68 | BottomTabbedRenderer.IconSize = 20;
69 | BottomTabbedRenderer.ItemTextColor = stateList;
70 | BottomTabbedRenderer.ItemIconTintList = stateList;
71 | BottomTabbedRenderer.Typeface = Typeface.CreateFromAsset(this.Assets, "HiraginoKakugoProNW3.otf");
72 | BottomTabbedRenderer.ItemBackgroundResource = Resource.Drawable.bnv_selector;
73 | BottomTabbedRenderer.ItemSpacing = 8;
74 | BottomTabbedRenderer.ItemPadding = new Xamarin.Forms.Thickness(8);
75 | BottomTabbedRenderer.BottomBarHeight = 80;
76 | BottomTabbedRenderer.ItemAlign = BottomTabbedRenderer.ItemAlignFlags.Center;
77 | ```
78 |
79 | ### Use Iconize for menu item
80 | ```c#
81 | BottomTabbedRenderer.MenuItemIconSetter = (menuItem, iconSource) => {
82 | var iconized = Iconize.FindIconForKey(iconSource.File);
83 | if (iconized == null)
84 | {
85 | BottomTabbedRenderer.DefaultMenuItemIconSetter.Invoke(menuItem, iconSource);
86 |
87 | return;
88 | }
89 |
90 | var drawable = new IconDrawable(this, iconized).Color(Color.White).SizeDp(20);
91 |
92 | menuItem.SetIcon(drawable);
93 | };
94 | ```
95 |
96 | ## Source Code
97 | - Naxam.BottomNavs.Platform.Droid/*.cs
98 | - Naxam.BottomNavs.Forms/BottomTabbedPage.cs
99 |
100 | ## Credits
101 | This library currently uses `BottomNavigationViewEx` from @ittianyu [BottomNavigationViewEx](https://github.com/ittianyu/BottomNavigationViewEx) library.
102 |
103 | ## License
104 |
105 | BottmTabbedPage is released under the Apache License license.
106 | See [LICENSE](./LICENSE) for details.
--------------------------------------------------------------------------------
/art/repo_header.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NAXAM/bottomtabbedpage-xamarin-forms/61316493e777d7bb946c1b8ca423827b6be639d4/art/repo_header.png
--------------------------------------------------------------------------------
/art/tab1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NAXAM/bottomtabbedpage-xamarin-forms/61316493e777d7bb946c1b8ca423827b6be639d4/art/tab1.png
--------------------------------------------------------------------------------
/art/tab5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NAXAM/bottomtabbedpage-xamarin-forms/61316493e777d7bb946c1b8ca423827b6be639d4/art/tab5.png
--------------------------------------------------------------------------------
/bottombar.nuspec:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Naxam.BottomTabbedPage
6 | 0.3.0.3-pre1
7 | A library for Xamarin.Forms where BottomNavigationView is used instead of TabLayout.
8 | Vu Duc Tuyen, Do Thanh Binh
9 | NAXAM CO.,LTD
10 | false
11 | Naxam - BottomTabbedPage
12 |
13 | Upgrade to Android.Support v28
14 |
15 | A library for Xamarin.Forms where BottomNavigationView is used instead of TabLayout.
16 | https://avatars1.githubusercontent.com/u/25535951
17 | https://github.com/NAXAM/bottomtabbedpage-xamarin-forms
18 | Copyright (c) 2017-present NAXAM
19 | Xamarin.Android, Xamarin.Forms, BottomNaviationView, BottomNavigationViewEx, BottomTabbedPage
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/demo/BottomTabbedPageQs.Droid/Assets/AboutAssets.txt:
--------------------------------------------------------------------------------
1 | Any raw assets you want to be deployed with your application can be placed in
2 | this directory (and child directories) and given a Build Action of "AndroidAsset".
3 |
4 | These files will be deployed with your package and will be accessible using Android's
5 | AssetManager, like this:
6 |
7 | public class ReadAsset : Activity
8 | {
9 | protected override void OnCreate (Bundle bundle)
10 | {
11 | base.OnCreate (bundle);
12 |
13 | InputStream input = Assets.Open ("my_asset.txt");
14 | }
15 | }
16 |
17 | Additionally, some Android functions will automatically load asset files:
18 |
19 | Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
20 |
--------------------------------------------------------------------------------
/demo/BottomTabbedPageQs.Droid/Assets/architep.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NAXAM/bottomtabbedpage-xamarin-forms/61316493e777d7bb946c1b8ca423827b6be639d4/demo/BottomTabbedPageQs.Droid/Assets/architep.ttf
--------------------------------------------------------------------------------
/demo/BottomTabbedPageQs.Droid/BottomTabbedPageQs.Droid.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | {98E4BF61-0B7E-4F8F-A599-78235D272669}
7 | {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
8 | Library
9 | BottomTabbedPageQs.Droid
10 | Naxam.BottomTabbedPage.Demo.Droid
11 | v9.0
12 | True
13 | Resources\Resource.designer.cs
14 | Resource
15 | Properties\AndroidManifest.xml
16 | Resources
17 | Assets
18 | OnOutputUpdated
19 |
20 |
21 |
22 |
23 | true
24 | full
25 | false
26 | bin\Debug
27 | DEBUG;
28 | prompt
29 | 4
30 | None
31 |
32 |
33 | true
34 | pdbonly
35 | true
36 | bin\Release
37 | prompt
38 | 4
39 | true
40 | false
41 |
42 | 1G
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 | {60aa62d7-8c05-44b5-85ee-95dd36a6c43a}
91 | BottomTabbedPage.Platform.Droid
92 |
93 |
94 | {b3f20a5f-fb43-4825-bd57-e1b7976020f8}
95 | BottomTabbedPage.Forms
96 |
97 |
98 | {DEFB4EE7-1350-4DDC-BE1C-2F6BBAD93527}
99 | BottomTabbedPageQs
100 |
101 |
102 |
103 |
104 | 2.0.4
105 |
106 |
107 | 1.0.10
108 |
109 |
110 | 1.0.10
111 |
112 |
113 | 1.1.1.1
114 |
115 |
116 | 1.1.1.1
117 |
118 |
119 | 1.1.1.1
120 |
121 |
122 | 28.0.0.1
123 |
124 |
125 | 28.0.0.1
126 |
127 |
128 | 28.0.0.1
129 |
130 |
131 | 28.0.0.1
132 |
133 |
134 | 28.0.0.1
135 |
136 |
137 | 28.0.0.1
138 |
139 |
140 | 28.0.0.1
141 |
142 |
143 | 28.0.0.1
144 |
145 |
146 | 28.0.0.1
147 |
148 |
149 | 28.0.0.1
150 |
151 |
152 | 28.0.0.1
153 |
154 |
155 | 28.0.0.1
156 |
157 |
158 | 28.0.0.1
159 |
160 |
161 | 28.0.0.1
162 |
163 |
164 | 28.0.0.1
165 |
166 |
167 | 28.0.0.1
168 |
169 |
170 | 2.5.1.527436
171 |
172 |
173 |
174 |
--------------------------------------------------------------------------------
/demo/BottomTabbedPageQs.Droid/MainActivity.cs:
--------------------------------------------------------------------------------
1 |
2 | using Android.App;
3 | using Android.Content.PM;
4 | using Android.Graphics;
5 | using Android.OS;
6 | using Naxam.Controls.Platform.Droid;
7 | using Naxam.Demo;
8 |
9 | namespace BottomTabbedPageQs.Droid
10 | {
11 | [Activity(Label = "BottomTabbedQs", Icon = "@mipmap/ic_launcher", Theme = "@style/MyTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
12 | public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
13 | {
14 | protected override void OnCreate(Bundle savedInstanceState)
15 | {
16 | TabLayoutResource = Resource.Layout.Tabbar;
17 | ToolbarResource = Resource.Layout.Toolbar;
18 |
19 | SetupBottomTabs();
20 |
21 | base.OnCreate(savedInstanceState);
22 |
23 | global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
24 |
25 | LoadApplication(new App());
26 | }
27 |
28 | void SetupBottomTabs()
29 | {
30 | var stateList = new Android.Content.Res.ColorStateList(
31 | new int[][] {
32 | new int[] { Android.Resource.Attribute.StateChecked
33 | },
34 | new int[] { Android.Resource.Attribute.StateEnabled
35 | }
36 | },
37 | new int[] {
38 | Color.DarkRed, //Selected
39 | Color.White //Normal
40 | });
41 | BottomTabbedRenderer.VisibleTitle = false;
42 | BottomTabbedRenderer.BackgroundColor = new Color(0x9C, 0x27, 0xB0);
43 | BottomTabbedRenderer.FontSize = 12f;
44 | BottomTabbedRenderer.IconSize = 24;
45 | BottomTabbedRenderer.ItemTextColor = stateList;
46 | BottomTabbedRenderer.ItemIconTintList = stateList;
47 | BottomTabbedRenderer.Typeface = Typeface.CreateFromAsset(this.Assets, "architep.ttf");
48 | BottomTabbedRenderer.ItemBackgroundResource = Resource.Drawable.bnv_selector;
49 | BottomTabbedRenderer.ItemSpacing = 4;
50 | //BottomTabbedRenderer.ItemPadding = new Xamarin.Forms.Thickness(6);
51 | BottomTabbedRenderer.BottomBarHeight = 56;
52 | BottomTabbedRenderer.ItemAlign = ItemAlignFlags.Center;
53 | BottomTabbedRenderer.MenuItemIconSetter = (menuItem, iconSource, selected) => {
54 | var resId = Resources.GetIdentifier(iconSource.File, "drawable", PackageName);
55 |
56 | menuItem.SetIcon(resId);
57 | };
58 | }
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/demo/BottomTabbedPageQs.Droid/Properties/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/demo/BottomTabbedPageQs.Droid/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using Android.App;
4 |
5 | // Information about this assembly is defined by the following attributes.
6 | // Change them to the values specific to your project.
7 |
8 | [assembly: AssemblyTitle("BottomTabbedPage.Demo.Droid")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("NAXAM CO.,LTD")]
12 | [assembly: AssemblyProduct("")]
13 | [assembly: AssemblyCopyright("Copyright (c) 2017 NAXAM")]
14 | [assembly: AssemblyTrademark("NAXAM")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
18 | // The form "{Major}.{Minor}.*" will automatically update the build and revision,
19 | // and "{Major}.{Minor}.{Build}.*" will update just the revision.
20 |
21 | [assembly: AssemblyVersion("1.0.0")]
22 |
23 | // The following attributes are used to specify the signing key for the assembly,
24 | // if desired. See the Mono documentation for more information about signing.
25 |
26 | //[assembly: AssemblyDelaySign(false)]
27 | //[assembly: AssemblyKeyFile("")]
28 |
--------------------------------------------------------------------------------
/demo/BottomTabbedPageQs.Droid/Resources/AboutResources.txt:
--------------------------------------------------------------------------------
1 | Images, layout descriptions, binary blobs and string dictionaries can be included
2 | in your application as resource files. Various Android APIs are designed to
3 | operate on the resource IDs instead of dealing with images, strings or binary blobs
4 | directly.
5 |
6 | For example, a sample Android app that contains a user interface layout (main.axml),
7 | an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
8 | would keep its resources in the "Resources" directory of the application:
9 |
10 | Resources/
11 | drawable/
12 | icon.png
13 |
14 | layout/
15 | main.axml
16 |
17 | values/
18 | strings.xml
19 |
20 | In order to get the build system to recognize Android resources, set the build action to
21 | "AndroidResource". The native Android APIs do not operate directly with filenames, but
22 | instead operate on resource IDs. When you compile an Android application that uses resources,
23 | the build system will package the resources for distribution and generate a class called "R"
24 | (this is an Android convention) that contains the tokens for each one of the resources
25 | included. For example, for the above Resources layout, this is what the R class would expose:
26 |
27 | public class R {
28 | public class drawable {
29 | public const int icon = 0x123;
30 | }
31 |
32 | public class layout {
33 | public const int main = 0x456;
34 | }
35 |
36 | public class strings {
37 | public const int first_string = 0xabc;
38 | public const int second_string = 0xbcd;
39 | }
40 | }
41 |
42 | You would then use R.drawable.icon to reference the drawable/icon.png file, or R.layout.main
43 | to reference the layout/main.axml file, or R.strings.first_string to reference the first
44 | string in the dictionary file values/strings.xml.
45 |
--------------------------------------------------------------------------------
/demo/BottomTabbedPageQs.Droid/Resources/drawable-hdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NAXAM/bottomtabbedpage-xamarin-forms/61316493e777d7bb946c1b8ca423827b6be639d4/demo/BottomTabbedPageQs.Droid/Resources/drawable-hdpi/icon.png
--------------------------------------------------------------------------------
/demo/BottomTabbedPageQs.Droid/Resources/drawable-hdpi/naxam_copyright.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NAXAM/bottomtabbedpage-xamarin-forms/61316493e777d7bb946c1b8ca423827b6be639d4/demo/BottomTabbedPageQs.Droid/Resources/drawable-hdpi/naxam_copyright.png
--------------------------------------------------------------------------------
/demo/BottomTabbedPageQs.Droid/Resources/drawable-mdpi/naxam_copyright.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NAXAM/bottomtabbedpage-xamarin-forms/61316493e777d7bb946c1b8ca423827b6be639d4/demo/BottomTabbedPageQs.Droid/Resources/drawable-mdpi/naxam_copyright.png
--------------------------------------------------------------------------------
/demo/BottomTabbedPageQs.Droid/Resources/drawable-xhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NAXAM/bottomtabbedpage-xamarin-forms/61316493e777d7bb946c1b8ca423827b6be639d4/demo/BottomTabbedPageQs.Droid/Resources/drawable-xhdpi/icon.png
--------------------------------------------------------------------------------
/demo/BottomTabbedPageQs.Droid/Resources/drawable-xhdpi/naxam_copyright.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NAXAM/bottomtabbedpage-xamarin-forms/61316493e777d7bb946c1b8ca423827b6be639d4/demo/BottomTabbedPageQs.Droid/Resources/drawable-xhdpi/naxam_copyright.png
--------------------------------------------------------------------------------
/demo/BottomTabbedPageQs.Droid/Resources/drawable-xxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NAXAM/bottomtabbedpage-xamarin-forms/61316493e777d7bb946c1b8ca423827b6be639d4/demo/BottomTabbedPageQs.Droid/Resources/drawable-xxhdpi/icon.png
--------------------------------------------------------------------------------
/demo/BottomTabbedPageQs.Droid/Resources/drawable-xxhdpi/naxam_copyright.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NAXAM/bottomtabbedpage-xamarin-forms/61316493e777d7bb946c1b8ca423827b6be639d4/demo/BottomTabbedPageQs.Droid/Resources/drawable-xxhdpi/naxam_copyright.png
--------------------------------------------------------------------------------
/demo/BottomTabbedPageQs.Droid/Resources/drawable-xxxhdpi/naxam_copyright.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NAXAM/bottomtabbedpage-xamarin-forms/61316493e777d7bb946c1b8ca423827b6be639d4/demo/BottomTabbedPageQs.Droid/Resources/drawable-xxxhdpi/naxam_copyright.png
--------------------------------------------------------------------------------
/demo/BottomTabbedPageQs.Droid/Resources/drawable/bg_splash.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | -
8 |
11 |
12 |
13 | -
16 |
19 |
20 |
--------------------------------------------------------------------------------
/demo/BottomTabbedPageQs.Droid/Resources/drawable/bnv_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/demo/BottomTabbedPageQs.Droid/Resources/drawable/ic_audiotrack_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/demo/BottomTabbedPageQs.Droid/Resources/drawable/ic_backup_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/demo/BottomTabbedPageQs.Droid/Resources/drawable/ic_camera_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/demo/BottomTabbedPageQs.Droid/Resources/drawable/ic_favorite_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/demo/BottomTabbedPageQs.Droid/Resources/drawable/ic_visibility_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/demo/BottomTabbedPageQs.Droid/Resources/drawable/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NAXAM/bottomtabbedpage-xamarin-forms/61316493e777d7bb946c1b8ca423827b6be639d4/demo/BottomTabbedPageQs.Droid/Resources/drawable/icon.png
--------------------------------------------------------------------------------
/demo/BottomTabbedPageQs.Droid/Resources/layout/Tabbar.axml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/demo/BottomTabbedPageQs.Droid/Resources/layout/Toolbar.axml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/demo/BottomTabbedPageQs.Droid/Resources/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NAXAM/bottomtabbedpage-xamarin-forms/61316493e777d7bb946c1b8ca423827b6be639d4/demo/BottomTabbedPageQs.Droid/Resources/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/demo/BottomTabbedPageQs.Droid/Resources/mipmap-ldpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NAXAM/bottomtabbedpage-xamarin-forms/61316493e777d7bb946c1b8ca423827b6be639d4/demo/BottomTabbedPageQs.Droid/Resources/mipmap-ldpi/ic_launcher.png
--------------------------------------------------------------------------------
/demo/BottomTabbedPageQs.Droid/Resources/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NAXAM/bottomtabbedpage-xamarin-forms/61316493e777d7bb946c1b8ca423827b6be639d4/demo/BottomTabbedPageQs.Droid/Resources/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/demo/BottomTabbedPageQs.Droid/Resources/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NAXAM/bottomtabbedpage-xamarin-forms/61316493e777d7bb946c1b8ca423827b6be639d4/demo/BottomTabbedPageQs.Droid/Resources/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/demo/BottomTabbedPageQs.Droid/Resources/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NAXAM/bottomtabbedpage-xamarin-forms/61316493e777d7bb946c1b8ca423827b6be639d4/demo/BottomTabbedPageQs.Droid/Resources/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/demo/BottomTabbedPageQs.Droid/Resources/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NAXAM/bottomtabbedpage-xamarin-forms/61316493e777d7bb946c1b8ca423827b6be639d4/demo/BottomTabbedPageQs.Droid/Resources/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/demo/BottomTabbedPageQs.Droid/Resources/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #5DAC48
4 |
6 |
7 |
26 |
29 | #00ffffff
30 | #0Dffffff
31 |
32 |
--------------------------------------------------------------------------------
/demo/BottomTabbedPageQs/App.xaml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/demo/BottomTabbedPageQs/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using Naxam.Controls.Forms;
4 | using Xamarin.Forms;
5 | using Xamarin.Forms.Xaml;
6 |
7 | [assembly: XamlCompilation(XamlCompilationOptions.Compile)]
8 | namespace Naxam.Demo
9 | {
10 | public partial class App : Application
11 | {
12 | public App()
13 | {
14 | InitializeComponent();
15 |
16 | var tabs = new BottomTabbedPage();
17 |
18 | var icons = Plugin.Iconize.Iconize.Modules.FirstOrDefault()?.Keys.Take(5) ?? new string[0];
19 | tabs.Children.Add(new ContentPage
20 | {
21 | Title = "Tab 1",
22 | Icon = icons.FirstOrDefault() ?? "ic_audiotrack_black_24dp",
23 | BackgroundColor = Color.Aqua,
24 | Content = new Label
25 | {
26 | HorizontalTextAlignment = TextAlignment.Center,
27 | VerticalTextAlignment = TextAlignment.Center,
28 | Text = "BottomTabbedPage - A Xamarin.Forms page with tabs at the bottom.",
29 | TextColor = Color.DarkCyan,
30 | Margin = new Thickness(16)
31 | }
32 | });
33 | tabs.Children.Add(new ContentPage
34 | {
35 | Title = "Tab 2",
36 | Icon = icons.Skip(1).FirstOrDefault() ?? "ic_backup_black_24dp",
37 | BackgroundColor = Color.Beige,
38 | Content = new Label
39 | {
40 | HorizontalTextAlignment = TextAlignment.Center,
41 | VerticalTextAlignment = TextAlignment.Center,
42 | Text = "BottomTabbedPage internally uses BottomNavigationViewEx.",
43 | TextColor = Color.Green,
44 | Margin = new Thickness(16)
45 | }
46 | });
47 | tabs.Children.Add(new ContentPage
48 | {
49 | Title = "Tab 3",
50 | Icon = icons.Skip(2).FirstOrDefault() ?? "ic_camera_black_24dp",
51 | BackgroundColor = Color.BlueViolet,
52 | Content = new Label
53 | {
54 | HorizontalTextAlignment = TextAlignment.Center,
55 | VerticalTextAlignment = TextAlignment.Center,
56 | Text = "BottomTabbedPage could be embedded inside a NavigationPage.",
57 | TextColor = Color.Aqua,
58 | Margin = new Thickness(16)
59 | }
60 | });
61 |
62 | tabs.Children.Add(new ContentPage
63 | {
64 | Title = "Tab 4",
65 | Icon = icons.Skip(3).FirstOrDefault() ?? "ic_favorite_black_24dp",
66 | BackgroundColor = Color.Bisque,
67 | Content = new Label
68 | {
69 | HorizontalTextAlignment = TextAlignment.Center,
70 | VerticalTextAlignment = TextAlignment.Center,
71 | Text = "BottomTabbedPage is a product developed by NAXAM",
72 | TextColor = Color.DarkGreen,
73 | Margin = new Thickness(16)
74 | }
75 | });
76 |
77 | MainPage = tabs;
78 | }
79 |
80 | protected override void OnStart()
81 | {
82 | // Handle when your app starts
83 | }
84 |
85 | protected override void OnSleep()
86 | {
87 | // Handle when your app sleeps
88 | }
89 |
90 | protected override void OnResume()
91 | {
92 | // Handle when your app resumes
93 | }
94 | }
95 | }
96 |
--------------------------------------------------------------------------------
/demo/BottomTabbedPageQs/BottomTabbedPageQs.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.0
5 | {DEFB4EE7-1350-4DDC-BE1C-2F6BBAD93527}
6 |
7 |
8 |
9 | {b3f20a5f-fb43-4825-bd57-e1b7976020f8}
10 | BottomTabbedPage.Forms
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/demo/BottomTabbedPageQs/TestPage.xaml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
21 |
22 |
28 |
29 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/demo/BottomTabbedPageQs/TestPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | using Xamarin.Forms;
5 |
6 | namespace Naxam.Demo
7 | {
8 | public partial class TestPage : ContentPage
9 | {
10 | public TestPage (bool allowsNav=true)
11 | {
12 | InitializeComponent ();
13 |
14 | btnNav.Clicked += async delegate {
15 | if (!allowsNav) {
16 | return;
17 | }
18 |
19 | await Navigation?.PushAsync (new TestPage {
20 | Title = Title + ":1"
21 | }, true);
22 | };
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------