From 4c1fad5c0c5dba5352956f615298dcd0f93ff13e Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Tue, 11 Aug 2015 15:53:02 +0200 Subject: Fix lint warning, fix fab in config converter --- .../java/de/blinkt/openvpn/activities/ConfigConverter.java | 6 ++++-- .../java/de/blinkt/openvpn/activities/MainActivity.java | 7 +++++-- main/src/main/java/de/blinkt/openvpn/core/VpnStatus.java | 1 + main/src/main/res/layout-v21/save_fab.xml | 2 +- main/src/main/res/layout-v21/share_fab.xml | 1 + main/src/main/res/layout/config_converter.xml | 13 +++++++++---- 6 files changed, 21 insertions(+), 9 deletions(-) diff --git a/main/src/main/java/de/blinkt/openvpn/activities/ConfigConverter.java b/main/src/main/java/de/blinkt/openvpn/activities/ConfigConverter.java index a6b97bb5..1eaca6c5 100644 --- a/main/src/main/java/de/blinkt/openvpn/activities/ConfigConverter.java +++ b/main/src/main/java/de/blinkt/openvpn/activities/ConfigConverter.java @@ -527,8 +527,10 @@ public class ConfigConverter extends Activity implements FileSelectCallback, Vie super.onCreate(savedInstanceState); ImageButton fab_button = (ImageButton) findViewById(R.id.fab_save); - if (fab_button != null) + if (fab_button != null) { fab_button.setOnClickListener(this); + findViewById(R.id.fab_footerspace).setVisibility(View.VISIBLE); + } if (savedInstanceState != null && savedInstanceState.containsKey(VPNPROFILE)) { mResult = (VpnProfile) savedInstanceState.getSerializable(VPNPROFILE); @@ -630,7 +632,7 @@ public class ConfigConverter extends Activity implements FileSelectCallback, Vie TextView tv = new TextView(this); tv.setText(logmessage); LinearLayout logLayout = (LinearLayout) findViewById(R.id.config_convert_root); - logLayout.addView(tv); + logLayout.addView(tv, logLayout.getChildCount() - 1); } private void doImport(InputStream is, String newName) { diff --git a/main/src/main/java/de/blinkt/openvpn/activities/MainActivity.java b/main/src/main/java/de/blinkt/openvpn/activities/MainActivity.java index 4aa7e120..38600e4b 100644 --- a/main/src/main/java/de/blinkt/openvpn/activities/MainActivity.java +++ b/main/src/main/java/de/blinkt/openvpn/activities/MainActivity.java @@ -69,9 +69,12 @@ public class MainActivity extends Activity { tabs.setViewPager(mPager); } + private static final String FEATURE_TELEVISION = "android.hardware.type.television"; + private static final String FEATURE_LEANBACK = "android.software.leanback"; + private boolean isDirectToTV() { - return(getPackageManager().hasSystemFeature(PackageManager.FEATURE_TELEVISION) - || getPackageManager().hasSystemFeature(PackageManager.FEATURE_LEANBACK)); + return(getPackageManager().hasSystemFeature(FEATURE_TELEVISION) + || getPackageManager().hasSystemFeature(FEATURE_LEANBACK)); } @TargetApi(Build.VERSION_CODES.LOLLIPOP) diff --git a/main/src/main/java/de/blinkt/openvpn/core/VpnStatus.java b/main/src/main/java/de/blinkt/openvpn/core/VpnStatus.java index ef168675..b8a673b1 100644 --- a/main/src/main/java/de/blinkt/openvpn/core/VpnStatus.java +++ b/main/src/main/java/de/blinkt/openvpn/core/VpnStatus.java @@ -261,6 +261,7 @@ public class VpnStatus { String version = "error getting version"; try { + @SuppressLint("PackageManagerGetSignatures") Signature raw = c.getPackageManager().getPackageInfo(c.getPackageName(), PackageManager.GET_SIGNATURES).signatures[0]; CertificateFactory cf = CertificateFactory.getInstance("X.509"); X509Certificate cert = (X509Certificate) cf.generateCertificate(new ByteArrayInputStream(raw.toByteArray())); diff --git a/main/src/main/res/layout-v21/save_fab.xml b/main/src/main/res/layout-v21/save_fab.xml index 55fdecc6..fbd583da 100644 --- a/main/src/main/res/layout-v21/save_fab.xml +++ b/main/src/main/res/layout-v21/save_fab.xml @@ -5,8 +5,8 @@ --> - @@ -43,8 +43,13 @@ android:textAppearance="?android:attr/textAppearanceMedium" android:text="@string/import_log" android:id="@+id/textView"/> - + + - - + + -- cgit v1.2.3