Code Monkey home page Code Monkey logo

legacybar's Introduction

๐Ÿ‘‹ Greetings traveller!

My name is Tomasz or you may know me better as Cheesebaron. I work mostly within the .NET mobile ecosystem. You can find lots of my contributions here.

I help maintain all sorts of .NET mobile projects such as:

Connect with me

Blog Twitter Mastodon Donate

Stats

Cheesebaron

ย Cheesebaron

legacybar's People

Contributors

cheesebaron avatar jamesmontemagno avatar leandroaraujo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

legacybar's Issues

Attribute Title Has Already Been Defined

Hi,

I added your class library project to my solution and I get this error:

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: Error: Tool exited with code: 1. Output: /Users/josephanderson/Projects/GitHub/glass/Source/Core/Glass.Core.Android/obj/Debug/library_projects/LegacyBar.Library/library_project_imports/res/values/attrs.xml:14: error: Attribute "title" has already been defined
/Users/josephanderson/Projects/GitHub/glass/Source/Core/Glass.Core.Android/obj/Debug/library_projects/LegacyBar.Library/library_project_imports/res/values/attrs.xml:14: error: Attribute "title_color" has already been defined
/Users/josephanderson/Projects/GitHub/glass/Source/Core/Glass.Core.Android/obj/Debug/library_projects/LegacyBar.Library/library_project_imports/res/values/attrs.xml:14: error: Attribute "separator" has already been defined
/Users/josephanderson/Projects/GitHub/glass/Source/Core/Glass.Core.Android/obj/Debug/library_projects/LegacyBar.Library/library_project_imports/res/values/attrs.xml:14: error: Attribute "background" has already been defined
/Users/josephanderson/Projects/GitHub/glass/Source/Core/Glass.Core.Android/obj/Debug/library_projects/LegacyBar.Library/library_project_imports/res/values/attrs.xml:14: error: Attribute "background_item" has already been defined
/Users/josephanderson/Projects/GitHub/glass/Source/Core/Glass.Core.Android/obj/Debug/library_projects/LegacyBar.Library/library_project_imports/res/values/attrs.xml:14: error: Attribute "theme" has already been defined
/Users/josephanderson/Projects/GitHub/glass/Source/Core/Glass.Core.Android/obj/Debug/library_projects/LegacyBar.Library/library_project_imports/res/values/attrs.xml:14: error: Attribute "is_bottom" has already been defined
/Users/josephanderson/Projects/GitHub/glass/Source/Core/Glass.Core.Android/obj/Debug/library_projects/LegacyBar.Library/library_project_imports/res/values/attrs.xml:14: error: Attribute "light_icons" has already been defined
(Glass.Core.Android)

What am I doing wrong?

Implement base themes

It would be nice with a set of base themes to choose from.

I.e.:
HoloDark
HoloLight
Green
Blue
Red
Yellow
Orange

Could Not Type Load LegacyBar.Library.BarActions.LegacyBarMenuItem

As stated in:
#42

I have also run across this issue, similar to issue 42.

My resolution was to simply remove the line (MenuItemLegacyBarAction):

_menuItem = new LegacyBarMenuItem(menuId, Handle);

And implement the callback using an Action.

Under my testing, LegacyBarMenuItem fails to be ctor'd (the binding fails to attach to Android's MenuItem). I am unable to pinpoint exactly what's causing this. Therefore, I simply removed it.

Rename LegacyBar in base activites?

One question is should we rename this? When you have to do a findview you have to do this:

LegacyBar = FindViewById<LegacyBar.Library.Bar.LegacyBar>(Resource.Id.actionbar);

Should we rename to "CurrentLegacyBar"? Or something else?

Why APIs <= 10 can't use overflow action menu?

I can't get overflow actions from the sample for Galaxy S (2.2.1). So I hack
m_HasMenuButton = false;//currentapiVersion <= 10;
and see overflow actions menu but it was default popup with radio buttons list (screenshot). What I need to do to get custom styled drop-down list like this one in project README.md?

Add ability to set Home icon in AXML

Give the ability to the user to be able to set the Home icon through AXML. This should simply require a new attribute along with a home button creation in the Ctor of LegacyBar.

Throw better exceptions when adding null LegacyBarActions

Spent some time finding out why I got a null pointer exception in LegacyBar, and found out it was because of I was trying to add an Action to the LegacyBar which was null. Had we had a better exception in hand here, it would have been a bit easier to understand why the exception was thrown.

Maybe add an ArgumentException in the methods for adding Actions to the Bar.

Clean up try catches

There are some try/catch statements around in the code where the catch part is empty and just catching everything. Not nice and we should do something about it.

Why APIs <= 10 can't use overflow action menu?

I can't get overflow actions from the sample for Galaxy S (2.2.1). So I hack
m_HasMenuButton = false;//currentapiVersion <= 10;
and see overflow actions menu but it was default popup with radio buttons list (screenshot). What I need to do to get custom styled drop-down list like this one in project README.md?

Could Not Type Load LegacyBar.Library.BarActions.LegacyBarMenuItem

Hi,

I am trying to add buttons and menu items. Can you send me documentation, please?

I tried this code, but am I missing an assembly? I got the error in the subject.

LegacyBar = FindViewById<LegacyBar.Library.Bar.LegacyBar>(Resource.Id.actionbar);
LegacyBar.SetHomeLogo(Resource.Drawable.Icon);
MenuId = Resource.Menu.mainmenu;

        var searchMenuItemAction = new MenuItemLegacyBarAction(
            this, Resource.Id.menu_search, LegacyBar.LightIcons ? Resource.Drawable.ic_action_share : Resource.Drawable.ic_action_share_dark,
            Resource.String.menu_string_search)
        {
            ActionType = ActionType.IfRoom
        };
        LegacyBar.AddAction(searchMenuItemAction);

ListActivity no layout

Hi, how do I add the action bar to an activity where I have no layout file? If I have a class inheriting from list activity how do I use your solution?

Q: Is it possible to add a MenuItem and always show Text/Label

With the Android action bar, it's possible to add a menu option and set it to show the text label.

Is this possible with LegacyBar? I can't see how to do it

As a workaround I've been nesting views in the XML which looks messy and partly defeats the objective of using the LegacyBar but perhaps I've missed something?

OnPrepareOptionsMenu() doesn't get called

If the device doesn't have physical menu button, OnPrepareOptionsMenu won't get called when I click on the overflow menu button.

But in the official Google ActionBar implementation, it gets called.

I looked at ActionBarSherlock, it seems to be a problem as well.

I tried let OnCreateOptionsMenu return true to get OnPrepareOptionsMenu called but no luck. See here.

Can't see overflowed actions at Samsung Galaxy S

I see overflowed actions search and refresh at Galaxy Nexus (4.0.2) but cann't see it at Galaxy S (2.2.1). As I see in debug stepping in first case ActionBarUtils.ActionFits() called from ActionBar.AddAction() return false and in second case return true.

UPDATE: As I see in sources this behaviout don't contradict the logic of the project (so, it's expected behaviour), so I close this issue.

Fix Menu button detection

Menu button was broken when we converted the project to a library, the pre-compiler conditions are always going to assume API level 17 as that is what we are targeting the library for.

Use Build.Version.Sdk_Int to detect current API level instead.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.