Code Monkey home page Code Monkey logo

caldroid's People

Contributors

aint avatar ben-j69 avatar bitdeli-chef avatar cashlo avatar coffeeworks avatar crocodile2u avatar dexion avatar jjobes avatar joshkennedy avatar lasprezz avatar lawabidingninja avatar mikepenz avatar nazneenrupawalla avatar nydevel avatar orcchg avatar serggl avatar sh0m1 avatar slavick avatar swolfand avatar theironmarx avatar thomasdao 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

caldroid's Issues

Using Caldroid as a photo calendar

Hello,
I'm making photo app, but I'm stuck with a thing that goes like this: when You click on the date I want it to open new activity (or whatever needs to be opened) where You can take a picture of a day and set that picture as a background of that date - just like here: https://play.google.com/store/apps/details?id=pl.pawelbialecki.a365photoapp

Simply put: just want to copy the app above and enhance it with tweaks that I think will be a great feature.

I'm programming Android like for 2 months with no prior experience so please keep it simple :) Thank You in advance for helping out!

Calendar Moves to Next Month On Rotation

When the calendar is viewed as a dialog, on rotation it moves to the next the month. It seems the DatePageChangeListener refreshAdapters is being called each time it rotates causing it to move to the next month.

Changing month when calendar not visible

Hi there. Caldroid is great, will highly recommend it. I have a question. I want to grab 12 images of the calendar, one for each of the last 12 months. This is invisible to the user and the calendar isn't shown while this happens.

My code to generate the image is as follows:

 public ByteArrayOutputStream getImage() {
    myCalendarView.setBackgroundColor(Color.WHITE);
    myCalendarView.layout(0, 0, 700, 700);
    myCalendarView.buildDrawingCache();
    Bitmap b = calendarView.getDrawingCache();

    ByteArrayOutputStream stream = new ByteArrayOutputStream();

    b = Bitmap.createScaledBitmap(b, 400, 400, true);
    b.compress(Bitmap.CompressFormat.JPEG /* FileType */, 100 /* Ratio */,
            stream);

    myCalendarView.setBackgroundColor(Color.TRANSPARENT);
    myCalendarView.destroyDrawingCache();
    return stream;
}

Then I loop through the last 12 months like this

      for (int i = 0; i < months; i++) {
            ByteArrayOutputStream stream = getImage();

            Image graph = Image.getInstance(stream.toByteArray());
            graph.setAbsolutePosition(xRows, (pdfHeight - topOffset - 550)
                    - (i * 500));
            document.add(graph);

            now.addMonths(-1);
            calendarFrag.moveToDateTime(now.toDateTime());

            Thread.sleep(10);
        }

(I know sleeping the main thread is not good, but otherwise the image gets grabbed half way between transitions on the month change on the calendar).

This works fine for the current month and the month before, bet any month before that shows blank. I guess this is to do with the buffered page viewer having one month either side buffered, however I have looked and cannot for the life of me work out what is wrong.

If you have any ideas that would be great.

Thanks!
Simon

blank

customize the caldroid calendar height?

I have been using the caldroid in my app, so i need to change the height of calendar. how is it possible? Because i didn't see anywhere the size and other specifies.

Multiple license files

There is a second license file located here.
Caldroid/src/com/antonyt/infiniteviewpager/LICENSE.txt.

Clicking on a Custom Date Grid Cell produces an ANR

I tried the custom cell view for Date Grid. While clicking on the Date cell gives an ANR.
While checking the log there is a problem in casting the type View type to Textview in the onItemClickListener. Please fix it

Display improvement

Change "LUN. MAR. MER. JEU. VEN. SAM. DIM." color, change arrows and red_border without editing the lib itself.

Allowing dialog without any title

Thanks for sharing this great piece of work.
I wanted to use the dialog fragment without any title so I modified CaldroidFragment to this:

String dialogTitle = args.getString("dialogTitle");
if (dialogTitle != null) {
    getDialog().setTitle(dialogTitle);
} else {
    getDialog().requestWindowFeature(Window.FEATURE_NO_TITLE);
}

...which makes sense for me, because if I don't provide a title, I probably won't have an empty title bar displayed.

HoloEverywhere Conflict

Just a note to anyone that may come across it, if you are using the HoloEverywhere library with this, make sure that the Caldroid library comes before the HoloEverywhere library or else you will get some strange layout errors and crashes. Not sure if it was exclusive to me, but it may be beneficial to other developers who cannot find this issue.

fIimBLK

Updating data in view through AsyncTask

I am loading the calender firstly, then on call of onMonthChange function, I am fetching data (which is basically a count for each day) through Json in asynctask. Thereafter, I have to update the view with count for each day. To do that I am calling notifydatasetchanged in postExecute of the AsynTask.
However, notifydatasetchanged doesn't update view for all months. The pattern is somethign like this:
For example- if we load any month from January, February, or March, view of February is only updated. Then on opening April, no view is updated. Then on calling May, June, or July only view of June is updated each time. This pattern get repeated.
I need to know if I am wrong in calling notifydatasetchanged...Is there any other function I need to call for this purpose?

Gradient in setBackgroundResourceForDates

Is it possible to add a gradient or several colors for one day? I am using to mark holidays blue but there may be a different color from another brand and overlap.

On the other hand, I am implementing a DrawerLayout and get stuck half second it is barely noticeable but it is annoying, I've tried everything but I can not be fluid.

Unable to start activity Null Pointer Exception

Hello Sir,

 I Have followed the procedure to setup the application and i successfully seted up. The problem is when i run the application in my log its showing Null Pointer exception. I don't know whats happening. Can you please guide me regarding this issue.

Thanxs

Background-color of cell

Hello,

Is it possible to define for each cell (day), a different background color ?

For example, I would like to have the 01/07 green, 02/07 red, 03/07 pink, etc ...

Thank you !

NoClassDefFoundError: com.caldroid.R$layout

I'm attempting to use the Caldroid library, and have added all the source files to my current project. However, upon deployment, I receive a fatal error every time I try to show a calendar (using the CaldroidFragment).

The error is java.lang.NoClassDefFoundError: com.caldroid.R$layout
at com.caldroid.CaldroidFragment.onCreateView(CaldroidFragment.java:683).

Does anyone know of a possible fix? I can provide any other info if needed.

Thanks.

Swipe to change month

Would it be possible for you to implement swipe left and right to change the month?

CaldroidFragment Loses Calendar On Rotation

Currently using the FragmentDialog version of the Calendar and on rotation the calendar view pager disappears on rotation. Has anyone seen this issue and no the solution?

< & > buttons are not responding all the time

The 2 red arrows on top left and right are sometimes not responding well and seem to cancel the touch event.
This happens when pressing these buttons repeatedly & sometimes when just using it for regular switching.

Landscape mode problem

In CaldroidSample, on changing to landscape mode, the "Customize" and "Show Dialog" button disappear. So I added a scroll view to the whole layout. But after doing so, the calendar grid is no longer visible. Although the calendar arrow and date can be seen, the date grid is vanished. (the buttons are visible). So how to handle the grid when mode is changed to landscape?

client injects arraylist to CaldroidGridAdapter using extraData

first i inject an arraylist by extraData to CaldroidGridAdapter, and then i get the arraylist in getView function of CaldroidGridAdapter to Iterate through this arraylist, checking whether current date is in the arraylist, but it always causes Null Pointer Exception.am i doing something wrong because i can inject simple string but arraylist seems not work, please help

Request: Caldroid Fragment performClick,performLongClick

Hi I understand there is a CaldroidListener for program to listen to long tap and single tap. This is good but I am wondering can we have a programmatically feature? That is in Android view we have the performClick() method. This allow us to simulate a click on the view programmatically.

So I am requesting for something similar for Caldroid but maybe to programmatically performClick(Date t) and performLongClick(Date t). Then internally it will trigger the existing CaldroidListener methods.

Thanks.

[HELP] Change background for certain dates .

Hi, I'm trying to highlight certain dates in Caldroid and i'm using a HashMap and A custom Function for parsing a String into a Date variable .. But, it is not working .. What have i done wrong here ?

        // CUSTOM FUNCTION FOR PARSING STRING TO DATA
    public Date ParseDate(String date_str)
    {
        SimpleDateFormat formatter = new SimpleDateFormat("dd MMM yyyy");
        Date dateStr = null;
        try {
            dateStr = formatter.parse(date_str);
        } catch (ParseException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return dateStr;     
    }

        // SETTING THE BACKGROUND
    // Create a hash map
    HashMap hm = new HashMap();
    // Put elements to the map
        hm.put(ParseDate("Jun 14 2013"), R.color.blue);
        hm.put(ParseDate("Jun 16 2013"), R.color.green);
        hm.put(ParseDate("Jun 18 2013"), R.color.blue);
        hm.put(ParseDate("Jun 20 2013"), R.color.green);
        hm.put(ParseDate("Jun 22 2013"), R.color.blue);
    if (caldroidFragment != null) {
            caldroidFragment.setBackgroundResourceForDates(hm);
        }

So, what is wrong here ?? Any help would be greatly appreciated ...

implement in fragment

hi! i have a problem with your code... i have a fragment where i want to display your calendar... i tried from your wiki but it doesnt work... can you help me?

Caldroid RefreshView

Hi I am a new user of Caldroid. I don't know if this is a bug but just want to list down something that does not seem to allow refresh.

HashMap<Date, Integer> map = new HashMap<Date,Integer>();
//put in values etc
m_fragCaldroid.setBackgroundResourceForDates(map);
m_fragCaldroid.refreshView();

Upon calling refreshView below error occurs

org.joda.time.IllegalFieldValueException: Value -1 for monthOfYear must be in the range [1,12]

Trace to below code in refreshView method
// Refresh title view
monthTitleTextView.setText(new DateTime(year, month, 1, 0, 0, 0, 0)
.monthOfYear().getAsText().toUpperCase()
+ " " + year);

Basically I am calling setBackgroundResourceForDates for different map so I want to re-use the Caldroid fragment by doing a refresh every time I set a new map. Is this supported or whenever I change the map, I need to instantiate a new Caldroid fragment ?

Personnalize each cell

I'm building a a calendar with 3 kinds of cell, normal cells, cells with price and cells with amount in percentage (see the picture).

I added an ArrayList of my cells, order by date in the Adapter.

It's working fine for the selected month, but when i change the month the method getNewDatesGridAdapter is called and i can't figure how to use my array to build the display.

Do you think there is a better way to do this?
device-2013-04-16-100637

Orientation issue

When i change the orientation from Portrait to landscape and then landscape to portrait,
another calendar view gets added at the bottom of the previous view.

First day of week

To select the first day of week can be useful, depends on the country

Cannot be nested within a fragment

Given I add the CaldroidFragment into an existing fragment, I will receive this error message:

java.lang.IllegalStateException: Can't retain fragements that are nested in other fragments

This is how I set things up:

@EFragment(R.layout.frg_analysis)
public class AnalysisFragment extends SherlockFragment {

    @AfterViews
    protected void setupView() {
        CaldroidFragment caldroidFragment = new CaldroidFragment();
        Bundle args = new Bundle();
        Calendar cal = Calendar.getInstance();
        args.putInt("month", cal.get(Calendar.MONTH) + 1);
        args.putInt("year", cal.get(Calendar.YEAR));
        caldroidFragment.setArguments(args);

        FragmentTransaction t = getChildFragmentManager().beginTransaction();
        t.add(R.id.containerCalendar, caldroidFragment);
        t.commit();
    }
}

Stackoverflow has some hints: http://stackoverflow.com/questions/14850573/cant-retain-nested-fragments .

Full stacktrace:

E/AndroidRuntime( 1763): java.lang.IllegalStateException: Can't retain fragements that are nested in other fragments
E/AndroidRuntime( 1763):    at android.support.v4.app.Fragment.setRetainInstance(Fragment.java:742)
E/AndroidRuntime( 1763):    at com.caldroid.CaldroidFragment.onCreate(CaldroidFragment.java:924)
E/AndroidRuntime( 1763):    at android.support.v4.app.Fragment.performCreate(Fragment.java:1437)
E/AndroidRuntime( 1763):    at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:877)
E/AndroidRuntime( 1763):    at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1088)
E/AndroidRuntime( 1763):    at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:682)
E/AndroidRuntime( 1763):    at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1444)
E/AndroidRuntime( 1763):    at android.support.v4.app.Fragment.performStart(Fragment.java:1481)
E/AndroidRuntime( 1763):    at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:941)
E/AndroidRuntime( 1763):    at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1088)
E/AndroidRuntime( 1763):    at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:682)
E/AndroidRuntime( 1763):    at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1444)
E/AndroidRuntime( 1763):    at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:429)
E/AndroidRuntime( 1763):    at android.os.Handler.handleCallback(Handler.java:725)
E/AndroidRuntime( 1763):    at android.os.Handler.dispatchMessage(Handler.java:92)
E/AndroidRuntime( 1763):    at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime( 1763):    at android.app.ActivityThread.main(ActivityThread.java:5041)
E/AndroidRuntime( 1763):    at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 1763):    at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime( 1763):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
E/AndroidRuntime( 1763):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
E/AndroidRuntime( 1763):    at dalvik.system.NativeStart.main(Native Method)

[GUIDE]Caldroid with ActionbarSherlock

To all those trying to make Caldroid work along with ActionbarSherlock (without any errors).

  • Import ActionbarSherlock Library and Caldroid Library.
  • Then delete the support v4 jar from the libs folder of ActionbarSherlock
  • Add caldroid as a dependency to ActionbarSherlock.
  • Add ActionbarSherlock as a dependency to your app.

Now, everything will work without any errors !

[Help]how to store daily record with SQLite?

Hello.
First, Thank you so much for the great work what I ve been looking for, for many days.
I am a student, and studying android development beginner.
Could I ask how to store daily schedule with SQLite?
I ve tried to make an sqlite db and a column of date to integrate db with each date.

i.e. I want to make an input and saving daily record app, just like "Work Mate" app.

Please give me some hints.

Thank you.

Sincerely S.

Incorrect Caldroid fragment height in ScrollView

Hi,

Tried to reproduce Roomorama's nice Availability page, with multiple, scrollable Caldroid fragments:
https://www.dropbox.com/s/0kpb8435ffv1psp/Screenshot_2013-08-26-18-17-53.png

If I add multiple Caldroid fragments to a LinearLayout that's fine, no problem at all. BUT if I embed it into a ScrollView, height will be messed, and I'll get this:
https://www.dropbox.com/s/g3ntnkrnr8shbbv/Screenshot_2013-08-26-17-57-54.png

Please let me know if you have any idea, or workaround.

Thank you!

Setting text on custom grid view, also set text on wrong grids

Hi, I am using CaldroidSampleCustomAdapter to customize cell layout. I am putting some text on few textview on few dates. It sets data fine, but when i scroll the layout it also sets the text on wrong grids which i don't want. Please check attached image to see the duplicate text on wrong grids. Can you please look into this issue? Because i find this tutorial very helpful and useful, so it can help others perfectly.
caldroid

Refreshing only some particular date cells

When refreshView() is called, caldroid updates the date cells for the previous, current and next month. This takes up around 2 seconds to get the dates and refresh. How about adding an extraData (HashMap) parameter inside refreshView() so that dates of some particular cells can be passed and then caldroid would take much less time to refresh these cells?

Today Method

It would be wonderful if there was a method to change the gridview and date to the current day. I'm having a hard time implementing this with the new InfinePager.

how to add extra text in Gridview

I want to add numbers at the top left corner of the grid views when events are added for a particular date. How can i achieve this?

Caldroid fragment not taking whole fragment height

I'm injecting Caldroid fragment into my layout.Here is layout code:

    <LinearLayout
        android:id="@+id/left_page"
        android:layout_width="1dp"
        android:layout_height="match_parent"
        android:layout_marginBottom="35dp"
        android:layout_marginLeft="75dp"
        android:layout_marginRight="40dp"
        android:layout_marginTop="35dp"
        android:layout_weight="0.5"
        android:orientation="vertical" >
    </LinearLayout>

Calendar is properly stretched in width however takes ony like a half of the fragment height making me scroll.

Is there possible to quickly switch years inside dialog?

Hello! At first thank you for great work. Now I will describe issue or maybe the feature which seems to be lack in your lib. I would like to see the way of quick switch between years not only months. So the user wont clik 12 times to get the year he expects.

Please guide me about this :)

JodaTime

JodaTime is great library, but I'm not sure if I want 0.5 MB library only because of datepicker :-(

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.