Commit d70c285b authored by Thomas's avatar Thomas
Browse files

Merge branch 'develop'

parents af10d647 bb2b66ce
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -13,8 +13,8 @@ android {
    defaultConfig {
        minSdk 21
        targetSdk 33
        versionCode 463
        versionName "3.14.1"
        versionCode 464
        versionName "3.14.2"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    flavorDimensions "default"
+5 −0
Original line number Diff line number Diff line
@@ -249,6 +249,11 @@
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:label="@string/Suggestions"
            android:theme="@style/AppThemeBar" />
        <activity
            android:name=".activities.DirectoryActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:label="@string/Directory"
            android:theme="@style/AppThemeBar" />
        <activity
            android:name=".activities.PartnerShipActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
+5 −0
Original line number Diff line number Diff line
[
  {
    "version": "3.14.2",
    "code": "464",
    "note": "Added:\n- Display familiar followers on profiles\n- Display and filter Instance directory\n\nChanged:\n- Bot and reply icon indicators more visible\n- Single media are hidden with link previews\n\nFixed:\n- Fix a crash with Art timelines\n- Friendica: media cannot be downloaded/shared\n- Fix a crash with pinned timelines"
  },
  {
    "version": "3.14.1",
    "code": "463",
+4 −0
Original line number Diff line number Diff line
@@ -109,6 +109,7 @@ import app.fedilab.android.activities.BaseActivity;
import app.fedilab.android.activities.CacheActivity;
import app.fedilab.android.activities.ComposeActivity;
import app.fedilab.android.activities.ContextActivity;
import app.fedilab.android.activities.DirectoryActivity;
import app.fedilab.android.activities.DraftActivity;
import app.fedilab.android.activities.FilterActivity;
import app.fedilab.android.activities.FollowRequestActivity;
@@ -409,6 +410,9 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
            } else if (id == R.id.nav_suggestions) {
                Intent intent = new Intent(this, SuggestionActivity.class);
                startActivity(intent);
            } else if (id == R.id.nav_directory) {
                Intent intent = new Intent(this, DirectoryActivity.class);
                startActivity(intent);
            } else if (id == R.id.nav_cache) {
                Intent intent = new Intent(BaseMainActivity.this, CacheActivity.class);
                startActivity(intent);
+81 −0
Original line number Diff line number Diff line
package app.fedilab.android.activities;
/* Copyright 2022 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 static app.fedilab.android.client.entities.app.Timeline.TimeLineEnum.ACCOUNT_DIRECTORY;

import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;

import org.jetbrains.annotations.NotNull;

import app.fedilab.android.R;
import app.fedilab.android.databinding.ActivityDirectoryBinding;
import app.fedilab.android.helper.Helper;
import app.fedilab.android.ui.fragment.timeline.FragmentMastodonAccount;


public class DirectoryActivity extends BaseBarActivity {

    private static boolean local = false;
    private static String order = "active";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        ActivityDirectoryBinding binding = ActivityDirectoryBinding.inflate(getLayoutInflater());
        setContentView(binding.getRoot());
        if (getSupportActionBar() != null) {
            getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        }
        Bundle bundle = new Bundle();
        bundle.putBoolean(Helper.ARG_DIRECTORY_LOCAL, local);
        bundle.putString(Helper.ARG_DIRECTORY_ORDER, order);
        bundle.putSerializable(Helper.ARG_TIMELINE_TYPE, ACCOUNT_DIRECTORY);
        Helper.addFragment(getSupportFragmentManager(), R.id.nav_host_fragment_directory, new FragmentMastodonAccount(), bundle, null, null);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.menu_directory, menu);
        if (order.equals("active")) {
            menu.findItem(R.id.order_active).setChecked(true);
        } else {
            menu.findItem(R.id.order_new).setChecked(true);
        }
        menu.findItem(R.id.action_local).setChecked(local);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(@NotNull MenuItem item) {
        if (item.getItemId() == android.R.id.home) {
            finish();
            return true;
        } else if (item.getItemId() == R.id.action_local) {
            item.setChecked(!item.isChecked());
            local = item.isChecked();
        } else if (item.getItemId() == R.id.order_active) {
            order = "active";
        } else if (item.getItemId() == R.id.order_new) {
            order = "new";
        }
        recreate();
        return super.onOptionsItemSelected(item);
    }

}
Loading