Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 16801347 authored by Mohammed Althaf T's avatar Mohammed Althaf T 😊
Browse files

Use custom tab intent for changelog

parent 103aff3f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ android_app {
        "androidx.recyclerview_recyclerview",
        "com.google.android.material_material",
        "elib",
        "androidx.browser_browser",
    ],

    optimize: {
+1 −0
Original line number Diff line number Diff line
@@ -106,6 +106,7 @@ dependencies {
    implementation("com.google.android.material:material:1.13.0")

    implementation("foundation.e:elib:0.0.1-alpha11")
    implementation("androidx.browser:browser:1.9.0")
}

configure<GenerateBpPluginExtension> {
+13 −3
Original line number Diff line number Diff line
@@ -55,6 +55,7 @@ import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.widget.SwitchCompat;
import androidx.appcompat.widget.Toolbar;
import androidx.browser.customtabs.CustomTabsIntent;
import androidx.core.content.ContextCompat;
import androidx.core.view.WindowInsetsCompat;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
@@ -292,9 +293,18 @@ public class UpdatesActivity extends UpdatesListActivity implements UpdateImport
            showPreferencesDialog();
            return true;
        } else if (itemId == R.id.menu_show_changelog) {
            Intent openUrl = new Intent(Intent.ACTION_VIEW,
                    Uri.parse(Utils.getChangelogURL(this)));
            Uri uri = Uri.parse(Utils.getChangelogURL(this));
            try {
                CustomTabsIntent intent = new CustomTabsIntent.Builder()
                        .setShowTitle(true)
                        .build();
                intent.launchUrl(this, uri);
            } catch (Exception e) {
                // Fallback: launch default browser
                Log.w(TAG, "Custom Tab failed, falling back to default browser", e);
                Intent openUrl = new Intent(Intent.ACTION_VIEW, uri);
                startActivity(openUrl);
            }
            return true;
        } else if (itemId == R.id.menu_local_update) {
            mUpdateImporter.openImportPicker();