Commit 3a7508d7 authored by Hans Muller's avatar Hans Muller Committed by GitHub

New gallery identity (#5210)

parent 0ba0127c
...@@ -11,7 +11,7 @@ dependencies: ...@@ -11,7 +11,7 @@ dependencies:
flutter_gallery_assets: flutter_gallery_assets:
git: git:
url: https://flutter.googlesource.com/gallery-assets url: https://flutter.googlesource.com/gallery-assets
ref: 3e55082f0128cb4ef95e0e8d2c14e941024d6da9 ref: ef658435dff4e3a7ad671feed19b634d53ae98f9
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
......
...@@ -9,7 +9,7 @@ dependencies: ...@@ -9,7 +9,7 @@ dependencies:
flutter_gallery_assets: flutter_gallery_assets:
git: git:
url: https://flutter.googlesource.com/gallery-assets url: https://flutter.googlesource.com/gallery-assets
ref: 3e55082f0128cb4ef95e0e8d2c14e941024d6da9 ref: ef658435dff4e3a7ad671feed19b634d53ae98f9
dev_dependencies: dev_dependencies:
test: any # flutter_test provides the version constraints test: any # flutter_test provides the version constraints
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.INTERNET"/>
<application android:icon="@mipmap/ic_launcher" android:label="Flutter Gallery" android:name="org.domokit.sky.shell.SkyApplication"> <application android:icon="@mipmap/ic_launcher" android:label="Flutter Gallery" android:name="org.domokit.sky.shell.SkyApplication">
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize" android:hardwareAccelerated="true" android:launchMode="singleTask" android:name="org.domokit.sky.shell.SkyActivity" android:theme="@android:style/Theme.Black.NoTitleBar"> <activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize" android:hardwareAccelerated="true" android:launchMode="singleTask" android:name="org.domokit.sky.shell.SkyActivity" android:theme="@android:style/Theme.Black.NoTitleBar" android:screenOrientation="sensorPortrait">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />
......
...@@ -3,6 +3,12 @@ uses-material-design: true ...@@ -3,6 +3,12 @@ uses-material-design: true
assets: assets:
- lib/gallery/example_code.dart - lib/gallery/example_code.dart
- packages/flutter_gallery_assets/appbar_background.jpg - packages/flutter_gallery_assets/appbar_background.jpg
- packages/flutter_gallery_assets/appbar/appbar_background_layer0.png
- packages/flutter_gallery_assets/appbar/appbar_background_layer1.png
- packages/flutter_gallery_assets/appbar/appbar_background_layer2.png
- packages/flutter_gallery_assets/appbar/appbar_background_layer3.png
- packages/flutter_gallery_assets/appbar/appbar_background_layer4.png
- packages/flutter_gallery_assets/appbar/appbar_background_layer5.png
- packages/flutter_gallery_assets/pesto/avatar.jpg - packages/flutter_gallery_assets/pesto/avatar.jpg
- packages/flutter_gallery_assets/pesto/image10.jpg - packages/flutter_gallery_assets/pesto/image10.jpg
- packages/flutter_gallery_assets/pesto/image11.jpg - packages/flutter_gallery_assets/pesto/image11.jpg
...@@ -27,9 +33,11 @@ assets: ...@@ -27,9 +33,11 @@ assets:
- packages/flutter_gallery_assets/pesto/quick.png - packages/flutter_gallery_assets/pesto/quick.png
- packages/flutter_gallery_assets/pesto/spicy.png - packages/flutter_gallery_assets/pesto/spicy.png
- packages/flutter_gallery_assets/pesto/veggie.png - packages/flutter_gallery_assets/pesto/veggie.png
- packages/flutter_gallery_assets/ali_connors.png - packages/flutter_gallery_assets/about_logo.png
- packages/flutter_gallery_assets/kangaroo_valley_safari.png - packages/flutter_gallery_assets/ali_connors.jpg
- packages/flutter_gallery_assets/top_10_australian_beaches.png - packages/flutter_gallery_assets/drawer_logo.png
- packages/flutter_gallery_assets/kangaroo_valley_safari.jpg
- packages/flutter_gallery_assets/top_10_australian_beaches.jpg
- packages/flutter_gallery_assets/landscape_0.jpg - packages/flutter_gallery_assets/landscape_0.jpg
- packages/flutter_gallery_assets/landscape_1.jpg - packages/flutter_gallery_assets/landscape_1.jpg
- packages/flutter_gallery_assets/landscape_2.jpg - packages/flutter_gallery_assets/landscape_2.jpg
......
...@@ -33,15 +33,11 @@ ...@@ -33,15 +33,11 @@
<key>UISupportedInterfaceOrientations</key> <key>UISupportedInterfaceOrientations</key>
<array> <array>
<string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array> </array>
<key>UISupportedInterfaceOrientations~ipad</key> <key>UISupportedInterfaceOrientations~ipad</key>
<array> <array>
<string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string> <string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array> </array>
<key>UIViewControllerBasedStatusBarAppearance</key> <key>UIViewControllerBasedStatusBarAppearance</key>
<false/> <false/>
......
...@@ -17,7 +17,7 @@ class TravelDestination { ...@@ -17,7 +17,7 @@ class TravelDestination {
final List<TravelDestination> destinations = <TravelDestination>[ final List<TravelDestination> destinations = <TravelDestination>[
const TravelDestination( const TravelDestination(
assetName: 'packages/flutter_gallery_assets/top_10_australian_beaches.png', assetName: 'packages/flutter_gallery_assets/top_10_australian_beaches.jpg',
title: 'Top 10 Australian beaches', title: 'Top 10 Australian beaches',
description: const <String>[ description: const <String>[
'Number 10', 'Number 10',
...@@ -26,7 +26,7 @@ final List<TravelDestination> destinations = <TravelDestination>[ ...@@ -26,7 +26,7 @@ final List<TravelDestination> destinations = <TravelDestination>[
] ]
), ),
const TravelDestination( const TravelDestination(
assetName: 'packages/flutter_gallery_assets/kangaroo_valley_safari.png', assetName: 'packages/flutter_gallery_assets/kangaroo_valley_safari.jpg',
title: 'Kangaroo Valley Safari', title: 'Kangaroo Valley Safari',
description: const <String>[ description: const <String>[
'2031 Moss Vale Road', '2031 Moss Vale Road',
......
...@@ -130,7 +130,7 @@ class ContactsDemoState extends State<ContactsDemo> { ...@@ -130,7 +130,7 @@ class ContactsDemoState extends State<ContactsDemo> {
background: new Stack( background: new Stack(
children: <Widget>[ children: <Widget>[
new Image.asset( new Image.asset(
'packages/flutter_gallery_assets/ali_connors.png', 'packages/flutter_gallery_assets/ali_connors.jpg',
fit: ImageFit.cover, fit: ImageFit.cover,
height: _appBarHeight height: _appBarHeight
), ),
......
...@@ -16,12 +16,12 @@ final Map<String, WidgetBuilder> _kRoutes = new Map<String, WidgetBuilder>.fromI ...@@ -16,12 +16,12 @@ final Map<String, WidgetBuilder> _kRoutes = new Map<String, WidgetBuilder>.fromI
final ThemeData _kGalleryLightTheme = new ThemeData( final ThemeData _kGalleryLightTheme = new ThemeData(
brightness: Brightness.light, brightness: Brightness.light,
primarySwatch: Colors.teal primarySwatch: Colors.lightBlue,
); );
final ThemeData _kGalleryDarkTheme = new ThemeData( final ThemeData _kGalleryDarkTheme = new ThemeData(
brightness: Brightness.dark, brightness: Brightness.dark,
primarySwatch: Colors.teal primarySwatch: Colors.lightBlue
); );
class GalleryApp extends StatefulWidget { class GalleryApp extends StatefulWidget {
......
...@@ -49,7 +49,15 @@ class GalleryDrawer extends StatelessWidget { ...@@ -49,7 +49,15 @@ class GalleryDrawer extends StatelessWidget {
child: new Block( child: new Block(
children: <Widget>[ children: <Widget>[
new DrawerHeader( new DrawerHeader(
child: new Center(child: new Text('Flutter gallery')) child: new Center(
child: new Padding(
padding: const EdgeInsets.all(16.0),
child: new Image.asset(
'packages/flutter_gallery_assets/drawer_logo.png',
fit: ImageFit.contain
)
)
)
), ),
new DrawerItem( new DrawerItem(
icon: new Icon(Icons.brightness_5), icon: new Icon(Icons.brightness_5),
...@@ -112,7 +120,7 @@ class GalleryDrawer extends StatelessWidget { ...@@ -112,7 +120,7 @@ class GalleryDrawer extends StatelessWidget {
), ),
new AboutDrawerItem( new AboutDrawerItem(
applicationVersion: '2016 Q2 Preview', applicationVersion: '2016 Q2 Preview',
applicationIcon: new AssetImage('packages/flutter_gallery_assets/appbar_background.jpg'), applicationIcon: new AssetImage('packages/flutter_gallery_assets/about_logo.png'),
applicationLegalese: '© 2016 The Chromium Authors', applicationLegalese: '© 2016 The Chromium Authors',
aboutBoxChildren: <Widget>[ aboutBoxChildren: <Widget>[
new Padding( new Padding(
......
...@@ -18,6 +18,53 @@ final List<GalleryItem> _demoItems = _itemsWithCategory('Demos'); ...@@ -18,6 +18,53 @@ final List<GalleryItem> _demoItems = _itemsWithCategory('Demos');
final List<GalleryItem> _componentItems = _itemsWithCategory('Components'); final List<GalleryItem> _componentItems = _itemsWithCategory('Components');
final List<GalleryItem> _styleItems = _itemsWithCategory('Style'); final List<GalleryItem> _styleItems = _itemsWithCategory('Style');
class _BackgroundLayer {
_BackgroundLayer({ int level, double parallax })
: assetName = 'packages/flutter_gallery_assets/appbar/appbar_background_layer$level.png',
parallaxTween = new Tween<double>(begin: 0.0, end: parallax);
final String assetName;
final Tween<double> parallaxTween;
}
final List<_BackgroundLayer> _kBackgroundLayers = <_BackgroundLayer>[
new _BackgroundLayer(level: 0, parallax: _kFlexibleSpaceMaxHeight),
new _BackgroundLayer(level: 1, parallax: _kFlexibleSpaceMaxHeight),
new _BackgroundLayer(level: 2, parallax: _kFlexibleSpaceMaxHeight / 2.0),
new _BackgroundLayer(level: 3, parallax: _kFlexibleSpaceMaxHeight / 4.0),
new _BackgroundLayer(level: 4, parallax: _kFlexibleSpaceMaxHeight / 2.0),
new _BackgroundLayer(level: 5, parallax: _kFlexibleSpaceMaxHeight)
];
class _AppBarBackground extends StatelessWidget {
_AppBarBackground({ Key key, this.animation }) : super(key: key);
final Animation<double> animation;
@override
Widget build(BuildContext context) {
return new AnimatedBuilder(
animation: animation,
builder: (BuildContext context, Widget child) {
return new Stack(
children: _kBackgroundLayers.map((_BackgroundLayer layer) {
return new Positioned(
top: -layer.parallaxTween.evaluate(animation),
left: 0.0,
right: 0.0,
bottom: 0.0,
child: new Image.asset(
layer.assetName,
fit: ImageFit.cover,
height: _kFlexibleSpaceMaxHeight
)
);
}).toList()
);
}
);
}
}
class GalleryHome extends StatefulWidget { class GalleryHome extends StatefulWidget {
GalleryHome({ GalleryHome({
Key key, Key key,
...@@ -96,12 +143,14 @@ class GalleryHomeState extends State<GalleryHome> { ...@@ -96,12 +143,14 @@ class GalleryHomeState extends State<GalleryHome> {
appBar: new AppBar( appBar: new AppBar(
expandedHeight: _kFlexibleSpaceMaxHeight, expandedHeight: _kFlexibleSpaceMaxHeight,
flexibleSpace: new FlexibleSpaceBar( flexibleSpace: new FlexibleSpaceBar(
background: new Image.asset( title: new Text('Flutter Gallery'),
'packages/flutter_gallery_assets/appbar_background.jpg', background: new Builder(
fit: ImageFit.cover, builder: (BuildContext context) {
height: _kFlexibleSpaceMaxHeight return new _AppBarBackground(
), animation: Scaffold.of(context).appBarAnimation
title: new Text('Flutter gallery') );
}
)
) )
), ),
appBarBehavior: AppBarBehavior.under, appBarBehavior: AppBarBehavior.under,
......
...@@ -13,7 +13,7 @@ dependencies: ...@@ -13,7 +13,7 @@ dependencies:
flutter_gallery_assets: flutter_gallery_assets:
git: git:
url: https://flutter.googlesource.com/gallery-assets url: https://flutter.googlesource.com/gallery-assets
ref: 3e55082f0128cb4ef95e0e8d2c14e941024d6da9 ref: ef658435dff4e3a7ad671feed19b634d53ae98f9
dev_dependencies: dev_dependencies:
test: any # flutter_test provides the version constraints test: any # flutter_test provides the version constraints
......
...@@ -50,6 +50,6 @@ void main() { ...@@ -50,6 +50,6 @@ void main() {
await tapDrawerItem('Home'); await tapDrawerItem('Home');
await tapDrawerItem('Return to Gallery'); await tapDrawerItem('Return to Gallery');
expect(find.text('Flutter gallery'), findsOneWidget); expect(find.text('Flutter Gallery'), findsOneWidget);
}); });
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment