Skip to content
Snippets Groups Projects
Commit cb16e1d8 authored by JeongPil Lee's avatar JeongPil Lee
Browse files

Merge branch 'master' of git.ajou.ac.kr:open-source-2018-spring/Awsome_Android_Global_Calender

parents 88008341 87840d5c
Branches
No related tags found
No related merge requests found
Showing
with 31722 additions and 269 deletions
기존 안드로이드 달력에 국가선택 및 다양한 기능추가 기존 안드로이드 달력에 국가선택 및 다양한 기능추가
================================================= =================================================
### introduce ## introduce
* 나라에 맞게 공휴일 & 기념일 설정이 가능한 달력입니다. * 나라에 맞게 공휴일 & 기념일 설정이 가능한 달력입니다.
* 기존 달력에 국가선택 및 다른 기능을 추가 * 기존 달력에 국가선택 기능.
* 해외 여행 & 글로벌 인턴 시 원하는 나라에 맞춰 캘린더 활용가능 * 그 외에도 다른 기능 추가.
* 해외 여행 & 글로벌 인턴 시 원하는 나라에 맞게 캘린더 활용가능.
### Summary ## Summary
> <p> 1.해외여행 증가.</p> > <p> 1.해외여행 증가.</p>
> <p> 2.기존 안드로이드 기본 달력에는 국가설정이 없음.</p> > <p> 2.기존 안드로이드 기본 달력에는 국가설정이 없음.</p>
> <p> 3.기타 다양한 기능 추가.</p> > <p> 3.기타 다양한 기능 추가.</p>
> <p> 이런 점에서 모티브를 얻어 달력에 기능 추가.</p> > <p> 이런 점에서 모티브를 얻어 달력에 기능 추가</p>
### opensource&tools ## tools
* Android Calender * googleAPI
* kotlin * kotlin
* android * android studio 3.1
### License ## 기존 유사 프로젝트
* 기존 안드로이드 달력
<p> https://github.com/wanasit/google-calendar</p>
<p> 국가 변경 기능이 추가되어 있지는 않지만 구글 계정 변경을 통해 변경 가능</p>
<p> 한 계정으로 여러 국가를 설정 할 수 없음</p>
<p> 여행 시 다른나라 공휴일을 검색 등으로 찾아봐야 하는 번거로움</p>
* 차별성 & 개선 사항
<p> 국가 변경 기능 </p>
<p> GPS 사용을 통한 나라 자동 변경 기능 </p>
<p> 가계부 기능 등 기타 기능 추가</p>
<p> 모든 기능 한글화 </p>
<p> 공휴일 한글화 </p>
## View
![1](/uploads/4450a80ffc0c355363a13e050a6d0925/1.jpg)
![2](/uploads/0091579a73dd192c359ecc3eb8773eff/2.jpg)
![3](/uploads/2e37e5482fec4ffef562de4d9edc0ecf/3.jpg)
![4](/uploads/c5e4a1b5577bd60c24f8ce50468dacd8/4.jpg)
![5](/uploads/b1b0fb1ff009745e40179aaf102154ec/accoun.png)
## 사용한 오픈소스 & 개선
### 달력 기초 및 가계부UI
* Simple-calendar(https://github.com/SimpleMobileTools/Simple-Calendar)
* wisedog/Whoochoo(https://github.com/wisedog/Whoochoo)
### DB
* open holiday ics파일
* open holiday dataset
* 개선한 점 : ics파일에 없는 내용을 holiday dataset에서 추가 한국 여행자 등에게 도움이 될 수 있도록 한국어로 번역
### 타 개발자에게 도움이 될만한 자료
* python - ics parser
* https://github.com/oblique63/Python-GoogleCalendarParser (기존 파이썬 ics parser)
* 기존 파이썬 ics parser를 참고하여 kotlin ics parser 제작
* http://git.ajou.ac.kr/open-source-2018-spring/Android_ics_parser_kotlin (kotlin으로 ics parser 새로 작성)
* kotlin 안드로이드 개발자들에게 도움이 될 것으로 예상됨(날짜 등을 활용한 프로젝트에서)
* kotlin google_GPS_api 사용법 정리 및 샘플 코드 작성(안드로이드 스튜디오 3.1버전에서)
* http://git.ajou.ac.kr/open-source-2018-spring/Google_GPS_API_Kotlin
* GPS를 이용해야 하는 개발자들에게 도움이 될 것으로 예상됨
## 사용한 오픈소스 & License
* Simple-calendar(Apache 2.0)
* wisedog/Whoochoo(Apache 2.0)
## License
* Apache 2.0 License * Apache 2.0 License
### developers ## developers
* 201420978 이정필 * 201420978 이정필
* 201421000 박신혁 * 201421000 박신혁
* 201421005 이현호 * 201421005 이현호
### Update ## Update
> <p> 1.나라별 변경 완료.</p> > <p> 1.나라별 변경 완료.</p>
> <p> 2.기능 한글화.</p> > <p> 2.기능 한글화.</p>
> <p> 3.나라별 공휴일 한글화 완료.</p> > <p> 3.나라별 공휴일 한글화 완료.</p>
> <p> 4.D-day 기능 구현(예정)</p> > <p> 4.D-day 기능 구현 완료.</p>
> <p> 5.GPS 국가 자동 변경 기능 완료</p> > <p> 5.GPS 국가 자동 변경 기능 완료.</p>
> <p> 6.가계부 기능 추가 구현(예정)</p> > <p> 6.가계부 기능 구현 완료.</p>
\ No newline at end of file
This diff is collapsed.
package com.simplemobiletools.calendar.activities
import android.content.Intent
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import com.simplemobiletools.calendar.R
import kotlinx.android.synthetic.main.activity_count.*
private var allNum : Int =0
class CountActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_count)
var sumNum : String
btn_result.setOnClickListener {
val num01: Int = Integer.parseInt(edt_01.text.toString())
val num02 = Integer.parseInt(edt_02.text.toString())
sumNum = end(num01 ,num02).toString()
txt_present.text = allNum.toString()
allNum += sumNum.toInt()
txt_result.text = allNum.toString()
}
}
fun end(a: Int, b: Int):Int{
return (a+b)
}
}
...@@ -22,6 +22,7 @@ import com.simplemobiletools.commons.extensions.* ...@@ -22,6 +22,7 @@ import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.helpers.* import com.simplemobiletools.commons.helpers.*
import com.simplemobiletools.commons.models.RadioItem import com.simplemobiletools.commons.models.RadioItem
import kotlinx.android.synthetic.main.activity_event.* import kotlinx.android.synthetic.main.activity_event.*
//import kotlinx.android.synthetic.main.activity_account.*
import org.joda.time.DateTime import org.joda.time.DateTime
import java.util.* import java.util.*
import java.util.regex.Pattern import java.util.regex.Pattern
...@@ -44,10 +45,11 @@ class EventActivity : SimpleActivity() { ...@@ -44,10 +45,11 @@ class EventActivity : SimpleActivity() {
lateinit var mEventEndDateTime: DateTime lateinit var mEventEndDateTime: DateTime
lateinit var mEvent: Event lateinit var mEvent: Event
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setContentView(R.layout.activity_event) setContentView(R.layout.activity_event)
//setContentView(R.layout.activity_account)
supportActionBar?.setHomeAsUpIndicator(R.drawable.ic_cross) supportActionBar?.setHomeAsUpIndicator(R.drawable.ic_cross)
val intent = intent ?: return val intent = intent ?: return
mDialogTheme = getDialogTheme() mDialogTheme = getDialogTheme()
...@@ -80,7 +82,9 @@ class EventActivity : SimpleActivity() { ...@@ -80,7 +82,9 @@ class EventActivity : SimpleActivity() {
mReminder1Minutes = config.defaultReminderMinutes mReminder1Minutes = config.defaultReminderMinutes
mReminder2Minutes = config.defaultReminderMinutes3 mReminder2Minutes = config.defaultReminderMinutes3
mReminder3Minutes = config.defaultReminderMinutes2 mReminder3Minutes = config.defaultReminderMinutes2
setupNewEvent() setupNewEvent()
//setupNewEvent2()
} }
checkReminderTexts() checkReminderTexts()
...@@ -171,11 +175,12 @@ class EventActivity : SimpleActivity() { ...@@ -171,11 +175,12 @@ class EventActivity : SimpleActivity() {
val endTS = (intent.getLongExtra("endTime", System.currentTimeMillis()) / 1000).toInt() val endTS = (intent.getLongExtra("endTime", System.currentTimeMillis()) / 1000).toInt()
mEventEndDateTime = Formatter.getDateTimeFromTS(endTS) mEventEndDateTime = Formatter.getDateTimeFromTS(endTS)
var a =1000
event_title.setText(intent.getStringExtra("title")) event_title.setText(intent.getStringExtra("title"))
event_location.setText(intent.getStringExtra("eventLocation")) event_location.setText(intent.getStringExtra("eventLocation"))
event_description.setText(intent.getStringExtra("description")) event_description.setText(intent.getStringExtra("description"))
event_description.movementMethod = LinkMovementMethod.getInstance() event_description.movementMethod = LinkMovementMethod.getInstance()
} else { } else {
val startTS = intent.getIntExtra(NEW_EVENT_START_TS, 0) val startTS = intent.getIntExtra(NEW_EVENT_START_TS, 0)
val dateTime = Formatter.getDateTimeFromTS(startTS) val dateTime = Formatter.getDateTimeFromTS(startTS)
...@@ -186,6 +191,33 @@ class EventActivity : SimpleActivity() { ...@@ -186,6 +191,33 @@ class EventActivity : SimpleActivity() {
} }
} }
// private fun setupNewEvent2() {
// window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE)
// supportActionBar?.title = resources.getString(R.string.account)
// val isLastCaldavCalendarOK = config.caldavSync && config.getSyncedCalendarIdsAsList().contains(config.lastUsedCaldavCalendarId.toString())
// mEventCalendarId = if (isLastCaldavCalendarOK) config.lastUsedCaldavCalendarId else STORED_LOCALLY_ONLY
//
// if (intent.action == Intent.ACTION_EDIT || intent.action == Intent.ACTION_INSERT) {
// val startTS = (intent.getLongExtra("beginTime", System.currentTimeMillis()) / 1000).toInt()
// mEventStartDateTime = Formatter.getDateTimeFromTS(startTS)
//
// val endTS = (intent.getLongExtra("endTime", System.currentTimeMillis()) / 1000).toInt()
// mEventEndDateTime = Formatter.getDateTimeFromTS(endTS)
//
// event_title.setText(intent.getStringExtra("title"))
// event_location.setText(intent.getStringExtra("eventLocation"))
// event_description.setText(intent.getStringExtra("description"))
// event_description.movementMethod = LinkMovementMethod.getInstance()
// } else {
// val startTS = intent.getIntExtra(NEW_EVENT_START_TS, 0)
// val dateTime = Formatter.getDateTimeFromTS(startTS)
// mEventStartDateTime = dateTime
//
// val addHours = if (intent.getBooleanExtra(NEW_EVENT_SET_HOUR_DURATION, false)) 1 else 0
// mEventEndDateTime = mEventStartDateTime.plusHours(addHours)
// }
// }
private fun showReminder1Dialog() { private fun showReminder1Dialog() {
showPickSecondsDialogHelper(mReminder1Minutes) { showPickSecondsDialogHelper(mReminder1Minutes) {
mReminder1Minutes = if (it <= 0) it else it / 60 mReminder1Minutes = if (it <= 0) it else it / 60
......
...@@ -64,6 +64,7 @@ import com.google.android.gms.location.LocationServices ...@@ -64,6 +64,7 @@ import com.google.android.gms.location.LocationServices
import kotlinx.android.synthetic.main.activity_main.* import kotlinx.android.synthetic.main.activity_main.*
import android.location.Address import android.location.Address
import android.util.Log import android.util.Log
import android.widget.Button
import java.io.IOException import java.io.IOException
class MainActivity : SimpleActivity(), RefreshRecyclerViewListener , com.google.android.gms.location.LocationListener{ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener , com.google.android.gms.location.LocationListener{
...@@ -95,7 +96,7 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener , com.google. ...@@ -95,7 +96,7 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener , com.google.
private var mStoredIsSundayFirst = false private var mStoredIsSundayFirst = false
private var mStoredUse24HourFormat = false private var mStoredUse24HourFormat = false
private var mStoredDimPastEvents = true private var mStoredDimPastEvents = true
private var allNum =0
override fun onLocationChanged(location: Location?) { override fun onLocationChanged(location: Location?) {
// You can now create a LatLng Object for use with maps // You can now create a LatLng Object for use with maps
// val latLng = LatLng(location.latitude, location.longitude) // val latLng = LatLng(location.latitude, location.longitude)
...@@ -134,6 +135,7 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener , com.google. ...@@ -134,6 +135,7 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener , com.google.
} }
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
buildGoogleApiClient() buildGoogleApiClient()
...@@ -146,17 +148,23 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener , com.google. ...@@ -146,17 +148,23 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener , com.google.
checkWhatsNewDialog() checkWhatsNewDialog()
calendar_fab.beVisibleIf(config.storedView != YEARLY_VIEW) calendar_fab.beVisibleIf(config.storedView != YEARLY_VIEW)
calendar_fab.setOnClickListener { calendar_fab.setOnClickListener {
launchNewEventIntent(currentFragments.last().getNewEventDayCode()) launchNewEventIntent(currentFragments.last().getNewEventDayCode())
} }
button_Dday.setOnClickListener { button_Dday.setOnClickListener {
toast("click!!!!!") toast("click!!!!!")
val intent_dday = Intent(this, Dday::class.java) val intent_dday = Intent(this, Dday::class.java)
startActivity(intent_dday) startActivity(intent_dday)
} }
calendar_count.setOnClickListener{
val intent = Intent(this, CountActivity::class.java)
startActivity(intent)
}
storeStateVariables() storeStateVariables()
if (resources.getBoolean(R.bool.portrait_only)) { if (resources.getBoolean(R.bool.portrait_only)) {
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
......
package com.simplemobiletools.calendar.models package com.simplemobiletools.calendar.models
import android.accounts.Account
import com.simplemobiletools.calendar.extensions.seconds import com.simplemobiletools.calendar.extensions.seconds
import com.simplemobiletools.calendar.helpers.* import com.simplemobiletools.calendar.helpers.*
import com.simplemobiletools.calendar.helpers.Formatter import com.simplemobiletools.calendar.helpers.Formatter
......
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".CountActivity">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.kotlin_test.Activity.FunctionActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:orientation="horizontal"
android:weightSum="4">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="첫 번째 :"
android:gravity="center"/>
<EditText
android:id="@+id/edt_01"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:inputType="number"/>
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="두 번째 :"
android:gravity="center"/>
<EditText
android:id="@+id/edt_02"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:inputType="number"/>
</LinearLayout>
<Button
android:id="@+id/btn_result"
style="@style/Widget.AppCompat.Button"
android:layout_width="match_parent"
android:layout_height="50dp"
android:text="END" />
<TextView
android:id="@+id/textView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="이전 합계" />
<TextView
android:id="@+id/txt_present"
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center"
android:textSize="20sp" />
<TextView
android:id="@+id/textView2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="최신 합계" />
<TextView
android:id="@+id/txt_result"
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center"
android:textSize="20sp" />
</LinearLayout>
</android.support.constraint.ConstraintLayout>
This diff is collapsed.
...@@ -31,6 +31,23 @@ ...@@ -31,6 +31,23 @@
app:backgroundTint="@color/color_primary" app:backgroundTint="@color/color_primary"
app:rippleColor="@color/pressed_item_foreground" /> app:rippleColor="@color/pressed_item_foreground" />
<com.simplemobiletools.commons.views.MyFloatingActionButton
android:id="@+id/calendar_count"
style="@style/Widget.AppCompat.Button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_margin="@dimen/activity_margin"
android:contentDescription="@string/account"
android:src="@drawable/ic_plus"
app:backgroundTint="#0366fc"
app:rippleColor="@color/pressed_item_foreground" />
<RelativeLayout <RelativeLayout
android:id="@+id/search_holder" android:id="@+id/search_holder"
android:layout_width="match_parent" android:layout_width="match_parent"
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
</LinearLayout>
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
<string name="event">이벤트</string> <string name="event">이벤트</string>
<string name="edit_event">이벤트 수정</string> <string name="edit_event">이벤트 수정</string>
<string name="new_event">새 이벤트</string> <string name="new_event">새 이벤트</string>
<string name="account">가계부</string>>
<string name="create_new_event">Create a new event</string> <string name="create_new_event">Create a new event</string>
<string name="duplicate_event">Duplicate event</string> <string name="duplicate_event">Duplicate event</string>
<string name="title_empty">제목을 입력해주세요</string> <string name="title_empty">제목을 입력해주세요</string>
......
...@@ -10,9 +10,10 @@ buildscript { ...@@ -10,9 +10,10 @@ buildscript {
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:3.1.2' classpath 'com.android.tools.build:gradle:3.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files // in the individual module build.gradle files
} }
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment