imp: Bring back categories to library screen
Sorry guys for constant shifting.
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import 'package:florid/l10n/app_localizations.dart';
|
||||
import 'package:florid/models/fdroid_app.dart';
|
||||
import 'package:florid/screens/home/categories_screen.dart';
|
||||
import 'package:florid/screens/home/library_screen.dart';
|
||||
import 'package:florid/screens/settings/settings_screen.dart';
|
||||
import 'package:florid/screens/settings/user_screen.dart';
|
||||
@@ -36,7 +35,7 @@ class _FloridAppState extends State<FloridApp> {
|
||||
|
||||
late final List<Widget> _screens = [
|
||||
const LibraryScreen(),
|
||||
CategoriesScreen(),
|
||||
// CategoriesScreen(),
|
||||
SearchScreen(),
|
||||
UpdatesScreen(),
|
||||
UserScreen(),
|
||||
@@ -497,11 +496,11 @@ class _FloridAppState extends State<FloridApp> {
|
||||
selectedIcon: Icon(SolarIconsBold.home2),
|
||||
label: localizations.home,
|
||||
),
|
||||
NavigationDestination(
|
||||
icon: Icon(SolarIconsOutline.widget_5),
|
||||
selectedIcon: const Icon(SolarIconsBold.widget_5),
|
||||
label: localizations.categories,
|
||||
),
|
||||
// NavigationDestination(
|
||||
// icon: Icon(SolarIconsOutline.widget_5),
|
||||
// selectedIcon: const Icon(SolarIconsBold.widget_5),
|
||||
// label: localizations.categories,
|
||||
// ),
|
||||
NavigationDestination(
|
||||
icon: Icon(SolarIconsOutline.roundedMagnifier),
|
||||
selectedIcon: Icon(SolarIconsBold.roundedMagnifier),
|
||||
|
||||
@@ -211,10 +211,6 @@ class _CategoriesScreenState extends State<CategoriesScreen>
|
||||
onRefresh: _onRefresh,
|
||||
child: CustomScrollView(
|
||||
slivers: [
|
||||
SliverAppBar(
|
||||
floating: true,
|
||||
title: Text(AppLocalizations.of(context)!.categories),
|
||||
),
|
||||
SliverPadding(
|
||||
padding: const EdgeInsets.only(bottom: 16),
|
||||
sliver: SliverList(
|
||||
|
||||
@@ -33,7 +33,7 @@ class _LibraryScreenState extends State<LibraryScreen>
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_tabController = TabController(length: 2, vsync: this);
|
||||
_tabController = TabController(length: 3, vsync: this);
|
||||
_titleSwitchTimer = Timer(const Duration(seconds: 3), () {
|
||||
if (!mounted) return;
|
||||
setState(() {
|
||||
@@ -71,7 +71,7 @@ class _LibraryScreenState extends State<LibraryScreen>
|
||||
newIndex = oldIndex + 1;
|
||||
}
|
||||
|
||||
final newLength = shouldShowTopApps ? 3 : 2;
|
||||
final newLength = shouldShowTopApps ? 4 : 3;
|
||||
final clampedIndex = newIndex.clamp(0, newLength - 1);
|
||||
|
||||
_tabController.dispose();
|
||||
@@ -96,6 +96,7 @@ class _LibraryScreenState extends State<LibraryScreen>
|
||||
final localizations = AppLocalizations.of(context)!;
|
||||
final tabs = <Widget>[
|
||||
const HomeScreen(),
|
||||
const CategoriesScreen(),
|
||||
if (_showTopAppsTab)
|
||||
AppSectionViewer(
|
||||
showAppBar: false,
|
||||
@@ -181,7 +182,12 @@ class _LibraryScreenState extends State<LibraryScreen>
|
||||
: Theme.of(context).colorScheme.surface,
|
||||
snap: true,
|
||||
floating: true,
|
||||
shape: LinearBorder(bottom: LinearBorderEdge(), side: BorderSide(color: Theme.of(context).colorScheme.surfaceContainerLow)),
|
||||
shape: LinearBorder(
|
||||
bottom: LinearBorderEdge(),
|
||||
side: BorderSide(
|
||||
color: Theme.of(context).colorScheme.surfaceContainerLow,
|
||||
),
|
||||
),
|
||||
bottom: PreferredSize(
|
||||
preferredSize: Size.fromHeight(
|
||||
settingsProvider.themeStyle == ThemeStyle.florid ? 64 : 56,
|
||||
@@ -204,6 +210,10 @@ class _LibraryScreenState extends State<LibraryScreen>
|
||||
icon: SolarIconsOutline.home,
|
||||
label: AppLocalizations.of(context)!.home,
|
||||
),
|
||||
FloridTabBarItem(
|
||||
icon: SolarIconsOutline.widget_5,
|
||||
label: AppLocalizations.of(context)!.categories,
|
||||
),
|
||||
if (_showTopAppsTab)
|
||||
FloridTabBarItem(
|
||||
icon: SolarIconsOutline.courseUp,
|
||||
|
||||
Reference in New Issue
Block a user