Skip to content
Permalink
Browse files

remove unused font and update how placeholder story is rendered, upda…

…te android image
  • Loading branch information...
MaikuB committed May 12, 2019
1 parent 3abd428 commit d64226780a5ac5185db8d7e13fd1f57167b1909a
Showing with 193 additions and 123 deletions.
  1. +2 −1 android/app/src/main/AndroidManifest.xml
  2. BIN android/app/src/main/ic_launcher-web.png
  3. +74 −0 android/app/src/main/res/drawable/ic_launcher_background.xml
  4. +3 −3 android/app/src/main/res/drawable/launch_background.xml
  5. BIN android/app/src/main/res/drawable/launcher_image.png
  6. BIN android/app/src/main/res/mipmap-hdpi/ic_launcher.png
  7. BIN android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
  8. BIN android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
  9. BIN android/app/src/main/res/mipmap-mdpi/ic_launcher.png
  10. BIN android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
  11. BIN android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
  12. BIN android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
  13. BIN android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
  14. BIN android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
  15. BIN android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
  16. BIN android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png
  17. BIN android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
  18. BIN android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
  19. BIN android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png
  20. BIN android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
  21. BIN fonts/Lato-Bold.ttf
  22. +6 −76 lib/main.dart
  23. +2 −1 lib/screens/stories_page.dart
  24. +13 −0 lib/widgets/placeholder_container.dart
  25. +12 −0 lib/widgets/placeholder_stories.dart
  26. +50 −8 lib/widgets/placeholder_story.dart
  27. +22 −31 lib/widgets/story.dart
  28. +7 −0 pubspec.lock
  29. +2 −3 pubspec.yaml
@@ -11,7 +11,8 @@
<application
android:name="io.flutter.app.FlutterApplication"
android:label="SUpNews"
android:icon="@mipmap/ic_launcher">
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round">
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
Binary file not shown.
@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="utf-8"?>
<vector
android:height="108dp"
android:width="108dp"
android:viewportHeight="108"
android:viewportWidth="108"
xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#008577"
android:pathData="M0,0h108v108h-108z"/>
<path android:fillColor="#00000000" android:pathData="M9,0L9,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,0L19,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M29,0L29,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M39,0L39,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M49,0L49,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M59,0L59,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M69,0L69,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M79,0L79,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M89,0L89,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M99,0L99,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,9L108,9"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,19L108,19"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,29L108,29"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,39L108,39"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,49L108,49"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,59L108,59"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,69L108,69"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,79L108,79"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,89L108,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,99L108,99"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,29L89,29"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,39L89,39"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,49L89,49"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,59L89,59"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,69L89,69"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,79L89,79"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M29,19L29,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M39,19L39,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M49,19L49,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M59,19L59,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M69,19L69,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M79,19L79,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
</vector>
@@ -4,9 +4,9 @@
<item android:drawable="@android:color/white" />

<!-- You can insert your own image assets here -->
<!-- <item>
<item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
android:src="@mipmap/ic_launcher" />
</item>
</layer-list>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN -642 KB fonts/Lato-Bold.ttf
Binary file not shown.
@@ -53,7 +53,11 @@ class ThemeableApp extends StatelessWidget {
fontFamily: 'Lato',
brightness:
store.useDarkMode == true ? Brightness.dark : Brightness.light,
primarySwatch: Colors.blue,
primarySwatch: Colors.teal,
textTheme: TextTheme(
subhead: TextStyle(fontSize: 16, fontWeight: FontWeight.w500),
subtitle: TextStyle(fontWeight: FontWeight.w300),
),
),
home: SafeArea(
child: CupertinoTabScaffold(
@@ -64,7 +68,7 @@ class ThemeableApp extends StatelessWidget {
title: Text('New'),
),
BottomNavigationBarItem(
icon: Icon(Icons.featured_play_list),
icon: Icon(Icons.trending_up),
title: Text('Top'),
),
BottomNavigationBarItem(
@@ -84,7 +88,6 @@ class ThemeableApp extends StatelessWidget {
child: Consumer<NewStoriesStore>(
builder: (context, value, _) => NewStoriesPage(
value,
key: PageStorageKey('New'),
),
),
);
@@ -97,7 +100,6 @@ class ThemeableApp extends StatelessWidget {
child: Consumer<TopStoriesStore>(
builder: (context, value, _) => TopStoriesPage(
value,
key: PageStorageKey('Top'),
),
),
);
@@ -109,77 +111,5 @@ class ThemeableApp extends StatelessWidget {
),
)),
);
// return Observer(
// builder: (_) => MaterialApp(
// title: 'SUpNews',
// theme: ThemeData(
// fontFamily: 'Lato',
// brightness: store.useDarkMode == true
// ? Brightness.dark
// : Brightness.light,
// primarySwatch: Colors.blue,
// ),
// home: DefaultTabController(
// length: 3,
// child: Scaffold(
// bottomNavigationBar: BottomAppBar(
// child: TabBar(
// tabs: [
// Tab(
// icon: Icon(
// Icons.new_releases,
// color: Colors.red,
// ),
// ),
// Tab(
// icon: Icon(
// Icons.featured_play_list,
// color: Colors.red,
// ),
// ),
// Tab(
// icon: Icon(
// Icons.settings,
// color: Colors.red,
// ),
// ),
// ],
// ),
// ),
// body: SafeArea(
// child: TabBarView(
// children: [
// Provider(
// builder: (_) => NewStoriesStore(
// Provider.of<ItemsService>(context),
// Provider.of<PreferencesService>(context),
// ),
// child: Consumer<NewStoriesStore>(
// builder: (context, value, _) => NewStoriesPage(
// value,
// key: PageStorageKey('New'),
// ),
// ),
// ),
// Provider(
// builder: (_) => TopStoriesStore(
// Provider.of<ItemsService>(context),
// Provider.of<PreferencesService>(context),
// ),
// child: Consumer<TopStoriesStore>(
// builder: (context, value, _) => TopStoriesPage(
// value,
// key: PageStorageKey('Top'),
// ),
// ),
// ),
// SettingsPage(),
// ],
// ),
// ),
// ),
// ),
// ),
// );
}
}
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:supnews/models/item.dart';
import 'package:supnews/stores/stories_store.dart';
import 'package:supnews/widgets/placeholder_stories.dart';
import 'package:supnews/widgets/placeholder_story.dart';
import 'package:supnews/widgets/story.dart';

