-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from recruit-mp/1.0.1
[リリース] Version 1.0.1
- Loading branch information
Showing
54 changed files
with
542 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
apply plugin: 'com.android.application' | ||
|
||
android { | ||
compileSdkVersion 23 | ||
buildToolsVersion "24.0.1" | ||
|
||
defaultConfig { | ||
applicationId "jp.co.recruit.android.lightcalendarview.javasample" | ||
minSdkVersion 15 | ||
targetSdkVersion 23 | ||
versionCode 1 | ||
versionName "1.0" | ||
|
||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" | ||
|
||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
compile fileTree(dir: 'libs', include: ['*.jar']) | ||
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { | ||
exclude group: 'com.android.support', module: 'support-annotations' | ||
}) | ||
compile 'com.android.support:appcompat-v7:23.4.0' | ||
compile project(":library") | ||
testCompile 'junit:junit:4.12' | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="jp.co.recruit_mp.android.lightcalendarview.javasample"> | ||
|
||
<application android:allowBackup="true" android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" android:supportsRtl="true" android:theme="@style/AppTheme"> | ||
<activity android:name=".MainActivity"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
|
||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
</application> | ||
|
||
</manifest> |
86 changes: 86 additions & 0 deletions
86
...ple/src/main/java/jp/co/recruit_mp/android/lightcalendarview/javasample/MainActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
package jp.co.recruit_mp.android.lightcalendarview.javasample; | ||
|
||
import android.os.Bundle; | ||
import android.os.Handler; | ||
import android.support.annotation.Nullable; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.util.Log; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
|
||
import java.text.SimpleDateFormat; | ||
import java.util.ArrayList; | ||
import java.util.Calendar; | ||
import java.util.Date; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Locale; | ||
|
||
import jp.co.recruit_mp.android.lightcalendarview.LightCalendarView; | ||
import jp.co.recruit_mp.android.lightcalendarview.MonthView; | ||
import jp.co.recruit_mp.android.lightcalendarview.accent.Accent; | ||
import jp.co.recruit_mp.android.lightcalendarview.accent.DotAccent; | ||
|
||
public class MainActivity extends AppCompatActivity { | ||
|
||
private SimpleDateFormat formatter = new SimpleDateFormat("MMMM yyyy", Locale.getDefault()); | ||
|
||
@Override | ||
protected void onCreate(@Nullable Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_main); | ||
|
||
Calendar calFrom = Calendar.getInstance(); | ||
Calendar calTo = Calendar.getInstance(); | ||
Calendar calNow = Calendar.getInstance(); | ||
calFrom.set(Calendar.MONTH, 0); | ||
calTo.set(Calendar.MONTH, 11); | ||
|
||
LightCalendarView calendarView = (LightCalendarView) findViewById(R.id.calendarView); | ||
calendarView.setMonthFrom(calFrom.getTime()); | ||
calendarView.setMonthTo(calTo.getTime()); | ||
calendarView.setMonthCurrent(calNow.getTime()); | ||
|
||
// set the calendar view callbacks | ||
calendarView.setOnStateUpdatedListener(new LightCalendarView.OnStateUpdatedListener() { | ||
|
||
@Override | ||
public void onMonthSelected(@NotNull Date date, @NotNull final MonthView view) { | ||
getSupportActionBar().setTitle(formatter.format(date)); | ||
|
||
new Handler().postDelayed(new Runnable() { | ||
@Override | ||
public void run() { | ||
Calendar cal = Calendar.getInstance(); | ||
List<Date> dates = new ArrayList<Date>(); | ||
for (int i = 0; i < 31; i++) { | ||
if (i % 2 == 0) { | ||
cal.set(view.getMonth().getYear() + 1900, view.getMonth().getMonth(), i); | ||
dates.add(cal.getTime()); | ||
} | ||
} | ||
HashMap<Date, List<Accent>> map = new HashMap<>(); | ||
for (Date date : dates) { | ||
List<Accent> accents = new ArrayList<>(); | ||
for (int i = 0; i <= (date.getDate() % 3); i++) { | ||
accents.add(new DotAccent(10f, null, formatter.format(date) + "-" + i)); | ||
} | ||
map.put(date, accents); | ||
} | ||
view.setAccents(map); | ||
} | ||
}, 1000); | ||
|
||
Log.i("JavaMainActivity", "onMonthSelected: date = " + date); | ||
} | ||
|
||
@Override | ||
public void onDateSelected(@NotNull Date date) { | ||
Log.i("JavaMainActivity", "onDateSelected: date = " + date); | ||
} | ||
}); | ||
|
||
// change the actionbar title | ||
getSupportActionBar().setTitle(formatter.format(calendarView.getMonthCurrent())); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item android:color="#EEEEEE" android:state_active="true" android:state_selected="true" /> | ||
<item android:color="#3d52f1" android:state_active="true" /> | ||
<item android:color="#EEEEEE" android:state_selected="true" /> | ||
<item android:color="#3d52f1" /> | ||
</selector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item android:color="#FFFFFF" android:state_active="true" android:state_selected="true" /> | ||
<item android:color="#3d4ff1" android:state_active="true" /> | ||
<item android:color="#FFFFFF" android:state_selected="true" /> | ||
<item android:color="#8D8B95" /> | ||
</selector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item android:color="#3d4cf1" android:state_active="true" android:state_selected="true" /> | ||
<item android:color="#8D8B95" android:state_selected="true" /> | ||
</selector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<color name="colorPrimary">#3F51B5</color> | ||
<color name="colorPrimaryDark">#303F9F</color> | ||
<color name="colorAccent">#FF4081</color> | ||
</resources> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<resources> | ||
<string name="app_name">LightCalendarViewJava</string> | ||
</resources> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Add project specific ProGuard rules here. | ||
# By default, the flags in this file are appended to flags specified | ||
# in /Users/masayuki-recruit/Library/Android/sdk/tools/proguard/proguard-android.txt | ||
# You can edit the include path and order by changing the proguardFiles | ||
# directive in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# Add any project specific keep options here: | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} |
4 changes: 2 additions & 2 deletions
4
sample/src/main/AndroidManifest.xml → kotlinsample/src/main/AndroidManifest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:paddingBottom="@dimen/activity_vertical_margin" | ||
android:paddingLeft="@dimen/activity_horizontal_margin" | ||
android:paddingRight="@dimen/activity_horizontal_margin" | ||
android:paddingTop="@dimen/activity_vertical_margin" | ||
tools:context=".MainActivity"> | ||
|
||
<ScrollView | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content"> | ||
|
||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:orientation="vertical"> | ||
|
||
<jp.co.recruit_mp.android.lightcalendarview.LightCalendarView | ||
android:id="@+id/calendarView" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
app:lcv_weekDayTextSize="18sp" | ||
app:lcv_dayTextSize="18sp" | ||
app:lcv_textColor="@color/calendar_day_text" | ||
app:lcv_selectionColor="@color/calendar_selection" | ||
app:lcv_accentColor="@color/calendar_accent" | ||
app:lcv_firstDayOfWeek="@integer/lcv_monday"/> | ||
|
||
</LinearLayout> | ||
</ScrollView> | ||
|
||
</RelativeLayout> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<resources> | ||
<!-- Example customization of dimensions originally defined in res/values/dimens.xml | ||
(such as screen margins) for screens with more than 820dp of available width. This | ||
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). --> | ||
<dimen name="activity_horizontal_margin">64dp</dimen> | ||
</resources> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<resources> | ||
<!-- Default screen margins, per the Android Design guidelines. --> | ||
<dimen name="activity_horizontal_margin">16dp</dimen> | ||
<dimen name="activity_vertical_margin">16dp</dimen> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<resources> | ||
<string name="app_name">LightCalendarViewKotlin</string> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<resources> | ||
|
||
<!-- Base application theme. --> | ||
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> | ||
<!-- Customize your theme here. --> | ||
<item name="colorPrimary">@color/colorPrimary</item> | ||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item> | ||
<item name="colorAccent">@color/colorAccent</item> | ||
</style> | ||
|
||
</resources> |
12 changes: 12 additions & 0 deletions
12
library/src/main/kotlin/jp/co/recruit_mp/android/lightcalendarview/CalendarKt.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package jp.co.recruit_mp.android.lightcalendarview | ||
|
||
import java.util.* | ||
|
||
/** | ||
* Created by recruit-mahayash on 2017/01/13. | ||
*/ | ||
class CalendarKt : GregorianCalendar() { | ||
companion object { | ||
fun getInstance(settings: CalendarSettings) = getInstance(settings.timeZone, settings.locale) | ||
} | ||
} |
Oops, something went wrong.