finished app compat themeing

This commit is contained in:
Daniel Gultsch 2018-03-02 17:09:00 +01:00
parent e5704f4cbd
commit 57bcf824e9
19 changed files with 16 additions and 94 deletions

View file

@ -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);
}
}
@ -97,7 +96,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);
});

View file

@ -447,29 +447,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();
@ -750,7 +744,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);

View file

@ -292,7 +292,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() {

View file

@ -163,7 +163,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();
}

View file

@ -421,12 +421,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() {

View file

@ -85,9 +85,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;
@ -414,9 +411,6 @@ public abstract class XmppActivity extends AppCompatActivity {
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);
mColorOrange = ContextCompat.getColor(this, R.color.orange500);
mColorGreen = ContextCompat.getColor(this, R.color.green500);
@ -426,9 +420,6 @@ public abstract class XmppActivity extends AppCompatActivity {
this.mTheme = findTheme();
if (isDarkTheme()) {
mPrimaryTextColor = ContextCompat.getColor(this, R.color.white);
mSecondaryTextColor = ContextCompat.getColor(this, R.color.white70);
mTertiaryTextColor = ContextCompat.getColor(this, R.color.white12);
mPrimaryBackgroundColor = ContextCompat.getColor(this, R.color.grey800);
mSecondaryBackgroundColor = ContextCompat.getColor(this, R.color.grey900);
}
@ -443,7 +434,7 @@ public abstract class XmppActivity extends AppCompatActivity {
}
public boolean isDarkTheme() {
return this.mTheme == R.style.ConversationsTheme_Dark || this.mTheme == R.style.ConversationsTheme_Dark_LargerText;
return this.mTheme == R.style.ConversationsTheme_Dark;
}
public int getThemeResource(int r_attr_name, int r_drawable_def) {
@ -778,14 +769,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;
}
@ -859,18 +842,11 @@ 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 (dark) {
if (larger)
return R.style.ConversationsTheme_Dark_LargerText;
else
return R.style.ConversationsTheme_Dark;
return R.style.ConversationsTheme_Dark;
} else {
if (larger)
return R.style.ConversationsTheme_LargerText;
else
return R.style.ConversationsTheme;
return R.style.ConversationsTheme;
}
}

View file

@ -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"

View file

@ -71,7 +71,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"
@ -604,8 +604,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"
@ -621,8 +620,7 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:enabled="false"
android:text="@string/save"
android:textColor="?attr/color_text_secondary"/>
android:text="@string/save"/>
</LinearLayout>
</RelativeLayout>

View file

@ -71,8 +71,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"
@ -88,8 +87,7 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:enabled="false"
android:text="@string/publish"
android:textColor="?attr/color_text_secondary"/>
android:text="@string/publish"/>
</LinearLayout>
</RelativeLayout>

View file

@ -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>

View file

@ -17,7 +17,6 @@
android:layout_marginTop="8dp"
android:id="@+id/report_spam"
android:layout_width="wrap_content"
android:textColor="?attr/color_text_primary"
android:layout_height="wrap_content"
android:text="@string/report_jid_as_spammer" />

View file

@ -18,7 +18,6 @@
<CheckBox
android:id="@+id/end_conversation_checkbox"
android:layout_width="wrap_content"
android:textColor="?attr/color_text_primary"
android:layout_height="wrap_content"
android:checked="true"
android:text="@string/also_end_conversation" />

View file

@ -47,8 +47,7 @@
android:paddingBottom="12dp"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:paddingTop="12dp"
android:textColor="?attr/color_text_primary">
android:paddingTop="12dp">
<requestFocus/>
</eu.siacs.conversations.ui.widget.EditMessage>

View file

@ -80,7 +80,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:textColor="?attr/color_text_secondary"
android:textColor="?android:textColorSecondary"
android:textSize="@dimen/fineprint_size"
android:maxLines="1"
android:text="@string/free_for_six_month"

View file

@ -50,7 +50,7 @@
android:layout_height="wrap_content"
android:layout_gravity="right"
android:text="@string/use_own_provider"
android:textColor="?attr/color_text_secondary"/>
android:textColor="?android:textColorSecondary"/>
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
@ -73,7 +73,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:textColor="?attr/color_text_secondary"
android:textColor="?android:attr/textColorSecondary"
android:textSize="@dimen/fineprint_size"
android:maxLines="1"
android:text="@string/free_for_six_month"

View file

@ -2,14 +2,10 @@
<resources>
<attr name="TextSizeInfo" format="dimension" />
<attr name="TextSizeBody" format="dimension" />
<attr name="TextSeparation" format="dimension"/>
<attr name="IconSize" format="dimension"/>
<attr name="color_text_primary" format="reference|color" />
<attr name="color_text_secondary" format="reference|color" />
<attr name="color_background_secondary" format="reference|color" />
<attr name="color_background_primary" format="reference|color" />

View file

@ -283,8 +283,6 @@
<string name="title_pref_quiet_hours_end_time">End time</string>
<string name="title_pref_enable_quiet_hours">Enable quiet hours</string>
<string name="pref_quiet_hours_summary">Notifications will be silenced during quiet hours</string>
<string name="pref_use_larger_font">Increase font size</string>
<string name="pref_use_larger_font_summary">Use larger font sizes across the entire app</string>
<string name="pref_use_send_button_to_indicate_status">Send button indicates status</string>
<string name="pref_use_indicate_received">Request message receipts</string>
<string name="pref_use_indicate_received_summary">Received messages will be marked with a green tick if supported</string>

View file

@ -6,9 +6,6 @@
<item name="colorPrimaryDark">@color/primary700</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>
@ -16,7 +13,6 @@
<item name="android:actionModeBackground">@color/accent</item>
<item name="TextSizeInfo">12sp</item>
<item name="TextSizeBody">14sp</item>
<item name="TextSeparation">5sp</item>
<item name="IconSize">18sp</item>
@ -85,8 +81,6 @@
<item name="colorPrimaryDark">@color/primary900</item>
<item name="colorAccent">@color/accent</item>
<item name="color_text_primary">@color/white</item>
<item name="color_text_secondary">@color/white70</item>
<item name="color_background_primary">@color/grey800</item>
<item name="color_background_secondary">@color/grey900</item>
@ -95,7 +89,6 @@
<item name="android:actionModeBackground">@color/accent</item>
<item name="TextSizeInfo">12sp</item>
<item name="TextSizeBody">14sp</item>
<item name="TextSeparation">5sp</item>
<item name="IconSize">18sp</item>
@ -159,20 +152,6 @@
<item type="reference" name="icon_enable_undecided_device">@drawable/ic_new_releases_white_24dp</item>
</style>
<style name="ConversationsTheme.LargerText" parent="ConversationsTheme">
<item name="TextSizeInfo">14sp</item>
<item name="TextSizeBody">16sp</item>
<item name="TextSeparation">6sp</item>
<item name="IconSize">20sp</item>
</style>
<style name="ConversationsTheme.Dark.LargerText" parent="ConversationsTheme.Dark">
<item name="TextSizeInfo">14sp</item>
<item name="TextSizeBody">16sp</item>
<item name="IconSize">20sp</item>
<item name="TextSeparation">6sp</item>
</style>
<style name="ConversationsTheme.FullScreen" parent="@style/Theme.AppCompat.Light">
<item name="android:windowNoTitle">true</item>
<item name="android:windowActionBar">false</item>

View file

@ -149,11 +149,6 @@
android:key="use_green_background"
android:summary="@string/pref_use_green_background_summary"
android:title="@string/pref_use_green_background"/>
<CheckBoxPreference
android:defaultValue="@bool/use_larger_font"
android:key="use_larger_font"
android:summary="@string/pref_use_larger_font_summary"
android:title="@string/pref_use_larger_font"/>
<CheckBoxPreference
android:defaultValue="@bool/send_button_status"
android:key="send_button_status"