fix building

This commit is contained in:
adbenitez 2024-06-12 02:17:10 +02:00
parent 2ca581495e
commit fee58e6eac
415 changed files with 122 additions and 108 deletions

View file

@ -0,0 +1,41 @@
package org.thoughtcrime.securesms;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.core.content.ContextCompat;
import org.thoughtcrime.securesms.util.ResUtil;
public class ProfileSettingsItem extends LinearLayout {
private TextView labelView;
public ProfileSettingsItem(Context context) {
super(context);
}
public ProfileSettingsItem(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
protected void onFinishInflate() {
super.onFinishInflate();
labelView = findViewById(R.id.label);
}
public void set(String label, int labelColor, int iconLeft) {
labelView.setText(label==null? "" : label);
labelView.setCompoundDrawablesWithIntrinsicBounds(iconLeft, 0,0,0);
// we need different color getters as `labelColor` is `R.color.name` while default is `R.attr.name`
if (labelColor != 0) {
labelView.setTextColor(ContextCompat.getColor(getContext(), labelColor));
} else {
labelView.setTextColor(ResUtil.getColor(getContext(), R.attr.emoji_text_color));
}
}
}