diff options
Diffstat (limited to 'app/src/main/java/se/leap')
10 files changed, 45 insertions, 39 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/base/fragments/AboutFragment.java b/app/src/main/java/se/leap/bitmaskclient/base/fragments/AboutFragment.java index c269c872..dbdd008a 100644 --- a/app/src/main/java/se/leap/bitmaskclient/base/fragments/AboutFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/base/fragments/AboutFragment.java @@ -6,8 +6,8 @@ import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.widget.TextView; +import androidx.appcompat.widget.AppCompatTextView; import androidx.fragment.app.Fragment; import butterknife.BindView; @@ -25,10 +25,10 @@ public class AboutFragment extends Fragment { private Unbinder unbinder; @BindView(R.id.version) - TextView versionTextView; + AppCompatTextView versionTextView; @BindView(R.id.terms_of_service) - TextView termsOfService; + AppCompatTextView termsOfService; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { diff --git a/app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java b/app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java index b2e91fd5..11cab7e5 100644 --- a/app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/base/fragments/EipFragment.java @@ -491,7 +491,7 @@ public class EipFragment extends Fragment implements Observer { View layout = inflater.inflate(R.layout.custom_toast, activity.findViewById(R.id.custom_toast_container)); - TextView text = layout.findViewById(R.id.text); + AppCompatTextView text = layout.findViewById(R.id.text); text.setText(message); Vibrator v = (Vibrator) activity.getSystemService(Context.VIBRATOR_SERVICE); diff --git a/app/src/main/java/se/leap/bitmaskclient/base/fragments/ExcludeAppsFragment.java b/app/src/main/java/se/leap/bitmaskclient/base/fragments/ExcludeAppsFragment.java index 18000171..db5057cc 100644 --- a/app/src/main/java/se/leap/bitmaskclient/base/fragments/ExcludeAppsFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/base/fragments/ExcludeAppsFragment.java @@ -11,7 +11,6 @@ import android.content.Context; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.os.Bundle; -import androidx.fragment.app.Fragment; import android.text.TextUtils; import android.util.Log; import android.view.LayoutInflater; @@ -27,7 +26,9 @@ import android.widget.Filterable; import android.widget.ImageView; import android.widget.ListView; import android.widget.SearchView; -import android.widget.TextView; + +import androidx.appcompat.widget.AppCompatTextView; +import androidx.fragment.app.Fragment; import java.util.Collections; import java.util.List; @@ -77,10 +78,10 @@ public class ExcludeAppsFragment extends Fragment implements AdapterView.OnItemC static class AppViewHolder { public ApplicationInfo mInfo; public View rootView; - public TextView appName; + public AppCompatTextView appName; public ImageView appIcon; - //public TextView appSize; - //public TextView disabled; + //public AppCompatTextView appSize; + //public AppCompatTextView disabled; public CompoundButton checkBox; static public AppViewHolder createOrRecycle(LayoutInflater inflater, View convertView, ViewGroup parent) { diff --git a/app/src/main/java/se/leap/bitmaskclient/base/fragments/LogFragment.java b/app/src/main/java/se/leap/bitmaskclient/base/fragments/LogFragment.java index d788b9e6..a5a5e555 100644 --- a/app/src/main/java/se/leap/bitmaskclient/base/fragments/LogFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/base/fragments/LogFragment.java @@ -19,8 +19,6 @@ import android.os.Handler; import android.os.Handler.Callback; import android.os.Message; import android.preference.PreferenceManager; -import androidx.annotation.Nullable; -import androidx.fragment.app.ListFragment; import android.text.SpannableString; import android.text.format.DateFormat; import android.view.LayoutInflater; @@ -37,9 +35,12 @@ import android.widget.ListAdapter; import android.widget.ListView; import android.widget.RadioGroup; import android.widget.SeekBar; -import android.widget.TextView; import android.widget.Toast; +import androidx.annotation.Nullable; +import androidx.appcompat.widget.AppCompatTextView; +import androidx.fragment.app.ListFragment; + import java.text.SimpleDateFormat; import java.util.Collections; import java.util.Date; @@ -55,8 +56,8 @@ import de.blinkt.openvpn.core.Preferences; import de.blinkt.openvpn.core.VpnStatus; import de.blinkt.openvpn.core.VpnStatus.LogListener; import de.blinkt.openvpn.core.VpnStatus.StateListener; -import se.leap.bitmaskclient.base.models.Constants; import se.leap.bitmaskclient.R; +import se.leap.bitmaskclient.base.models.Constants; import static de.blinkt.openvpn.core.OpenVPNService.humanReadableByteCount; @@ -70,9 +71,9 @@ public class LogFragment extends ListFragment implements StateListener, SeekBar. private SeekBar mLogLevelSlider; private LinearLayout mOptionsLayout; private RadioGroup mTimeRadioGroup; - private TextView mUpStatus; - private TextView mDownStatus; - private TextView mConnectStatus; + private AppCompatTextView mUpStatus; + private AppCompatTextView mDownStatus; + private AppCompatTextView mConnectStatus; private boolean mShowOptionsLayout; private CheckBox mClearLogCheckBox; @@ -219,11 +220,11 @@ public class LogFragment extends ListFragment implements StateListener, SeekBar. @Override public View getView(int position, View convertView, ViewGroup parent) { - TextView v; + AppCompatTextView v; if (convertView == null) - v = new TextView(getActivity()); + v = new AppCompatTextView(getActivity()); else - v = (TextView) convertView; + v = (AppCompatTextView) convertView; LogItem le = currentLevelEntries.get(position); String msg = le.getString(getActivity()); @@ -380,7 +381,7 @@ public class LogFragment extends ListFragment implements StateListener, SeekBar. private LogWindowListAdapter ladapter; - private TextView mSpeedView; + private AppCompatTextView mSpeedView; @Override @@ -474,7 +475,7 @@ public class LogFragment extends ListFragment implements StateListener, SeekBar. int position, long id) { ClipboardManager clipboard = (ClipboardManager) getActivity().getSystemService(Context.CLIPBOARD_SERVICE); - ClipData clip = ClipData.newPlainText("Log Entry", ((TextView) view).getText()); + ClipData clip = ClipData.newPlainText("Log Entry", ((AppCompatTextView) view).getText()); clipboard.setPrimaryClip(clip); Toast.makeText(getActivity(), R.string.copied_entry, Toast.LENGTH_SHORT).show(); return true; diff --git a/app/src/main/java/se/leap/bitmaskclient/base/fragments/NavigationDrawerFragment.java b/app/src/main/java/se/leap/bitmaskclient/base/fragments/NavigationDrawerFragment.java index 1f4d0b17..020a48a4 100644 --- a/app/src/main/java/se/leap/bitmaskclient/base/fragments/NavigationDrawerFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/base/fragments/NavigationDrawerFragment.java @@ -27,6 +27,7 @@ import android.os.Bundle; import android.os.Handler; import androidx.annotation.NonNull; import androidx.annotation.StringRes; +import androidx.appcompat.widget.AppCompatTextView; import androidx.fragment.app.DialogFragment; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentTransaction; @@ -380,7 +381,7 @@ public class NavigationDrawerFragment extends Fragment implements SharedPreferen } private void initShowExperimentalHint() { - TextView textView = drawerLayout.findViewById(R.id.show_experimental_features); + AppCompatTextView textView = drawerLayout.findViewById(R.id.show_experimental_features); textView.setText(showExperimentalFeatures(getContext()) ? R.string.hide_experimental : R.string.show_experimental); textView.setOnClickListener(v -> { boolean shown = showExperimentalFeatures(getContext()); @@ -388,12 +389,12 @@ public class NavigationDrawerFragment extends Fragment implements SharedPreferen tethering.setVisibility(GONE); firewall.setVisibility(GONE); experimentalFeatureFooter.setVisibility(GONE); - ((TextView) v).setText(R.string.show_experimental); + ((AppCompatTextView) v).setText(R.string.show_experimental); } else { tethering.setVisibility(VISIBLE); firewall.setVisibility(VISIBLE); experimentalFeatureFooter.setVisibility(VISIBLE); - ((TextView) v).setText(R.string.hide_experimental); + ((AppCompatTextView) v).setText(R.string.hide_experimental); } PreferenceHelper.setShowExperimentalFeatures(getContext(), !shown); }); diff --git a/app/src/main/java/se/leap/bitmaskclient/base/views/IconCheckboxEntry.java b/app/src/main/java/se/leap/bitmaskclient/base/views/IconCheckboxEntry.java index 977056f7..0957712b 100644 --- a/app/src/main/java/se/leap/bitmaskclient/base/views/IconCheckboxEntry.java +++ b/app/src/main/java/se/leap/bitmaskclient/base/views/IconCheckboxEntry.java @@ -7,10 +7,10 @@ import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.View; import android.widget.LinearLayout; -import android.widget.TextView; import androidx.annotation.Nullable; import androidx.appcompat.widget.AppCompatImageView; +import androidx.appcompat.widget.AppCompatTextView; import androidx.core.content.ContextCompat; import androidx.core.graphics.drawable.DrawableCompat; @@ -23,7 +23,7 @@ import se.leap.bitmaskclient.base.fragments.TetheringDialog; public class IconCheckboxEntry extends LinearLayout { @BindView(android.R.id.text1) - TextView textView; + AppCompatTextView textView; @BindView(R.id.material_icon) AppCompatImageView iconView; 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 b6d72ab6..a499cdd1 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 @@ -24,6 +24,7 @@ import androidx.annotation.DrawableRes; import androidx.annotation.Nullable; import androidx.annotation.StringRes; import androidx.appcompat.widget.AppCompatImageView; +import androidx.appcompat.widget.AppCompatTextView; import androidx.appcompat.widget.SwitchCompat; import android.util.AttributeSet; import android.view.LayoutInflater; @@ -36,8 +37,8 @@ import se.leap.bitmaskclient.R; public class IconSwitchEntry extends LinearLayout { - private TextView textView; - private TextView subtitleView; + private AppCompatTextView textView; + private AppCompatTextView subtitleView; private AppCompatImageView iconView; private SwitchCompat switchView; private CompoundButton.OnCheckedChangeListener checkedChangeListener; diff --git a/app/src/main/java/se/leap/bitmaskclient/base/views/IconTextEntry.java b/app/src/main/java/se/leap/bitmaskclient/base/views/IconTextEntry.java index 6b9bd760..2d9525ed 100644 --- a/app/src/main/java/se/leap/bitmaskclient/base/views/IconTextEntry.java +++ b/app/src/main/java/se/leap/bitmaskclient/base/views/IconTextEntry.java @@ -4,25 +4,26 @@ import android.annotation.TargetApi; import android.content.Context; import android.content.res.TypedArray; import android.graphics.drawable.Drawable; -import androidx.annotation.ColorRes; -import androidx.annotation.DrawableRes; -import androidx.annotation.Nullable; -import androidx.annotation.StringRes; import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.View; import android.widget.ImageView; import android.widget.LinearLayout; -import android.widget.TextView; + +import androidx.annotation.ColorRes; +import androidx.annotation.DrawableRes; +import androidx.annotation.Nullable; +import androidx.annotation.StringRes; +import androidx.appcompat.widget.AppCompatTextView; import se.leap.bitmaskclient.R; public class IconTextEntry extends LinearLayout { - private TextView textView; + private AppCompatTextView textView; private ImageView iconView; - private TextView subtitleView; + private AppCompatTextView subtitleView; public IconTextEntry(Context context) { super(context); diff --git a/app/src/main/java/se/leap/bitmaskclient/providersetup/ProviderRenderer.java b/app/src/main/java/se/leap/bitmaskclient/providersetup/ProviderRenderer.java index 339199e0..8aba4941 100644 --- a/app/src/main/java/se/leap/bitmaskclient/providersetup/ProviderRenderer.java +++ b/app/src/main/java/se/leap/bitmaskclient/providersetup/ProviderRenderer.java @@ -4,7 +4,8 @@ import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.widget.TextView; + +import androidx.appcompat.widget.AppCompatTextView; import com.pedrogomez.renderers.Renderer; @@ -20,9 +21,9 @@ public class ProviderRenderer extends Renderer<Provider> { private final Context context; @BindView(R.id.provider_name) - TextView name; + AppCompatTextView name; @BindView(R.id.provider_domain) - TextView domain; + AppCompatTextView domain; public ProviderRenderer(Context context) { this.context = context; diff --git a/app/src/main/java/se/leap/bitmaskclient/providersetup/activities/AbstractProviderDetailActivity.java b/app/src/main/java/se/leap/bitmaskclient/providersetup/activities/AbstractProviderDetailActivity.java index ba84ed9a..66999580 100644 --- a/app/src/main/java/se/leap/bitmaskclient/providersetup/activities/AbstractProviderDetailActivity.java +++ b/app/src/main/java/se/leap/bitmaskclient/providersetup/activities/AbstractProviderDetailActivity.java @@ -62,7 +62,7 @@ public abstract class AbstractProviderDetailActivity extends ConfigWizardBaseAct optionsList.toArray(new String[optionsList.size()]) )); options.setOnItemClickListener((parent, view, position, id) -> { - String text = ((TextView) view).getText().toString(); + String text = ((AppCompatTextView) view).getText().toString(); Intent intent; if (text.equals(getString(R.string.login_to_profile))) { Log.d(TAG, "login selected"); |