add a settings button for getting into managing event types

This commit is contained in:
tibbi 2017-02-09 22:51:47 +01:00
parent bbd5354e67
commit ee7455ac4b
18 changed files with 75 additions and 2 deletions

View File

@ -77,6 +77,11 @@
android:label="@string/settings"
android:parentActivityName=".activities.MainActivity"/>
<activity
android:name=".activities.ManageEventTypesActivity"
android:label="@string/event_types"
android:parentActivityName=".activities.SettingsActivity"/>
<receiver
android:name=".helpers.MyWidgetMonthlyProvider"
android:icon="@drawable/img_widget_monthly_preview"

View File

@ -0,0 +1,14 @@
package com.simplemobiletools.calendar.activities
import android.os.Bundle
import com.simplemobiletools.calendar.R
import com.simplemobiletools.commons.extensions.updateTextColors
import kotlinx.android.synthetic.main.activity_manage_event_types.*
class ManageEventTypesActivity : SimpleActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_manage_event_types)
updateTextColors(manage_event_types_scrollview)
}
}

View File

@ -40,6 +40,7 @@ class SettingsActivity : SimpleActivity() {
super.onResume()
setupCustomizeColors()
setupManageEventTypes()
setupSundayFirst()
setupGoogleSync()
setupWeeklyStart()
@ -57,6 +58,12 @@ class SettingsActivity : SimpleActivity() {
}
}
private fun setupManageEventTypes() {
settings_manage_event_types_holder.setOnClickListener {
startActivity(Intent(this, ManageEventTypesActivity::class.java))
}
}
private fun setupGoogleSync() {
settings_google_sync.isChecked = config.googleSync
settings_google_sync_holder.setOnClickListener {

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/manage_event_types_scrollview"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:id="@+id/manage_event_types_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
</LinearLayout>
</ScrollView>

View File

@ -30,14 +30,33 @@
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_manage_event_types_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/medium_margin"
android:background="?attr/selectableItemBackground"
android:padding="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/settings_manage_event_types_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:paddingLeft="@dimen/medium_margin"
android:paddingStart="@dimen/medium_margin"
android:text="@string/manage_event_types"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_google_sync_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/medium_margin"
android:background="?attr/selectableItemBackground"
android:visibility="gone"
android:padding="@dimen/activity_margin">
android:padding="@dimen/activity_margin"
android:visibility="gone">
<com.simplemobiletools.commons.views.MySwitchCompat
android:id="@+id/settings_google_sync"

View File

@ -81,6 +81,7 @@
<string name="week">Woche</string>
<!-- Event types -->
<string name="event_types">Event types</string>
<string name="add_new_type">Add a new type</string>
<string name="type_already_exists">Type with this title already exists</string>
<string name="color">Color</string>

View File

@ -81,6 +81,7 @@
<string name="week">Week</string>
<!-- Event types -->
<string name="event_types">Event types</string>
<string name="add_new_type">Add a new type</string>
<string name="type_already_exists">Type with this title already exists</string>
<string name="color">Color</string>

View File

@ -81,6 +81,7 @@
<string name="week">Week</string>
<!-- Event types -->
<string name="event_types">Event types</string>
<string name="add_new_type">Add a new type</string>
<string name="type_already_exists">Type with this title already exists</string>
<string name="color">Color</string>

View File

@ -81,6 +81,7 @@
<string name="week">Week</string>
<!-- Event types -->
<string name="event_types">Event types</string>
<string name="add_new_type">Add a new type</string>
<string name="type_already_exists">Type with this title already exists</string>
<string name="color">Color</string>

View File

@ -81,6 +81,7 @@
<string name="week">Week</string>
<!-- Event types -->
<string name="event_types">Event types</string>
<string name="add_new_type">Add a new type</string>
<string name="type_already_exists">Type with this title already exists</string>
<string name="color">Color</string>

View File

@ -81,6 +81,7 @@
<string name="week">Week</string>
<!-- Event types -->
<string name="event_types">Event types</string>
<string name="add_new_type">Add a new type</string>
<string name="type_already_exists">Type with this title already exists</string>
<string name="color">Color</string>

View File

@ -81,6 +81,7 @@
<string name="week">שבוע</string>
<!-- Event types -->
<string name="event_types">Event types</string>
<string name="add_new_type">Add a new type</string>
<string name="type_already_exists">Type with this title already exists</string>
<string name="color">Color</string>

View File

@ -81,6 +81,7 @@
<string name="week">Week</string>
<!-- Event types -->
<string name="event_types">Event types</string>
<string name="add_new_type">Add a new type</string>
<string name="type_already_exists">Type with this title already exists</string>
<string name="color">Color</string>

View File

@ -81,6 +81,7 @@
<string name="week">Semana</string>
<!-- Event types -->
<string name="event_types">Event types</string>
<string name="add_new_type">Add a new type</string>
<string name="type_already_exists">Type with this title already exists</string>
<string name="color">Color</string>

View File

@ -81,6 +81,7 @@
<string name="week">Неделя</string>
<!-- Event types -->
<string name="event_types">Event types</string>
<string name="add_new_type">Add a new type</string>
<string name="type_already_exists">Type with this title already exists</string>
<string name="color">Color</string>

View File

@ -81,6 +81,7 @@
<string name="week">Týždeň</string>
<!-- Event types -->
<string name="event_types">Typy udalostí</string>
<string name="add_new_type">Pridať nový typ</string>
<string name="type_already_exists">Typ s daným názvom už existuje</string>
<string name="color">Farba</string>

View File

@ -81,6 +81,7 @@
<string name="week">Vecka</string>
<!-- Event types -->
<string name="event_types">Event types</string>
<string name="add_new_type">Add a new type</string>
<string name="type_already_exists">Type with this title already exists</string>
<string name="color">Color</string>

View File

@ -81,6 +81,7 @@
<string name="week">Week</string>
<!-- Event types -->
<string name="event_types">Event types</string>
<string name="add_new_type">Add a new type</string>
<string name="type_already_exists">Type with this title already exists</string>
<string name="color">Color</string>