Skip to content
Snippets Groups Projects
Commit c98f0216 authored by hyunholee's avatar hyunholee
Browse files

가계부

parent 8e03fcd2
No related branches found
No related tags found
No related merge requests found
Showing
with 31550 additions and 3 deletions
...@@ -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,14 @@ class EventActivity : SimpleActivity() { ...@@ -171,11 +175,14 @@ 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_account.setInputExtras(intent.getIntExtra("account",event_account.inputType))
event_account.setText(intent.getStringExtra("account"))
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 +193,33 @@ class EventActivity : SimpleActivity() { ...@@ -186,6 +193,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
......
...@@ -76,9 +76,18 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener { ...@@ -76,9 +76,18 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
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())
} }
// calendar_count.beVisibleIf(config.storedView != YEARLY_VIEW)
// calendar_count.setOnClickListener {
//
//
// launchNewEventIntent(currentFragments.last().getNewEventDayCode())
// //setContentView(R.layout.activity_account)
// }
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"?>
<ScrollView
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:id="@+id/event_scrollview"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:id="@+id/event_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.simplemobiletools.commons.views.MyEditText
android:id="@+id/event_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/activity_margin"
android:layout_marginRight="@dimen/activity_margin"
android:layout_marginTop="@dimen/activity_margin"
android:hint="@string/account"
android:inputType="textCapSentences"
android:maxLength="80"
android:maxLines="1"
android:minEms="20"
android:textCursorDrawable="@null"
android:textSize="@dimen/day_text_size"/>
<com.simplemobiletools.commons.views.MyEditText
android:id="@+id/event_location"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/event_title"
android:layout_marginLeft="@dimen/activity_margin"
android:layout_marginTop="@dimen/activity_margin"
android:layout_toLeftOf="@+id/event_show_on_map"
android:hint="money"
android:inputType="number"
android:maxLength="80"
android:maxLines="1"
android:minEms="20"
android:textCursorDrawable="@null"
android:textSize="@dimen/day_text_size"/>
<com.simplemobiletools.commons.views.MyEditText
android:id="@+id/event_description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/event_location"
android:layout_marginLeft="@dimen/activity_margin"
android:layout_marginRight="@dimen/activity_margin"
android:layout_marginTop="@dimen/activity_margin"
android:autoLink="all"
android:gravity="top"
android:hint="class"
android:inputType="textCapSentences|textMultiLine"
android:linksClickable="true"
android:minEms="20"
android:textCursorDrawable="@null"
android:textSize="@dimen/day_text_size"/>
<ImageView
android:id="@+id/event_description_divider"
android:layout_width="match_parent"
android:layout_height="1px"
android:layout_below="@+id/event_description"
android:layout_marginBottom="@dimen/normal_margin"
android:layout_marginTop="@dimen/activity_margin"
android:background="@color/divider_grey"
android:importantForAccessibility="no"/>
ImageView
android:id="@+id/event_date_time_divider"
android:layout_width="match_parent"
android:layout_height="1px"
android:layout_below="@+id/event_end_date"
android:layout_marginBottom="@dimen/medium_margin"
android:layout_marginTop="@dimen/medium_margin"
android:background="@color/divider_grey"
android:importantForAccessibility="no"/>
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/event_reminder_2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/event_reminder_1"
android:layout_alignStart="@+id/event_reminder_1"
android:layout_below="@+id/event_reminder_1"
android:alpha="0.4"
android:background="?attr/selectableItemBackground"
android:paddingBottom="@dimen/activity_margin"
android:paddingTop="@dimen/activity_margin"
android:text="@string/add_another_reminder"
android:textSize="@dimen/day_text_size"
android:visibility="gone"/>
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/event_reminder_3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/event_reminder_1"
android:layout_alignStart="@+id/event_reminder_1"
android:layout_below="@+id/event_reminder_2"
android:alpha="0.4"
android:background="?attr/selectableItemBackground"
android:paddingBottom="@dimen/activity_margin"
android:paddingTop="@dimen/activity_margin"
android:text="@string/add_another_reminder"
android:textSize="@dimen/day_text_size"
android:visibility="gone"/>
<RelativeLayout
android:id="@+id/event_repetition_rule_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/event_repetition"
android:layout_alignStart="@+id/event_repetition"
android:layout_below="@+id/event_repetition"
android:background="?attr/selectableItemBackground"
android:visibility="gone">
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/event_repetition_rule_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="false"
android:paddingBottom="@dimen/activity_margin"
android:paddingTop="@dimen/activity_margin"
android:text="@string/repeat_on"
android:textSize="@dimen/day_text_size"/>
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/event_repetition_rule"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_toEndOf="@+id/event_repetition_rule_label"
android:layout_toRightOf="@+id/event_repetition_rule_label"
android:clickable="false"
android:gravity="end"
android:padding="@dimen/activity_margin"
android:text="@string/every_day"
android:textSize="@dimen/day_text_size"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/event_repetition_limit_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/event_repetition"
android:layout_alignStart="@+id/event_repetition"
android:layout_below="@+id/event_repetition_rule_holder"
android:background="?attr/selectableItemBackground"
android:visibility="gone">
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/event_repetition_limit_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toLeftOf="@+id/event_repetition_limit"
android:layout_toStartOf="@+id/event_repetition_limit"
android:clickable="false"
android:paddingBottom="@dimen/activity_margin"
android:paddingTop="@dimen/activity_margin"
android:text="@string/repeat_till"
android:textSize="@dimen/day_text_size"/>
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/event_repetition_limit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:clickable="false"
android:padding="@dimen/activity_margin"
android:text="@string/forever"
android:textSize="@dimen/day_text_size"/>
</RelativeLayout>
<ImageView
android:id="@+id/event_caldav_calendar_image"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignBottom="@+id/event_caldav_calendar_holder"
android:layout_alignTop="@+id/event_caldav_calendar_holder"
android:layout_below="@+id/event_repetition_divider"
android:layout_marginLeft="@dimen/normal_margin"
android:layout_marginStart="@dimen/normal_margin"
android:alpha="0.8"
android:padding="@dimen/medium_margin"
android:src="@drawable/ic_calendar"
android:visibility="gone"/>
<RelativeLayout
android:id="@+id/event_caldav_calendar_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/event_repetition_divider"
android:layout_toEndOf="@+id/event_caldav_calendar_image"
android:layout_toRightOf="@+id/event_caldav_calendar_image"
android:background="?attr/selectableItemBackground"
android:visibility="gone">
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/event_caldav_calendar_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/small_margin"
android:layout_marginStart="@dimen/small_margin"
android:ellipsize="end"
android:maxLines="1"
android:paddingBottom="@dimen/tiny_margin"
android:paddingTop="@dimen/medium_margin"
android:textSize="@dimen/day_text_size"
tools:text="My calendar"/>
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/event_caldav_calendar_email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/event_caldav_calendar_name"
android:layout_marginLeft="@dimen/small_margin"
android:layout_marginStart="@dimen/small_margin"
android:ellipsize="end"
android:maxLines="1"
android:paddingBottom="@dimen/medium_margin"
android:textSize="@dimen/meta_text_size"
tools:text="hello@simplemobiletools.com"/>
</RelativeLayout>
<ImageView
android:id="@+id/event_caldav_calendar_divider"
android:layout_width="match_parent"
android:layout_height="1px"
android:layout_below="@+id/event_caldav_calendar_holder"
android:background="@color/divider_grey"
android:importantForAccessibility="no"
android:visibility="gone"/>
</RelativeLayout>
</ScrollView>
...@@ -75,11 +75,28 @@ ...@@ -75,11 +75,28 @@
android:textCursorDrawable="@null" android:textCursorDrawable="@null"
android:textSize="@dimen/day_text_size"/> android:textSize="@dimen/day_text_size"/>
<com.simplemobiletools.commons.views.MyEditText
android:id="@+id/event_account"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/event_description"
android:layout_marginLeft="@dimen/activity_margin"
android:layout_marginRight="@dimen/activity_margin"
android:layout_marginTop="@dimen/activity_margin"
android:autoLink="all"
android:gravity="top"
android:hint="@string/account"
android:inputType="number"
android:linksClickable="true"
android:minEms="20"
android:textCursorDrawable="@null"
android:textSize="@dimen/day_text_size"/>
<ImageView <ImageView
android:id="@+id/event_description_divider" android:id="@+id/event_description_divider"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="1px" android:layout_height="1px"
android:layout_below="@+id/event_description" android:layout_below="@+id/event_account"
android:layout_marginBottom="@dimen/normal_margin" android:layout_marginBottom="@dimen/normal_margin"
android:layout_marginTop="@dimen/activity_margin" android:layout_marginTop="@dimen/activity_margin"
android:background="@color/divider_grey" android:background="@color/divider_grey"
......
This diff is collapsed.
...@@ -21,6 +21,18 @@ ...@@ -21,6 +21,18 @@
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"-->
<!--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>
......
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