summaryrefslogtreecommitdiff
path: root/app/src/main/java/se/leap/bitmaskclient/views/IconSwitchEntry.java
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2019-09-19 22:41:30 +0200
committercyBerta <cyberta@riseup.net>2019-09-19 22:42:16 +0200
commit9044c3fdc13f02b7c21bb181d769fadb71924b75 (patch)
tree07006ecd2b4a8a3628678ad934901d5b53e3594b /app/src/main/java/se/leap/bitmaskclient/views/IconSwitchEntry.java
parenta49be8cf197af87e68aae263d31b3448f8ce379a (diff)
add subtitles to navigation drawer items - better explanation for PT
Diffstat (limited to 'app/src/main/java/se/leap/bitmaskclient/views/IconSwitchEntry.java')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/views/IconSwitchEntry.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/views/IconSwitchEntry.java b/app/src/main/java/se/leap/bitmaskclient/views/IconSwitchEntry.java
index 82e02a6e..02347b05 100644
--- a/app/src/main/java/se/leap/bitmaskclient/views/IconSwitchEntry.java
+++ b/app/src/main/java/se/leap/bitmaskclient/views/IconSwitchEntry.java
@@ -21,6 +21,7 @@ import se.leap.bitmaskclient.R;
public class IconSwitchEntry extends LinearLayout {
private TextView textView;
+ private TextView subtitleView;
private ImageView iconView;
private SwitchCompat switchView;
private CompoundButton.OnCheckedChangeListener checkedChangeListener;
@@ -51,6 +52,7 @@ public class IconSwitchEntry extends LinearLayout {
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View rootview = inflater.inflate(R.layout.v_switch_list_item, this, true);
textView = rootview.findViewById(android.R.id.text1);
+ subtitleView = rootview.findViewById(R.id.subtitle);
iconView = rootview.findViewById(R.id.material_icon);
switchView = rootview.findViewById(R.id.option_switch);
@@ -62,6 +64,12 @@ public class IconSwitchEntry extends LinearLayout {
textView.setText(entryText);
}
+ String subtitle = typedArray.getString(R.styleable.IconTextEntry_subtitle);
+ if (subtitle != null) {
+ subtitleView.setText(subtitle);
+ subtitleView.setVisibility(VISIBLE);
+ }
+
Drawable drawable = typedArray.getDrawable(R.styleable.IconTextEntry_icon);
if (drawable != null) {
iconView.setImageDrawable(drawable);