Skip to content
Snippets Groups Projects
Commit b67d5d68 authored by 박신혁's avatar 박신혁
Browse files

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

parents 630eb269 78e2ec5e
Branches
No related tags found
No related merge requests found
Showing
with 31450 additions and 18 deletions
......@@ -17,9 +17,16 @@
## tools
* googleAPI
* kotlin
* android studio 3.1
=======
### License
>>>>>>> 78e2ec5e7d77fb0bcc38a6277c65aef76adda53d
## 기존 유사 프로젝트
* 기존 안드로이드 달력
......@@ -61,6 +68,7 @@
* 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 안드로이드 개발자들에게 도움이 될 것으로 예상됨(날짜 등을 활용한 프로젝트에서)
......@@ -73,6 +81,22 @@
* Simple-calendar(Apache 2.0)
* wisedog/Whoochoo(Apache 2.0)
* 기존 파이썬 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
......@@ -92,3 +116,5 @@
> <p> 5.GPS 국가 자동 변경 기능 완료.</p>
> <p> 6.가계부 기능 구현 완료.</p>
......@@ -50,7 +50,6 @@ dependencies {
implementation 'joda-time:joda-time:2.9.9'
implementation 'com.facebook.stetho:stetho:1.5.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.facebook.android:facebook-login:[4,5)'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
......
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.*
import com.simplemobiletools.commons.helpers.*
import com.simplemobiletools.commons.models.RadioItem
import kotlinx.android.synthetic.main.activity_event.*
//import kotlinx.android.synthetic.main.activity_account.*
import org.joda.time.DateTime
import java.util.*
import java.util.regex.Pattern
......@@ -44,10 +45,11 @@ class EventActivity : SimpleActivity() {
lateinit var mEventEndDateTime: DateTime
lateinit var mEvent: Event
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_event)
//setContentView(R.layout.activity_account)
supportActionBar?.setHomeAsUpIndicator(R.drawable.ic_cross)
val intent = intent ?: return
mDialogTheme = getDialogTheme()
......@@ -80,7 +82,9 @@ class EventActivity : SimpleActivity() {
mReminder1Minutes = config.defaultReminderMinutes
mReminder2Minutes = config.defaultReminderMinutes3
mReminder3Minutes = config.defaultReminderMinutes2
setupNewEvent()
//setupNewEvent2()
}
checkReminderTexts()
......@@ -171,11 +175,12 @@ class EventActivity : SimpleActivity() {
val endTS = (intent.getLongExtra("endTime", System.currentTimeMillis()) / 1000).toInt()
mEventEndDateTime = Formatter.getDateTimeFromTS(endTS)
var a =1000
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)
......@@ -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() {
showPickSecondsDialogHelper(mReminder1Minutes) {
mReminder1Minutes = if (it <= 0) it else it / 60
......
......@@ -64,6 +64,7 @@ import com.google.android.gms.location.LocationServices
import kotlinx.android.synthetic.main.activity_main.*
import android.location.Address
import android.util.Log
import android.widget.Button
import java.io.IOException
class MainActivity : SimpleActivity(), RefreshRecyclerViewListener , com.google.android.gms.location.LocationListener{
......@@ -96,7 +97,7 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener , com.google.
private var mStoredIsSundayFirst = false
private var mStoredUse24HourFormat = false
private var mStoredDimPastEvents = true
private var allNum =0
override fun onLocationChanged(location: Location?) {
// You can now create a LatLng Object for use with maps
// val latLng = LatLng(location.latitude, location.longitude)
......@@ -130,6 +131,7 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener , com.google.
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
buildGoogleApiClient()
......@@ -142,9 +144,20 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener , com.google.
checkWhatsNewDialog()
calendar_fab.beVisibleIf(config.storedView != YEARLY_VIEW)
calendar_fab.setOnClickListener {
launchNewEventIntent(currentFragments.last().getNewEventDayCode())
}
calendar_count.setOnClickListener{
val intent = Intent(this, CountActivity::class.java)
startActivity(intent)
}
storeStateVariables()
if (resources.getBoolean(R.bool.portrait_only)) {
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
......
package com.simplemobiletools.calendar.models
import android.accounts.Account
import com.simplemobiletools.calendar.extensions.seconds
import com.simplemobiletools.calendar.helpers.*
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.
......@@ -21,6 +21,23 @@
app:backgroundTint="@color/color_primary"
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
android:id="@+id/search_holder"
android:layout_width="match_parent"
......
......@@ -164,16 +164,6 @@
android:text="@string/event_reminders"
android:textAllCaps="true"
android:textSize="@dimen/smaller_text_size"/>
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/login_facebook"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/bigger_margin"
android:layout_marginStart="@dimen/bigger_margin"
android:layout_marginTop="@dimen/activity_margin"
android:text="@string/event_reminders"
android:textAllCaps="true"
android:textSize="@dimen/smaller_text_size"/>
<RelativeLayout
android:id="@+id/settings_gps_holder"
......
<?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>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="facebook_app_id">253715235190653</string>
<string name="fb_login_protocol_scheme">fb253715235190653</string>
<string name="app_name">심플 캘린더</string>
<string name="app_launcher_name">캘린더</string>
<string name="change_view">보기 변경</string>
......@@ -21,6 +19,7 @@
<string name="event">이벤트</string>
<string name="edit_event">이벤트 수정</string>
<string name="new_event">새 이벤트</string>
<string name="account">가계부</string>>
<string name="create_new_event">Create a new event</string>
<string name="duplicate_event">Duplicate event</string>
<string name="title_empty">제목을 입력해주세요</string>
......
......@@ -10,7 +10,7 @@ buildscript {
}
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"
......
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