Skip to content
This repository has been archived by the owner on Jul 13, 2020. It is now read-only.

Generator of ActionBars' properties #53

Closed
wants to merge 9 commits into from
Closed

Generator of ActionBars' properties #53

wants to merge 9 commits into from

Conversation

lucky-dev
Copy link
Contributor

Added

New properties of ActionBar and Activity

for original API

  • var android.app.ActionBar.customView: android.view.View?
  • var android.app.ActionBar.displayOptions: Int
  • val android.app.ActionBar.height: Int
  • val android.app.ActionBar.navigationItemCount: Int
  • var android.app.ActionBar.navigationMode: Int
  • val android.app.ActionBar.selectedNavigationIndex: Int
  • var android.app.ActionBar.subtitle: CharSequence?
  • var android.app.ActionBar.subtitleResource: Int
  • val android.app.ActionBar.tabCount: Int
  • var android.app.ActionBar.title: CharSequence?
  • var android.app.ActionBar.titleResource: Int
  • var android.app.ActionBar.icon
  • var android.app.ActionBar.logo
  • var android.app.ActionBar.selectedNavigationItem
  • var android.app.ActionBar.displayUseLogoEnabled
  • var android.app.ActionBar.displayShowHomeEnabled
  • var android.app.ActionBar.displayHomeAsUpEnabled
  • var android.app.ActionBar.displayShowTitleEnabled
  • var android.app.ActionBar.displayShowCustomEnabled
  • var android.app.ActionBar.backgroundDrawable
  • var android.app.ActionBar.stackedBackgroundDrawable
  • var android.app.ActionBar.splitBackgroundDrawable
  • var android.app.ActionBar.homeButtonEnabled
  • var android.app.ActionBar.homeAsUpIndicator
  • val android.app.Activity.actionBar: android.app.ActionBar?
  • val android.app.Activity.fragmentManager: android.app.FragmentManager
  • val android.app.Activity.menuInflater: android.view.MenuInflater

for support-library API

  • var android.support.v7.app.ActionBar.customView: android.view.View?
  • var android.support.v7.app.ActionBar.displayOptions: Int
  • val android.support.v7.app.ActionBar.height: Int
  • val android.support.v7.app.ActionBar.navigationItemCount: Int
  • var android.support.v7.app.ActionBar.navigationMode: Int
  • val android.support.v7.app.ActionBar.selectedNavigationIndex: Int
  • val android.support.v7.app.ActionBar.selectedTab: android.support.v7.app.ActionBar.Tab?
  • var android.support.v7.app.ActionBar.subtitle: CharSequence?
  • var android.support.v7.app.ActionBar.subtitleResource: Int
  • val android.support.v7.app.ActionBar.tabCount: Int
  • var android.support.v7.app.ActionBar.title: CharSequence?
  • var android.support.v7.app.ActionBar.titleResource: Int
  • var android.support.v7.app.ActionBar.displayHomeAsUpEnabled
  • var android.support.v7.app.ActionBar.selectedNavigationItem
  • var android.support.v7.app.ActionBar.displayUseLogoEnabled
  • var android.support.v7.app.ActionBar.logo
  • var android.support.v7.app.ActionBar.displayShowTitleEnabled
  • var android.support.v7.app.ActionBar.displayShowHomeEnabled
  • var android.support.v7.app.ActionBar.icon
  • var android.support.v7.app.ActionBar.displayShowCustomEnabled
  • var android.support.v7.app.ActionBar.backgroundDrawable
  • var android.support.v7.app.ActionBar.stackedBackgroundDrawable
  • var android.support.v7.app.ActionBar.splitBackgroundDrawable
  • var android.support.v7.app.ActionBar.homeButtonEnabled
  • var android.support.v7.app.ActionBar.homeAsUpIndicator
  • val android.support.v4.app.FragmentActivity.supportFragmentManager: android.support.v4.app.FragmentManager?
  • val android.support.v7.app.AppCompatActivity.menuInflater: android.view.MenuInflater?
  • val android.support.v7.app.AppCompatActivity.supportActionBar: android.support.v7.app.ActionBar?

P.S. These methods are most popular, in my opinion.

New methods

Searching fragments:

fragmentManager.find<MyFragment>(MyFragment.TAG) // By tag
fragmentManager.find<MyFragment>(R.id.my_fragment) // By id

Fragments' transactions:

fragmentManager.transactions {
  add(MyFragment(), MyFragment.TAG)
}.commit()

@yanex
Copy link
Member

yanex commented Jun 10, 2015

This approach is not so good as it is not extensible (ActionBar class names are hardcoded, and it would take the same time to support any other class in Android SDK).
Anko now can resolve external annotations, so putting a custom annotation on ActionBar class would be much cleaner solution.

@lucky-dev
Copy link
Contributor Author

it would take the same time to support any other class in Android SDK

I agree with you. I have a question: could you give an example of this: putting a custom annotation on ActionBar class would be much cleaner solution? It's interesting.

@yanex
Copy link
Member

yanex commented Jun 10, 2015

It's actually very easy. I added a custom annotation in ed39f2c to support _Layout helper class generation for ImageSwitcher.
I will try to spend some time today to handle external annotations in property generation.

@lucky-dev
Copy link
Contributor Author

Thanks for explanation

@lucky-dev lucky-dev closed this Jun 11, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants