From 423da49517fd207a2db349669e4e6faaf6100002 Mon Sep 17 00:00:00 2001 From: Janne Koschinski <janne@kuschku.de> Date: Sun, 1 Apr 2018 17:19:09 +0200 Subject: [PATCH] Improve settings and license screen UI --- app/src/main/AndroidManifest.xml | 14 +- .../quasseldroid/dagger/ActivityModule.kt | 5 - .../about/AboutSettingsFragment.kt | 25 +- .../ui/clientsettings/about/Library.kt | 2 +- .../ui/clientsettings/about/LibraryAdapter.kt | 5 +- .../license/LicenseSettingsActivity.kt | 2 +- .../license/LicenseSettingsFragment.kt | 5 - .../ui/coresettings/CoreSettingsFragment.kt | 135 ++++++----- .../ui/coresettings/SettingsItem.kt | 6 + .../ui/coresettings/SettingsItemAdapter.kt | 53 ++++ .../identity/IdentitiesActivity.kt | 5 - .../identity/IdentitiesFragment.kt | 103 -------- .../identity/IdentitiesFragmentProvider.kt | 10 - .../coresettings/identity/IdentityFragment.kt | 3 + .../main/res/drawable/ic_list_bulleted.xml | 9 + app/src/main/res/layout/fragment_about.xml | 3 +- .../main/res/layout/fragment_chat_list.xml | 1 + app/src/main/res/layout/fragment_crash.xml | 3 +- app/src/main/res/layout/fragment_license.xml | 22 +- app/src/main/res/layout/fragment_messages.xml | 1 + .../main/res/layout/fragment_nick_list.xml | 1 + .../main/res/layout/preference_vertical.xml | 6 +- app/src/main/res/layout/settings_identity.xml | 3 +- app/src/main/res/layout/settings_item.xml | 15 +- app/src/main/res/layout/settings_list.xml | 228 +++++++++++++++++- .../res/layout/settings_networkconfig.xml | 3 +- .../main/res/layout/setup_account_edit.xml | 6 +- app/src/main/res/layout/widget_formatting.xml | 4 +- app/src/main/res/values-de/strings.xml | 3 + .../res/values-de/strings_contributors.xml | 8 + .../main/res/values-de/strings_settings.xml | 43 ++-- app/src/main/res/values/strings.xml | 3 + .../main/res/values/strings_contributors.xml | 8 + app/src/main/res/values/strings_licenses.xml | 43 +++- app/src/main/res/values/strings_settings.xml | 40 +-- app/src/main/res/values/styles_widgets.xml | 6 +- 36 files changed, 538 insertions(+), 294 deletions(-) create mode 100644 app/src/main/java/de/kuschku/quasseldroid/ui/coresettings/SettingsItem.kt create mode 100644 app/src/main/java/de/kuschku/quasseldroid/ui/coresettings/SettingsItemAdapter.kt delete mode 100644 app/src/main/java/de/kuschku/quasseldroid/ui/coresettings/identity/IdentitiesActivity.kt delete mode 100644 app/src/main/java/de/kuschku/quasseldroid/ui/coresettings/identity/IdentitiesFragment.kt delete mode 100644 app/src/main/java/de/kuschku/quasseldroid/ui/coresettings/identity/IdentitiesFragmentProvider.kt create mode 100644 app/src/main/res/drawable/ic_list_bulleted.xml create mode 100644 app/src/main/res/values-de/strings_contributors.xml create mode 100644 app/src/main/res/values/strings_contributors.xml diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 88dc8ff21..369e64e73 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -76,23 +76,17 @@ android:parentActivityName=".ui.chat.ChatActivity" android:windowSoftInputMode="adjustResize" /> <activity - android:name=".ui.coresettings.networkconfig.NetworkConfigActivity" + android:name=".ui.coresettings.identity.IdentityActivity" android:exported="false" - android:label="@string/settings_networkconfig_title" + android:label="@string/settings_identity_title" android:parentActivityName=".ui.coresettings.CoreSettingsActivity" android:windowSoftInputMode="adjustResize" /> <activity - android:name=".ui.coresettings.identity.IdentitiesActivity" + android:name=".ui.coresettings.networkconfig.NetworkConfigActivity" android:exported="false" - android:label="@string/settings_identities_title" + android:label="@string/settings_networkconfig_title" android:parentActivityName=".ui.coresettings.CoreSettingsActivity" android:windowSoftInputMode="adjustResize" /> - <activity - android:name=".ui.coresettings.identity.IdentityActivity" - android:exported="false" - android:label="@string/settings_identity_title" - android:parentActivityName=".ui.coresettings.identity.IdentitiesActivity" - android:windowSoftInputMode="adjustResize" /> <!-- Client Setup Flow --> <activity diff --git a/app/src/main/java/de/kuschku/quasseldroid/dagger/ActivityModule.kt b/app/src/main/java/de/kuschku/quasseldroid/dagger/ActivityModule.kt index 94cef23ec..16d9f31a2 100644 --- a/app/src/main/java/de/kuschku/quasseldroid/dagger/ActivityModule.kt +++ b/app/src/main/java/de/kuschku/quasseldroid/dagger/ActivityModule.kt @@ -18,8 +18,6 @@ import de.kuschku.quasseldroid.ui.clientsettings.license.LicenseSettingsActivity import de.kuschku.quasseldroid.ui.clientsettings.license.LicenseSettingsFragmentProvider import de.kuschku.quasseldroid.ui.coresettings.CoreSettingsActivity import de.kuschku.quasseldroid.ui.coresettings.CoreSettingsFragmentProvider -import de.kuschku.quasseldroid.ui.coresettings.identity.IdentitiesActivity -import de.kuschku.quasseldroid.ui.coresettings.identity.IdentitiesFragmentProvider import de.kuschku.quasseldroid.ui.coresettings.identity.IdentityActivity import de.kuschku.quasseldroid.ui.coresettings.identity.IdentityFragmentProvider import de.kuschku.quasseldroid.ui.coresettings.networkconfig.NetworkConfigActivity @@ -53,9 +51,6 @@ abstract class ActivityModule { @ContributesAndroidInjector(modules = [CoreSettingsFragmentProvider::class]) abstract fun bindCoreSettingsActivity(): CoreSettingsActivity - @ContributesAndroidInjector(modules = [IdentitiesFragmentProvider::class]) - abstract fun bindIdentitiesActivity(): IdentitiesActivity - @ContributesAndroidInjector(modules = [IdentityFragmentProvider::class]) abstract fun bindIdentityActivity(): IdentityActivity diff --git a/app/src/main/java/de/kuschku/quasseldroid/ui/clientsettings/about/AboutSettingsFragment.kt b/app/src/main/java/de/kuschku/quasseldroid/ui/clientsettings/about/AboutSettingsFragment.kt index 3d86df20c..8c95b9b25 100644 --- a/app/src/main/java/de/kuschku/quasseldroid/ui/clientsettings/about/AboutSettingsFragment.kt +++ b/app/src/main/java/de/kuschku/quasseldroid/ui/clientsettings/about/AboutSettingsFragment.kt @@ -139,6 +139,21 @@ class AboutSettingsFragment : DaggerFragment() { license = apache2, url = "https://github.com/square/leakcanary" ), + Library( + name = "Material Design Icons: Community", + license = License( + shortName = "SIL Open Font License v1.1", + fullName = "SIL OPEN FONT LICENSE", + text = R.string.license_materialdesignicons + ), + url = "https://github.com/Templarian/MaterialDesign" + ), + Library( + name = "Material Design Icons: Google", + version = "3.0.1", + license = apache2, + url = "https://github.com/google/material-design-icons" + ), Library( name = "Material Dialogs", version = "0.9.6.0", @@ -179,27 +194,27 @@ class AboutSettingsFragment : DaggerFragment() { Contributor( name = "Frederik M. J. Vestre", nickName = "freqmod", - description = "Initial qdatastream deserialization attempts" + description = getString(R.string.contributor_description_freqmod) ), Contributor( name = "Martin “Java Sucks” Sandsmark", nickName = "sandsmark", - description = "Legacy protocol implementation, (de)serializers, project (de)moralizer" + description = getString(R.string.contributor_description_sandsmark) ), Contributor( name = "Magnus Fjell", nickName = "magnuf", - description = "Legacy UI" + description = getString(R.string.contributor_description_magnuf) ), Contributor( name = "Ken Børge Viktil", nickName = "Kenji", - description = "Legacy UI" + description = getString(R.string.contributor_description_kenji) ), Contributor( name = "Janne Koschinski", nickName = "justJanne", - description = "Rewrite, UI, Annotation Processors, Backend" + description = getString(R.string.contributor_description_justjanne) ) )) contributors.addItemDecoration(DividerItemDecoration(context, LinearLayoutManager.VERTICAL)) diff --git a/app/src/main/java/de/kuschku/quasseldroid/ui/clientsettings/about/Library.kt b/app/src/main/java/de/kuschku/quasseldroid/ui/clientsettings/about/Library.kt index 87230d548..21debd0ec 100644 --- a/app/src/main/java/de/kuschku/quasseldroid/ui/clientsettings/about/Library.kt +++ b/app/src/main/java/de/kuschku/quasseldroid/ui/clientsettings/about/Library.kt @@ -2,7 +2,7 @@ package de.kuschku.quasseldroid.ui.clientsettings.about data class Library( val name: String, - val version: String, + val version: String? = null, val license: License, val url: String? = null ) \ No newline at end of file diff --git a/app/src/main/java/de/kuschku/quasseldroid/ui/clientsettings/about/LibraryAdapter.kt b/app/src/main/java/de/kuschku/quasseldroid/ui/clientsettings/about/LibraryAdapter.kt index f63a6f3ae..6cc525cf0 100644 --- a/app/src/main/java/de/kuschku/quasseldroid/ui/clientsettings/about/LibraryAdapter.kt +++ b/app/src/main/java/de/kuschku/quasseldroid/ui/clientsettings/about/LibraryAdapter.kt @@ -10,6 +10,7 @@ import butterknife.BindView import butterknife.ButterKnife import de.kuschku.quasseldroid.R import de.kuschku.quasseldroid.ui.clientsettings.license.LicenseSettingsActivity +import de.kuschku.quasseldroid.util.helper.visibleIf class LibraryAdapter(private val libraries: List<Library>) : RecyclerView.Adapter<LibraryAdapter.LibraryViewHolder>() { @@ -39,8 +40,7 @@ class LibraryAdapter(private val libraries: List<Library>) : ButterKnife.bind(this, itemView) itemView.setOnClickListener { this.item?.run { - val intent = Intent(itemView.context, - LicenseSettingsActivity::class.java) + val intent = Intent(itemView.context, LicenseSettingsActivity::class.java) intent.putExtra("license_name", license.fullName) intent.putExtra("license_text", license.text) itemView.context.startActivity(intent) @@ -52,6 +52,7 @@ class LibraryAdapter(private val libraries: List<Library>) : this.item = item this.name.text = item.name this.version.text = item.version + this.version.visibleIf(!item.version.isNullOrBlank()) this.license.text = item.license.shortName } } diff --git a/app/src/main/java/de/kuschku/quasseldroid/ui/clientsettings/license/LicenseSettingsActivity.kt b/app/src/main/java/de/kuschku/quasseldroid/ui/clientsettings/license/LicenseSettingsActivity.kt index 24177ec86..79630f680 100644 --- a/app/src/main/java/de/kuschku/quasseldroid/ui/clientsettings/license/LicenseSettingsActivity.kt +++ b/app/src/main/java/de/kuschku/quasseldroid/ui/clientsettings/license/LicenseSettingsActivity.kt @@ -2,4 +2,4 @@ package de.kuschku.quasseldroid.ui.clientsettings.license import de.kuschku.quasseldroid.util.ui.SettingsActivity -class LicenseSettingsActivity : SettingsActivity() \ No newline at end of file +class LicenseSettingsActivity : SettingsActivity(LicenseSettingsFragment()) \ No newline at end of file diff --git a/app/src/main/java/de/kuschku/quasseldroid/ui/clientsettings/license/LicenseSettingsFragment.kt b/app/src/main/java/de/kuschku/quasseldroid/ui/clientsettings/license/LicenseSettingsFragment.kt index b597440f8..0e9cfb75e 100644 --- a/app/src/main/java/de/kuschku/quasseldroid/ui/clientsettings/license/LicenseSettingsFragment.kt +++ b/app/src/main/java/de/kuschku/quasseldroid/ui/clientsettings/license/LicenseSettingsFragment.kt @@ -12,9 +12,6 @@ import dagger.android.support.DaggerFragment import de.kuschku.quasseldroid.R class LicenseSettingsFragment : DaggerFragment() { - @BindView(R.id.name) - lateinit var name: TextView - @BindView(R.id.text) lateinit var text: TextView @@ -23,8 +20,6 @@ class LicenseSettingsFragment : DaggerFragment() { val view = inflater.inflate(R.layout.fragment_license, container, false) ButterKnife.bind(this, view) - name.text = arguments?.getString("license_name") - val textResource = arguments?.getInt("license_text", 0) ?: 0 if (textResource != 0) { text.text = Html.fromHtml(getString(textResource)) diff --git a/app/src/main/java/de/kuschku/quasseldroid/ui/coresettings/CoreSettingsFragment.kt b/app/src/main/java/de/kuschku/quasseldroid/ui/coresettings/CoreSettingsFragment.kt index d522f0dc2..5fa61ef00 100644 --- a/app/src/main/java/de/kuschku/quasseldroid/ui/coresettings/CoreSettingsFragment.kt +++ b/app/src/main/java/de/kuschku/quasseldroid/ui/coresettings/CoreSettingsFragment.kt @@ -1,91 +1,118 @@ package de.kuschku.quasseldroid.ui.coresettings +import android.arch.lifecycle.Observer import android.content.Intent import android.os.Bundle +import android.support.v4.view.ViewCompat import android.support.v7.widget.DividerItemDecoration import android.support.v7.widget.LinearLayoutManager import android.support.v7.widget.RecyclerView import android.view.LayoutInflater import android.view.View import android.view.ViewGroup -import android.widget.TextView import butterknife.BindView import butterknife.ButterKnife +import de.kuschku.libquassel.quassel.syncables.BufferViewConfig +import de.kuschku.libquassel.quassel.syncables.Identity +import de.kuschku.libquassel.quassel.syncables.Network import de.kuschku.quasseldroid.R -import de.kuschku.quasseldroid.ui.coresettings.identity.IdentitiesActivity +import de.kuschku.quasseldroid.ui.coresettings.identity.IdentityActivity import de.kuschku.quasseldroid.ui.coresettings.networkconfig.NetworkConfigActivity -import de.kuschku.quasseldroid.util.helper.visibleIf +import de.kuschku.quasseldroid.util.helper.combineLatest +import de.kuschku.quasseldroid.util.helper.toLiveData import de.kuschku.quasseldroid.util.service.ServiceBoundFragment class CoreSettingsFragment : ServiceBoundFragment() { - @BindView(R.id.list) - lateinit var list: RecyclerView + @BindView(R.id.networks) + lateinit var networks: RecyclerView + + @BindView(R.id.identities) + lateinit var identities: RecyclerView + + @BindView(R.id.chatlists) + lateinit var chatlists: RecyclerView + + @BindView(R.id.networkconfig) + lateinit var networkConfig: View override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { val view = inflater.inflate(R.layout.settings_list, container, false) ButterKnife.bind(this, view) - val adapter = CoreSettingsAdapter(listOf( - CoreSetting( - getString(R.string.settings_identities_title), - getString(R.string.settings_identities_description), - Intent(requireContext(), IdentitiesActivity::class.java) - ), - CoreSetting( - getString(R.string.settings_networkconfig_title), - getString(R.string.settings_networkconfig_description), - Intent(requireContext(), NetworkConfigActivity::class.java) - ) - )) - list.adapter = adapter - list.layoutManager = LinearLayoutManager(context) - list.addItemDecoration(DividerItemDecoration(requireContext(), DividerItemDecoration.VERTICAL)) - - return view - } - - data class CoreSetting( - val title: CharSequence, - val summary: CharSequence? = null, - val intent: Intent? = null - ) - - class CoreSettingsAdapter(private val data: List<CoreSetting>) : - RecyclerView.Adapter<CoreSettingsAdapter.CoreSettingsViewHolder>() { - override fun getItemCount() = data.size + val networkAdapter = SettingsItemAdapter { + /* + val intent = Intent(requireContext(), NetworkActivity::class.java) + intent.putExtra("network", it) + startActivity(intent) + */ + } - override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = CoreSettingsViewHolder( - LayoutInflater.from(parent.context).inflate(R.layout.settings_item, parent, false) - ) + val identityAdapter = SettingsItemAdapter { + val intent = Intent(requireContext(), IdentityActivity::class.java) + intent.putExtra("identity", it) + startActivity(intent) + } - override fun onBindViewHolder(holder: CoreSettingsViewHolder, position: Int) { - holder.bind(data[position]) + val chatListAdapter = SettingsItemAdapter { + /* + val intent = Intent(requireContext(), BufferViewConfigActivity::class.java) + intent.putExtra("bufferviewconfig", it) + startActivity(intent) + */ } - class CoreSettingsViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { - @BindView(R.id.title) - lateinit var title: TextView + val itemDecoration = DividerItemDecoration(requireContext(), DividerItemDecoration.VERTICAL) - @BindView(R.id.summary) - lateinit var summary: TextView + networks.adapter = networkAdapter + networks.layoutManager = LinearLayoutManager(context) + networks.addItemDecoration(itemDecoration) + ViewCompat.setNestedScrollingEnabled(networks, false) + + viewModel.networks.switchMap { + combineLatest(it.values.map(Network::liveNetworkInfo)).map { + it.map { + SettingsItem(it.networkId, it.networkName) + }.sortedBy(SettingsItem::name) + } + }.toLiveData().observe(this, Observer { + networkAdapter.submitList(it.orEmpty()) + }) - var item: CoreSetting? = null + identities.adapter = identityAdapter + identities.layoutManager = LinearLayoutManager(context) + identities.addItemDecoration(itemDecoration) + ViewCompat.setNestedScrollingEnabled(identities, false) - init { - ButterKnife.bind(this, itemView) - itemView.setOnClickListener { - item?.intent?.let(itemView.context::startActivity) - } + viewModel.identities.switchMap { + combineLatest(it.values.map(Identity::liveUpdates)).map { + it.map { + SettingsItem(it.id(), it.identityName()) + }.sortedBy(SettingsItem::name) } + }.toLiveData().observe(this, Observer { + identityAdapter.submitList(it.orEmpty()) + }) - fun bind(item: CoreSetting) { - this.item = item + chatlists.adapter = chatListAdapter + chatlists.layoutManager = LinearLayoutManager(context) + chatlists.addItemDecoration(itemDecoration) + ViewCompat.setNestedScrollingEnabled(chatlists, false) - this.title.text = item.title - this.summary.text = item.summary - this.summary.visibleIf(!item.summary.isNullOrBlank()) + viewModel.bufferViewConfigs.switchMap { + combineLatest(it.map(BufferViewConfig::live_config)).map { + it.map { + SettingsItem(it.bufferViewId(), it.bufferViewName()) + }.sortedBy(SettingsItem::name) } + }.toLiveData().observe(this, Observer { + chatListAdapter.submitList(it.orEmpty()) + }) + + networkConfig.setOnClickListener { + startActivity(Intent(requireContext(), NetworkConfigActivity::class.java)) } + + return view } } \ No newline at end of file diff --git a/app/src/main/java/de/kuschku/quasseldroid/ui/coresettings/SettingsItem.kt b/app/src/main/java/de/kuschku/quasseldroid/ui/coresettings/SettingsItem.kt new file mode 100644 index 000000000..939c36527 --- /dev/null +++ b/app/src/main/java/de/kuschku/quasseldroid/ui/coresettings/SettingsItem.kt @@ -0,0 +1,6 @@ +package de.kuschku.quasseldroid.ui.coresettings + +data class SettingsItem( + val id: Int, + val name: String +) \ No newline at end of file diff --git a/app/src/main/java/de/kuschku/quasseldroid/ui/coresettings/SettingsItemAdapter.kt b/app/src/main/java/de/kuschku/quasseldroid/ui/coresettings/SettingsItemAdapter.kt new file mode 100644 index 000000000..ac1812720 --- /dev/null +++ b/app/src/main/java/de/kuschku/quasseldroid/ui/coresettings/SettingsItemAdapter.kt @@ -0,0 +1,53 @@ +package de.kuschku.quasseldroid.ui.coresettings + +import android.support.v7.recyclerview.extensions.ListAdapter +import android.support.v7.util.DiffUtil +import android.support.v7.widget.RecyclerView +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.widget.TextView +import butterknife.BindView +import butterknife.ButterKnife +import de.kuschku.libquassel.protocol.IdentityId +import de.kuschku.quasseldroid.R + +class SettingsItemAdapter(private val clickListener: (Int) -> Unit) : + ListAdapter<SettingsItem, SettingsItemAdapter.SettingsItemViewHolder>( + object : DiffUtil.ItemCallback<SettingsItem>() { + override fun areItemsTheSame(oldItem: SettingsItem, newItem: SettingsItem) = + oldItem.id == newItem.id + + override fun areContentsTheSame(oldItem: SettingsItem, newItem: SettingsItem) = + oldItem == newItem + } + ) { + override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = SettingsItemViewHolder( + LayoutInflater.from(parent.context).inflate(R.layout.settings_item, parent, false), + clickListener + ) + + override fun onBindViewHolder(holder: SettingsItemViewHolder, position: Int) { + holder.bind(getItem(position)) + } + + class SettingsItemViewHolder(itemView: View, clickListener: (Int) -> Unit) : + RecyclerView.ViewHolder(itemView) { + @BindView(R.id.title) + lateinit var title: TextView + + var id: IdentityId? = null + + init { + ButterKnife.bind(this, itemView) + itemView.setOnClickListener { + id?.let(clickListener::invoke) + } + } + + fun bind(item: SettingsItem) { + this.id = item.id + this.title.text = item.name + } + } +} \ No newline at end of file diff --git a/app/src/main/java/de/kuschku/quasseldroid/ui/coresettings/identity/IdentitiesActivity.kt b/app/src/main/java/de/kuschku/quasseldroid/ui/coresettings/identity/IdentitiesActivity.kt deleted file mode 100644 index ca0cc09af..000000000 --- a/app/src/main/java/de/kuschku/quasseldroid/ui/coresettings/identity/IdentitiesActivity.kt +++ /dev/null @@ -1,5 +0,0 @@ -package de.kuschku.quasseldroid.ui.coresettings.identity - -import de.kuschku.quasseldroid.util.ui.SettingsActivity - -class IdentitiesActivity : SettingsActivity(IdentitiesFragment()) \ No newline at end of file diff --git a/app/src/main/java/de/kuschku/quasseldroid/ui/coresettings/identity/IdentitiesFragment.kt b/app/src/main/java/de/kuschku/quasseldroid/ui/coresettings/identity/IdentitiesFragment.kt deleted file mode 100644 index a8ad3a124..000000000 --- a/app/src/main/java/de/kuschku/quasseldroid/ui/coresettings/identity/IdentitiesFragment.kt +++ /dev/null @@ -1,103 +0,0 @@ -package de.kuschku.quasseldroid.ui.coresettings.identity - -import android.arch.lifecycle.Observer -import android.content.Intent -import android.os.Bundle -import android.support.v7.recyclerview.extensions.ListAdapter -import android.support.v7.util.DiffUtil -import android.support.v7.widget.DividerItemDecoration -import android.support.v7.widget.LinearLayoutManager -import android.support.v7.widget.RecyclerView -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import android.widget.TextView -import butterknife.BindView -import butterknife.ButterKnife -import de.kuschku.libquassel.protocol.IdentityId -import de.kuschku.libquassel.quassel.syncables.Identity -import de.kuschku.quasseldroid.R -import de.kuschku.quasseldroid.util.helper.combineLatest -import de.kuschku.quasseldroid.util.helper.toLiveData -import de.kuschku.quasseldroid.util.service.ServiceBoundFragment - -class IdentitiesFragment : ServiceBoundFragment() { - @BindView(R.id.list) - lateinit var list: RecyclerView - - override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, - savedInstanceState: Bundle?): View? { - val view = inflater.inflate(R.layout.settings_list, container, false) - ButterKnife.bind(this, view) - - val adapter = IdentityAdapter { - val intent = Intent(requireContext(), IdentityActivity::class.java) - intent.putExtra("identity", it) - startActivity(intent) - } - - list.adapter = adapter - list.layoutManager = LinearLayoutManager(context) - list.addItemDecoration(DividerItemDecoration(requireContext(), DividerItemDecoration.VERTICAL)) - - viewModel.identities.switchMap { - combineLatest(it.values.map(Identity::liveUpdates)).map { - it.map { - IdentityItem( - it.id(), - it.identityName() - ) - } - } - }.toLiveData().observe(this, Observer { - adapter.submitList(it.orEmpty()) - }) - - return view - } - - data class IdentityItem( - val id: IdentityId, - val name: String - ) - - class IdentityAdapter(private val clickListener: (IdentityId) -> Unit) : - ListAdapter<IdentityItem, IdentityAdapter.IdentityViewHolder>( - object : DiffUtil.ItemCallback<IdentityItem>() { - override fun areItemsTheSame(oldItem: IdentityItem, newItem: IdentityItem) = - oldItem.id == newItem.id - - override fun areContentsTheSame(oldItem: IdentityItem, newItem: IdentityItem) = - oldItem == newItem - } - ) { - override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = IdentityViewHolder( - LayoutInflater.from(parent.context).inflate(R.layout.settings_item, parent, false), - clickListener - ) - - override fun onBindViewHolder(holder: IdentityViewHolder, position: Int) { - holder.bind(getItem(position)) - } - - class IdentityViewHolder(itemView: View, clickListener: (IdentityId) -> Unit) : - RecyclerView.ViewHolder(itemView) { - @BindView(R.id.title) - lateinit var title: TextView - - var id: IdentityId? = null - - init { - ButterKnife.bind(this, itemView) - itemView.setOnClickListener { - id?.let(clickListener::invoke) - } - } - - fun bind(item: IdentityItem) { - this.id = item.id - this.title.text = item.name - } - } - } -} \ No newline at end of file diff --git a/app/src/main/java/de/kuschku/quasseldroid/ui/coresettings/identity/IdentitiesFragmentProvider.kt b/app/src/main/java/de/kuschku/quasseldroid/ui/coresettings/identity/IdentitiesFragmentProvider.kt deleted file mode 100644 index 54fd243ae..000000000 --- a/app/src/main/java/de/kuschku/quasseldroid/ui/coresettings/identity/IdentitiesFragmentProvider.kt +++ /dev/null @@ -1,10 +0,0 @@ -package de.kuschku.quasseldroid.ui.coresettings.identity - -import dagger.Module -import dagger.android.ContributesAndroidInjector - -@Module -abstract class IdentitiesFragmentProvider { - @ContributesAndroidInjector - abstract fun bindIdentitiesFragment(): IdentitiesFragment -} diff --git a/app/src/main/java/de/kuschku/quasseldroid/ui/coresettings/identity/IdentityFragment.kt b/app/src/main/java/de/kuschku/quasseldroid/ui/coresettings/identity/IdentityFragment.kt index 52479c3df..d83068daf 100644 --- a/app/src/main/java/de/kuschku/quasseldroid/ui/coresettings/identity/IdentityFragment.kt +++ b/app/src/main/java/de/kuschku/quasseldroid/ui/coresettings/identity/IdentityFragment.kt @@ -2,6 +2,7 @@ package de.kuschku.quasseldroid.ui.coresettings.identity import android.arch.lifecycle.Observer import android.os.Bundle +import android.support.v4.view.ViewCompat import android.support.v7.widget.LinearLayoutManager import android.support.v7.widget.RecyclerView import android.support.v7.widget.RecyclerView.ViewHolder @@ -98,6 +99,8 @@ class IdentityFragment : SettingsFragment() { adapter = IdentityNicksAdapter(::nickClick, ::startDrag) nicks.layoutManager = LinearLayoutManager(requireContext()) nicks.adapter = adapter + ViewCompat.setNestedScrollingEnabled(nicks, false) + val callback = DragSortItemTouchHelperCallback(adapter) helper = ItemTouchHelper(callback) helper.attachToRecyclerView(nicks) diff --git a/app/src/main/res/drawable/ic_list_bulleted.xml b/app/src/main/res/drawable/ic_list_bulleted.xml new file mode 100644 index 000000000..701472b21 --- /dev/null +++ b/app/src/main/res/drawable/ic_list_bulleted.xml @@ -0,0 +1,9 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportHeight="24" + android:viewportWidth="24"> + <path + android:fillColor="#000" + android:pathData="M7,5H21V7H7V5M7,13V11H21V13H7M4,4.5A1.5,1.5 0 0,1 5.5,6A1.5,1.5 0 0,1 4,7.5A1.5,1.5 0 0,1 2.5,6A1.5,1.5 0 0,1 4,4.5M4,10.5A1.5,1.5 0 0,1 5.5,12A1.5,1.5 0 0,1 4,13.5A1.5,1.5 0 0,1 2.5,12A1.5,1.5 0 0,1 4,10.5M7,19V17H21V19H7M4,16.5A1.5,1.5 0 0,1 5.5,18A1.5,1.5 0 0,1 4,19.5A1.5,1.5 0 0,1 2.5,18A1.5,1.5 0 0,1 4,16.5Z" /> +</vector> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_about.xml b/app/src/main/res/layout/fragment_about.xml index 1f91e76b0..53c4d37b7 100644 --- a/app/src/main/res/layout/fragment_about.xml +++ b/app/src/main/res/layout/fragment_about.xml @@ -2,7 +2,8 @@ <android.support.v4.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" - android:layout_height="match_parent"> + android:layout_height="match_parent" + android:scrollbars="vertical"> <LinearLayout android:layout_width="match_parent" diff --git a/app/src/main/res/layout/fragment_chat_list.xml b/app/src/main/res/layout/fragment_chat_list.xml index b3de99779..eaf8628d8 100644 --- a/app/src/main/res/layout/fragment_chat_list.xml +++ b/app/src/main/res/layout/fragment_chat_list.xml @@ -32,5 +32,6 @@ android:id="@+id/chatList" android:layout_width="match_parent" android:layout_height="match_parent" + android:scrollbars="vertical" tools:listitem="@layout/widget_buffer" /> </LinearLayout> diff --git a/app/src/main/res/layout/fragment_crash.xml b/app/src/main/res/layout/fragment_crash.xml index d84e8ff1d..7783a1bba 100644 --- a/app/src/main/res/layout/fragment_crash.xml +++ b/app/src/main/res/layout/fragment_crash.xml @@ -2,4 +2,5 @@ <android.support.v7.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/list" android:layout_width="match_parent" - android:layout_height="match_parent" /> \ No newline at end of file + android:layout_height="match_parent" + android:scrollbars="vertical" /> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_license.xml b/app/src/main/res/layout/fragment_license.xml index 26a12b053..e6ec8ca96 100644 --- a/app/src/main/res/layout/fragment_license.xml +++ b/app/src/main/res/layout/fragment_license.xml @@ -5,24 +5,10 @@ android:layout_height="match_parent" android:scrollbars="vertical"> - <LinearLayout + <TextView + android:id="@+id/text" android:layout_width="match_parent" android:layout_height="wrap_content" - android:orientation="vertical" - android:padding="16dp"> - - <TextView - android:id="@+id/name" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="8dp" - android:textAppearance="@style/TextAppearance.AppCompat.Title" - tools:text="Apache-2.0" /> - - <TextView - android:id="@+id/text" - android:layout_width="match_parent" - android:layout_height="wrap_content" - tools:text="@string/license_apache_2" /> - </LinearLayout> + android:padding="16dp" + tools:text="@string/license_apache_2" /> </android.support.v4.widget.NestedScrollView> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_messages.xml b/app/src/main/res/layout/fragment_messages.xml index abb48fc54..2605c1812 100644 --- a/app/src/main/res/layout/fragment_messages.xml +++ b/app/src/main/res/layout/fragment_messages.xml @@ -16,6 +16,7 @@ android:id="@+id/messages" android:layout_width="match_parent" android:layout_height="match_parent" + android:scrollbars="vertical" app:stackFromEnd="true" tools:listitem="@layout/widget_chatmessage_plain" /> diff --git a/app/src/main/res/layout/fragment_nick_list.xml b/app/src/main/res/layout/fragment_nick_list.xml index 58f05b5eb..a1ef84e92 100644 --- a/app/src/main/res/layout/fragment_nick_list.xml +++ b/app/src/main/res/layout/fragment_nick_list.xml @@ -6,5 +6,6 @@ android:background="?attr/colorBackground" android:clipToPadding="false" android:fitsSystemWindows="true" + android:scrollbars="vertical" tools:listitem="@layout/widget_nick" tools:showIn="@layout/activity_main" /> diff --git a/app/src/main/res/layout/preference_vertical.xml b/app/src/main/res/layout/preference_vertical.xml index 3799ea31b..0b1d34f85 100644 --- a/app/src/main/res/layout/preference_vertical.xml +++ b/app/src/main/res/layout/preference_vertical.xml @@ -19,6 +19,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="?android:attr/selectableItemBackground" + android:baselineAligned="false" android:clipToPadding="false" android:focusable="true" android:gravity="center_vertical" @@ -26,7 +27,6 @@ android:paddingEnd="?android:attr/listPreferredItemPaddingRight" android:paddingLeft="?android:attr/listPreferredItemPaddingLeft" android:paddingRight="?android:attr/listPreferredItemPaddingRight" - android:baselineAligned="false" android:paddingStart="?android:attr/listPreferredItemPaddingLeft"> <FrameLayout @@ -39,10 +39,10 @@ android:minWidth="60dp" android:orientation="horizontal" android:paddingBottom="4dp" - android:paddingLeft="0dp" - android:paddingStart="0dp" android:paddingEnd="12dp" + android:paddingLeft="0dp" android:paddingRight="12dp" + android:paddingStart="0dp" android:paddingTop="4dp"> <android.support.v7.internal.widget.PreferenceImageView diff --git a/app/src/main/res/layout/settings_identity.xml b/app/src/main/res/layout/settings_identity.xml index 846ecfdbe..6d490acd6 100644 --- a/app/src/main/res/layout/settings_identity.xml +++ b/app/src/main/res/layout/settings_identity.xml @@ -3,7 +3,8 @@ 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:layout_height="match_parent" + android:scrollbars="vertical"> <LinearLayout style="@style/Widget.CoreSettings.Wrapper"> diff --git a/app/src/main/res/layout/settings_item.xml b/app/src/main/res/layout/settings_item.xml index 3a1a9a6d8..8d9ac8173 100644 --- a/app/src/main/res/layout/settings_item.xml +++ b/app/src/main/res/layout/settings_item.xml @@ -3,14 +3,15 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="?android:attr/selectableItemBackground" + android:background="?selectableItemBackground" android:focusable="true" android:gravity="center_vertical" - android:minHeight="?android:attr/listPreferredItemHeightSmall" - android:paddingEnd="?android:attr/listPreferredItemPaddingRight" - android:paddingLeft="?android:attr/listPreferredItemPaddingLeft" - android:paddingRight="?android:attr/listPreferredItemPaddingRight" - android:paddingStart="?android:attr/listPreferredItemPaddingLeft"> + android:minHeight="?listPreferredItemHeightSmall" + android:paddingEnd="?listPreferredItemPaddingRight" + android:paddingLeft="8dp" + android:paddingRight="?listPreferredItemPaddingRight" + android:paddingStart="8dp" + tools:showIn="@layout/settings_list"> <LinearLayout android:layout_width="match_parent" @@ -33,7 +34,7 @@ android:id="@+id/summary" android:layout_width="match_parent" android:layout_height="wrap_content" - android:textAppearance="?android:attr/textAppearanceSmall" + android:textAppearance="?android:textAppearanceSmall" android:textColor="?colorTextPrimary" android:visibility="gone" /> </LinearLayout> diff --git a/app/src/main/res/layout/settings_list.xml b/app/src/main/res/layout/settings_list.xml index 627c357e7..31b83f712 100644 --- a/app/src/main/res/layout/settings_list.xml +++ b/app/src/main/res/layout/settings_list.xml @@ -1,7 +1,229 @@ <?xml version="1.0" encoding="utf-8"?> -<android.support.v7.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android" +<android.support.v4.widget.NestedScrollView 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/list" android:layout_width="match_parent" android:layout_height="match_parent" - tools:listitem="@layout/settings_item" /> \ No newline at end of file + android:scrollbars="vertical"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:gravity="center_vertical" + android:minHeight="?listPreferredItemHeightSmall" + android:paddingEnd="?listPreferredItemPaddingRight" + android:paddingLeft="?listPreferredItemPaddingLeft" + android:paddingRight="?listPreferredItemPaddingRight" + android:paddingStart="?listPreferredItemPaddingLeft"> + + <android.support.v7.widget.AppCompatImageView + style="@style/Widget.CoreSettings.PrimaryItemIcon" + app:srcCompat="@drawable/ic_server_network" /> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical" + android:paddingBottom="16dp" + android:paddingTop="16dp"> + + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:ellipsize="marquee" + android:singleLine="true" + android:text="@string/settings_networks_title" + android:textColor="?colorTextPrimary" + android:textSize="16sp" /> + </LinearLayout> + </LinearLayout> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginLeft="72dp" + android:layout_marginStart="72dp" + android:orientation="vertical"> + + <android.support.v7.widget.RecyclerView + android:id="@+id/networks" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:visibility="visible" + tools:itemCount="2" + tools:listitem="@layout/settings_item" /> + + <LinearLayout + style="@style/Widget.CoreSettings.EditTextLayout" + android:orientation="horizontal"> + + <Button + android:id="@+id/new_network" + style="@style/Widget.Button.Borderless.Colored" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/label_new_network" /> + </LinearLayout> + </LinearLayout> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:gravity="center_vertical" + android:minHeight="?listPreferredItemHeightSmall" + android:paddingEnd="?listPreferredItemPaddingRight" + android:paddingLeft="?listPreferredItemPaddingLeft" + android:paddingRight="?listPreferredItemPaddingRight" + android:paddingStart="?listPreferredItemPaddingLeft"> + + <android.support.v7.widget.AppCompatImageView + style="@style/Widget.CoreSettings.PrimaryItemIcon" + app:srcCompat="@drawable/ic_account_card" /> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical" + android:paddingBottom="16dp" + android:paddingTop="16dp"> + + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:ellipsize="marquee" + android:singleLine="true" + android:text="@string/settings_identities_title" + android:textColor="?colorTextPrimary" + android:textSize="16sp" /> + </LinearLayout> + </LinearLayout> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginLeft="72dp" + android:layout_marginStart="72dp" + android:orientation="vertical"> + + <android.support.v7.widget.RecyclerView + android:id="@+id/identities" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:visibility="visible" + tools:itemCount="1" + tools:listitem="@layout/settings_item" /> + + <LinearLayout + style="@style/Widget.CoreSettings.EditTextLayout" + android:orientation="horizontal"> + + <Button + android:id="@+id/new_identity" + style="@style/Widget.Button.Borderless.Colored" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/label_new_identity" /> + </LinearLayout> + </LinearLayout> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:gravity="center_vertical" + android:minHeight="?listPreferredItemHeightSmall" + android:paddingEnd="?listPreferredItemPaddingRight" + android:paddingLeft="?listPreferredItemPaddingLeft" + android:paddingRight="?listPreferredItemPaddingRight" + android:paddingStart="?listPreferredItemPaddingLeft"> + + <android.support.v7.widget.AppCompatImageView + style="@style/Widget.CoreSettings.PrimaryItemIcon" + app:srcCompat="@drawable/ic_list_bulleted" /> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical" + android:paddingBottom="16dp" + android:paddingTop="16dp"> + + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:ellipsize="marquee" + android:singleLine="true" + android:text="@string/settings_chatlists_title" + android:textColor="?colorTextPrimary" + android:textSize="16sp" /> + </LinearLayout> + </LinearLayout> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginLeft="72dp" + android:layout_marginStart="72dp" + android:orientation="vertical"> + + <android.support.v7.widget.RecyclerView + android:id="@+id/chatlists" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:visibility="visible" + tools:itemCount="2" + tools:listitem="@layout/settings_item" /> + + <LinearLayout + style="@style/Widget.CoreSettings.EditTextLayout" + android:orientation="horizontal"> + + <Button + android:id="@+id/new_chatlist" + style="@style/Widget.Button.Borderless.Colored" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/label_new_chatlist" /> + </LinearLayout> + </LinearLayout> + + <LinearLayout + android:id="@+id/networkconfig" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="?selectableItemBackground" + android:focusable="true" + android:gravity="center_vertical" + android:minHeight="?listPreferredItemHeightSmall" + android:paddingEnd="?listPreferredItemPaddingRight" + android:paddingLeft="?listPreferredItemPaddingLeft" + android:paddingRight="?listPreferredItemPaddingRight" + android:paddingStart="?listPreferredItemPaddingLeft"> + + <android.support.v7.widget.AppCompatImageView + style="@style/Widget.CoreSettings.PrimaryItemIcon" + app:srcCompat="@drawable/ic_message_bulleted" /> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical" + android:paddingBottom="16dp" + android:paddingTop="16dp"> + + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:ellipsize="marquee" + android:singleLine="true" + android:text="@string/settings_networkconfig_title" + android:textColor="?colorTextPrimary" + android:textSize="16sp" /> + </LinearLayout> + </LinearLayout> + </LinearLayout> +</android.support.v4.widget.NestedScrollView> \ No newline at end of file diff --git a/app/src/main/res/layout/settings_networkconfig.xml b/app/src/main/res/layout/settings_networkconfig.xml index f654040fa..c730dfde5 100644 --- a/app/src/main/res/layout/settings_networkconfig.xml +++ b/app/src/main/res/layout/settings_networkconfig.xml @@ -3,7 +3,8 @@ 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:layout_height="match_parent" + android:scrollbars="vertical"> <LinearLayout style="@style/Widget.CoreSettings.Wrapper"> diff --git a/app/src/main/res/layout/setup_account_edit.xml b/app/src/main/res/layout/setup_account_edit.xml index 8c9c4e395..d2c305e91 100644 --- a/app/src/main/res/layout/setup_account_edit.xml +++ b/app/src/main/res/layout/setup_account_edit.xml @@ -27,8 +27,8 @@ android:layout_width="24dp" android:layout_height="24dp" android:layout_gravity="center_vertical" - app:tint="?android:textColorSecondary" app:srcCompat="@drawable/ic_pencil" + app:tint="?android:textColorSecondary" tools:ignore="ContentDescription" /> </FrameLayout> @@ -65,8 +65,8 @@ android:layout_width="24dp" android:layout_height="24dp" android:layout_gravity="center_vertical" - app:tint="?android:textColorSecondary" app:srcCompat="@drawable/ic_server_network" + app:tint="?android:textColorSecondary" tools:ignore="ContentDescription" /> </FrameLayout> @@ -125,8 +125,8 @@ android:layout_width="24dp" android:layout_height="24dp" android:layout_gravity="center_vertical" - app:tint="?android:textColorSecondary" app:srcCompat="@drawable/ic_account" + app:tint="?android:textColorSecondary" tools:ignore="ContentDescription" /> </FrameLayout> diff --git a/app/src/main/res/layout/widget_formatting.xml b/app/src/main/res/layout/widget_formatting.xml index ba916fcea..eebeda3c6 100644 --- a/app/src/main/res/layout/widget_formatting.xml +++ b/app/src/main/res/layout/widget_formatting.xml @@ -68,9 +68,9 @@ <android.support.v7.widget.AppCompatImageButton android:id="@+id/action_format_foreground" style="@style/Widget.Button.Format" - android:contentDescription="@string/label_foreground" android:layout_width="match_parent" android:layout_height="match_parent" + android:contentDescription="@string/label_foreground" android:paddingBottom="4dp" app:srcCompat="@drawable/ic_format_foreground" app:tint="?colorControlNormal" /> @@ -97,9 +97,9 @@ <android.support.v7.widget.AppCompatImageButton android:id="@+id/action_format_background" style="@style/Widget.Button.Format" - android:contentDescription="@string/label_background" android:layout_width="match_parent" android:layout_height="match_parent" + android:contentDescription="@string/label_background" android:paddingBottom="4dp" app:srcCompat="@drawable/ic_format_background" app:tint="?colorControlNormal" /> diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 745472750..e8c655bd0 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -33,6 +33,9 @@ <string name="label_libraries">Bibliotheken</string> <string name="label_license">Lizenz</string> <string name="label_new_account">Account hinzufügen</string> + <string name="label_new_chatlist">Chatliste hinzufügen</string> + <string name="label_new_identity">Identität hinzufügen</string> + <string name="label_new_network">Netzwerk hinzufügen</string> <string name="label_new_nick">Spitzname hinzufügen</string> <string name="label_no">Nein</string> <string name="label_reset">Zurücksetzen</string> diff --git a/app/src/main/res/values-de/strings_contributors.xml b/app/src/main/res/values-de/strings_contributors.xml new file mode 100644 index 000000000..e66b4f4be --- /dev/null +++ b/app/src/main/res/values-de/strings_contributors.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <string name="contributor_description_freqmod">Ursprüngliche qdatastream Deserialisierungsversuche</string> + <string name="contributor_description_sandsmark">Historische Protokollimplementierung, (De-)Serialisierer, Projekt (De-)Moralisierer</string> + <string name="contributor_description_magnuf">Historisches UI</string> + <string name="contributor_description_kenji">Historisches UI</string> + <string name="contributor_description_justjanne">Rwerite, UI, Annotation Processors, Backend</string> +</resources> \ No newline at end of file diff --git a/app/src/main/res/values-de/strings_settings.xml b/app/src/main/res/values-de/strings_settings.xml index 9323ec34a..c527829c0 100644 --- a/app/src/main/res/values-de/strings_settings.xml +++ b/app/src/main/res/values-de/strings_settings.xml @@ -1,30 +1,9 @@ <?xml version="1.0" encoding="utf-8"?> <resources> - <string name="settings_networkconfig_title">Network Config</string> - <string name="settings_networkconfig_description" /> - - <string name="settings_networkconfig_ping_timeout">Erkennung von Ping-Zeitüberschreitungen</string> - - <string name="settings_networkconfig_ping_interval">Ping-Intervall</string> - <string name="settings_networkconfig_ping_interval_unit">Sekunden</string> - - <string name="settings_networkconfig_max_ping_count">Verbindungstrennung nach</string> - <string name="settings_networkconfig_max_ping_count_unit">verpassten Pings</string> - - <string name="settings_networkconfig_auto_who">Automatische Suche nach Nutzerinformationen</string> - <string name="settings_networkconfig_auto_who_interval">Aktualisierungs-Intervall</string> - <string name="settings_networkconfig_auto_who_interval_unit">Sekunden</string> - <string name="settings_networkconfig_auto_who_nick_limit">Ignoriere Chats mit mehr als</string> - <string name="settings_networkconfig_auto_who_nick_limit_unit">Nutzern</string> - <string name="settings_networkconfig_auto_who_delay">Mindestabstand zwischen zwei Abfragen</string> - <string name="settings_networkconfig_auto_who_delay_unit">Sekunden</string> - - <string name="settings_networkconfig_standard_ctcp">Standardkonformes CTCP-Verhalten aktivieren</string> - + <string name="settings_networks_title">Netzwerke</string> + <string name="settings_network_title">Netzwerk</string> <string name="settings_identities_title">Identitäten</string> - <string name="settings_identities_description" /> - <string name="settings_identity_title">Identität</string> <string name="settings_identity_names">Namen</string> <string name="settings_identity_identity_name">Identitätsname</string> @@ -39,4 +18,22 @@ <string name="settings_identity_away_reason">Abwesenheitsgrund</string> <string name="settings_identity_detach_away">Abwesend wenn nicht verbunden</string> <string name="settings_identity_detach_away_reason">Abwesenheitsgrund</string> + + <string name="settings_chatlists_title">Chatlisten</string> + <string name="settings_chatlist_title">Chatliste</string> + + <string name="settings_networkconfig_title">IRC Konfiguration</string> + <string name="settings_networkconfig_ping_timeout">Erkennung von Ping-Zeitüberschreitungen</string> + <string name="settings_networkconfig_ping_interval">Ping-Intervall</string> + <string name="settings_networkconfig_ping_interval_unit">Sekunden</string> + <string name="settings_networkconfig_max_ping_count">Verbindungstrennung nach</string> + <string name="settings_networkconfig_max_ping_count_unit">verpassten Pings</string> + <string name="settings_networkconfig_auto_who">Automatische Suche nach Nutzerinformationen</string> + <string name="settings_networkconfig_auto_who_interval">Aktualisierungs-Intervall</string> + <string name="settings_networkconfig_auto_who_interval_unit">Sekunden</string> + <string name="settings_networkconfig_auto_who_nick_limit">Ignoriere Chats mit mehr als</string> + <string name="settings_networkconfig_auto_who_nick_limit_unit">Nutzern</string> + <string name="settings_networkconfig_auto_who_delay">Mindestabstand zwischen zwei Abfragen</string> + <string name="settings_networkconfig_auto_who_delay_unit">Sekunden</string> + <string name="settings_networkconfig_standard_ctcp">Standardkonformes CTCP-Verhalten aktivieren</string> </resources> \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 0485740d4..5ced578d3 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -33,6 +33,9 @@ <string name="label_libraries">Libraries</string> <string name="label_license">License</string> <string name="label_new_account">New Account</string> + <string name="label_new_chatlist">New Chatlist</string> + <string name="label_new_identity">New Identity</string> + <string name="label_new_network">New Network</string> <string name="label_new_nick">New Nick</string> <string name="label_no">No</string> <string name="label_reset">Reset</string> diff --git a/app/src/main/res/values/strings_contributors.xml b/app/src/main/res/values/strings_contributors.xml new file mode 100644 index 000000000..a0800dbee --- /dev/null +++ b/app/src/main/res/values/strings_contributors.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <string name="contributor_description_freqmod">Initial qdatastream deserialization attempts</string> + <string name="contributor_description_sandsmark">Legacy protocol implementation, (de)serializers, project (de)moralizer</string> + <string name="contributor_description_magnuf">Legacy UI</string> + <string name="contributor_description_kenji">Legacy UI</string> + <string name="contributor_description_justjanne">Rewrite, UI, Annotation Processors, Backend</string> +</resources> \ No newline at end of file diff --git a/app/src/main/res/values/strings_licenses.xml b/app/src/main/res/values/strings_licenses.xml index 7aa355b38..8fde63d09 100644 --- a/app/src/main/res/values/strings_licenses.xml +++ b/app/src/main/res/values/strings_licenses.xml @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <resources xmlns:tools="http://schemas.android.com/tools"> <string name="license_apache_2" translatable="false"><![CDATA[ + <h2>Apache License</h2> <p>Version 2.0, January 2004<br /><br /><a href="http://www.apache.org/licenses/">http://www.apache.org/licenses/</a></p> <p>TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION</p> <p><strong>1. Definitions</strong>.</p> @@ -27,22 +28,48 @@ <p><strong>8. Limitation of Liability</strong>. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.</p> <p><strong>9. Accepting Warranty or Additional Liability</strong>. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.</p> ]]></string> - <string name="license_materialdialogs" tools:ignore="TypographyOther" translatable="false"><![CDATA[ + <string name="license_materialdesignicons" translatable="false" tools:ignore="TypographyOther"><![CDATA[ + <p>Copyright (c) 2014, Austin Andrews (<a href="http://materialdesignicons.com/">http://materialdesignicons.com/<a/>), with Reserved Font Name Material Design Icons.</p> + <p>Copyright (c) 2014, Google (<a href="http://www.google.com/design/">http://www.google.com/design/</a>) uses the license at <a href="https://github.com/google/material-design-icons/blob/master/LICENSE">https://github.com/google/material-design-icons/blob/master/LICENSE</a></p> + <p>This Font Software is licensed under the SIL Open Font License, Version 1.1.</p> + <p>This license is copied below, and is also available with a FAQ at: <a href="http://scripts.sil.org/OFL">http://scripts.sil.org/OFL</a></p> + <h2>SIL OPEN FONT LICENSE </h2> + <p>Version 1.1 - 26 February 2007</p> + <h3>PREAMBLE</h3> + <p>The goals of the Open Font License (OFL) are to stimulate worldwide development of collaborative font projects, to support the font creation efforts of academic and linguistic communities, and to provide a free and open framework in which fonts may be shared and improved in partnership with others.</p> + <p>The OFL allows the licensed fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. The fonts, including any derivative works, can be bundled, embedded, redistributed and/or sold with any software provided that any reserved names are not used by derivative works. The fonts and derivatives, however, cannot be released under any other type of license. The requirement for fonts to remain under this license does not apply to any document created using the fonts or their derivatives.</p><a name="ebb1469e"></a> + <h3>DEFINITIONS</h3> + <p>"Font Software" refers to the set of files released by the Copyright Holder(s) under this license and clearly marked as such. This may include source files, build scripts and documentation.</p> + <p>"Reserved Font Name" refers to any names specified as such after the copyright statement(s).</p> + <p>"Original Version" refers to the collection of Font Software components as distributed by the Copyright Holder(s).</p> + <p>"Modified Version" refers to any derivative made by adding to, deleting, or substituting — in part or in whole — any of the components of the Original Version, by changing formats or by porting the Font Software to a new environment.</p> + <p>"Author" refers to any designer, engineer, programmer, technical writer or other person who contributed to the Font Software.</p> + <h3>PERMISSION & CONDITIONS</h3> + <p>Permission is hereby granted, free of charge, to any person obtaining a copy of the Font Software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and unmodified copies of the Font Software, subject to the following conditions:</p> + <p>1) Neither the Font Software nor any of its individual components, in Original or Modified Versions, may be sold by itself.</p> + <p>2) Original or Modified Versions of the Font Software may be bundled, redistributed and/or sold with any software, provided that each copy contains the above copyright notice and this license. These can be included either as stand-alone text files, human-readable headers or in the appropriate machine-readable metadata fields within text or binary files as long as those fields can be easily viewed by the user.</p> + <p>3) No Modified Version of the Font Software may use the Reserved Font Name(s) unless explicit written permission is granted by the corresponding Copyright Holder. This restriction only applies to the primary font name as presented to the users.</p> + <p>4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software shall not be used to promote, endorse or advertise any Modified Version, except to acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) or with their explicit written permission. </p> + <p>5) The Font Software, modified or unmodified, in part or in whole, must be distributed entirely under this license, and must not be distributed under any other license. The requirement for fonts to remain under this license does not apply to any document created using the Font Software.</p> + <h3>TERMINATION</h3> + <p>This license becomes null and void if any of the above conditions are not met.</p> + <h3>DISCLAIMER</h3> + <p>THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.</p> + ]]></string> + <string name="license_materialdialogs" translatable="false" tools:ignore="TypographyOther"><![CDATA[ + <h2>The MIT License (MIT)</h2> <p>Copyright (c) 2014-2016 Aidan Michael Follestad</p> <p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</p> <p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p> <p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p> ]]></string> - <string name="license_threetenbp" tools:ignore="TypographyOther" translatable="false"><![CDATA[ + <string name="license_threetenbp" translatable="false" tools:ignore="TypographyOther"><![CDATA[ <p>Copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos</p> <p>All rights reserved.</p> <p>Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:</p> - <ol> - <li>Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.</li> - <li>Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.</li> - <li>Neither the name of JSR-310 nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission..</li> - </ol> + <p>1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.</p> + <p>2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.</p> + <p>3. Neither the name of JSR-310 nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.</p> <p>THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</p> ]]></string> - </resources> diff --git a/app/src/main/res/values/strings_settings.xml b/app/src/main/res/values/strings_settings.xml index ce48dfef4..7aaab55a8 100644 --- a/app/src/main/res/values/strings_settings.xml +++ b/app/src/main/res/values/strings_settings.xml @@ -1,27 +1,9 @@ <?xml version="1.0" encoding="utf-8"?> <resources> - <string name="settings_networkconfig_title">IRC Config</string> - <string name="settings_networkconfig_description" /> - - <string name="settings_networkconfig_ping_timeout">Ping Timeout Detection</string> - <string name="settings_networkconfig_ping_interval">Ping Interval</string> - <string name="settings_networkconfig_ping_interval_unit">seconds</string> - <string name="settings_networkconfig_max_ping_count">Disconnect after</string> - <string name="settings_networkconfig_max_ping_count_unit">missed pings</string> - <string name="settings_networkconfig_auto_who">Automatic User Info Lookup</string> - <string name="settings_networkconfig_auto_who_interval">Update interval</string> - <string name="settings_networkconfig_auto_who_interval_unit">seconds</string> - <string name="settings_networkconfig_auto_who_nick_limit">Ignore channels with more than</string> - <string name="settings_networkconfig_auto_who_nick_limit_unit">users</string> - <string name="settings_networkconfig_auto_who_delay">Minimum delay between requests</string> - <string name="settings_networkconfig_auto_who_delay_unit">seconds</string> - - <string name="settings_networkconfig_standard_ctcp">Standard-Compliant CTCP behavior</string> - + <string name="settings_networks_title">Networks</string> + <string name="settings_network_title">Network</string> <string name="settings_identities_title">Identities</string> - <string name="settings_identities_description" /> - <string name="settings_identity_title">Identity</string> <string name="settings_identity_names">Names</string> <string name="settings_identity_identity_name">Identity name</string> @@ -36,4 +18,22 @@ <string name="settings_identity_away_reason">Away Reason</string> <string name="settings_identity_detach_away">Away on Detach</string> <string name="settings_identity_detach_away_reason">Away on Detach Reason</string> + + <string name="settings_chatlists_title">Chatlists</string> + <string name="settings_chatlist_title">Chatlist</string> + + <string name="settings_networkconfig_title">IRC Config</string> + <string name="settings_networkconfig_ping_timeout">Ping Timeout Detection</string> + <string name="settings_networkconfig_ping_interval">Ping Interval</string> + <string name="settings_networkconfig_ping_interval_unit">seconds</string> + <string name="settings_networkconfig_max_ping_count">Disconnect after</string> + <string name="settings_networkconfig_max_ping_count_unit">missed pings</string> + <string name="settings_networkconfig_auto_who">Automatic User Info Lookup</string> + <string name="settings_networkconfig_auto_who_interval">Update interval</string> + <string name="settings_networkconfig_auto_who_interval_unit">seconds</string> + <string name="settings_networkconfig_auto_who_nick_limit">Ignore channels with more than</string> + <string name="settings_networkconfig_auto_who_nick_limit_unit">users</string> + <string name="settings_networkconfig_auto_who_delay">Minimum delay between requests</string> + <string name="settings_networkconfig_auto_who_delay_unit">seconds</string> + <string name="settings_networkconfig_standard_ctcp">Standard-Compliant CTCP behavior</string> </resources> \ No newline at end of file diff --git a/app/src/main/res/values/styles_widgets.xml b/app/src/main/res/values/styles_widgets.xml index 425af41b2..1b290b663 100644 --- a/app/src/main/res/values/styles_widgets.xml +++ b/app/src/main/res/values/styles_widgets.xml @@ -88,8 +88,10 @@ <style name="Widget.CoreSettings.PrimaryItemSwitch" parent=""> <item name="android:layout_width">match_parent</item> - <item name="android:layout_height">match_parent</item> - <item name="android:layout_gravity">center_vertical</item> + <item name="android:layout_height">wrap_content</item> + <item name="android:layout_gravity">fill_vertical</item> + <item name="android:paddingTop">10dp</item> + <item name="android:paddingBottom">10dp</item> <item name="android:gravity">center_vertical</item> <item name="android:textAppearance">?android:textAppearanceMedium</item> <item name="android:textColor">?colorTextPrimary</item> -- GitLab