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

Multiline date on header??

Open wserpas opened this issue 9 years ago • 8 comments

hello how i can make multiline the date from header i try several times but dont success on setupDateTimeInterpreter

return weekday.toUpperCase() + System.getProperty("line.separator") + format.format(date.getTime());

return weekday.toUpperCase() + "\n" + format.format(date.getTime());

return weekday.toUpperCase() + "\r\n" + format.format(date.getTime());

always return the same TUE 29/03

i need to make something like this

TUE 29/03 2016

any suggestion??

wserpas avatar Mar 29 '16 15:03 wserpas

I'm not sure if this is currently possible. But if you found a solution, please free to share it here!

entropitor avatar Apr 03 '16 21:04 entropitor

I succes get multiline on string returned from Interpreter, but on the label not showing on two lines, what i doing wrong???

private void setupDateTimeInterpreter(final boolean shortDate) {
        mWeekView.setDateTimeInterpreter(new DateTimeInterpreter() {
            @Override
            public String interpretDate(Calendar date) {
                SimpleDateFormat weekdayNameFormat = new SimpleDateFormat("EEE", Locale.getDefault());
                String weekday = weekdayNameFormat.format(date.getTime());
                SimpleDateFormat format = new SimpleDateFormat("EEE\nd/M", Locale.getDefault());
                return ""+format.format(date.getTime());
                // Return mie.
                //        6/4
            }

            @Override
            public String interpretTime(int hour) {
                return hour > 11 ? (hour - 12) + " PM" : (hour == 0 ? "12 M" : hour + " AM");
            }
        });
    }

I expect mie. 6/4

but always is mie. 6/4

How can i activate multiline label??

image

wserpas avatar Apr 05 '16 17:04 wserpas

You might have to change the library itself and do a Pull Request to be able to make it work.

entropitor avatar Apr 05 '16 22:04 entropitor

Works perfect, Thanks @caske33 !!

image

wserpas avatar Apr 14 '16 16:04 wserpas

Feel free to make a Pull Request so others can enjoy it as well.

entropitor avatar Apr 18 '16 11:04 entropitor

@wserpas How did you do it? What should be changed?

AndroidDeveloperLB avatar May 06 '18 09:05 AndroidDeveloperLB

how can I set setMinHour and MaxHour in weekview candendar?

eiphyuphwe avatar Sep 19 '18 10:09 eiphyuphwe

@eiphyuphwe I suggest trying out my fork for this repository. I've updated there a lot of things, fixed issues, and I've made it clearer for modification. It might have what you need. Sadly it can never be so customizable due to the amount of drawing within a single View, though. Please check it out here: https://github.com/AndroidDeveloperLB/Android-Week-View

AndroidDeveloperLB avatar Feb 12 '19 18:02 AndroidDeveloperLB