Comments (9)
I guess, the line wrapping we use in the events itself should maybe applied to the header column as well.
(Feel free to take a look in the code and submit a Pull Request for this issue. Any help is greatly appreciated!)
from android-week-view.
@kelvin-huan-kok-yang Have you tried SimpleDateFormat format = new SimpleDateFormat("yyyy\n\n\n EEE\n\n\n MMM d", Locale.getDefault()); ?
Android uses 3 time \n most of the time instead of just \n
from android-week-view.
@caske33
I could not found any line wrapping setting in the events itself...even if WeekView.java...
mHeaderTextHeight, mHeaderHeight, mHeaderMarginBottom, mHeaderColumnWidth, mHeaderColumnPadding, mHeaderRowPadding
These are all float attribute related to header...i think not really related to multi-line right ? just editable design for the text space...
If I able to make multi-line...i will submit a Pull Request :)
@jhoobergs
For the triple \n, I have tried just now...but ends up with 3 white space...haha
from android-week-view.
@kelvin-huan-kok-yang Change the drawing of the header text to use the StaticLayout class as used to draw the event titles: https://github.com/Quivr/Android-Week-View/blob/develop/library/src/main/java/com/alamkanak/weekview/WeekView.java#L1088
I think that should work.
from android-week-view.
@jhoobergs i done it with multi-line ! thanks ! π
but currently still got a problem... the third line will "crash" with the event background
and the font size is small...although font size can be increased by using :- (but the "crash" problem will still exist) :(
float fontSize = 25;
mTextPaint.setTextSize(fontSize);
The multi-line is achieve using StaticLayout
String dayLabel = getDateTimeInterpreter().interpretDate(day);
if (dayLabel == null)
throw new IllegalStateException("A DateTimeInterpreter must not return null date");
TextPaint mTextPaint=new TextPaint();
StaticLayout mTextLayout = new StaticLayout(dayLabel,mTextPaint
(int)mWidthPerDay,
Layout.Alignment.ALIGN_NORMAL,
2, 0.5f, false);
canvas.save();
float textX = startPixel + mWidthPerDay / 2;
loat textY = mHeaderTextHeight + mHeaderRowPadding ;
canvas.translate(textX, textY);
mTextLayout.draw(canvas);
canvas.restore();
drawAllDayEvents(day, startPixel, canvas);
startPixel += mWidthPerDay + mColumnGap;
from android-week-view.
@kelvin-huan-kok-yang I think you need to set the mHeaderTextHeight
variable to the right value
from android-week-view.
@kelvin-huan-kok-yang any update ?
from android-week-view.
Did you guys get it right eventually ?
from android-week-view.
Ok I did it myself:
#97 (comment)
:)
from android-week-view.
Related Issues (20)
- Bug with goToHour method when time range is set HOT 3
- Serious bug in viewing events : not showing all events that are given HOT 1
- Bug: adding full day WeekViewEvent with same startDate and endDate results in single cell HOT 1
- Event not drawing on 31st day of month HOT 2
- Events Not loading after asynchronous call
- On Load scroll to current time, not 12am HOT 1
- disable fling doesn't seem to work correctly HOT 1
- Crash issue
- Enchanced : customize the date format
- Preview Render Problems HOT 1
- Add Event Dynamically HOT 3
- Crashes on API 28
- doesnt shows anything any help HOT 1
- Needs to Click the gototoday before showing all the events
- How to implement a multi-line String on header date
- Drag and Drop feature on marked Events HOT 3
- ε¨ζζ·»ε event δΈη΄θΏε
- Event title vertical alignment
- Multiple events on same day not showing
- is it possible to turn off zoom?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-week-view.