Skip to content
Snippets Groups Projects
Verified Commit 747ed83b authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

UI changes

- Avatars are square by default
- Implement Speeddial Layout for debug
- Prepare for Channel/Query Join/Create UI
- Fix and improve Spinner UI
parent 71338de8
Branches
Tags
No related merge requests found
Showing
with 406 additions and 13 deletions
......@@ -154,6 +154,7 @@ dependencies {
// UI
implementation("com.leinardi.android", "speed-dial", "2.0.1")
implementation("me.zhanghai.android.materialprogressbar", "library", "1.6.1")
implementation(project(":ui_spinner"))
withVersion("0.9.6.0") {
implementation("com.afollestad.material-dialogs", "core", version)
implementation("com.afollestad.material-dialogs", "commons", version)
......
......@@ -19,4 +19,5 @@
<resources>
<string name="package_name" translatable="false">com.iskrembilen.quasseldroid.debug</string>
<string name="speedial_behavior" translatable="false">com.leinardi.android.speeddial.SpeedDialView$ScrollingViewSnackbarBehavior</string>
</resources>
......@@ -78,7 +78,6 @@
</activity>
<!-- Info -->
<activity
android:name="de.kuschku.quasseldroid.ui.info.user.UserInfoActivity"
android:exported="false"
......@@ -113,6 +112,23 @@
android:label="@string/label_info_certificate"
android:windowSoftInputMode="adjustResize" />
<!-- Add -->
<activity
android:name="de.kuschku.quasseldroid.ui.chat.add.create.ChannelCreateActivity"
android:exported="false"
android:label="@string/label_create_channel"
android:windowSoftInputMode="adjustResize" />
<activity
android:name="de.kuschku.quasseldroid.ui.chat.add.join.ChannelJoinActivity"
android:exported="false"
android:label="@string/label_join_long"
android:windowSoftInputMode="adjustResize" />
<activity
android:name="de.kuschku.quasseldroid.ui.chat.add.query.QueryCreateActivity"
android:exported="false"
android:label="@string/label_query_medium"
android:windowSoftInputMode="adjustResize" />
<!-- Core Settings -->
<activity
android:name=".ui.coresettings.CoreSettingsActivity"
......@@ -264,6 +280,7 @@
android:label="@string/setup_core_title"
android:parentActivityName=".ui.chat.ChatActivity"
android:windowSoftInputMode="adjustResize" />
<!-- Core User Setup Flow -->
<activity
android:name=".ui.setup.user.UserSetupActivity"
......@@ -271,6 +288,7 @@
android:label="@string/setup_user_title"
android:parentActivityName=".ui.chat.ChatActivity"
android:windowSoftInputMode="adjustResize" />
<!-- Network Setup Flow -->
<activity
android:name=".ui.setup.network.NetworkSetupActivity"
......
......@@ -26,6 +26,12 @@ import de.kuschku.quasseldroid.service.QuasselServiceModule
import de.kuschku.quasseldroid.ui.chat.ChatActivity
import de.kuschku.quasseldroid.ui.chat.ChatActivityModule
import de.kuschku.quasseldroid.ui.chat.ChatFragmentProvider
import de.kuschku.quasseldroid.ui.chat.add.create.ChannelCreateActivity
import de.kuschku.quasseldroid.ui.chat.add.create.ChannelCreateFragmentProvider
import de.kuschku.quasseldroid.ui.chat.add.join.ChannelJoinActivity
import de.kuschku.quasseldroid.ui.chat.add.join.ChannelJoinFragmentProvider
import de.kuschku.quasseldroid.ui.chat.add.query.QueryCreateActivity
import de.kuschku.quasseldroid.ui.chat.add.query.QueryCreateFragmentProvider
import de.kuschku.quasseldroid.ui.chat.topic.TopicFragmentProvider
import de.kuschku.quasseldroid.ui.clientsettings.about.AboutActivity
import de.kuschku.quasseldroid.ui.clientsettings.about.AboutFragmentProvider
......@@ -99,6 +105,8 @@ abstract class ActivityModule {
@ContributesAndroidInjector(modules = [ChatActivityModule::class, ChatFragmentProvider::class, SettingsModule::class, DatabaseModule::class, ActivityBaseModule::class])
abstract fun bindChatActivity(): ChatActivity
// Info
@ActivityScope
@ContributesAndroidInjector(modules = [UserInfoFragmentProvider::class, SettingsModule::class, DatabaseModule::class, ActivityBaseModule::class])
abstract fun bindUserInfoActivity(): UserInfoActivity
......@@ -123,6 +131,20 @@ abstract class ActivityModule {
@ContributesAndroidInjector(modules = [CertificateInfoFragmentProvider::class, SettingsModule::class, DatabaseModule::class, ActivityBaseModule::class])
abstract fun bindCertificateInfoActivity(): CertificateInfoActivity
// Add
@ActivityScope
@ContributesAndroidInjector(modules = [ChannelCreateFragmentProvider::class, SettingsModule::class, DatabaseModule::class, ActivityBaseModule::class])
abstract fun bindChannelCreateActivity(): ChannelCreateActivity
@ActivityScope
@ContributesAndroidInjector(modules = [ChannelJoinFragmentProvider::class, SettingsModule::class, DatabaseModule::class, ActivityBaseModule::class])
abstract fun bindChannelJoinActivity(): ChannelJoinActivity
@ActivityScope
@ContributesAndroidInjector(modules = [QueryCreateFragmentProvider::class, SettingsModule::class, DatabaseModule::class, ActivityBaseModule::class])
abstract fun bindQueryCreateActivity(): QueryCreateActivity
// Client Settings
@ActivityScope
......
......@@ -32,7 +32,7 @@ data class MessageSettings(
val timeAtEnd: Boolean = false,
val showRealNames: Boolean = false,
val showAvatars: Boolean = true,
val squareAvatars: Boolean = false,
val squareAvatars: Boolean = true,
val showIRCCloudAvatars: Boolean = false,
val showGravatarAvatars: Boolean = false,
val showMatrixAvatars: Boolean = false,
......
/*
* Quasseldroid - Quassel client for Android
*
* Copyright (c) 2019 Janne Koschinski
* Copyright (c) 2019 The Quassel Project
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3 as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.kuschku.quasseldroid.ui.chat.add.create
import android.content.Context
import android.content.Intent
import de.kuschku.quasseldroid.util.ui.settings.ServiceBoundSettingsActivity
class ChannelCreateActivity : ServiceBoundSettingsActivity(ChannelCreateFragment()) {
companion object {
fun launch(context: Context) = context.startActivity(intent(context))
fun intent(context: Context) = Intent(context, ChannelCreateActivity::class.java)
}
}
/*
* Quasseldroid - Quassel client for Android
*
* Copyright (c) 2019 Janne Koschinski
* Copyright (c) 2019 The Quassel Project
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3 as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.kuschku.quasseldroid.ui.chat.add.create
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import butterknife.ButterKnife
import de.kuschku.quasseldroid.R
import de.kuschku.quasseldroid.util.service.ServiceBoundFragment
class ChannelCreateFragment : ServiceBoundFragment() {
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?): View? {
val view = inflater.inflate(R.layout.add_create, container, false)
ButterKnife.bind(this, view)
return view
}
}
/*
* Quasseldroid - Quassel client for Android
*
* Copyright (c) 2019 Janne Koschinski
* Copyright (c) 2019 The Quassel Project
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3 as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.kuschku.quasseldroid.ui.chat.add.create
import androidx.fragment.app.FragmentActivity
import dagger.Binds
import dagger.Module
import dagger.android.ContributesAndroidInjector
@Module
abstract class ChannelCreateFragmentProvider {
@Binds
abstract fun bindFragmentActivity(activity: ChannelCreateActivity): FragmentActivity
@ContributesAndroidInjector
abstract fun bindChannelCreateFragment(): ChannelCreateFragment
}
/*
* Quasseldroid - Quassel client for Android
*
* Copyright (c) 2019 Janne Koschinski
* Copyright (c) 2019 The Quassel Project
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3 as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.kuschku.quasseldroid.ui.chat.add.join
import android.content.Context
import android.content.Intent
import de.kuschku.quasseldroid.util.ui.settings.ServiceBoundSettingsActivity
class ChannelJoinActivity : ServiceBoundSettingsActivity(ChannelJoinFragment()) {
companion object {
fun launch(context: Context) = context.startActivity(intent(context))
fun intent(context: Context) = Intent(context, ChannelJoinActivity::class.java)
}
}
/*
* Quasseldroid - Quassel client for Android
*
* Copyright (c) 2019 Janne Koschinski
* Copyright (c) 2019 The Quassel Project
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3 as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.kuschku.quasseldroid.ui.chat.add.join
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import butterknife.ButterKnife
import de.kuschku.quasseldroid.R
import de.kuschku.quasseldroid.util.service.ServiceBoundFragment
class ChannelJoinFragment : ServiceBoundFragment() {
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?): View? {
val view = inflater.inflate(R.layout.add_join, container, false)
ButterKnife.bind(this, view)
return view
}
}
/*
* Quasseldroid - Quassel client for Android
*
* Copyright (c) 2019 Janne Koschinski
* Copyright (c) 2019 The Quassel Project
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3 as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.kuschku.quasseldroid.ui.chat.add.join
import androidx.fragment.app.FragmentActivity
import dagger.Binds
import dagger.Module
import dagger.android.ContributesAndroidInjector
@Module
abstract class ChannelJoinFragmentProvider {
@Binds
abstract fun bindFragmentActivity(activity: ChannelJoinActivity): FragmentActivity
@ContributesAndroidInjector
abstract fun bindChannelJoinFragment(): ChannelJoinFragment
}
/*
* Quasseldroid - Quassel client for Android
*
* Copyright (c) 2019 Janne Koschinski
* Copyright (c) 2019 The Quassel Project
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3 as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.kuschku.quasseldroid.ui.chat.add.query
import android.content.Context
import android.content.Intent
import de.kuschku.quasseldroid.util.ui.settings.ServiceBoundSettingsActivity
class QueryCreateActivity : ServiceBoundSettingsActivity(QueryCreateFragment()) {
companion object {
fun launch(context: Context) = context.startActivity(intent(context))
fun intent(context: Context) = Intent(context, QueryCreateActivity::class.java)
}
}
/*
* Quasseldroid - Quassel client for Android
*
* Copyright (c) 2019 Janne Koschinski
* Copyright (c) 2019 The Quassel Project
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3 as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.kuschku.quasseldroid.ui.chat.add.query
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import butterknife.ButterKnife
import de.kuschku.quasseldroid.R
import de.kuschku.quasseldroid.util.service.ServiceBoundFragment
class QueryCreateFragment : ServiceBoundFragment() {
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?): View? {
val view = inflater.inflate(R.layout.add_query, container, false)
ButterKnife.bind(this, view)
return view
}
}
/*
* Quasseldroid - Quassel client for Android
*
* Copyright (c) 2019 Janne Koschinski
* Copyright (c) 2019 The Quassel Project
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3 as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.kuschku.quasseldroid.ui.chat.add.query
import androidx.fragment.app.FragmentActivity
import dagger.Binds
import dagger.Module
import dagger.android.ContributesAndroidInjector
import de.kuschku.quasseldroid.ui.chat.add.query.QueryCreateActivity
@Module
abstract class QueryCreateFragmentProvider {
@Binds
abstract fun bindFragmentActivity(activity: QueryCreateActivity): FragmentActivity
@ContributesAndroidInjector
abstract fun bindQueryCreateFragment(): QueryCreateFragment
}
......@@ -26,6 +26,7 @@ import android.text.TextWatcher
import android.view.*
import android.widget.AdapterView
import android.widget.EditText
import androidx.annotation.ColorInt
import androidx.appcompat.widget.AppCompatImageButton
import androidx.appcompat.widget.AppCompatSpinner
import androidx.appcompat.widget.Toolbar
......@@ -36,6 +37,8 @@ import androidx.recyclerview.widget.RecyclerView
import butterknife.BindView
import butterknife.ButterKnife
import com.afollestad.materialdialogs.MaterialDialog
import com.leinardi.android.speeddial.SpeedDialActionItem
import com.leinardi.android.speeddial.SpeedDialView
import de.kuschku.libquassel.protocol.BufferId
import de.kuschku.libquassel.protocol.Buffer_Activity
import de.kuschku.libquassel.protocol.Buffer_Type
......@@ -50,12 +53,16 @@ import de.kuschku.libquassel.util.helpers.mapMap
import de.kuschku.libquassel.util.helpers.mapOrElse
import de.kuschku.libquassel.util.helpers.nullIf
import de.kuschku.libquassel.util.helpers.value
import de.kuschku.quasseldroid.BuildConfig
import de.kuschku.quasseldroid.R
import de.kuschku.quasseldroid.persistence.db.AccountDatabase
import de.kuschku.quasseldroid.persistence.db.QuasselDatabase
import de.kuschku.quasseldroid.settings.AppearanceSettings
import de.kuschku.quasseldroid.settings.MessageSettings
import de.kuschku.quasseldroid.ui.chat.ChatActivity
import de.kuschku.quasseldroid.ui.chat.add.create.ChannelCreateActivity
import de.kuschku.quasseldroid.ui.chat.add.join.ChannelJoinActivity
import de.kuschku.quasseldroid.ui.chat.add.query.QueryCreateActivity
import de.kuschku.quasseldroid.ui.coresettings.network.NetworkEditActivity
import de.kuschku.quasseldroid.ui.info.channellist.ChannelListActivity
import de.kuschku.quasseldroid.util.ColorContext
......@@ -91,10 +98,9 @@ class BufferViewConfigFragment : ServiceBoundFragment() {
@BindView(R.id.buffer_search_container)
lateinit var bufferSearchContainer: ViewGroup
/*
@BindView(R.id.fab)
@BindView(R.id.fab_chatlist)
lateinit var fab: SpeedDialView
*/
@Inject
lateinit var appearanceSettings: AppearanceSettings
......@@ -535,16 +541,27 @@ class BufferViewConfigFragment : ServiceBoundFragment() {
bufferSearch.setText("")
}
/*
@ColorInt var colorLabel = 0
@ColorInt var colorLabelBackground = 0
view.context.theme.styledAttributes(R.attr.colorTextPrimary, R.attr.colorBackgroundCard) {
@ColorInt var fabBackground0 = 0
@ColorInt var fabBackground1 = 0
@ColorInt var fabBackground2 = 0
view.context.theme.styledAttributes(
R.attr.colorTextPrimary, R.attr.colorBackgroundCard,
R.attr.senderColorF, R.attr.senderColorE, R.attr.senderColorD
) {
colorLabel = getColor(0, 0)
colorLabelBackground = getColor(1, 0)
fabBackground0 = getColor(2, 0)
fabBackground1 = getColor(3, 0)
fabBackground2 = getColor(4, 0)
}
fab.addActionItem(
SpeedDialActionItem.Builder(R.id.fab_create, R.drawable.ic_add)
.setFabBackgroundColor(fabBackground0)
.setFabImageTintColor(0xffffffffu.toInt())
.setLabel(R.string.label_create_channel)
.setLabelBackgroundColor(colorLabelBackground)
......@@ -554,6 +571,7 @@ class BufferViewConfigFragment : ServiceBoundFragment() {
fab.addActionItem(
SpeedDialActionItem.Builder(R.id.fab_join, R.drawable.ic_channel)
.setFabBackgroundColor(fabBackground1)
.setFabImageTintColor(0xffffffffu.toInt())
.setLabel(R.string.label_join_long)
.setLabelBackgroundColor(colorLabelBackground)
......@@ -563,13 +581,33 @@ class BufferViewConfigFragment : ServiceBoundFragment() {
fab.addActionItem(
SpeedDialActionItem.Builder(R.id.fab_query, R.drawable.ic_account)
.setFabBackgroundColor(fabBackground2)
.setFabImageTintColor(0xffffffffu.toInt())
.setLabel(R.string.label_query_medium)
.setLabelBackgroundColor(colorLabelBackground)
.setLabelColor(colorLabel)
.create()
)
*/
fab.setOnActionSelectedListener {
when (it.id) {
R.id.fab_query -> {
context?.let(QueryCreateActivity.Companion::launch)
true
}
R.id.fab_join -> {
context?.let(ChannelJoinActivity.Companion::launch)
true
}
R.id.fab_create -> {
context?.let(ChannelCreateActivity.Companion::launch)
true
}
else -> false
}
}
fab.visibleIf(BuildConfig.DEBUG)
return view
}
......
......@@ -49,7 +49,7 @@ class MinimumActivityAdapter(val data: List<MinimumActivityItem>) :
else
parent.context
)
val view = inflater.inflate(R.layout.widget_spinner_item_inline, parent, false)
val view = inflater.inflate(R.layout.widget_spinner_item_material, parent, false)
return MinimumActivityViewHolder(
view
)
......
......@@ -57,7 +57,7 @@ class NetworkAdapter(@StringRes private val fallbackName: Int) :
else
parent.context
)
val view = inflater.inflate(R.layout.widget_spinner_item_inline, parent, false)
val view = inflater.inflate(R.layout.widget_spinner_item_material, parent, false)
return NetworkViewHolder(fallbackName, view)
}
......
......@@ -49,7 +49,7 @@ class HighlightNickTypeAdapter(val data: List<HighlightNickTypeItem>) :
else
parent.context
)
val view = inflater.inflate(R.layout.widget_spinner_item_inline, parent, false)
val view = inflater.inflate(R.layout.widget_spinner_item_material, parent, false)
return HighlightNickTypeViewHolder(
view
)
......
......@@ -49,7 +49,7 @@ class IgnoreTypeAdapter(val data: List<IgnoreTypeItem>) :
else
parent.context
)
val view = inflater.inflate(R.layout.widget_spinner_item_inline, parent, false)
val view = inflater.inflate(R.layout.widget_spinner_item_material, parent, false)
return IgnoreTypeViewHolder(
view
)
......
......@@ -49,7 +49,7 @@ class ScopeTypeAdapter(val data: List<ScopeTypeItem>) :
else
parent.context
)
val view = inflater.inflate(R.layout.widget_spinner_item_inline, parent, false)
val view = inflater.inflate(R.layout.widget_spinner_item_material, parent, false)
return ScopeTypeViewHolder(
view
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment