mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 03:59:35 +01:00
wrap warning in cardview and add warning icon for extra visual
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
c368af6bab
commit
202d98d478
@ -872,7 +872,8 @@ public class ConversationsListController extends BaseController implements Searc
|
|||||||
new LovelyStandardDialog(getActivity(), LovelyStandardDialog.ButtonLayout.HORIZONTAL)
|
new LovelyStandardDialog(getActivity(), LovelyStandardDialog.ButtonLayout.HORIZONTAL)
|
||||||
.setTopColorRes(R.color.nc_darkRed)
|
.setTopColorRes(R.color.nc_darkRed)
|
||||||
.setIcon(DisplayUtils.getTintedDrawable(context.getResources(),
|
.setIcon(DisplayUtils.getTintedDrawable(context.getResources(),
|
||||||
R.drawable.ic_timer_black_24dp, R.color.bg_default))
|
R.drawable.ic_warning_white,
|
||||||
|
R.color.bg_default))
|
||||||
.setPositiveButtonColor(context.getResources().getColor(R.color.nc_darkRed))
|
.setPositiveButtonColor(context.getResources().getColor(R.color.nc_darkRed))
|
||||||
.setCancelable(false)
|
.setCancelable(false)
|
||||||
.setTitle(R.string.nc_settings_server_eol_title)
|
.setTitle(R.string.nc_settings_server_eol_title)
|
||||||
|
@ -29,6 +29,7 @@ import android.content.DialogInterface;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.content.res.ColorStateList;
|
import android.content.res.ColorStateList;
|
||||||
|
import android.graphics.PorterDuff;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
@ -45,6 +46,7 @@ import android.view.WindowManager;
|
|||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.Checkable;
|
import android.widget.Checkable;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
|
import android.widget.ImageView;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.RelativeLayout;
|
import android.widget.RelativeLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
@ -56,6 +58,7 @@ import com.bluelinelabs.conductor.changehandler.HorizontalChangeHandler;
|
|||||||
import com.bluelinelabs.conductor.changehandler.VerticalChangeHandler;
|
import com.bluelinelabs.conductor.changehandler.VerticalChangeHandler;
|
||||||
import com.bluelinelabs.logansquare.LoganSquare;
|
import com.bluelinelabs.logansquare.LoganSquare;
|
||||||
import com.facebook.drawee.view.SimpleDraweeView;
|
import com.facebook.drawee.view.SimpleDraweeView;
|
||||||
|
import com.google.android.material.card.MaterialCardView;
|
||||||
import com.google.android.material.textfield.TextInputLayout;
|
import com.google.android.material.textfield.TextInputLayout;
|
||||||
import com.nextcloud.talk.BuildConfig;
|
import com.nextcloud.talk.BuildConfig;
|
||||||
import com.nextcloud.talk.R;
|
import com.nextcloud.talk.R;
|
||||||
@ -103,6 +106,7 @@ import javax.inject.Inject;
|
|||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
import androidx.core.view.ViewCompat;
|
import androidx.core.view.ViewCompat;
|
||||||
import androidx.emoji.widget.EmojiTextView;
|
import androidx.emoji.widget.EmojiTextView;
|
||||||
import androidx.work.OneTimeWorkRequest;
|
import androidx.work.OneTimeWorkRequest;
|
||||||
@ -144,8 +148,12 @@ public class SettingsController extends BaseController {
|
|||||||
EmojiTextView displayNameTextView;
|
EmojiTextView displayNameTextView;
|
||||||
@BindView(R.id.base_url_text)
|
@BindView(R.id.base_url_text)
|
||||||
TextView baseUrlTextView;
|
TextView baseUrlTextView;
|
||||||
|
@BindView(R.id.server_age_warning_text_card)
|
||||||
|
MaterialCardView serverAgeCardView;
|
||||||
@BindView(R.id.server_age_warning_text)
|
@BindView(R.id.server_age_warning_text)
|
||||||
TextView serverAgeTextView;
|
TextView serverAgeTextView;
|
||||||
|
@BindView(R.id.server_age_warning_icon)
|
||||||
|
ImageView serverAgeIcon;
|
||||||
@BindView(R.id.settings_call_sound)
|
@BindView(R.id.settings_call_sound)
|
||||||
MaterialStandardPreference settingsCallSound;
|
MaterialStandardPreference settingsCallSound;
|
||||||
@BindView(R.id.settings_message_sound)
|
@BindView(R.id.settings_message_sound)
|
||||||
@ -554,13 +562,17 @@ public class SettingsController extends BaseController {
|
|||||||
baseUrlTextView.setText(Uri.parse(currentUser.getBaseUrl()).getHost());
|
baseUrlTextView.setText(Uri.parse(currentUser.getBaseUrl()).getHost());
|
||||||
|
|
||||||
if (currentUser.isServerEOL()) {
|
if (currentUser.isServerEOL()) {
|
||||||
serverAgeTextView.setTextColor(getResources().getColor(R.color.nc_darkRed));
|
serverAgeTextView.setTextColor(ContextCompat.getColor(context, R.color.nc_darkRed));
|
||||||
serverAgeTextView.setText(R.string.nc_settings_server_eol);
|
serverAgeTextView.setText(R.string.nc_settings_server_eol);
|
||||||
|
serverAgeIcon.setColorFilter(ContextCompat.getColor(context, R.color.nc_darkRed),
|
||||||
|
PorterDuff.Mode.SRC_IN);
|
||||||
} else if (currentUser.isServerAlmostEOL()) {
|
} else if (currentUser.isServerAlmostEOL()) {
|
||||||
serverAgeTextView.setTextColor(getResources().getColor(R.color.nc_darkYellow));
|
serverAgeTextView.setTextColor(ContextCompat.getColor(context, R.color.nc_darkYellow));
|
||||||
serverAgeTextView.setText(R.string.nc_settings_server_almost_eol);
|
serverAgeTextView.setText(R.string.nc_settings_server_almost_eol);
|
||||||
|
serverAgeIcon.setColorFilter(ContextCompat.getColor(context, R.color.nc_darkYellow),
|
||||||
|
PorterDuff.Mode.SRC_IN);
|
||||||
} else {
|
} else {
|
||||||
serverAgeTextView.setVisibility(View.GONE);
|
serverAgeCardView.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
reauthorizeButton.addPreferenceClickListener(view14 -> {
|
reauthorizeButton.addPreferenceClickListener(view14 -> {
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
<com.yarolegovich.mp.MaterialPreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
<com.yarolegovich.mp.MaterialPreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:apc="http://schemas.android.com/apk/res-auto"
|
xmlns:apc="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/settings_screen"
|
android:id="@+id/settings_screen"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -73,16 +74,45 @@
|
|||||||
android:textColor="@color/medium_emphasis_text"
|
android:textColor="@color/medium_emphasis_text"
|
||||||
tools:text="nextcloud.com" />
|
tools:text="nextcloud.com" />
|
||||||
|
|
||||||
|
<com.google.android.material.card.MaterialCardView
|
||||||
|
android:id="@+id/server_age_warning_text_card"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@id/base_url_text"
|
||||||
|
android:layout_margin="@dimen/standard_margin"
|
||||||
|
app:cardCornerRadius="8dp"
|
||||||
|
app:cardElevation="2dp"
|
||||||
|
app:strokeWidth="0dp">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="@dimen/standard_padding">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/server_age_warning_icon"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:src="@drawable/ic_warning_white"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
app:tint="@color/nc_darkRed"
|
||||||
|
android:contentDescription="@string/nc_settings_warning" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/server_age_warning_text"
|
android:id="@+id/server_age_warning_text"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@id/base_url_text"
|
android:layout_toEndOf="@id/server_age_warning_icon"
|
||||||
|
android:paddingStart="@dimen/standard_padding"
|
||||||
|
android:paddingEnd="0dp"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:layout_margin="@dimen/standard_margin"
|
|
||||||
android:textColor="@color/nc_darkRed"
|
android:textColor="@color/nc_darkRed"
|
||||||
tools:text="@string/nc_settings_server_almost_eol" />
|
tools:text="@string/nc_settings_server_almost_eol" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
</com.google.android.material.card.MaterialCardView>
|
||||||
|
|
||||||
<com.facebook.drawee.view.SimpleDraweeView
|
<com.facebook.drawee.view.SimpleDraweeView
|
||||||
android:id="@+id/avatar_image"
|
android:id="@+id/avatar_image"
|
||||||
android:layout_width="@dimen/avatar_size_big"
|
android:layout_width="@dimen/avatar_size_big"
|
||||||
@ -92,12 +122,11 @@
|
|||||||
apc:roundAsCircle="true"
|
apc:roundAsCircle="true"
|
||||||
tools:src="@tools:sample/avatars[0]" />
|
tools:src="@tools:sample/avatars[0]" />
|
||||||
|
|
||||||
|
|
||||||
<com.yarolegovich.mp.MaterialStandardPreference
|
<com.yarolegovich.mp.MaterialStandardPreference
|
||||||
android:id="@+id/settings_switch"
|
android:id="@+id/settings_switch"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@id/server_age_warning_text"
|
android:layout_below="@id/server_age_warning_text_card"
|
||||||
android:tag="switchAccountButton"
|
android:tag="switchAccountButton"
|
||||||
apc:mp_title="@string/nc_settings_switch_account" />
|
apc:mp_title="@string/nc_settings_switch_account" />
|
||||||
|
|
||||||
|
@ -86,10 +86,9 @@
|
|||||||
<string name="nc_settings_remove_account">Remove account</string>
|
<string name="nc_settings_remove_account">Remove account</string>
|
||||||
<string name="nc_settings_add_account">Add a new account</string>
|
<string name="nc_settings_add_account">Add a new account</string>
|
||||||
<string name="nc_settings_server_eol_title">Unsupported server</string>
|
<string name="nc_settings_server_eol_title">Unsupported server</string>
|
||||||
<string name="nc_settings_server_eol">The server version is too old and not supported by this version of the
|
<string name="nc_settings_server_eol">The server version is too old and not supported by this version of the Android app</string>
|
||||||
Android app</string>
|
<string name="nc_settings_server_almost_eol">The server version is very old and will not be supported in the next release!</string>
|
||||||
<string name="nc_settings_server_almost_eol">The server version is very old and will not be supported in the next
|
<string name="nc_settings_warning">Warning</string>
|
||||||
release!</string>
|
|
||||||
<string name="nc_add">Add</string>
|
<string name="nc_add">Add</string>
|
||||||
<string name="nc_settings_wrong_account">Only current account can be reauthorized</string>
|
<string name="nc_settings_wrong_account">Only current account can be reauthorized</string>
|
||||||
<string name="nc_settings_no_talk_installed">Talk app is not installed on the server you tried to authenticate against</string>
|
<string name="nc_settings_no_talk_installed">Talk app is not installed on the server you tried to authenticate against</string>
|
||||||
|
Loading…
Reference in New Issue
Block a user