Dynamic Calendar


Source link: https://github.com/SilleBille/DynamicCalendar

Dynamic Calendar

DynamicCalendar library generates a custom calendar icon based on the date you provide. You can also change the background template of the generated date icon.

You can specify the font's typeface, size, position, color and the empty calendar icon.

!!! There may be some issues with different screen resolutions. Please let me know if you face any such problems

Features Included

  • Specify the background empty calendar icon
  • Change the typeface of both date and month
  • Change the size of the date and month fonts independently
  • Provision for saving the generated image to external storage

Change Log

  • 12 Jan 2015: First release
  • 13 Jan 2015: Added support from API 9

Screen Shots

Adding the library to your project

Add this to your build.gradle of your project

dependencies {

  ...
  compile 'com.github.sillebille:dynamic-calendar:1.0.1'
  ... 
}

Mandatory Properties to be set

// Create an object of ImageGenerator class in your activity // and pass the context as the parameter ImageGenerator mImageGenerator = new ImageGenerator(this);
  // Set the icon size to the generated in dip.  mImageGenerator.setIconSize(50, 50);
  // Set the size of the date and month font in dip. mImageGenerator.setDateSize(30);
 mImageGenerator.setMonthSize(10);
  // Set the position of the date and month in dip. mImageGenerator.setDatePosition(42);
 mImageGenerator.setMonthPosition(14);
  // Set the color of the font to be generated mImageGenerator.setDateColor(Color.parseColor("#3c6eaf"));
 mImageGenerator.setMonthColor(Color.WHITE);

Generating the Image

After setting all the required properties, generate the image. This function returns a bitmap.

// 1st param, mCurrentDate should be an instance of class Calendar // 2nd param, send the id of the empty calendar icon mImageGenerator.generateDateImage(mCurrentDate, R.drawable.empty_calendar);

Optional Features

1 - Storing the generated image to SDCard

// The images are stored in ../sdcard/CalendarImageGenerated/ mImageGenerator.setStorageToSDCard(true);

2 - Changing the fonts. The fonts should be placed in assets/fonts folder. Create folder if they do not exist.

// You have to add the complete name with extension mImageGenerator.setDateTypeFace("Roboto-Light.ttf");
 mImageGenerator.setMonthTypeFace("Ubuntu-R.ttf");

Sample App

A sample app using this library is available in Android Play Store.

Author

Dinesh Prasanth

License

Copyright (c) 2015. DineshPrasanth  Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License. You may obtain a copy of the License at
  http://www.apache.org/licenses/LICENSE-2.0  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 

Resources

This is the Android Architecture Components extension library available for Kotlin.

A Library to provide Http post request easily.

A spinning circular loading view; for use when you need to display something when you are loading something off of the main UI thread.

Reduks is a redux-like implementation for kotlin apps, with this you can create, state, actions, reducers, stores and middlewares in an easy way.

A simple animation with tanslation or scale views written in Java.

A reusable fragment to display links to social networks, the Play Store as well as recommendation and support email links. The fragment tries to open installed apps on the user's device first and resorts to the web browser otherwise.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes