Git Product home page Git Product logo

calendarlistview's People

Contributors

traex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

calendarlistview's Issues

getMinYear

Why can't I find the method getMinYear() and how can I set the minium year?
@traex

Min / Max range or at least not same day allowed

It would be nice to be able to specify the minimum range for selection (e,g,. 2 days) as well as a maximum selection (e.g. 21 days). Or it would be nice to at least have a flag for whether same day should be allowed (i.e. don't allow a range of 1 - require at least two different days to be selected).

Need to show highlighted days only, not ranges

Hi,
I am trying to change your code to achieve something that I want but unfortunately things are not going in the right direction. I have an ArrayList and all i want is to highlight the calendar list dates based on the data in the list i.e I don't want any ranges. Can you please help me out..?

Why getMaxYear? Just asking...

I set the getMaxYear() to 2415

When 2415 comes, it will not show up anymore, but this will not be my business.

However, just asking, why did you need to implement such a method?

ic_launcher Conflict?

I'm getting a build failure after adding this library, adding tools:replace="android:icon" to my manifest doesn't fix it. Any ideas?

/Users/myapp/Documents/myapp-mobile-android/app/src/main/AndroidManifest.xml
Warning:(24, 5) application@android:icon was tagged at AndroidManifest.xml:24 to replace other declarations but no other declaration present
:app:fabricGenerateResourcesDebug
:app:jrebelPinDebugResids
:app:processDebugResources
/Users/myapp/Documents/myapp-mobile-android/app/build/intermediates/res/debug/drawable-hdpi-v4/ic_launcher.png: error: Duplicate file.
/Users/myapp/Documents/myapp-mobile-android/app/build/intermediates/res/debug/drawable-hdpi/ic_launcher.png: Original is here. The version qualifier may be implied.
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Users/myapp/Library/Android/sdk/build-tools/22.0.1/aapt'' finished with non-zero exit value 1

DaySelectedBackgroundColor is not respected when selecting days between years

When selecting days across or within month (e.g. from 1 January to 31 January, or 1 January to 1 February), the selected days respects the DaySelectedBackgroundColor that I specified.

Screenshot:
screenshot_2015-10-26-15-10-11

However, when selecting days across years (e.g. from 30 Dec 2015 to 10 January 2016), the selected days does not respect my DaySelectedBackgroundColor. The font is changes color but the background doesnt do that.

Screenshot:
screenshot_2015-10-26-15-03-28

No way to provide custom adapter

If I extend the DayPickerView with a view to overriding the setAdapter method, I can't provide my own adapter as the mController and typedArray attributes are private, so I have no way of accessing them to pass to my own adapter.

Calendar Not Displayed

The GitHub demo is not displaying Calendar. It is not giving any error or exceptions. I am using Android 4.3.

Cannot see the calendar

Hey guys,

I downloaded the sample and attempted to integrate this view into my project but I cannot actually see the view. Is this a styling thing?

Please advise.

The only one selectable date.

The default mode of the view is to have select multiple dates or a date range but i want only one selectable date.

Add Events

How can Add Events in Calendar as well as How can I display Event using Webserivices(JsonData) on Calendar.

Arabic language layout

Hi,

Thanks for the post.

I observed that Arabic language layout is not supported. How can we update the code to support Arabic language?

Calendar not show. What i am doing wrong?

/Layout:

<com.andexert.calendarlistview.library.DayPickerView
    android:id="@+id/pickerView"
    android:layout_width="match_parent"
    android:layout_height="match_parent"

    calendar:drawRoundRect="true" />

Activity Class:

package com.example.enny.agendando.ui.activities;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;

import com.andexert.calendarlistview.library.DayPickerView;
import com.andexert.calendarlistview.library.SimpleMonthAdapter;
import com.example.enny.agendando.R;

public class SelectDateActivity extends Activity implements com.andexert.calendarlistview.library.DatePickerController {

private DayPickerView dayPickerView;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_select_date);
    dayPickerView = (DayPickerView) findViewById(R.id.pickerView);
    dayPickerView.setController(this);
}

@Override
public int getMaxYear() {
    return 2015;
}

@Override
public void onDayOfMonthSelected(int year, int month, int day) {
    Log.e("Day Selected", day + " / " + month + " / " + year);
}

@Override
public void onDateRangeSelected(SimpleMonthAdapter.SelectedDays<SimpleMonthAdapter.CalendarDay> selectedDays) {

    Log.e("Date range selected", selectedDays.getFirst().toString() + " --> " + selectedDays.getLast().toString());
}

}

SelectedDays Last can be before First

If you select the last day, then select the first day when you get the range of selected days it reports the last day in the range as the first and the first day in the range as the last. It should probably have logic to return the chronological first and chronological last.

February 2016 has 29 days but I get 28

