Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ActionBar #14

Open
MartinNuc opened this issue Mar 12, 2012 · 19 comments
Open

ActionBar #14

MartinNuc opened this issue Mar 12, 2012 · 19 comments

Comments

@MartinNuc
Copy link
Contributor

What do you think about ActionBar?

Maybe it wouldnt look so crisp as it is now but we could get rid of those menu's.

I have both devices with Android 2.3 and ICS so I could try to implement it.

@karllindmark
Copy link

I think the ActionBar would be nice, just not sure how to actually implement it in the current layout but I reckon it would have a spot up top.

Are ActionBars supported in releases prior to 3.0 via the compability package? I've heard a lot about some ActionBarSherlock, just haven't had time to look at it.

@peter-budo
Copy link
Collaborator

@mistm you are more then welcome to do small show case, just please remember to create new branch ;)

@MartinNuc
Copy link
Contributor Author

I will try to implement it when I have time. I dont have much experience with Action Bar but I want to learn it. I will let you know when I will have some experimental showcase.

@karllindmark
Copy link

@mistm Just add the screenshots in a new comment when they're ready for the world!

@MartinNuc
Copy link
Contributor Author

Here are few screens with ActionBar. I didnt put there any special buttons yet. However there should be refresh button next to three dots menu. And back to home button on the icon.

1
2
3
4

It would look great if there wasnt that Tab layout but ViewPager (http://blog.stylingandroid.com/archives/537)

What do you think?

@karllindmark
Copy link

Have you had a chance to try the ActionBar on earlier versions too? I'm liking what I'm seeing, and also noticing that the titles might not be optimal as they're now. :-)

HOWEVER, you really need to _git pull master-devel_, as most items are already converted to use ViewPager instead of TabLayout... ;-)

I think the optimal approach for the ViewPager would be to add each "tab" as a menu item, so that people can get to the latter "tabs" faster than scrolling.

@karllindmark
Copy link

Also, how interchangable is the background color of the ActionBar? I wonder if it'd look creepy solid black, as that's what the "viewpager indicator" is at the moment.

@karllindmark
Copy link

(With that said, keep up the good work Martin!)

@MartinNuc
Copy link
Contributor Author

I see. When I forked repo there was no master-devel or at least I dont see it in my fork. I am quite new to git so I am still learning. I will add your repo as remote one so I can merge with mine.

I tried ActionBar on Android 2.3.7 and it run well. I didnt look into it much - just basic functionality. I used Sherlock Actionbar which is supposed to run on as many as possible Androids.

For background color of ActionBar. I can change background by extending Theme.Sherlock styles. Its possible to put there even image background.

As next step I would like to implement backbutton and refresh button. And I will do it on master-devel branch. I am really looking forward because it will look awsome with viewpager.

@karllindmark
Copy link

I'm new to git too, so we have @peter-budo to blame for everything. _laughs_

Yeah, I think ActionBarSherlock should be usable for atleast the scope of the app, if not even further down the hierarchy - that's good to know!

Yeah, a dedicated refresh button would be great in the ActionBar, but I'm not 100% sure regarding the "Back" one - let me know what it looks like when you've managed, it'll be quite exciting to see the Actionbar+Viewpager in action! :-)

@peter-budo
Copy link
Collaborator

#Add new remote
git remote add battlelog https://github.com/ninetwozero/BF3-Battlelog.git
#Create new branch on local
git checkout master-devel
#Get remote resources so you can merge, compare etc
git fetch battlelog
#Merge on current working local branch
git merge battlelog/master-devel
#Push to your repo, on first push it will also create new branch on your remote repo
git push origin master-devel

Hope this help

@MartinNuc
Copy link
Contributor Author

Thanks. I've done it already.

@MartinNuc
Copy link
Contributor Author

Its finished and working. Here are some screenshots.

1
2
3
4

I've tried it on Android 2.3.7 and it works well. Instead of three dots menu on the action bar there is classic menu after pressing menu button.

I had to remove fullscreen support (=no title bar) because it blocked ActionBar. I guess its not needed anymore.

The main change is in huge commit where I basicaly change inharitance from FragmentActivities to SherlockFragmentActivities. Then I updated imports to match sherlock library and added unimplemented methods.

I also added style for action bar so it looks completly black. It fits nice with current theme.

Before I submit pull request I would like to ask about one thing I dont clearly understand. Is there any purpuse to have public boolean handleSelectedOption(MenuItem item); in DefaultFragment.java? If I understand well its for selecting choice from context menu but context menu is not supposed to be in every Fragment. I removed it in my code and did a bit refactoring and it works well.

@MartinNuc
Copy link
Contributor Author

I've just noticed there are some issues with screen rotation.... on few activities when I change screen orientation i get NullPointerException. I checked version before ActionBar and it doesnt happen there. I will investigate further.

@karllindmark
Copy link

How's it going @mistm - have you had some time to look at this further? :-)

@MartinNuc
Copy link
Contributor Author

I got stucked when combining Swipey Tabs with Sherlock Actionbar. It crashes after rotation during AsyncTask which is downloading data. I couldnt figure it out. Current version is on https://github.com/mistm/BF3-Battlelog in branch ActionBar. Could you give me a hand?

@peter-budo
Copy link
Collaborator

We will be moving from AsyncTask to Loaders due to the exact issue as you mentioned, that AsyncTask are restarted on rotation change and result from the request that has been already send is missed.

@karllindmark
Copy link

@peter-budo http://stackoverflow.com/questions/7120813/asynctaskloader-vs-asynctask

Note that Loaders simply just load, and won't enable us to update the GUI out of it (only adapters)?

@peter-budo
Copy link
Collaborator

And they say you should be using handlers, which will happen >:)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants