Multi account feature (#490)

* basic implementation

* improve LoginActivity

* darken drawer background image

* add current avatar in ComposeActivity

* add account name to logout dialog

* multi account support for notifications

* multi account support for notifications

* bugfixes & cleanup

* fix bug where somethings notifications would open with the wrong user

* correctly set active account in SFragment

* small improvements
This commit is contained in:
Konrad Pozniak 2018-02-03 22:45:14 +01:00 committed by GitHub
commit 92ae463b38
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
40 changed files with 1293 additions and 773 deletions

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" >
<scale
xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="300"
android:fromXScale="0"
android:fromYScale="0"
android:pivotX="50%"
android:pivotY="50%"
android:toXScale="1"
android:toYScale="1" >
</scale>
</set>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

@ -16,7 +16,16 @@
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_marginBottom="8dp"
android:background="@android:color/transparent" />
android:background="@android:color/transparent">
<ImageView
android:id="@+id/composeAvatar"
android:padding="8dp"
android:layout_gravity="right|end"
android:layout_width="?attr/actionBarSize"
android:layout_height="?attr/actionBarSize"
tools:ignore="ContentDescription" />
<!--content description will be set in code -->
</android.support.v7.widget.Toolbar>
<TextView
android:textSize="?attr/status_text_small"

View file

@ -1,82 +1,99 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
<android.support.constraint.ConstraintLayout 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:fillViewport="true"
android:gravity="center"
android:orientation="vertical"
tools:context="com.keylesspalace.tusky.LoginActivity">
<LinearLayout
android:orientation="vertical"
<ScrollView
android:layout_width="match_parent"
android:padding="16dp"
android:gravity="center"
android:layout_height="wrap_content">
<ImageView
android:layout_width="147dp"
android:layout_height="160dp"
android:layout_marginBottom="50dp"
android:src="@drawable/elephant_friend"
android:contentDescription="@null" />
android:layout_height="match_parent"
android:fillViewport="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:id="@+id/login_input"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<android.support.design.widget.TextInputLayout
android:layout_height="wrap_content"
android:layout_width="250dp">
<android.support.design.widget.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textUri"
android:hint="@string/hint_domain"
android:ems="10"
android:id="@+id/edit_text_domain" />
</android.support.design.widget.TextInputLayout>
<Button
android:id="@+id/button_login"
android:layout_width="250dp"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:textColor="@android:color/white"
android:text="@string/action_login" />
<TextView
android:layout_width="250dp"
android:layout_height="wrap_content"
android:visibility="gone"
android:id="@+id/text_error" />
<TextView
android:layout_width="250dp"
android:layout_height="wrap_content"
android:paddingTop="5dp"
android:textAlignment="center"
android:id="@+id/whats_an_instance"
android:text="@string/link_whats_an_instance" />
</LinearLayout>
<LinearLayout
android:id="@+id/login_loading"
android:visibility="gone"
android:gravity="center"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ProgressBar
android:layout_gravity="center"
android:padding="16dp">
<ImageView
android:layout_width="147dp"
android:layout_height="160dp"
android:layout_marginBottom="50dp"
android:contentDescription="@null"
android:src="@drawable/elephant_friend" />
<LinearLayout
android:id="@+id/loginInputLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:paddingTop="10dp"
android:textAlignment="center"
android:layout_width="250dp"
android:layout_height="wrap_content"
android:text="@string/login_connection"/>
android:orientation="vertical">
<android.support.design.widget.TextInputLayout
android:layout_width="250dp"
android:layout_height="wrap_content">
<android.support.design.widget.TextInputEditText
android:id="@+id/domainEditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:hint="@string/hint_domain"
android:inputType="textUri" />
</android.support.design.widget.TextInputLayout>
<Button
android:id="@+id/loginButton"
android:layout_width="250dp"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="@string/action_login"
android:textColor="@android:color/white" />
<TextView
android:id="@+id/whatsAnInstanceTextView"
android:layout_width="250dp"
android:layout_height="wrap_content"
android:paddingTop="6dp"
android:text="@string/link_whats_an_instance"
android:textAlignment="center" />
</LinearLayout>
<LinearLayout
android:id="@+id/loginLoadingLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="gone">
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center" />
<TextView
android:layout_width="250dp"
android:layout_height="wrap_content"
android:paddingTop="10dp"
android:text="@string/login_connection"
android:textAlignment="center" />
</LinearLayout>
</LinearLayout>
</ScrollView>
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_alignParentTop="true"
android:background="@android:color/transparent"
app:layout_constraintTop_toTopOf="parent" />
</LinearLayout>
</ScrollView>
</android.support.constraint.ConstraintLayout>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?><!--
* This is the for follow notifications, the layout for the follows/following listings on account
* This is the for folnotificationsEnabledions, the layout for the follows/following listings on account
* pages are instead in item_account.xml.
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"

View file

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?><!--This applies only to favourite and reblog notifications.-->
<?xml version="1.0" encoding="utf-8"?><!--This applies only to favourite and rebnotificationsEnabledions.-->
<RelativeLayout 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"

View file

@ -55,7 +55,6 @@
<string name="action_compose">حرر</string>
<string name="action_login">التسجيل بواسطة ماستدون</string>
<string name="action_logout">خروج</string>
<string name="action_logout_confirm">هل تود تسجيل الخروج ؟</string>
<string name="action_follow">إتبع</string>
<string name="action_unfollow">إلغاء التتبع</string>
<string name="action_block">قم بحظره</string>

View file

@ -60,7 +60,6 @@
<string name="action_compose">Redacta</string>
<string name="action_login">Inicia sessió amb Mastodon</string>
<string name="action_logout">Tanca sessió</string>
<string name="action_logout_confirm">Vols tancar la sessió?</string>
<string name="action_follow">Segueix</string>
<string name="action_unfollow">Deixa de seguir</string>
<string name="action_block">Bloca</string>

View file

@ -216,7 +216,6 @@
<string name="pref_title_show_boosts">Zeige Boosts</string>
<string name="pref_title_pull_notification_check_interval">Überprüfungsintervall</string>
<string name="no_content">leer</string>
<string name="action_logout_confirm">Willst du dich wirklich ausloggen?</string>
<string name="action_hide_media">Verstecke Medien</string>
<string name="pref_title_status_filter">Timeline-Filter</string>
<string name="title_saved_toot">Gespeicherte Tröts</string>

View file

@ -93,7 +93,6 @@
<string name="action_save">Sauvegarder</string>
<string name="action_edit_profile">Modifier le profil</string>
<string name="action_accept">Accepter</string>
<string name="action_logout_confirm">Voulez-vous vous déconnectez ?</string>
<string name="action_reject">Rejeter</string>
<string name="action_undo">Annuler</string>
<string name="action_view_follow_requests">Demandes de suivi</string>

View file

@ -57,7 +57,6 @@
<string name="action_compose">Szerkeszt</string>
<string name="action_login">Bejelentkezés Mastodon-al</string>
<string name="action_logout">Kijelentkezés</string>
<string name="action_logout_confirm">Ki szeretne jelentkezni?</string>
<string name="action_follow">Követ</string>
<string name="action_unfollow">Követőktől eltávolít</string>
<string name="action_block">Blokkol</string>

View file

@ -57,7 +57,7 @@
<string name="action_compose">新規投稿</string>
<string name="action_login">Mastodonでログイン</string>
<string name="action_logout">ログアウト</string>
<string name="action_logout_confirm">ログアウトしますか?</string>
<string name="action_follow">フォローする</string>
<string name="action_unfollow">フォロー解除</string>
<string name="action_block">ブロック</string>

View file

@ -51,7 +51,6 @@
<string name="action_compose">Schrijven</string>
<string name="action_login">Inloggen bij Mastodon</string>
<string name="action_logout">Uitloggen</string>
<string name="action_logout_confirm">Wil je echt uitloggen?</string>
<string name="action_follow">Volgen</string>
<string name="action_unfollow">Ontvolgen</string>
<string name="action_block">Blokkeren</string>

View file

@ -68,9 +68,10 @@
<string name="action_compose">Napisz</string>
<string name="action_login">Zaloguj z Mastodon</string>
<string name="action_logout">Wyloguj</string>
<string name="action_logout_confirm">Czy chcesz wylogować się?</string>
<string name="action_follow">Śledź</string>
<string name="action_unfollow">Przestań śledzić</string>
<string name="action_block">Zablokuj</string>
<string name="action_unblock">Odblokuj</string>
<string name="action_report">Zgłoś</string>

View file

@ -60,7 +60,6 @@
<string name="action_compose">Compor</string>
<string name="action_login">Entrar com Mastodon</string>
<string name="action_logout">Sair</string>
<string name="action_logout_confirm">Deseja sair?</string>
<string name="action_follow">Seguir</string>
<string name="action_unfollow">Deixar de seguir</string>
<string name="action_block">Bloquear</string>

View file

@ -61,7 +61,6 @@
<string name="action_compose">Написать</string>
<string name="action_login">Войти</string>
<string name="action_logout">Выйти</string>
<string name="action_logout_confirm">Вы хотите выйти?</string>
<string name="action_follow">Подписаться</string>
<string name="action_unfollow">Отписаться</string>
<string name="action_block">Заблокировать</string>

View file

@ -4,6 +4,8 @@
<color name="view_video_background">#000000</color>
<color name="toolbar_view_media">#8f000000</color>
<color name="semi_transparent">#33000000</color>
<color name="header_background_filter">#44000000</color>
<!--Dark Theme Colors-->
<color name="color_primary_dark">#4c5368</color>
<color name="color_primary_dark_dark">#313543</color> <!--Dark Dark-->

View file

@ -61,7 +61,7 @@
<string name="action_compose">Compose</string>
<string name="action_login">Login with Mastodon</string>
<string name="action_logout">Log Out</string>
<string name="action_logout_confirm">Do you wish to logout</string>
<string name="action_logout_confirm">Are you sure you want to log out of the account %1$s?</string>
<string name="action_follow">Follow</string>
<string name="action_unfollow">Unfollow</string>
<string name="action_block">Block</string>
@ -157,6 +157,7 @@
<string name="pref_title_notification_settings">Notifications</string>
<string name="pref_title_edit_notification_settings">Edit Notifications</string>
<string name="pref_title_notifications_enabled">Notifications</string>
<string name="pref_summary_notifications">for account %1$s</string>
<string name="pref_title_pull_notification_check_interval">Check Interval</string>
<string name="pref_title_notification_alerts">Alerts</string>
<string name="pref_title_notification_alert_sound">Notify with a sound</string>
@ -230,7 +231,7 @@
<string name="notification_channel_boost_name">Boosts</string>
<string name="notification_channel_boost_description">Notifications when your toots get boosted</string>
<string name="notification_channel_favourite_name">Favourites</string>
<string name="notification_channel_favourite_description">Notifications when your toots get mark as favourite</string>
<string name="notification_channel_favourite_description">Notifications when your toots get marked as favourite</string>
<string name="notification_mention_format">%s mentioned you</string>
@ -285,9 +286,16 @@
<string name="title_media">Media</string>
<string name="replying_to">Replying to @%s</string>
<string name="load_more_placeholder_text">load more</string>
<string name="add_account_name">Add Account</string>
<string name="add_account_description">Add new Mastodon Account</string>
<string name="action_lists">Lists</string>
<string name="title_lists">Lists</string>
<string name="title_list_timeline">List timeline</string>
<string name="compose_active_account_description">Posting with account %1$s</string>
<string name="error_failed_set_caption">Failed to set caption</string>
<string name="hint_describe_for_visually_impaired">Describe for visually impaired</string>
<string name="action_set_caption">Set caption</string>