From ff5188d7de1df36c5d71d309a08d290560e9d337 Mon Sep 17 00:00:00 2001 From: cyBerta Date: Mon, 22 Mar 2021 18:49:19 +0100 Subject: initial draft for gateway selection on Android --- .../bitmaskclient/base/views/IconSwitchEntry.java | 27 +++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'app/src/main/java/se/leap/bitmaskclient/base/views') diff --git a/app/src/main/java/se/leap/bitmaskclient/base/views/IconSwitchEntry.java b/app/src/main/java/se/leap/bitmaskclient/base/views/IconSwitchEntry.java index 1160986e..628b4c15 100644 --- a/app/src/main/java/se/leap/bitmaskclient/base/views/IconSwitchEntry.java +++ b/app/src/main/java/se/leap/bitmaskclient/base/views/IconSwitchEntry.java @@ -1,3 +1,19 @@ +/** + * Copyright (c) 2021 LEAP Encryption Access Project and contributors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package se.leap.bitmaskclient.base.views; import android.annotation.TargetApi; @@ -51,7 +67,7 @@ public class IconSwitchEntry extends LinearLayout { LayoutInflater inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); View rootview = inflater.inflate(R.layout.v_switch_list_item, this, true); - textView = rootview.findViewById(android.R.id.text1); + textView = rootview.findViewById(R.id.title); subtitleView = rootview.findViewById(R.id.subtitle); iconView = rootview.findViewById(R.id.material_icon); switchView = rootview.findViewById(R.id.option_switch); @@ -88,6 +104,15 @@ public class IconSwitchEntry extends LinearLayout { textView.setText(id); } + public void setSubtitle(CharSequence text) { + subtitleView.setText(text); + } + + public void setSingleLine(boolean singleLine) { + textView.setSingleLine(singleLine); + subtitleView.setSingleLine(singleLine); + } + public void showSubtitle(boolean show) { subtitleView.setVisibility(show ? VISIBLE : GONE); } -- cgit v1.2.3