The issue is in the title (http://www.timeanddate.com/calendar/custom.html?year=2016&country=1&hol=25&df=1). I'm getting the same error for February 2020 and 2024.
Below my code:

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.MenuItem;
import android.widget.TextView;

import com.andexert.calendarlistview.library.DayPickerView;
import com.andexert.calendarlistview.library.SimpleMonthAdapter;

public class Calendar extends AppCompatActivity implements com.andexert.calendarlistview.library.DatePickerController{

    @Override
    protected void onCreate(Bundle savedInstanceState){
        super.onCreate(savedInstanceState);
        setContentView(R.layout.calendar);

        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar_layout);

        TextView mTitle = (TextView) toolbar.findViewById(R.id.toolbar_title);
        mTitle.setText("Calendar");
        setSupportActionBar(toolbar);

        assert getSupportActionBar() != null;

        this.getSupportActionBar().setDisplayHomeAsUpEnabled(true); 
        this.getSupportActionBar().setDisplayShowTitleEnabled(false);

        DayPickerView dayPickerView = (DayPickerView)findViewById(R.id.pickerView);
        dayPickerView.setController(this);

    }

    @Override
    public int getMaxYear()
    {
        return 2026;
    }

    @Override
    public void onDayOfMonthSelected(int year, int month, int day)
    {
        Log.e("Day Selected", day + " / " + month + " / " + year);
    }

    @Override
    public void onDateRangeSelected(SimpleMonthAdapter.SelectedDays<SimpleMonthAdapter.CalendarDay> selectedDays)
    {

        Log.e("Date range selected", selectedDays.getFirst().toString() + " --> " + selectedDays.getLast().toString());
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case android.R.id.home:
                finish();
                return true;
            default:
                return super.onOptionsItemSelected(item);
        }
    }

}

Can provide the method of setMinYear

Can provide the method of setMinYear,so we can set the min year we want to show. now it can only show the month which is bigger than current month.

When can I call getSelectedDays()?

There doesn't seem to be an API callback that lets me know when a date range has been selected. I can see in the controller that there is a callback when a date is selected, but internally this could be the firstDate or lastDate which will be populated into selectedDays.

Apart from constantly checking if first != null && last != null, how can I know when a range is available?

class not instance error

The following classes could not be instantiated:

  • com.example.caledarlistlib.DayPickerView (Open Class, Show Error Log)
    See the Error Log (Window > Show View) for more details.
    Tip: Use View.isInEditMode() in your custom views to skip code when shown in Eclipse

java.lang.UnsupportedOperationException: Unsupported Service: accessibility
at com.android.layoutlib.bridge.android.BridgeContext.getSystemService(BridgeContext.java:465)
at android.support.v7.widget.RecyclerView.(RecyclerView.java:290)
at com.example.caledarlistlib.DayPickerView.(DayPickerView.java:28)
at com.example.caledarlistlib.DayPickerView.(DayPickerView.java:24)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(NativeConstructorAccessorImpl.java:-2)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at com.android.ide.eclipse.adt.internal.editors.layout.ProjectCallback.instantiateClass(ProjectCallback.java:438)
at com.android.ide.eclipse.adt.internal.editors.layout.ProjectCallback.loadView(ProjectCallback.java:190)
at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:207)
at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:132)
at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:806)
at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
at android.view.LayoutInflater.inflate(LayoutInflater.java:385)

wrong days number in February in leap year

Hi, I notice one thing which is probably related to days count in February when it is not leap year.
For instance February 2015 ends with Sunday 29th and March begins with Sunday 1st. First thing was that March should start with Monday 1st but 2015 is not leap year so February should ends with Saturday 28th.

P.S. I have screenshot by I don't know how to attach it here.

UPD:

CalendarUtils class contains line:

return ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) ? 28 : 29;

which means that leap year contain 28 and regular 29 days.
Just switch 28 and 29 like this

return ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) ? 29 : 28;

CalendarUtils leap year logic is incorrect

According to wikipedia the following logic should be used to calculate leap years.

if (year is not divisible by 4) then (it is a common year)
else
if (year is not divisible by 100) then (it is a leap year)
else
if (year is not divisible by 400) then (it is a common year)
else (it is a leap year)

The CalendarUtils doesn't take into account the 100 and 400 year special conditions.

Set different colors for different dates

I want to develop vertical calendar list where different dates have different colors as in the attachment. How can I achieve this using your library ? Also, when I click on 2 dates, the dates between those 2 dates becomes red. How to avoid this text color change?
screenshot_2016-07-14-17-40-51

