summaryrefslogtreecommitdiff
path: root/main/src/ui/java
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/ui/java')
-rw-r--r--main/src/ui/java/de/blinkt/openvpn/activities/ConfigConverter.kt1
-rw-r--r--main/src/ui/java/de/blinkt/openvpn/activities/MainActivity.java14
-rw-r--r--main/src/ui/java/de/blinkt/openvpn/fragments/Settings_Allowed_Apps.kt2
3 files changed, 6 insertions, 11 deletions
diff --git a/main/src/ui/java/de/blinkt/openvpn/activities/ConfigConverter.kt b/main/src/ui/java/de/blinkt/openvpn/activities/ConfigConverter.kt
index 199c7819..5a42599f 100644
--- a/main/src/ui/java/de/blinkt/openvpn/activities/ConfigConverter.kt
+++ b/main/src/ui/java/de/blinkt/openvpn/activities/ConfigConverter.kt
@@ -73,6 +73,7 @@ class ConfigConverter : BaseActivity(), FileSelectCallback, View.OnClickListener
}
override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<String>, grantResults: IntArray) {
+ super.onRequestPermissionsResult(requestCode, permissions, grantResults);
// Permission declined, do nothing
if (grantResults.size == 0 || grantResults[0] == PackageManager.PERMISSION_DENIED)
return
diff --git a/main/src/ui/java/de/blinkt/openvpn/activities/MainActivity.java b/main/src/ui/java/de/blinkt/openvpn/activities/MainActivity.java
index fa6c4159..58698ea3 100644
--- a/main/src/ui/java/de/blinkt/openvpn/activities/MainActivity.java
+++ b/main/src/ui/java/de/blinkt/openvpn/activities/MainActivity.java
@@ -14,6 +14,8 @@ import android.view.MenuItem;
import androidx.appcompat.app.ActionBar;
import androidx.viewpager.widget.ViewPager;
+import com.google.android.material.tabs.TabLayout;
+
import de.blinkt.openvpn.R;
import de.blinkt.openvpn.fragments.AboutFragment;
import de.blinkt.openvpn.fragments.FaqFragment;
@@ -29,7 +31,7 @@ public class MainActivity extends BaseActivity {
private static final String FEATURE_TELEVISION = "android.hardware.type.television";
private static final String FEATURE_LEANBACK = "android.software.leanback";
- //private TabLayout mTabs;
+ private TabLayout mTabs;
private ViewPager mPager;
private ScreenSlidePagerAdapter mPagerAdapter;
@@ -58,19 +60,11 @@ public class MainActivity extends BaseActivity {
}
- if (isDirectToTV())
+ if (isAndroidTV())
mPagerAdapter.addTab(R.string.openvpn_log, LogFragment.class);
mPagerAdapter.addTab(R.string.about, AboutFragment.class);
mPager.setAdapter(mPagerAdapter);
-
- //mTabs = findViewById(R.id.sliding_tabs);
- //mTabs.setViewPager(mPager);
- }
-
- private boolean isDirectToTV() {
- return (getPackageManager().hasSystemFeature(FEATURE_TELEVISION)
- || getPackageManager().hasSystemFeature(FEATURE_LEANBACK));
}
diff --git a/main/src/ui/java/de/blinkt/openvpn/fragments/Settings_Allowed_Apps.kt b/main/src/ui/java/de/blinkt/openvpn/fragments/Settings_Allowed_Apps.kt
index 9ad32a47..c6712251 100644
--- a/main/src/ui/java/de/blinkt/openvpn/fragments/Settings_Allowed_Apps.kt
+++ b/main/src/ui/java/de/blinkt/openvpn/fragments/Settings_Allowed_Apps.kt
@@ -90,7 +90,7 @@ class Settings_Allowed_Apps : Fragment(), AdapterView.OnItemClickListener, View.
mListView.adapter = packageAdapter
Thread(Runnable {
- packageAdapter.populateList(activity!!)
+ packageAdapter.populateList(requireActivity())
activity?.runOnUiThread({
(v.findViewById<View>(R.id.loading_container)).visibility = View.GONE
(v.findViewById<View>(R.id.app_recycler_view)).visibility = View.VISIBLE