diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index ad27300611d86c04ceafce6697db3f107f04ae91..fe5fb234b26e3134526db148d85c321272f281eb 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -112,6 +112,13 @@ android:label="@string/label_info_certificate" android:windowSoftInputMode="adjustResize" /> + <!-- Archive --> + <activity + android:name="de.kuschku.quasseldroid.ui.chat.archive.ArchiveActivity" + android:exported="false" + android:label="@string/label_archived_chats" + android:windowSoftInputMode="adjustResize" /> + <!-- Add --> <activity android:name="de.kuschku.quasseldroid.ui.chat.add.create.ChannelCreateActivity" diff --git a/app/src/main/java/de/kuschku/quasseldroid/ui/chat/archive/ArchiveActivity.kt b/app/src/main/java/de/kuschku/quasseldroid/ui/chat/archive/ArchiveActivity.kt new file mode 100644 index 0000000000000000000000000000000000000000..467fea861b2beb479665ba2dd749caf794652c4a --- /dev/null +++ b/app/src/main/java/de/kuschku/quasseldroid/ui/chat/archive/ArchiveActivity.kt @@ -0,0 +1,42 @@ +/* + * 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.archive + +import android.content.Context +import android.content.Intent +import de.kuschku.quasseldroid.util.ui.settings.ServiceBoundSettingsActivity + +class ArchiveActivity : ServiceBoundSettingsActivity(ArchiveFragment()) { + companion object { + fun launch( + context: Context, + chatlistId: Int? = null + ) = context.startActivity(intent(context, chatlistId)) + + fun intent( + context: Context, + chatlistId: Int? = null + ) = Intent(context, ArchiveActivity::class.java).apply { + if (chatlistId != null) { + putExtra("chatlist_id", chatlistId) + } + } + } +} diff --git a/app/src/main/java/de/kuschku/quasseldroid/ui/chat/archive/ArchiveFragment.kt b/app/src/main/java/de/kuschku/quasseldroid/ui/chat/archive/ArchiveFragment.kt new file mode 100644 index 0000000000000000000000000000000000000000..e4cdb4fc6dc55435db2a16d6338f187881d8a7a0 --- /dev/null +++ b/app/src/main/java/de/kuschku/quasseldroid/ui/chat/archive/ArchiveFragment.kt @@ -0,0 +1,43 @@ +/* + * 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.archive + +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 +import de.kuschku.quasseldroid.viewmodel.helper.QuasselViewModelHelper +import javax.inject.Inject + +class ArchiveFragment : ServiceBoundFragment() { + @Inject + lateinit var modelHelper: QuasselViewModelHelper + + 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 + } +} diff --git a/app/src/main/java/de/kuschku/quasseldroid/ui/chat/archive/ArchiveFragmentProvider.kt b/app/src/main/java/de/kuschku/quasseldroid/ui/chat/archive/ArchiveFragmentProvider.kt new file mode 100644 index 0000000000000000000000000000000000000000..9e8ab28cfb7e8eb601bcab75b9bbb29d1cdd1282 --- /dev/null +++ b/app/src/main/java/de/kuschku/quasseldroid/ui/chat/archive/ArchiveFragmentProvider.kt @@ -0,0 +1,34 @@ +/* + * 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.archive + +import androidx.fragment.app.FragmentActivity +import dagger.Binds +import dagger.Module +import dagger.android.ContributesAndroidInjector + +@Module +abstract class ArchiveFragmentProvider { + @Binds + abstract fun bindFragmentActivity(activity: ArchiveActivity): FragmentActivity + + @ContributesAndroidInjector + abstract fun bindArchiveFragment(): ArchiveFragment +} diff --git a/app/src/main/res/layout/chat_archive.xml b/app/src/main/res/layout/chat_archive.xml new file mode 100644 index 0000000000000000000000000000000000000000..ffc9418bb0ba54f38ebfc6b1e3db2dd817573c95 --- /dev/null +++ b/app/src/main/res/layout/chat_archive.xml @@ -0,0 +1,81 @@ +<?xml version="1.0" encoding="utf-8"?><!-- + 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/>. + --> + + +<androidx.core.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:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical"> + + <LinearLayout style="@style/Widget.CoreSettings.PrimaryItemGroupHeader"> + + <androidx.appcompat.widget.AppCompatImageView + style="@style/Widget.CoreSettings.PrimaryItemIcon" + app:srcCompat="@drawable/ic_clock" /> + + <TextView + style="@style/Widget.CoreSettings.PrimaryItemSwitch" + android:text="@string/label_temporarily_archived" /> + </LinearLayout> + + <TextView + style="@style/Widget.CoreSettings.TextView" + android:layout_marginStart="72dp" + android:layout_marginLeft="72dp" + android:layout_marginEnd="16dp" + android:layout_marginRight="16dp" + android:text="@string/label_temporarily_archived_long" /> + + <androidx.recyclerview.widget.RecyclerView + android:layout_width="match_parent" + android:layout_height="wrap_content" + tools:listitem="@layout/widget_buffer_reorder" /> + + <LinearLayout style="@style/Widget.CoreSettings.PrimaryItemGroupHeader"> + + <androidx.appcompat.widget.AppCompatImageView + style="@style/Widget.CoreSettings.PrimaryItemIcon" + app:srcCompat="@drawable/ic_eye_off" /> + + <TextView + style="@style/Widget.CoreSettings.PrimaryItemSwitch" + android:text="@string/label_permanently_archived" /> + </LinearLayout> + + <TextView + style="@style/Widget.CoreSettings.TextView" + android:layout_marginStart="72dp" + android:layout_marginLeft="72dp" + android:layout_marginEnd="16dp" + android:layout_marginRight="16dp" + android:text="@string/label_permanently_archived_long" /> + + <androidx.recyclerview.widget.RecyclerView + android:layout_width="match_parent" + android:layout_height="wrap_content" + tools:listitem="@layout/widget_buffer_reorder" /> + </LinearLayout> +</androidx.core.widget.NestedScrollView> diff --git a/app/src/main/res/layout/widget_buffer.xml b/app/src/main/res/layout/widget_buffer.xml index 10ee8759cd919feb198d2633bde7d279efa9499e..7ad7c4a67edca15e0c4889f12775a33c6f070f34 100644 --- a/app/src/main/res/layout/widget_buffer.xml +++ b/app/src/main/res/layout/widget_buffer.xml @@ -30,7 +30,7 @@ android:paddingBottom="4dp" android:textAppearance="?android:attr/textAppearanceListItemSmall"> - <ImageView + <androidx.appcompat.widget.AppCompatImageView android:id="@+id/status" android:layout_width="@dimen/avatar_size_buffer" android:layout_height="@dimen/avatar_size_buffer" diff --git a/app/src/main/res/layout/widget_buffer_away.xml b/app/src/main/res/layout/widget_buffer_away.xml index 8ba8f4690fe747dce73d86f99d662452f8d2dfb5..f92b1f5520612c04e07ee60e92e4bb78407e82ed 100644 --- a/app/src/main/res/layout/widget_buffer_away.xml +++ b/app/src/main/res/layout/widget_buffer_away.xml @@ -31,7 +31,7 @@ android:paddingBottom="4dp" android:textAppearance="?android:attr/textAppearanceListItemSmall"> - <ImageView + <androidx.appcompat.widget.AppCompatImageView android:id="@+id/status" android:layout_width="@dimen/avatar_size_buffer" android:layout_height="@dimen/avatar_size_buffer" @@ -39,7 +39,7 @@ android:layout_marginEnd="16dp" android:layout_marginRight="16dp" android:contentDescription="@string/label_avatar" - tools:src="@drawable/ic_status_channel" /> + tools:src="@tools:sample/avatars" /> <LinearLayout android:layout_width="0dip" diff --git a/app/src/main/res/layout/widget_buffer_reorder.xml b/app/src/main/res/layout/widget_buffer_reorder.xml new file mode 100644 index 0000000000000000000000000000000000000000..ec3dcee2c79f3deeef8d17f003686bb58360043c --- /dev/null +++ b/app/src/main/res/layout/widget_buffer_reorder.xml @@ -0,0 +1,89 @@ +<?xml version="1.0" encoding="utf-8"?><!-- + 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/>. + --> + +<LinearLayout 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:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginStart="56dp" + android:layout_marginLeft="56dp" + android:background="?attr/backgroundMenuItem" + android:minHeight="?listPreferredItemHeightSmall" + android:orientation="horizontal" + android:paddingLeft="16dp" + android:paddingTop="4dp" + android:paddingRight="16dp" + android:paddingBottom="4dp" + android:textAppearance="?android:attr/textAppearanceListItemSmall"> + + <androidx.appcompat.widget.AppCompatImageView + android:id="@+id/status" + android:layout_width="@dimen/avatar_size_buffer" + android:layout_height="@dimen/avatar_size_buffer" + android:layout_gravity="center_vertical" + android:layout_marginEnd="16dp" + android:layout_marginRight="16dp" + android:contentDescription="@string/label_avatar" + tools:src="@tools:sample/avatars" /> + + <LinearLayout + android:layout_width="0dip" + android:layout_height="wrap_content" + android:layout_gravity="center_vertical" + android:layout_weight="1" + android:orientation="vertical"> + + <TextView + android:id="@+id/name" + style="@style/Widget.RtlConformTextView" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_vertical|start" + android:ellipsize="marquee" + android:fontFamily="sans-serif-medium" + android:singleLine="true" + android:textColor="?attr/colorTextPrimary" + android:textSize="13sp" + tools:text="@sample/messages.json/data/sender" /> + + <TextView + android:id="@+id/description" + style="@style/Widget.RtlConformTextView" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:ellipsize="marquee" + android:singleLine="true" + android:textColor="?attr/colorTextSecondary" + android:textSize="12sp" + tools:text="@sample/messages.json/data/sender" + tools:visibility="visible" /> + </LinearLayout> + + <androidx.appcompat.widget.AppCompatImageView + android:id="@+id/reorder" + android:layout_width="24dp" + android:layout_height="24dp" + android:layout_gravity="center_vertical" + android:layout_marginStart="16dp" + android:layout_marginLeft="16dp" + android:contentDescription="@string/label_reorder" + app:srcCompat="@drawable/ic_reorder" + app:tint="?colorTextSecondary" /> +</LinearLayout> diff --git a/app/src/main/res/layout/widget_buffer_reorder_away.xml b/app/src/main/res/layout/widget_buffer_reorder_away.xml new file mode 100644 index 0000000000000000000000000000000000000000..317ffb3b8452835dbd4e0ec1a9a57f8748ea2b28 --- /dev/null +++ b/app/src/main/res/layout/widget_buffer_reorder_away.xml @@ -0,0 +1,101 @@ +<?xml version="1.0" encoding="utf-8"?><!-- + 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/>. + --> + +<LinearLayout 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:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginStart="56dp" + android:layout_marginLeft="56dp" + android:background="?attr/backgroundMenuItem" + android:minHeight="?listPreferredItemHeightSmall" + android:orientation="horizontal" + android:paddingLeft="16dp" + android:paddingTop="4dp" + android:paddingRight="16dp" + android:paddingBottom="4dp" + android:textAppearance="?android:attr/textAppearanceListItemSmall"> + + <androidx.appcompat.widget.AppCompatImageView + android:id="@+id/status" + android:layout_width="@dimen/avatar_size_buffer" + android:layout_height="@dimen/avatar_size_buffer" + android:layout_gravity="center_vertical" + android:layout_marginEnd="16dp" + android:layout_marginRight="16dp" + android:contentDescription="@string/label_avatar" + tools:src="@tools:sample/avatars" /> + + <LinearLayout + android:layout_width="0dip" + android:layout_height="wrap_content" + android:layout_gravity="center_vertical" + android:layout_weight="1" + android:orientation="vertical"> + + <TextView + android:id="@+id/name" + style="@style/Widget.RtlConformTextView" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_vertical|start" + android:ellipsize="marquee" + android:fontFamily="sans-serif-medium" + android:singleLine="true" + android:textColor="?attr/colorTextSecondary" + android:textSize="13sp" + android:textStyle="italic" + tools:text="@sample/messages.json/data/sender" /> + + <TextView + android:id="@+id/description" + style="@style/Widget.RtlConformTextView" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:ellipsize="marquee" + android:singleLine="true" + android:textColor="?attr/colorTextSecondary" + android:textSize="12sp" + android:textStyle="italic" + tools:text="@sample/messages.json/data/sender" + tools:visibility="visible" /> + </LinearLayout> + + <androidx.appcompat.widget.AppCompatImageView + android:layout_width="24dp" + android:layout_height="24dp" + android:layout_gravity="center_vertical" + android:layout_marginStart="16dp" + android:layout_marginLeft="16dp" + android:contentDescription="@string/label_user_away" + app:srcCompat="@drawable/ic_clock" + app:tint="?colorTextSecondary" /> + + <androidx.appcompat.widget.AppCompatImageView + android:id="@+id/reorder" + android:layout_width="24dp" + android:layout_height="24dp" + android:layout_gravity="center_vertical" + android:layout_marginStart="16dp" + android:layout_marginLeft="16dp" + android:contentDescription="@string/label_reorder" + app:srcCompat="@drawable/ic_reorder" + app:tint="?colorTextSecondary" /> +</LinearLayout> diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 49c1348f6c2abee6a61044d22a0dca19bf7d9f61..356136610604857b3393b864c131c2db10406cea 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -45,7 +45,7 @@ <string name="label_connect">Connetti</string> <string name="label_copy">Copia</string> <string name="label_crashes">Arresti anomali</string> - <string name="label_crashes_empty">Nessun rapporto di arresto anomalo trovato</string> + <string name="label_crashes_empty">Nessun rapporto d’arresto anomalo trovato</string> <string name="label_create_channel">Crea canale</string> <string name="label_delete">Elimina</string> <string name="label_delete_all">Elimina tutto</string> @@ -57,7 +57,7 @@ <string name="label_edit_topic_long">Apri finestra di dialogo per cambiare l’argomento del canale</string> <string name="label_filter_messages">Filtro messaggi</string> <string name="label_finish">Finito</string> - <string name="label_generate_crash_report">Genera rapporto dell’arresto anomalo</string> + <string name="label_generate_crash_report">Genera rapporto d’arresto anomalo</string> <string name="label_hide_perm">Nascondi sempre</string> <string name="label_hide_temp">Nascondi temporaneamente</string> <string name="label_ignore">Ignora</string> @@ -124,7 +124,7 @@ <string name="label_settings_client">Impostazioni del client</string> <string name="label_settings_core">Impostazioni del core</string> <string name="label_share">Condividi</string> - <string name="label_share_crashreport">Condividi rapporto dell’arresto anomalo</string> + <string name="label_share_crashreport">Condividi rapporto d’arresto anomalo</string> <string name="label_shortcut">Scorciatoia</string> <string name="label_shortcut_long">Crea scorciatoia nella schermata Home</string> <string name="label_show_hidden">Mostra nascosti</string> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index cdb820c65d9fe5b3d70ccfcd4b41bc15f64ce6c5..dd3e63f6cea6b6ae00c55364a538cb169585d69e 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -28,6 +28,7 @@ <string name="label_about">About</string> <string name="label_accept">Accept</string> <string name="label_acknowledgements">Acknowledgements</string> + <string name="label_archived_chats">Archived Chats</string> <string name="label_ascending">Ascending</string> <string name="label_authors">Authors</string> <string name="label_autocomplete">Autocomplete</string> @@ -102,6 +103,8 @@ <string name="label_password_new">New Password</string> <string name="label_password_old">Old Password</string> <string name="label_password_repeat">Repeat Password</string> + <string name="label_permanently_archived">Permanently Archived</string> + <string name="label_permanently_archived_long">Permanently archived chats stay hidden until you manually choose to un-archive them.</string> <string name="label_placeholder_message">Write a message…</string> <string name="label_placeholder_topic">Describe the channel topic…</string> <string name="label_privacy_policy">Privacy Policy</string> @@ -109,6 +112,7 @@ <string name="label_query_long">Open private chat with user</string> <string name="label_query_medium">Open private chat</string> <string name="label_rename">Rename</string> + <string name="label_reorder">Reorder</string> <string name="label_reply">Reply</string> <string name="label_reset">Reset</string> <string name="label_save">Save</string> @@ -130,6 +134,8 @@ <string name="label_show_hidden">Show Hidden</string> <string name="label_sort">Sort</string> <string name="label_source">Source</string> + <string name="label_temporarily_archived">Temporarily Archived</string> + <string name="label_temporarily_archived_long">Chats which are temporarily archived will be shown again once they get a new message.</string> <string name="label_topic">Channel Topic</string> <string name="label_translators">Translators</string> <string name="label_unhide">Make Visible</string>