diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index f7b10d0ac..d44ba73c7 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -12,7 +12,7 @@ jobs: - name: ktlint uses: ScaCap/action-ktlint@1.4 with: - github_token: ${{ secrets.GITHUB_TOKEN }} + github_token: ${{ secrets.ACCESS_TOKEN }} reporter: github-pr-check android: true fail_on_error: true diff --git a/README.md b/README.md index ea9c659f7..1d6510019 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,11 @@ ## Contributing -Whether you have ideas, translations, design changes, code cleaning, or real heavy code changes, help is always welcome. The more is done the better it gets! If creating a pr, please make sure to format the code with ktlint before. +Whether you have ideas, translations, design changes, code cleaning, or real heavy code changes, help is always welcome.The more is done the better it gets! + +If creating a pull request, please make sure to format your code (with ktlint) before. + +If opening an issue without following the issue template, we will ignore the issue and force close it. WARNING: THIS IS A BETA VERSION, THEREFORE YOU MAY ENCOUNTER BUGS. IF YOU DO, OPEN AN ISSUE VIA OUR GITHUB REPOSITORY. diff --git a/app/src/main/java/com/github/libretube/MainActivity.kt b/app/src/main/java/com/github/libretube/MainActivity.kt index db9894118..2799f6b25 100644 --- a/app/src/main/java/com/github/libretube/MainActivity.kt +++ b/app/src/main/java/com/github/libretube/MainActivity.kt @@ -6,6 +6,7 @@ import android.content.Intent import android.content.pm.ActivityInfo import android.content.res.Configuration import android.net.ConnectivityManager +import android.net.NetworkCapabilities import android.net.Uri import android.os.Build import android.os.Bundle @@ -44,8 +45,9 @@ import com.google.android.material.color.DynamicColors class MainActivity : AppCompatActivity() { val TAG = "MainActivity" + lateinit var bottomNavigationView: BottomNavigationView - lateinit var toolbar: Toolbar + private lateinit var toolbar: Toolbar lateinit var navController: NavController override fun onCreate(savedInstanceState: Bundle?) { @@ -79,12 +81,8 @@ class MainActivity : AppCompatActivity() { ThemeHelper().updateTheme(this) LocaleHelper().updateLanguage(this) - val connectivityManager = - this.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager - val networkInfo = connectivityManager.activeNetworkInfo - val isConnected = networkInfo != null && networkInfo.isConnected - - if (!isConnected) { + // show noInternet Activity if no internet available on app startup + if (!isNetworkAvailable(this)) { setContentView(R.layout.activity_nointernet) findViewById