Commit 83ad77f3 authored by Thomas's avatar Thomas
Browse files

Merge branch 'develop' into main

parents 10fefbe6 07a819a9
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -9,8 +9,8 @@ android {
    defaultConfig {
        minSdk 21
        targetSdk 31
        versionCode 399
        versionName "3.0.9"
        versionCode 400
        versionName "3.0.10"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    flavorDimensions "default"
+52 −0
Original line number Diff line number Diff line
[
  {
    "version": "3.0.10",
    "code": "400",
    "note": "Added:\n- Allow to define the max chars count when not detected (In about the instance)\n- Add emoji one picker when composing (must be enabled in settings)\n- Add release notes with the ability to translate them\n\nFixed:\n- Friendica custom emojis not displayed\n- Long press to store media\n- Some bug fixes"
  },
  {
    "version": "3.0.9",
    "code": "399",
    "note": "Added:\n- Set compose language (from compose menu -> three vertical dots)\n- Add reactions support for Pleroma\n- Add privacy indicator at the top right\n\nChanged\n- Improve the scrolling behaviour\n- Scroll to top (tab reselection) will fetch new messages and then scroll to top\n\nFixed:\n- Empty tag timelines\n- Remove focus point for fit media preview\n- Fix cannot share with one account\n- Fix black theme\n- Theme cannot be selected\n- Fix some button colors"
  },
  {
    "version": "3.0.8",
    "code": "398",
    "note": "- Keep improving the scroll behaviour\n- Scroll to top (tab reselection) will fetch new messages and then scroll to top\n- Remove focus point for fit media preview\n- Fix cannot share with one account\n- Fix black theme\n- Fix some button colors"
  },
  {
    "version": "3.0.7",
    "code": "397",
    "note": "- Fix some bugs reported."
  },
  {
    "version": "3.0.6",
    "code": "396",
    "note": "Added:\n- Allow to set a focus point on previews (media editor)\n- Respect the focus point with previews\n- Pagination with the fetch more button support reading up or down\n- Add trends\n\nFixed:\n- Only last push notification is displayed (not grouped)\n- Bad behavior with the right/left scroll\n- Fix long profiles not fully displayed\n- Issues with some polls\n- Some crashes\n- Some bad behaviors"
  },
  {
    "version": "3.0.5",
    "code": "395",
    "note": "- Fix some bugs\n- Allow to share with the app"
  },
  {
    "version": "3.0.4",
    "code": "394",
    "note": "- Fix crashes for some Pleroma instances"
  },
  {
    "version": "3.0.2",
    "code": "393",
    "note": "- Some bug fixes\n- Improve pinned timelines"
  },
  {
    "version": "3.0.1",
    "code": "391",
    "note": "Some quick fixes"
  },
  {
    "version": "3.0.0",
    "code": "390",
    "note": "New version of Fedilab with new feature.\n- You can now compose threads\n- See the whole thread when replying\n- Cache support\n- New design"
  }
]
 No newline at end of file
+10 −4
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ import static app.fedilab.android.BaseMainActivity.status.DISCONNECTED;
import static app.fedilab.android.BaseMainActivity.status.UNKNOWN;
import static app.fedilab.android.helper.CacheHelper.deleteDir;
import static app.fedilab.android.helper.Helper.PREF_USER_TOKEN;
import static app.fedilab.android.helper.Helper.displayReleaseNotesIfNeeded;

import android.annotation.SuppressLint;
import android.content.BroadcastReceiver;
@@ -504,6 +505,8 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
            } else if (id == R.id.nav_about) {
                Intent intent = new Intent(this, AboutActivity.class);
                startActivity(intent);
            } else if (id == R.id.nav_release_notes) {
                displayReleaseNotesIfNeeded(BaseMainActivity.this, true);
            } else if (id == R.id.nav_partnership) {
                Intent intent = new Intent(this, PartnerShipActivity.class);
                startActivity(intent);
@@ -516,10 +519,15 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
            } else if (id == R.id.nav_cache) {
                Intent intent = new Intent(BaseMainActivity.this, CacheActivity.class);
                startActivity(intent);
            } else if (id == R.id.nav_about_instance) {
                Intent intent = new Intent(BaseMainActivity.this, InstanceActivity.class);
                startActivity(intent);
            }
            binding.drawerLayout.close();
            return false;
        });


        headerMainBinding.instanceInfo.setOnClickListener(v -> startActivity(new Intent(BaseMainActivity.this, InstanceHealthActivity.class)));
        headerMainBinding.accountProfilePicture.setOnClickListener(v -> {
            Intent intent = new Intent(BaseMainActivity.this, ProfileActivity.class);
@@ -677,10 +685,6 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
                    AlertDialog alert = alt_bld.create();
                    alert.show();
                    return true;
                } else if (itemId == R.id.action_about_instance) {
                    Intent intent = new Intent(BaseMainActivity.this, InstanceActivity.class);
                    startActivity(intent);
                    return true;
                } else if (itemId == R.id.action_proxy) {
                    Intent intent = new Intent(BaseMainActivity.this, ProxyActivity.class);
                    startActivity(intent);
@@ -759,6 +763,7 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt

                currentInstance = currentAccount.instance;
                currentUserID = currentAccount.user_id;

                show_boosts = sharedpreferences.getBoolean(getString(R.string.SET_SHOW_BOOSTS) + currentUserID + currentInstance, true);
                show_replies = sharedpreferences.getBoolean(getString(R.string.SET_SHOW_REPLIES) + currentUserID + currentInstance, true);
                regex_home = sharedpreferences.getString(getString(R.string.SET_FILTER_REGEX_HOME) + currentUserID + currentInstance, null);
@@ -799,6 +804,7 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
                        .observe(BaseMainActivity.this, mastodonAccount -> {
                            //Initialize static var
                            currentAccount.mastodon_account = mastodonAccount;
                            displayReleaseNotesIfNeeded(BaseMainActivity.this, false);
                            new Thread(() -> {
                                try {
                                    //Update account in db
+2 −4
Original line number Diff line number Diff line
@@ -53,14 +53,12 @@ public class ContextActivity extends BaseActivity {
    public static boolean displayCW;
    public static Resources.Theme theme;
    Fragment currentFragment;
    private Status focusedStatus;
    private ActivityConversationBinding binding;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ThemeHelper.applyTheme(this);
        binding = ActivityConversationBinding.inflate(getLayoutInflater());
        app.fedilab.android.databinding.ActivityConversationBinding binding = ActivityConversationBinding.inflate(getLayoutInflater());
        setContentView(binding.getRoot());
        setSupportActionBar(binding.toolbar);
        ActionBar actionBar = getSupportActionBar();
@@ -78,7 +76,7 @@ public class ContextActivity extends BaseActivity {
        Bundle b = getIntent().getExtras();
        final SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(ContextActivity.this);
        displayCW = sharedpreferences.getBoolean(getString(R.string.SET_EXPAND_CW), false);
        focusedStatus = null; // or other values
        Status focusedStatus = null; // or other values
        if (b != null)
            focusedStatus = (Status) b.getSerializable(Helper.ARG_STATUS);
        if (focusedStatus == null || currentAccount == null || currentAccount.mastodon_account == null) {
+74 −30
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@ package app.fedilab.android.activities;


import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
@@ -23,11 +25,15 @@ import android.text.Html;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.lifecycle.ViewModelProvider;
import androidx.preference.PreferenceManager;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.target.CustomTarget;
import com.bumptech.glide.request.transition.Transition;

import app.fedilab.android.BaseMainActivity;
import app.fedilab.android.R;
@@ -35,13 +41,13 @@ import app.fedilab.android.client.entities.api.Instance;
import app.fedilab.android.databinding.ActivityInstanceBinding;
import app.fedilab.android.helper.ThemeHelper;
import app.fedilab.android.viewmodel.mastodon.InstancesVM;
import es.dmoral.toasty.Toasty;


public class InstanceActivity extends BaseActivity {


    ActivityInstanceBinding binding;
    private boolean applyMaxChar = false;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
@@ -54,8 +60,26 @@ public class InstanceActivity extends BaseActivity {
        getWindow().setLayout(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
        if (getSupportActionBar() != null)
            getSupportActionBar().hide();
        SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(InstanceActivity.this);
        binding.close.setOnClickListener(

                view -> {
                    if (applyMaxChar) {
                        String max_char = binding.maxChar.getText().toString();

                        SharedPreferences.Editor editor = sharedpreferences.edit();
                        if (!max_char.isEmpty()) {
                            try {
                                editor.putInt(getString(R.string.SET_MAX_INSTANCE_CHAR) + MainActivity.currentInstance, Integer.parseInt(max_char));
                                editor.apply();
                            } catch (Exception ignored) {
                            }
                        }
                    }
                    finish();
                }

        binding.close.setOnClickListener(view -> finish());
        );

        if (getSupportActionBar() != null) {
            getSupportActionBar().setDisplayHomeAsUpEnabled(true);
@@ -66,10 +90,18 @@ public class InstanceActivity extends BaseActivity {
        instancesVM.getInstance(BaseMainActivity.currentInstance).observe(InstanceActivity.this, instanceInfo -> {
            binding.instanceContainer.setVisibility(View.VISIBLE);
            binding.loader.setVisibility(View.GONE);
            if (instanceInfo == null || instanceInfo.info == null) {
                Toasty.error(InstanceActivity.this, getString(R.string.toast_error), Toast.LENGTH_LONG).show();
                return;

            if (instanceInfo == null || instanceInfo.info == null || instanceInfo.info.description == null) {
                binding.maxCharContainer.setVisibility(View.VISIBLE);
                binding.instanceContainer.setVisibility(View.GONE);
                binding.instanceContact.setVisibility(View.GONE);
                int val = sharedpreferences.getInt(getString(R.string.SET_MAX_INSTANCE_CHAR) + MainActivity.currentInstance, -1);
                if (val != -1) {
                    binding.maxChar.setText(String.valueOf(val));
                }
                applyMaxChar = true;

            } else {
                Instance instance = instanceInfo.info;
                binding.instanceTitle.setText(instance.title);
                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
@@ -84,15 +116,27 @@ public class InstanceActivity extends BaseActivity {
                    binding.instanceContact.hide();
                }
                Glide.with(InstanceActivity.this)
                    .asBitmap()
                        .asDrawable()
                        .load(instance.thumbnail)
                    .into(binding.backGroundImage);
                        .into(new CustomTarget<Drawable>() {
                            @Override
                            public void onResourceReady(@NonNull Drawable resource, @Nullable Transition<? super Drawable> transition) {
                                binding.background.setAlpha(0.2f);
                                binding.background.setBackground(resource);
                            }

                            @Override
                            public void onLoadCleared(@Nullable Drawable placeholder) {

                            }
                        });

                binding.instanceContact.setOnClickListener(v -> {
                    Intent emailIntent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts("mailto", instance.email, null));
                    emailIntent.putExtra(Intent.EXTRA_SUBJECT, "[Mastodon] - " + instance.uri);
                    startActivity(Intent.createChooser(emailIntent, getString(R.string.send_email)));
                });
            }
        });
    }

Loading