This is not working for me :(

Hi,
I am using Eclipse version Mars.1 while using am always getting error and app force close. The error am getting is :
android.view.InflateException: Binary XML file line #8: Error inflating class com.andexert.calendarlistview.library.DayPickerView
Caused by: java.lang.ClassNotFoundException: com.andexert.calendarlistview.library.DayPickerView.
Please help me to sort this out.

app crashing after setting getMaxYear

I set get Max Year to 2017 and leave the rest the same as the sample.

The app is crashing with error:

java.lang.UnsupportedOperationException: Can't convert value at index 9 to dimension: type=0x12 at android.content.res.TypedArray.getDimensionPixelSize(TypedArray.java:737) at com.andexert.calendarlistview.library.SimpleMonthView.<init>(SimpleMonthView.java:146) at com.andexert.calendarlistview.library.SimpleMonthAdapter.onCreateViewHolder(SimpleMonthAdapter.java:63) at com.andexert.calendarlistview.library.SimpleMonthAdapter.onCreateViewHolder(SimpleMonthAdapter.java:39) at android.support.v7.widget.RecyclerView$Adapter.createViewHolder(RecyclerView.java:6487) at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5674) at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5557) at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5553) at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2229) at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1556) at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1516) at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:608) at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3693) at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:3410) at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:3962) at android.view.View.layout(View.java:18804) at android.view.ViewGroup.layout(ViewGroup.java:5951) at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1079) at android.view.View.layout(View.java:18804) at android.view.ViewGroup.layout(ViewGroup.java:5951) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323) at android.widget.FrameLayout.onLayout(FrameLayout.java:261) at android.view.View.layout(View.java:18804) at android.view.ViewGroup.layout(ViewGroup.java:5951) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1741) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1585) at android.widget.LinearLayout.onLayout(LinearLayout.java:1494) at android.view.View.layout(View.java:18804) at android.view.ViewGroup.layout(ViewGroup.java:5951) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323) at android.widget.FrameLayout.onLayout(FrameLayout.java:261) at com.android.internal.policy.DecorView.onLayout(DecorView.java:887) at android.view.View.layout(View.java:18804) at android.view.ViewGroup.layout(ViewGroup.java:5951) at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2655) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2371) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1522) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7098) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:927) at android.view.Choreographer.doCallbacks(Choreographer.java:702) at android.view.Choreographer.doFrame(Choreographer.java:638) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:913) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6682) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1534) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1424)

startCurrentMonth=true breaks getMaxYear

Hi,

If I set the getMaxYear to 2015 and only use the default flags then the calendar shows dates from January 2014 (current year) to December 2015, which is what I'd expect.

However, if I then apply the startCurrentMonth = true in my XML file, the calendar starts with November 2014 as expected, but the end of the calendar is now October 2016!! I'd have expected the end date to remain the same as before (December 2015).

I'm using v1.1.2.

Thanks,

Andy.

no data

i download the demo but the sample doesn'have data , would i miss something?

import 1.2.3

08-05 18:07:26.343 12953-12953/? I/art﹕ Late-enabling -Xcheck:jni
08-05 18:07:26.367 12953-12963/? I/art﹕ Debugger is no longer active
08-05 18:07:26.401 12953-12953/? W/System﹕ ClassLoader referenced unknown path: /data/app/com.example.zhaowencong.calenderdemo-1/lib/arm
08-05 18:07:26.486 12953-12982/? D/OpenGLRenderer﹕ Use EGL_SWAP_BEHAVIOR_PRESERVED: true
08-05 18:07:26.551 12953-12982/? I/Adreno﹕ QUALCOMM build : 4436883, Iff6937fcf5
Build Date : 06/04/15
OpenGL ES Shader Compiler Version: E031.26.00.02
Local Branch : master-M5
Remote Branch :
Remote Branch :
Reconstruct Branch :
08-05 18:07:26.553 12953-12982/? W/Adreno-GSL﹕ <gsl_device_getinfo_ext:1163>: Requested extened device info; but it isn't supported
08-05 18:07:26.561 12953-12982/? I/OpenGLRenderer﹕ Initialized EGL, version 1.4
08-05 18:07:26.562 12953-12982/? I/Adreno﹕ GetNativeFormatFromQctPixelFormat: Invalid qct format (611)
08-05 18:07:26.562 12953-12982/? I/Adreno﹕ GetNativeFormatFromQctPixelFormat: Invalid qct format (611)
08-05 18:07:26.562 12953-12982/? I/Adreno﹕ GetNativeFormatFromQctPixelFormat: Invalid qct format (611)
08-05 18:07:26.562 12953-12982/? I/Adreno﹕ GetNativeFormatFromQctPixelFormat: Invalid qct format (611)
08-05 18:07:26.562 12953-12982/? I/Adreno﹕ GetNativeFormatFromQctPixelFormat: Invalid qct format (612)
08-05 18:07:26.562 12953-12982/? I/Adreno﹕ GetNativeFormatFromQctPixelFormat: Invalid qct format (612)
08-05 18:07:26.562 12953-12982/? I/Adreno﹕ GetNativeFormatFromQctPixelFormat: Invalid qct format (612)
08-05 18:07:26.562 12953-12982/? I/Adreno﹕ GetNativeFormatFromQctPixelFormat: Invalid qct format (612)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.