Android-Week-View icon indicating copy to clipboard operation
Android-Week-View copied to clipboard

Display only one week

Open caioketo opened this issue 10 years ago • 11 comments

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

caioketo avatar Sep 25 '14 11:09 caioketo

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.

caioketo avatar Sep 25 '14 11:09 caioketo

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.

caioketo avatar Sep 25 '14 13:09 caioketo

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]

caioketo avatar Sep 25 '14 13:09 caioketo

Hi Can you please post the source code, i need also to display one fixed week. thanks

Brahim1992 avatar Dec 19 '14 14:12 Brahim1992

It would be nice if you would make a pull request @caioketo !

entropitor avatar Jan 06 '15 18:01 entropitor

@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

caioketo avatar Jan 07 '15 10:01 caioketo

Any updates regarding this? Would really like to have just a single week viewable.

JitinDhillon avatar Aug 16 '15 05:08 JitinDhillon

@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.

entropitor avatar Aug 16 '15 12:08 entropitor

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

dhavalocked avatar Jul 01 '16 08:07 dhavalocked

@mrwhite1 can you tell where you have made changes? I want to use that feature in my app.

RushiMThakker avatar Sep 20 '17 09:09 RushiMThakker

@dhavalocked This is how you do pull-request:

image

AndroidDeveloperLB avatar May 06 '18 06:05 AndroidDeveloperLB