Commit 1659997c authored by jordibgzashtita's avatar jordibgzashtita
Browse files

Merge remote-tracking branch 'develop/develop' into jordibgzashtita

parents c42c2fc6 8f53e6f5
Loading
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -13,8 +13,8 @@ android {
    defaultConfig {
        minSdk 21
        targetSdk 34
        versionCode 525
        versionName "3.31.1"
        versionCode 528
        versionName "3.31.3"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    flavorDimensions "default"
@@ -115,7 +115,7 @@ dependencies {

    implementation 'androidx.appcompat:appcompat:1.7.0'

    implementation 'com.google.android.material:material:1.12.0'
    implementation 'com.google.android.material:material:1.10.0'


    implementation 'androidx.constraintlayout:constraintlayout:2.2.0'
+364 −192

File changed.

Preview size limit exceeded, changes collapsed.

+12 −2
Original line number Diff line number Diff line
[
  {
    "version": "3.31.3",
    "code": "528",
    "note": "Added:\n- Add new icon launchers (Settings > Interface)\n\nChanged:\n- Make logout/proxy button more visible in main menu\n- Remove permission FOREGROUND_SERVICE\n- Improve a little more media layout with translations\n\nFixed:\n- Fix status bar icons not visible in light theme with custom accent color\n- Reaction buttons not clickable for some instances"
  },
  {
    "version": "3.31.2",
    "code": "527",
    "note": "Added:\n- Add support to URL scheme \"web+ap\" for opening profiles with the app\n\nChanged:\n- Layout for media descriptions\n\nFixed:\n- Fix a crash when translating media descriptions\n- Handle included twice when replying to a self user's boost\n- Fix color issues when using a custom theme"
  },
  {
    "version": "3.31.1",
    "code": "525",
    "note": "Added:\n- Add MinT machine translation system support\n\nFixed:\n- GIF not displayed in timelines\n- Fix a crash when unpinning timelines\n- Top bar coloring at scroll for conversations\n- Black screen when going back from the Peertube section"
    "code": "526",
    "note": "Added:\n- Add MinT machine translation system support\n- Add support \"instance only\" for GoToSocial\n\nFixed:\n- GIF not displayed in timelines\n- Fix a crash when unpinning timelines\n- Top bar coloring at scroll for conversations\n- Black screen when going back from the Peertube section"
  },
  {
    "version": "3.31.0",
+102 −0
Original line number Diff line number Diff line
package app.fedilab.android.activities;
/* Copyright 2025 Thomas Schneider
 *
 * This file is a part of Fedilab
 *
 * This program is free software; you can redistribute it and/or modify it under the terms of the
 * GNU General Public License as published by the Free Software Foundation; either version 3 of the
 * License, or (at your option) any later version.
 *
 * Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
 * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
 * Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with Fedilab; if not,
 * see <http://www.gnu.org/licenses>. */

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

import app.fedilab.android.mastodon.activities.ProfileActivity;
import app.fedilab.android.mastodon.client.entities.app.CachedBundle;
import app.fedilab.android.mastodon.helper.Helper;


public class WebActivityPub extends AppCompatActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Intent appIntent = getIntent();
        String acct = null;
        String intent = null;
        if(appIntent == null) {
            finish();
            return;
        }
        Uri uri = appIntent.getData();
        if(uri == null) {
            finish();
            return;
        }
        String scheme = uri.getScheme();
        String uriString = uri.toString();
        if(!uriString.startsWith(scheme+"://")) {
            uriString = uri.toString().replace(scheme+":",scheme+"://");
            uri = Uri.parse(uriString);
            if(uri == null) {
                finish();
                return;
            }
        }

        String host = uri.getHost();
        String path = uri.getPath();
        String query = uri.getQuery();

        if(path == null || path.isEmpty()) {
            finish();
            return;
        }
        if(query != null) {
            String intentPatternString = "intent=(\\w+)";
            final Pattern intentPattern = Pattern.compile(intentPatternString, Pattern.CASE_INSENSITIVE);
            Matcher matcherIntent = intentPattern.matcher(query);
            while (matcherIntent.find()) {
                intent = matcherIntent.group(1);
            }
        }
        if(path.startsWith("/@")) {
            String[] params = path.split("@");
            if(params.length == 2) {
                acct = params[1] + "@" + host;
            }
        } else if(path.split("/").length > 2) {
            String[] params = path.split("/");
            String root = params[1].toLowerCase();
            if (root.equals("users")) {
                acct = params[2] + "@" + host;
            }
        }
        if(acct != null) {
            Intent intentProfile = new Intent(WebActivityPub.this, ProfileActivity.class);
            Bundle args = new Bundle();
            args.putString(Helper.ARG_MENTION, acct);
            new CachedBundle(WebActivityPub.this).insertBundle(args, Helper.getCurrentAccount(WebActivityPub.this), bundleId -> {
                Bundle bundle = new Bundle();
                bundle.putLong(Helper.ARG_INTENT_ID, bundleId);
                intentProfile.putExtras(bundle);
                intentProfile.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                startActivity(intentProfile);
            });
        }
        finish();
    }
}
+15 −0
Original line number Diff line number Diff line
@@ -15,7 +15,9 @@ package app.fedilab.android.mastodon.activities;
 * see <http://www.gnu.org/licenses>. */


import static app.fedilab.android.BaseMainActivity.currentInstance;
import static app.fedilab.android.BaseMainActivity.currentNightMode;
import static app.fedilab.android.BaseMainActivity.currentUserID;

import android.annotation.SuppressLint;
import android.content.Context;
@@ -24,6 +26,7 @@ import android.content.res.Configuration;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;

@@ -72,8 +75,20 @@ public class BaseActivity extends AppCompatActivity {
        }

        String currentTheme = sharedpreferences.getString(getString(R.string.SET_THEME_BASE), getString(R.string.SET_DEFAULT_THEME));
        boolean customAccentEnabled = sharedpreferences.getBoolean(getString(R.string.SET_CUSTOM_ACCENT) + currentUserID + currentInstance, false);

        //Default automatic switch
        currentNightMode = getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK;


        if(customAccentEnabled && currentNightMode == Configuration.UI_MODE_NIGHT_NO) {
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
                getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR|View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
            }else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
                getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
            }
        }

        if (currentTheme.equals(getString(R.string.SET_DEFAULT_THEME))) {
            switch (currentNightMode) {
                case Configuration.UI_MODE_NIGHT_NO -> {
Loading