diff options
14 files changed, 18 insertions, 57 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ChangePasswordActivity.java b/src/main/java/de/pixart/messenger/ui/ChangePasswordActivity.java index f6bec9838..5f1b5ba94 100644 --- a/src/main/java/de/pixart/messenger/ui/ChangePasswordActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ChangePasswordActivity.java @@ -35,7 +35,6 @@ public class ChangePasswordActivity extends XmppActivity implements XmppConnecti mNewPasswordLayout.setError(null); xmppConnectionService.updateAccountPasswordOnServer(mAccount, newPassword, ChangePasswordActivity.this); mChangePasswordButton.setEnabled(false); - mChangePasswordButton.setTextColor(getSecondaryTextColor()); mChangePasswordButton.setText(R.string.updating); } } @@ -103,7 +102,6 @@ public class ChangePasswordActivity extends XmppActivity implements XmppConnecti runOnUiThread(() -> { mNewPasswordLayout.setError(getString(R.string.could_not_change_password)); mChangePasswordButton.setEnabled(true); - mChangePasswordButton.setTextColor(getPrimaryTextColor()); mChangePasswordButton.setText(R.string.change_password); }); diff --git a/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java b/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java index b69cf637e..a1a1956bc 100644 --- a/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java +++ b/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java @@ -455,29 +455,23 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat if (!mInitMode && passwordChangedInMagicCreateMode()) { this.mSaveButton.setText(R.string.change_password); this.mSaveButton.setEnabled(true); - this.mSaveButton.setTextColor(getPrimaryTextColor()); } else if (accountInfoEdited && !mInitMode) { this.mSaveButton.setText(R.string.save); this.mSaveButton.setEnabled(true); - this.mSaveButton.setTextColor(getPrimaryTextColor()); } else if (mAccount != null && (mAccount.getStatus() == Account.State.CONNECTING || mAccount.getStatus() == Account.State.REGISTRATION_SUCCESSFUL || mFetchingAvatar)) { this.mSaveButton.setEnabled(false); - this.mSaveButton.setTextColor(getSecondaryTextColor()); this.mSaveButton.setText(R.string.account_status_connecting); } else if (mAccount != null && mAccount.getStatus() == Account.State.DISABLED && !mInitMode) { this.mSaveButton.setEnabled(true); - this.mSaveButton.setTextColor(getPrimaryTextColor()); this.mSaveButton.setText(R.string.enable); } else { this.mSaveButton.setEnabled(true); - this.mSaveButton.setTextColor(getPrimaryTextColor()); if (!mInitMode) { if (mAccount != null && mAccount.isOnlineAndConnected()) { this.mSaveButton.setText(R.string.save); if (!accountInfoEdited) { this.mSaveButton.setEnabled(false); - this.mSaveButton.setTextColor(getSecondaryTextColor()); } } else { XmppConnection connection = mAccount == null ? null : mAccount.getXmppConnection(); @@ -776,7 +770,6 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat if (Config.MAGIC_CREATE_DOMAIN == null && this.xmppConnectionService.getAccounts().size() == 0) { this.mCancelButton.setEnabled(false); - this.mCancelButton.setTextColor(getSecondaryTextColor()); } if (mUsernameMode) { this.binding.accountJid.setHint(R.string.username_hint); diff --git a/src/main/java/de/pixart/messenger/ui/PublishProfilePictureActivity.java b/src/main/java/de/pixart/messenger/ui/PublishProfilePictureActivity.java index 681aedc6e..1dd23a3de 100644 --- a/src/main/java/de/pixart/messenger/ui/PublishProfilePictureActivity.java +++ b/src/main/java/de/pixart/messenger/ui/PublishProfilePictureActivity.java @@ -291,7 +291,6 @@ public class PublishProfilePictureActivity extends XmppActivity implements XmppC final boolean status = enabled && !publishing; this.publishButton.setText(publishing ? R.string.publishing : res); this.publishButton.setEnabled(status); - this.publishButton.setTextColor(status ? getPrimaryTextColor() : getSecondaryTextColor()); } public void refreshUiReal() { diff --git a/src/main/java/de/pixart/messenger/ui/SetPresenceActivity.java b/src/main/java/de/pixart/messenger/ui/SetPresenceActivity.java index d4bddb534..383763402 100644 --- a/src/main/java/de/pixart/messenger/ui/SetPresenceActivity.java +++ b/src/main/java/de/pixart/messenger/ui/SetPresenceActivity.java @@ -157,7 +157,6 @@ public class SetPresenceActivity extends XmppActivity implements View.OnClickLis } boolean e = noAccountUsesPgp(); this.binding.allAccounts.setEnabled(e); - this.binding.allAccounts.setTextColor(e ? getPrimaryTextColor() : getSecondaryTextColor()); } redrawTemplates(); } diff --git a/src/main/java/de/pixart/messenger/ui/TrustKeysActivity.java b/src/main/java/de/pixart/messenger/ui/TrustKeysActivity.java index 751c51f09..5641fc171 100644 --- a/src/main/java/de/pixart/messenger/ui/TrustKeysActivity.java +++ b/src/main/java/de/pixart/messenger/ui/TrustKeysActivity.java @@ -415,12 +415,10 @@ public class TrustKeysActivity extends OmemoActivity implements OnKeyStatusUpdat private void unlock() { binding.saveButton.setEnabled(true); - binding.saveButton.setTextColor(getPrimaryTextColor()); } private void lock() { binding.saveButton.setEnabled(false); - binding.saveButton.setTextColor(getSecondaryTextColor()); } private void lockOrUnlockAsNeeded() { diff --git a/src/main/java/de/pixart/messenger/ui/VerifyOTRActivity.java b/src/main/java/de/pixart/messenger/ui/VerifyOTRActivity.java index 47e991520..83518fcda 100644 --- a/src/main/java/de/pixart/messenger/ui/VerifyOTRActivity.java +++ b/src/main/java/de/pixart/messenger/ui/VerifyOTRActivity.java @@ -378,14 +378,12 @@ public class VerifyOTRActivity extends XmppActivity implements XmppConnectionSer protected void activateButton(Button button, int text, View.OnClickListener listener) { button.setEnabled(true); - button.setTextColor(getPrimaryTextColor()); button.setText(text); button.setOnClickListener(listener); } protected void deactivateButton(Button button, int text) { button.setEnabled(false); - button.setTextColor(getSecondaryTextColor()); button.setText(text); button.setOnClickListener(null); } diff --git a/src/main/java/de/pixart/messenger/ui/XmppActivity.java b/src/main/java/de/pixart/messenger/ui/XmppActivity.java index 38d7086f4..d38563d04 100644 --- a/src/main/java/de/pixart/messenger/ui/XmppActivity.java +++ b/src/main/java/de/pixart/messenger/ui/XmppActivity.java @@ -95,9 +95,6 @@ public abstract class XmppActivity extends AppCompatActivity { public boolean xmppConnectionServiceBound = false; protected boolean registeredListeners = false; - protected int mPrimaryTextColor; - protected int mSecondaryTextColor; - protected int mTertiaryTextColor; protected int mPrimaryBackgroundColor; protected int mSecondaryBackgroundColor; protected int mColorRed; @@ -413,9 +410,6 @@ public abstract class XmppActivity extends AppCompatActivity { super.onCreate(savedInstanceState); metrics = getResources().getDisplayMetrics(); ExceptionHelper.init(getApplicationContext()); - mPrimaryTextColor = ContextCompat.getColor(this, R.color.black87); - mSecondaryTextColor = ContextCompat.getColor(this, R.color.black54); - mTertiaryTextColor = ContextCompat.getColor(this, R.color.black12); mColorRed = ContextCompat.getColor(this, R.color.red800); mColorWarningButton = ContextCompat.getColor(this, R.color.warning_button); mColorWhite = ContextCompat.getColor(this, R.color.white70); @@ -434,6 +428,11 @@ public abstract class XmppActivity extends AppCompatActivity { } } + // todo theme +// public boolean isDarkTheme() { +// return this.mTheme == R.style.ConversationsTheme_Dark; +// } + public int getThemeResource(int r_attr_name, int r_drawable_def) { int[] attrs = { r_attr_name }; TypedArray ta = this.getTheme().obtainStyledAttributes(attrs); @@ -906,14 +905,6 @@ public abstract class XmppActivity extends AppCompatActivity { } } - public int getSecondaryTextColor() { - return this.mSecondaryTextColor; - } - - public int getPrimaryTextColor() { - return this.mPrimaryTextColor; - } - public int getWarningTextColor() { return this.mColorRed; } @@ -1010,6 +1001,7 @@ public abstract class XmppActivity extends AppCompatActivity { } protected int findTheme() { + Boolean dark = getPreferences().getString(SettingsActivity.THEME, getResources().getString(R.string.theme)).equals("dark"); Boolean larger = getPreferences().getBoolean("use_larger_font", getResources().getBoolean(R.bool.use_larger_font)); if (larger) { diff --git a/src/main/res/layout/activity_change_password.xml b/src/main/res/layout/activity_change_password.xml index 55cd7dd53..af1dcd271 100644 --- a/src/main/res/layout/activity_change_password.xml +++ b/src/main/res/layout/activity_change_password.xml @@ -31,7 +31,7 @@ android:layout_height="wrap_content" app:passwordToggleDrawable="@drawable/visibility_toggle_drawable" app:passwordToggleEnabled="true" - app:passwordToggleTint="?attr/color_text_secondary"> + app:passwordToggleTint="?android:textColorSecondary"> <android.support.design.widget.TextInputEditText android:id="@+id/current_password" @@ -48,7 +48,7 @@ android:layout_height="wrap_content" app:passwordToggleDrawable="@drawable/visibility_toggle_drawable" app:passwordToggleEnabled="true" - app:passwordToggleTint="?attr/color_text_secondary"> + app:passwordToggleTint="?android:textColorSecondary"> <android.support.design.widget.TextInputEditText android:id="@+id/new_password" diff --git a/src/main/res/layout/activity_contact_details.xml b/src/main/res/layout/activity_contact_details.xml index 4075476f9..88797b14a 100644 --- a/src/main/res/layout/activity_contact_details.xml +++ b/src/main/res/layout/activity_contact_details.xml @@ -112,7 +112,6 @@ android:layout_marginBottom="4dp" android:layout_marginTop="4dp" android:gravity="center_horizontal" - android:textColor="?attr/color_text_primary" android:textSize="?attr/TextSizeBody" android:textStyle="italic" /> diff --git a/src/main/res/layout/activity_edit_account.xml b/src/main/res/layout/activity_edit_account.xml index 687db3cea..90dd1b194 100644 --- a/src/main/res/layout/activity_edit_account.xml +++ b/src/main/res/layout/activity_edit_account.xml @@ -73,7 +73,7 @@ android:layout_height="wrap_content" app:passwordToggleDrawable="@drawable/visibility_toggle_drawable" app:passwordToggleEnabled="true" - app:passwordToggleTint="?attr/color_text_secondary"> + app:passwordToggleTint="?android:textColorSecondary"> <android.support.design.widget.TextInputEditText android:id="@+id/account_password" @@ -646,15 +646,13 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" - android:text="@string/cancel" - android:textColor="?attr/color_text_primary" /> + android:text="@string/cancel" /> <View android:layout_width="1dp" android:layout_height="fill_parent" android:layout_marginBottom="7dp" - android:layout_marginTop="7dp" - android:background="?attr/color_text_primary" /> + android:layout_marginTop="7dp" /> <Button android:id="@+id/save_button" @@ -663,8 +661,7 @@ android:layout_height="wrap_content" android:layout_weight="1" android:enabled="false" - android:text="@string/save" - android:textColor="?attr/color_text_primary" /> + android:text="@string/save" /> </LinearLayout> </RelativeLayout> </layout>
\ No newline at end of file diff --git a/src/main/res/layout/activity_publish_profile_picture.xml b/src/main/res/layout/activity_publish_profile_picture.xml index 1df224831..e0b33929d 100644 --- a/src/main/res/layout/activity_publish_profile_picture.xml +++ b/src/main/res/layout/activity_publish_profile_picture.xml @@ -82,8 +82,7 @@ android:layout_marginTop="8dp" android:minLines="3" android:textAlignment="center" - android:textAppearance="@style/TextAppearance.AppCompat.Body1" - android:textColor="?attr/color_text_primary" /> + android:textAppearance="@style/TextAppearance.AppCompat.Body1" /> </LinearLayout> </android.support.v7.widget.CardView> @@ -103,15 +102,13 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" - android:text="@string/cancel" - android:textColor="@color/black87" /> + android:text="@string/cancel" /> <View android:layout_width="1dp" android:layout_height="match_parent" android:layout_marginBottom="7dp" - android:layout_marginTop="7dp" - android:background="?attr/color_text_primary" /> + android:layout_marginTop="7dp" /> <Button android:id="@+id/publish_button" @@ -120,8 +117,7 @@ android:layout_height="wrap_content" android:layout_weight="1" android:enabled="false" - android:text="@string/publish" - android:textColor="?attr/color_text_primary" /> + android:text="@string/publish" /> </LinearLayout> </RelativeLayout> diff --git a/src/main/res/layout/activity_trust_keys.xml b/src/main/res/layout/activity_trust_keys.xml index 7f84491e0..f52d0fe99 100644 --- a/src/main/res/layout/activity_trust_keys.xml +++ b/src/main/res/layout/activity_trust_keys.xml @@ -110,8 +110,7 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" - android:text="@string/cancel" - android:textColor="?attr/color_text_primary" /> + android:text="@string/cancel" /> <View android:layout_width="1dp" @@ -127,8 +126,7 @@ android:layout_height="wrap_content" android:layout_weight="1" android:enabled="true" - android:text="@string/done" - android:textColor="?attr/color_text_secondary" /> + android:text="@string/done" /> </LinearLayout> </RelativeLayout> </layout>
\ No newline at end of file diff --git a/src/main/res/values/attrs.xml b/src/main/res/values/attrs.xml index f9bdae03a..4707136cb 100644 --- a/src/main/res/values/attrs.xml +++ b/src/main/res/values/attrs.xml @@ -11,9 +11,6 @@ <attr name="color_background_primary" format="reference|color" /> <attr name="color_warning" format="reference|color"/> - <attr name="color_text_primary" format="reference|color" /> - <attr name="color_text_secondary" format="reference|color" /> - <attr name="icon_add_group" format="reference" /> <attr name="icon_add_person" format="reference" /> <attr name="icon_cancel" format="reference" /> diff --git a/src/main/res/values/themes.xml b/src/main/res/values/themes.xml index 4db3ae107..8a7113b16 100644 --- a/src/main/res/values/themes.xml +++ b/src/main/res/values/themes.xml @@ -6,9 +6,6 @@ <item name="colorPrimaryDark">@color/primary_dark</item> <item name="colorAccent">@color/accent</item> - <item name="color_text_primary">@color/black87</item> - <item name="color_text_secondary">@color/black54</item> - <item name="color_background_primary">@color/grey50</item> <item name="color_background_secondary">@color/grey200</item> |