import net.ktnx.mobileledger.ui.CurrencySelectorFragment;
import net.ktnx.mobileledger.ui.DatePickerFragment;
import net.ktnx.mobileledger.ui.TextViewClearHelper;
-import net.ktnx.mobileledger.utils.Colors;
import net.ktnx.mobileledger.utils.DimensionUtils;
import net.ktnx.mobileledger.utils.Logger;
import net.ktnx.mobileledger.utils.MLDB;
}
}
private void setCurrencyString(String currency) {
+ @ColorInt int textColor = tvDummy.getTextColors()
+ .getDefaultColor();
if ((currency == null) || currency.isEmpty()) {
tvCurrency.setText(R.string.currency_symbol);
- tvCurrency.setTextColor(0x7f000000 + (0x00ffffff & Colors.defaultTextColor));
+ int alpha = (textColor >> 24) & 0xff;
+ alpha = alpha * 3 / 4;
+ tvCurrency.setTextColor((alpha << 24) | (0x00ffffff & textColor));
}
else {
tvCurrency.setText(currency);
- tvCurrency.setTextColor(Colors.defaultTextColor);
+ tvCurrency.setTextColor(textColor);
}
}
private void setCurrency(Currency currency) {
import android.widget.LinearLayout;
import android.widget.TextView;
+import androidx.annotation.ColorInt;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
// the accounts remain with their default text (set in the layout resource)
holder.tableAccounts.addView(row);
}
+ TextView dummyText = row.findViewById(R.id.dummy_text);
TextView accName = row.findViewById(R.id.transaction_list_acc_row_acc_name);
TextView accComment =
row.findViewById(R.id.transaction_list_acc_row_acc_comment);
accName.setText(ss);
}
else {
- accName.setTextColor(Colors.defaultTextColor);
- accAmount.setTextColor(Colors.defaultTextColor);
+ @ColorInt int textColor = dummyText.getTextColors()
+ .getDefaultColor();
+ accName.setTextColor(textColor);
+ accAmount.setTextColor(textColor);
accName.setText(acc.getAccountName());
}
@ColorInt
public static int tableRowDarkBG;
@ColorInt
- public static int primary, defaultTextColor, defaultTextColorDisabled;
+ public static int primary;
public static int profileThemeId = -1;
public static MutableLiveData<Integer> themeWatch = new MutableLiveData<>(0);
public static int errorTextColor;
tableRowLightBG = tv.data;
theme.resolveAttribute(R.attr.colorPrimary, tv, true);
primary = tv.data;
- theme.resolveAttribute(R.attr.textColor, tv, true);
- defaultTextColor = tv.data;
- defaultTextColorDisabled = 0x7f000000 | 0x00ffffff & defaultTextColor;
theme.resolveAttribute(R.attr.colorAccent, tv, true);
accent = tv.data;
theme.resolveAttribute(R.attr.errorTextColor, tv, true);
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="5"
- android:orientation="vertical">
+ android:orientation="vertical"
+ >
+ <TextView
+ android:id="@+id/dummy_text"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:visibility="gone"
+ />
<TextView
android:id="@+id/transaction_list_acc_row_acc_name"