Some Android Settings

This commit is contained in:
Florian Märkl 2019-10-16 16:44:23 +02:00
commit 65193fb575
No known key found for this signature in database
GPG key ID: 125BC8A5A6A1E857
5 changed files with 45 additions and 14 deletions

View file

@ -20,6 +20,7 @@ package com.metallic.chiaki.settings
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.metallic.chiaki.R
import kotlinx.android.synthetic.main.activity_settings.*
class SettingsActivity: AppCompatActivity()
{
@ -27,5 +28,7 @@ class SettingsActivity: AppCompatActivity()
{
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_settings)
title = ""
setSupportActionBar(toolbar)
}
}

View file

@ -122,7 +122,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center"
android:fontFamily="sans-serif-condensed"
android:text="@string/main_title"
android:text="@string/title_main"
android:textColor="?attr/colorOnPrimary"
android:textSize="20dp" />

View file

@ -1,14 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
android:theme="@style/AppTheme.Toolbar">
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:fontFamily="sans-serif-condensed"
android:text="@string/title_settings"
android:textColor="?attr/colorOnPrimary"
android:textSize="20dp" />
</com.google.android.material.appbar.MaterialToolbar>
<fragment
android:id="@+id/settingsFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="com.metallic.chiaki.settings.SettingsFragment" />
android:layout_height="0dp"
android:name="com.metallic.chiaki.settings.SettingsFragment"
app:layout_constraintTop_toBottomOf="@id/toolbar"
app:layout_constraintBottom_toBottomOf="parent"/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -1,6 +1,7 @@
<resources>
<string name="app_name">Chiaki</string>
<string name="main_title">Chiaki 千秋</string>
<string name="title_main">Chiaki 千秋</string>
<string name="title_settings">Settings</string>
<string name="alert_message_session_quit">Session has quit: %s</string>
<string name="alert_message_session_create_error">Failed to create Session: %s</string>
<string name="alert_message_login_pin_request">Login PIN:</string>
@ -38,4 +39,8 @@
<string name="alert_regist_duplicate">The console with MAC %s has already been registered. Should the previous record be overwritten?</string>
<string name="action_regist_overwrite">Overwrite</string>
<string name="action_regist_discard">Cancel</string>
<string name="preferences_category_title_general">General</string>
<string name="preferences_category_title_stream">Stream</string>
<string name="preferences_registered_hosts_title">Registered Consoles</string>
<string name="preferences_registered_hosts_summary">Currently registered: %d</string>
</resources>

View file

@ -1,11 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:app="http://schemas.android.com/apk/res-auto">
<SwitchPreferenceCompat
app:key="notifications"
app:title="Enable message notifications"/>
<PreferenceCategory
app:key="category_general"
app:title="@string/preferences_category_title_general">
<Preference
app:key="registered_hosts"
app:summary="@string/preferences_registered_hosts_summary"
app:title="@string/preferences_registered_hosts_title"/>
</PreferenceCategory>
<Preference
app:key="feedback"
app:title="Send feedback"
app:summary="Report technical issues or suggest new features"/>
<PreferenceCategory
app:key="category_stream"
app:title="@string/preferences_category_title_stream">
</PreferenceCategory>
</PreferenceScreen>