mirror of
https://github.com/deltachat/deltachat-android.git
synced 2025-10-03 09:49:21 +02:00
fix building
This commit is contained in:
parent
2ca581495e
commit
fee58e6eac
415 changed files with 122 additions and 108 deletions
|
@ -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));
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue