Revert longPress/Tap and Gallery changes (#17269)

Revert longPress/Tap and Gallery changes
This commit is contained in:
Chris Bracken
2018-05-03 16:51:45 -07:00
committed by GitHub
parent 40ddf01059
commit 322eb81a79
13 changed files with 92 additions and 383 deletions

View File

@@ -153,41 +153,17 @@ List<GalleryDemo> _buildGalleryDemos() {
routeName: BottomNavigationDemo.routeName,
buildRoute: (BuildContext context) => new BottomNavigationDemo(),
),
new GalleryDemo(
title: 'Bottom sheet: Modal',
subtitle: 'A dismissable bottom sheet',
icon: GalleryIcons.bottom_sheets,
category: _kMaterialComponents,
routeName: ModalBottomSheetDemo.routeName,
buildRoute: (BuildContext context) => new ModalBottomSheetDemo(),
),
new GalleryDemo(
title: 'Bottom sheet: Persistent',
subtitle: 'A bottom sheet that sticks around',
icon: GalleryIcons.bottom_sheet_persistent,
category: _kMaterialComponents,
routeName: PersistentBottomSheetDemo.routeName,
buildRoute: (BuildContext context) => new PersistentBottomSheetDemo(),
),
new GalleryDemo(
title: 'Buttons',
subtitle: 'Flat, raised, dropdown, and more',
subtitle: 'All kinds: flat, raised, dropdown, icon, etc',
icon: GalleryIcons.generic_buttons,
category: _kMaterialComponents,
routeName: ButtonsDemo.routeName,
buildRoute: (BuildContext context) => new ButtonsDemo(),
),
new GalleryDemo(
title: 'Buttons: Floating Action Button',
subtitle: 'FAB with transitions',
icon: GalleryIcons.buttons,
category: _kMaterialComponents,
routeName: TabsFabDemo.routeName,
buildRoute: (BuildContext context) => new TabsFabDemo(),
),
new GalleryDemo(
title: 'Cards',
subtitle: 'Baseline cards with rounded corners',
subtitle: 'Material with rounded corners and a drop shadow',
icon: GalleryIcons.cards,
category: _kMaterialComponents,
routeName: CardsDemo.routeName,
@@ -195,7 +171,7 @@ List<GalleryDemo> _buildGalleryDemos() {
),
new GalleryDemo(
title: 'Chips',
subtitle: 'Labeled with delete buttons and avatars',
subtitle: 'Label with an optional delete button and avatar',
icon: GalleryIcons.chips,
category: _kMaterialComponents,
routeName: ChipDemo.routeName,
@@ -210,16 +186,32 @@ List<GalleryDemo> _buildGalleryDemos() {
buildRoute: (BuildContext context) => new DataTableDemo(),
),
new GalleryDemo(
title: 'Dialogs',
subtitle: 'Simple, alert, and fullscreen',
title: 'Date and time pickers',
subtitle: 'Date and time selection widgets',
icon: GalleryIcons.event,
category: _kMaterialComponents,
routeName: DateAndTimePickerDemo.routeName,
buildRoute: (BuildContext context) => new DateAndTimePickerDemo(),
),
new GalleryDemo(
title: 'Dialog',
subtitle: 'All kinds: simple, alert, fullscreen, etc',
icon: GalleryIcons.dialogs,
category: _kMaterialComponents,
routeName: DialogDemo.routeName,
buildRoute: (BuildContext context) => new DialogDemo(),
),
new GalleryDemo(
title: 'Drawer',
subtitle: 'Navigation drawer with a standard header',
icon: GalleryIcons.menu,
category: _kMaterialComponents,
routeName: DrawerDemo.routeName,
buildRoute: (BuildContext context) => new DrawerDemo(),
),
new GalleryDemo(
title: 'Expand/collapse list control',
subtitle: 'A list with one sub-list level',
subtitle: 'List with one level of sublists',
icon: GalleryIcons.expand_all,
category: _kMaterialComponents,
routeName: TwoLevelListDemo.routeName,
@@ -233,6 +225,14 @@ List<GalleryDemo> _buildGalleryDemos() {
routeName: ExpansionPanelsDemo.routeName,
buildRoute: (BuildContext context) => new ExpansionPanelsDemo(),
),
new GalleryDemo(
title: 'Floating action button',
subtitle: 'Action buttons with transitions',
icon: GalleryIcons.buttons,
category: _kMaterialComponents,
routeName: TabsFabDemo.routeName,
buildRoute: (BuildContext context) => new TabsFabDemo(),
),
new GalleryDemo(
title: 'Grid',
subtitle: 'Row and column layout',
@@ -243,28 +243,28 @@ List<GalleryDemo> _buildGalleryDemos() {
),
new GalleryDemo(
title: 'Icons',
subtitle: 'Enabled and disabled icons with opacity',
subtitle: 'Enabled and disabled icons with varying opacity',
icon: GalleryIcons.sentiment_very_satisfied,
category: _kMaterialComponents,
routeName: IconsDemo.routeName,
buildRoute: (BuildContext context) => new IconsDemo(),
),
new GalleryDemo(
title: 'Lists',
subtitle: 'Scrolling list layouts',
icon: GalleryIcons.list_alt,
category: _kMaterialComponents,
routeName: ListDemo.routeName,
buildRoute: (BuildContext context) => const ListDemo(),
),
new GalleryDemo(
title: 'Lists: leave-behind list items',
title: 'Leave-behind list items',
subtitle: 'List items with hidden actions',
icon: GalleryIcons.lists_leave_behind,
category: _kMaterialComponents,
routeName: LeaveBehindDemo.routeName,
buildRoute: (BuildContext context) => const LeaveBehindDemo(),
),
new GalleryDemo(
title: 'List',
subtitle: 'Layout variations for scrollable lists',
icon: GalleryIcons.list_alt,
category: _kMaterialComponents,
routeName: ListDemo.routeName,
buildRoute: (BuildContext context) => const ListDemo(),
),
new GalleryDemo(
title: 'Menus',
subtitle: 'Menu buttons and simple menus',
@@ -274,15 +274,15 @@ List<GalleryDemo> _buildGalleryDemos() {
buildRoute: (BuildContext context) => const MenuDemo(),
),
new GalleryDemo(
title: 'Navigation drawer',
subtitle: 'Navigation drawer with standard header',
icon: GalleryIcons.menu,
title: 'Modal bottom sheet',
subtitle: 'Modal sheet that slides up from the bottom',
icon: GalleryIcons.bottom_sheets,
category: _kMaterialComponents,
routeName: DrawerDemo.routeName,
buildRoute: (BuildContext context) => new DrawerDemo(),
routeName: ModalBottomSheetDemo.routeName,
buildRoute: (BuildContext context) => new ModalBottomSheetDemo(),
),
new GalleryDemo(
title: 'Pagination',
title: 'Page selector',
subtitle: 'PageView with indicator',
icon: GalleryIcons.page_control,
category: _kMaterialComponents,
@@ -290,16 +290,16 @@ List<GalleryDemo> _buildGalleryDemos() {
buildRoute: (BuildContext context) => new PageSelectorDemo(),
),
new GalleryDemo(
title: 'Pickers',
subtitle: 'Date and time selection widgets',
icon: GalleryIcons.event,
title: 'Persistent bottom sheet',
subtitle: 'Sheet that slides up from the bottom',
icon: GalleryIcons.bottom_sheet_persistent,
category: _kMaterialComponents,
routeName: DateAndTimePickerDemo.routeName,
buildRoute: (BuildContext context) => new DateAndTimePickerDemo(),
routeName: PersistentBottomSheetDemo.routeName,
buildRoute: (BuildContext context) => new PersistentBottomSheetDemo(),
),
new GalleryDemo(
title: 'Progress indicators',
subtitle: 'Linear, circular, indeterminate',
subtitle: 'All kinds: linear, circular, indeterminate, etc',
icon: GalleryIcons.progress_activity,
category: _kMaterialComponents,
routeName: ProgressIndicatorDemo.routeName,
@@ -313,6 +313,14 @@ List<GalleryDemo> _buildGalleryDemos() {
routeName: OverscrollDemo.routeName,
buildRoute: (BuildContext context) => const OverscrollDemo(),
),
new GalleryDemo(
title: 'Scrollable tabs',
subtitle: 'Tab bar that scrolls',
category: _kMaterialComponents,
icon: GalleryIcons.tabs,
routeName: ScrollableTabsDemo.routeName,
buildRoute: (BuildContext context) => new ScrollableTabsDemo(),
),
new GalleryDemo(
title: 'Selection controls',
subtitle: 'Checkboxes, radio buttons, and switches',
@@ -323,7 +331,7 @@ List<GalleryDemo> _buildGalleryDemos() {
),
new GalleryDemo(
title: 'Sliders',
subtitle: 'Widgets for selecting a value by swiping',
subtitle: 'Widgets that select a value by dragging the slider thumb',
icon: GalleryIcons.sliders,
category: _kMaterialComponents,
routeName: SliderDemo.routeName,
@@ -331,7 +339,7 @@ List<GalleryDemo> _buildGalleryDemos() {
),
new GalleryDemo(
title: 'Snackbar',
subtitle: 'Temporary messaging',
subtitle: 'Temporary message that appears at the bottom',
icon: GalleryIcons.snackbar,
category: _kMaterialComponents,
routeName: SnackBarDemo.routeName,
@@ -345,14 +353,6 @@ List<GalleryDemo> _buildGalleryDemos() {
routeName: TabsDemo.routeName,
buildRoute: (BuildContext context) => new TabsDemo(),
),
new GalleryDemo(
title: 'Tabs: Scrolling',
subtitle: 'Tab bar that scrolls',
category: _kMaterialComponents,
icon: GalleryIcons.tabs,
routeName: ScrollableTabsDemo.routeName,
buildRoute: (BuildContext context) => new ScrollableTabsDemo(),
),
new GalleryDemo(
title: 'Text fields',
subtitle: 'Single line of editable text and numbers',
@@ -363,7 +363,7 @@ List<GalleryDemo> _buildGalleryDemos() {
),
new GalleryDemo(
title: 'Tooltips',
subtitle: 'Short message displayed on long-press',
subtitle: 'Short message displayed after a long-press',
icon: GalleryIcons.tooltip,
category: _kMaterialComponents,
routeName: TooltipDemo.routeName,
@@ -373,6 +373,7 @@ List<GalleryDemo> _buildGalleryDemos() {
// Cupertino Components
new GalleryDemo(
title: 'Activity Indicator',
subtitle: 'Cupertino styled activity indicator',
icon: GalleryIcons.cupertino_progress,
category: _kCupertinoComponents,
routeName: CupertinoProgressIndicatorDemo.routeName,
@@ -380,6 +381,7 @@ List<GalleryDemo> _buildGalleryDemos() {
),
new GalleryDemo(
title: 'Buttons',
subtitle: 'Cupertino styled buttons',
icon: GalleryIcons.generic_buttons,
category: _kCupertinoComponents,
routeName: CupertinoButtonsDemo.routeName,
@@ -387,6 +389,7 @@ List<GalleryDemo> _buildGalleryDemos() {
),
new GalleryDemo(
title: 'Dialogs',
subtitle: 'Cupertino styled dialogs',
icon: GalleryIcons.dialogs,
category: _kCupertinoComponents,
routeName: CupertinoDialogDemo.routeName,
@@ -394,6 +397,7 @@ List<GalleryDemo> _buildGalleryDemos() {
),
new GalleryDemo(
title: 'Navigation',
subtitle: 'Cupertino styled navigation patterns',
icon: GalleryIcons.bottom_navigation,
category: _kCupertinoComponents,
routeName: CupertinoNavigationDemo.routeName,
@@ -401,6 +405,7 @@ List<GalleryDemo> _buildGalleryDemos() {
),
new GalleryDemo(
title: 'Pickers',
subtitle: 'Cupertino styled pickers',
icon: GalleryIcons.event,
category: _kCupertinoComponents,
routeName: CupertinoPickerDemo.routeName,
@@ -408,6 +413,7 @@ List<GalleryDemo> _buildGalleryDemos() {
),
new GalleryDemo(
title: 'Pull to refresh',
subtitle: 'Cupertino styled refresh controls',
icon: GalleryIcons.cupertino_pull_to_refresh,
category: _kCupertinoComponents,
routeName: CupertinoRefreshControlDemo.routeName,
@@ -415,6 +421,7 @@ List<GalleryDemo> _buildGalleryDemos() {
),
new GalleryDemo(
title: 'Sliders',
subtitle: 'Cupertino styled sliders',
icon: GalleryIcons.sliders,
category: _kCupertinoComponents,
routeName: CupertinoSliderDemo.routeName,
@@ -422,6 +429,7 @@ List<GalleryDemo> _buildGalleryDemos() {
),
new GalleryDemo(
title: 'Switches',
subtitle: 'Cupertino styled switches',
icon: GalleryIcons.cupertino_switch,
category: _kCupertinoComponents,
routeName: CupertinoSwitchDemo.routeName,

View File

@@ -177,25 +177,6 @@ class _DemoItem extends StatelessWidget {
final bool isDark = theme.brightness == Brightness.dark;
final double textScaleFactor = MediaQuery.of(context)?.textScaleFactor ?? 1.0;
final List<Widget> titleChildren = <Widget>[
new Text(
demo.title,
style: theme.textTheme.subhead.copyWith(
color: isDark ? Colors.white : const Color(0xFF202124),
),
),
];
if (demo.subtitle != null) {
titleChildren.add(
new Text(
demo.subtitle,
style: theme.textTheme.body1.copyWith(
color: isDark ? Colors.white : const Color(0xFF60646B)
),
),
);
}
return new RawMaterialButton(
padding: EdgeInsets.zero,
splashColor: theme.primaryColor.withOpacity(0.12),
@@ -221,7 +202,19 @@ class _DemoItem extends StatelessWidget {
child: new Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: titleChildren,
children: <Widget>[
new Text(
demo.title,
style: theme.textTheme.subhead.copyWith(
color: isDark ? Colors.white : const Color(0xFF202124),
),
),
new Text(
demo.subtitle,
style: theme.textTheme.body1.copyWith(
color: isDark ? Colors.white : const Color(0xFF60646B)),
),
],
),
),
const SizedBox(width: 44.0),

View File

@@ -21,8 +21,8 @@ const FileSystem _fs = const LocalFileSystem();
// --trace-startup, as we do in this test, the VM stores trace events in an
// endless buffer instead of a ring buffer.
//
// These names must match GalleryItem titles from kAllGalleryDemos
// in examples/flutter_gallery/lib/gallery/demos.dart
// These names must match GalleryItem titles from kAllGalleryItems
// in examples/flutter_gallery/lib/gallery.item.dart
const List<String> kProfiledDemos = const <String>[
'Shrine',
'Contact profile',
@@ -31,14 +31,14 @@ const List<String> kProfiledDemos = const <String>[
'Buttons',
'Cards',
'Chips',
'Pickers',
'Dialogs',
'Date and time pickers',
'Dialog',
];
// Demos that will be backed out of within FlutterDriver.runUnsynchronized();
//
// These names must match GalleryItem titles from kAllGalleryDemos
// in examples/flutter_gallery/lib/gallery/demos.dart
// These names must match GalleryItem titles from kAllGalleryItems
// in examples/flutter_gallery/lib/gallery.item.dart
const List<String> kUnsynchronizedDemos = const <String>[
'Progress indicators',
'Activity Indicator',