Android-Week-View
Android-Week-View copied to clipboard
Display only one week
Is there any easy way to make it display only one week, without the dates. Like I need the view to show monday - sunday, like I need to make a plan for every week. I dont know if im very clear. Thanks
Its like, remove date from the header, disable scrolling to sides <- and -> So it will get fixed on one week, and without the dates, and the events would go only by dayinweek and hours.
So I started to change it to my needs. I got it looking as I wanted with 2 easy changes: in the scroll part I just commented the lines: if (Math.abs(distanceX) > Math.abs(distanceY)){ //mCurrentScrollDirection = Direction.HORIZONTAL; //mCurrentFlingDirection = Direction.HORIZONTAL; } else { mCurrentFlingDirection = Direction.VERTICAL; mCurrentScrollDirection = Direction.VERTICAL; }
It could be an option, a variable, if set as it it dont put the direction as horizontal and at the string of the header: I changed this: String dayLabel = String.format("%s %d/%02d", getDayName(day), day.get(Calendar.MONTH) + 1, day.get(Calendar.DAY_OF_MONTH));
to this: String dayLabel = String.format("%s ", getDayName(day));
Also could have an variable to switch with one or the other.
Now I'm starting to test, and change the events things, ill post here, if you find it usefull you can implement as an option to the lib.
I made a working onClickEvent (returning dayofWeek + hour), so I can add events on clicking. After I make all the changes, I can send u the source if you want to, so u see what u think its good to add here, and whats not. If u want to talk to me, send me an e-mail [email protected]
Hi Can you please post the source code, i need also to display one fixed week. thanks
It would be nice if you would make a pull request @caioketo !
@caske33 I didnt change anything in a lot of time, so I dont think it would be a good idea, its too diferent now, but I got a repository with the code that I used: https://github.com/caioketo/WeekViewModified if you got any doubts just open issue there and I'll try to help, but Im not developing this module anymore
Any updates regarding this? Would really like to have just a single week viewable.
@JitinDhillon I think your best bet would be to modify the source code yourself and then provide a Pull Request so other users can use it too.
If you have any problems while implementing, I'd happy to help, but I don't have the time to implement this myself.
i have implemented this feature, that is scroll range can be defined by user. however i dont know how to add a new pull request.. i have added the module in my git repo. can you help on how to do new pull request and commit here? here is the module with the range functionality. https://github.com/mrwhite1/WeekViewLibrary
@mrwhite1 can you tell where you have made changes? I want to use that feature in my app.
@dhavalocked This is how you do pull-request: