package com.texasgamer.zephyr.util.navigation;

import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.provider.Settings;

import androidx.annotation.NonNull;
import androidx.browser.customtabs.CustomTabsIntent;
import androidx.core.content.ContextCompat;

import com.texasgamer.zephyr.BuildConfig;
import com.texasgamer.zephyr.R;
import com.texasgamer.zephyr.ZephyrApplication;

/**
 * Navigation utilities.
 */
public final class NavigationUtils {

    private NavigationUtils() {
    }

    public static void openUrl(@NonNull Context context, @NonNull String url) {
        if (!(context instanceof Activity)) {
            Context activityContext = ZephyrApplication.getInstance().getCurrentActivity();
            if (activityContext != null) {
                context = activityContext;
            }
        }

        try {
            CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
            builder.setToolbarColor(ContextCompat.getColor(context, R.color.primary));
            CustomTabsIntent customTabsIntent = builder.build();
            customTabsIntent.launchUrl(context, Uri.parse(url));
        } catch (ActivityNotFoundException e) {
            Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
            context.startActivity(browserIntent);
        }
    }

    public static void openZephyrAppInfo(@NonNull Context context) {
        Intent intent = new Intent();
        intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
        Uri uri = Uri.fromParts("package", BuildConfig.APPLICATION_ID, null);
        intent.setData(uri);
        context.startActivity(intent);
    }
}

@@ -685,24 +685,64 @@
 ring url) %7B%0A
+        Context finalContext = context;%0A
         if (
@@ -922,25 +922,30 @@
             
-c
+finalC
 ontext = act
@@ -1135,17 +1135,22 @@
 etColor(
-c
+finalC
 ontext, 
@@ -1272,17 +1272,22 @@
 unchUrl(
-c
+finalC
 ontext, 
@@ -1438,33 +1438,38 @@
 ));%0A            
-c
+finalC
 ontext.startActi

Fix checkstyle