@@ -62,7 +63,7 @@ class _StoriesPageState<T extends StoriesStore> extends State<StoriesPage>
);

default:
return PlaceholderStory();
return PlaceholderStories();
}
},
),
@@ -0,0 +1,13 @@
import 'package:flutter/material.dart';

class PlaceholderContainer extends StatelessWidget {
final Widget child;

const PlaceholderContainer({Key key, @required this.child}) : super(key: key);

@override
Widget build(BuildContext context) => Container(
color: Colors.grey,
child: child,
);
}
@@ -0,0 +1,12 @@
import 'package:flutter/material.dart';
import 'package:supnews/widgets/placeholder_story.dart';

class PlaceholderStories extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ListView.builder(
itemCount: 1,
itemBuilder: (context, index) => PlaceholderStory(),
);
}
}
@@ -1,16 +1,58 @@
import 'package:flutter/material.dart';
import 'package:supnews/widgets/placeholder_container.dart';

class PlaceholderStory extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Align(
alignment: Alignment.topLeft,
child: ListTile(
title: Container(
color: Colors.grey,
child: Text(''),
),
return InkWell(
child: Padding(
padding: const EdgeInsets.fromLTRB(8, 8, 8, 16),
child: Row(
children: [
Center(
child: CircleAvatar(
backgroundColor: Colors.grey,
child: Center(
child: Text(
'',
),
),
),
),
Expanded(
child: Padding(
padding: const EdgeInsets.fromLTRB(8, 0, 0, 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Padding(
padding: const EdgeInsets.fromLTRB(0, 0, 0, 4),
child: PlaceholderContainer(
child: Text(
'',
style: Theme.of(context).textTheme.subhead,
),
),
),
Padding(
padding: const EdgeInsets.fromLTRB(0, 0, 0, 4),
child: PlaceholderContainer(
child: Text(
'',
style: Theme.of(context).textTheme.subtitle,
),
),
),
PlaceholderContainer(
child:
Text('', style: Theme.of(context).textTheme.subtitle),
),
],
),
),
),
],
),
);
));
}
}
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:supnews/models/item.dart';
import 'package:supnews/stores/stories_store.dart';
import 'package:intl/intl.dart' show DateFormat;

class Story extends StatelessWidget {
final Item item;
@@ -26,38 +27,28 @@ class Story extends StatelessWidget {
Expanded(
child: Padding(
padding: const EdgeInsets.fromLTRB(8, 0, 0, 0),
child: Align(
alignment: Alignment.topLeft,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.fromLTRB(0, 0, 0, 4),
child: Text(
item.title,
style: TextStyle(
fontWeight: FontWeight.w500,
fontSize: 16,
),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.fromLTRB(0, 0, 0, 4),
child: Text(item.title,
style: Theme.of(context).textTheme.subhead),
),
Padding(
padding: const EdgeInsets.fromLTRB(0, 0, 0, 4),
child: Text(
'${item.by} - ${DateFormat().format(
DateTime.fromMillisecondsSinceEpoch(item.time * 1000),
)}',
style: Theme.of(context).textTheme.subtitle,
),
Padding(
padding: const EdgeInsets.fromLTRB(0, 0, 0, 4),
child: Text(
item.by,
style: TextStyle(
fontWeight: FontWeight.w300,
),
),
),
Text(
'${item.kids.length} comments',
style: TextStyle(
fontWeight: FontWeight.w300,
),
),
],
),
),
Text(
'${item.kids.length} ${item.kids.length == 1 ? 'comment' : 'comments'}',
style: Theme.of(context).textTheme.subtitle,
),
],
),
),
),

0 comments on commit d642267

Please sign in to comment.
You can’t perform that action at this time.