Skip to content

Commit

Permalink
Merge pull request #5 from Atulin/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Atulin authored May 30, 2019
2 parents 943f7ab + aa63a8d commit 3fd8731
Show file tree
Hide file tree
Showing 13 changed files with 232 additions and 69 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ Derpibooru client made with Flutter

## Changelog

* **30.05.2019**
* Added search history
* Added application info
* Fixed filter sheet not updating
* Fixed image download

* **29.05.2019**
* Replaced `CachedNetworkImage` with `AdvancedNetworkImage`
* Added image cache cleanup
Expand Down
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ android {
}

defaultConfig {
applicationId "angius.com.chryssibooru"
applicationId "com.angius.chryssibooru"
minSdkVersion 16
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
Expand Down
2 changes: 1 addition & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="angius.com.chryssibooru">
package="com.angius.chryssibooru">

<!-- The INTERNET permission is required for development. Specifically,
flutter needs it to communicate with the running application
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package angius.com.chryssibooru;
package com.angius.chryssibooru;

import android.os.Bundle;
import io.flutter.app.FlutterActivity;
Expand Down
6 changes: 3 additions & 3 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = angius.com.chryssibooru;
PRODUCT_BUNDLE_IDENTIFIER = com.angius.chryssibooru;
PRODUCT_NAME = "$(TARGET_NAME)";
VERSIONING_SYSTEM = "apple-generic";
};
Expand Down Expand Up @@ -452,7 +452,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = angius.com.chryssibooru;
PRODUCT_BUNDLE_IDENTIFIER = com.angius.chryssibooru;
PRODUCT_NAME = "$(TARGET_NAME)";
VERSIONING_SYSTEM = "apple-generic";
};
Expand All @@ -475,7 +475,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = angius.com.chryssibooru;
PRODUCT_BUNDLE_IDENTIFIER = com.angius.chryssibooru;
PRODUCT_NAME = "$(TARGET_NAME)";
VERSIONING_SYSTEM = "apple-generic";
};
Expand Down
8 changes: 6 additions & 2 deletions lib/API.dart
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,12 @@ class Tag {

static List<Tag> parse(String tags) {
List<Tag> outTags = new List<Tag>();
for (String t in tags.split(', ')) {
outTags.add(new Tag(t));
if (tags != null){
for (String t in tags.split(', ')) {
outTags.add(new Tag(t));
}
} else {
outTags.add(new Tag('No tags ¯\\_(ツ)_/¯'));
}
return outTags;
}
Expand Down
6 changes: 6 additions & 0 deletions lib/DerpisRepo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,10 @@ class DerpisRepo extends ChangeNotifier {
}
loaded = true;
}

void setRatings(bool safe, bool questionable, bool explicit) {
this.safe = safe;
this.questionable = questionable;
this.explicit = explicit;
}
}
77 changes: 77 additions & 0 deletions lib/Elements/FilterSheet.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import 'package:flutter/material.dart';

class FilterSheet extends StatefulWidget {
FilterSheet({
@required this.safe, @required this.questionable, @required this.explicit,
@required this.safeChanged, @required this.questionableChanged, @required this.explicitChanged
});

final bool safe;
final bool questionable;
final bool explicit;
final ValueChanged safeChanged;
final ValueChanged questionableChanged;
final ValueChanged explicitChanged;

@override
_FilterSheet createState() => _FilterSheet();
}

class _FilterSheet extends State<FilterSheet> {
bool _safe;
bool _questionable;
bool _explicit;

@override
void initState() {
_safe = widget.safe;
_questionable = widget.questionable;
_explicit = widget.explicit;
super.initState();
}

@override
Widget build(BuildContext context) {
return new Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
new CheckboxListTile(
title: new Text('Safe'),
value: _safe,
onChanged: (bool newValue) {
setState(() {
_safe = newValue;
widget.safeChanged(newValue);
});
},
dense: true,
),
new CheckboxListTile(
title: new Text('Questionable'),
value: _questionable,
onChanged: (bool newValue) {
setState(() {
_questionable = newValue;
widget.questionableChanged(newValue);
});
},
dense: true,
),
new CheckboxListTile(
title: new Text('Explicit'),
value: _explicit,
onChanged: (bool newValue) {
setState(() {
_explicit = newValue;
widget.explicitChanged(newValue);
});
},
dense: true,
),
new ListTile(

)
],
);
}
}
2 changes: 1 addition & 1 deletion lib/Helpers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Future openInBrowser(String url) async {
Future downloadImage(String url) async {
try {
// Saved with this method.
var imageId = await ImageDownloader.downloadImage(url);
var imageId = await ImageDownloader.downloadImage('https://'+url);
if (imageId == null) {
debugPrint("Image is null");
}
Expand Down
3 changes: 1 addition & 2 deletions lib/ImageList.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ Future<List<Derpi>> searchImages(String query, bool s, bool q, bool e, String ke
if (e) ratingsArr.add("explicit");
var ratings = ratingsArr.join(" OR ");


var queryString = api_url + "q=" + query;

if (!((s&&q&&e)||!(s&&q&&e))) queryString += "%2C (" + ratings + ")";
if ( !( (s&&q&&e) || (!s&&!q&&!e) ) ) queryString += "%2C (" + ratings + ")";
queryString += "&page=" + page.toString();
if (key != "" || key != null) queryString += "&key=" + key;
if (key == "" || key == null) queryString += "&perpage=" + limit.toString();
Expand Down
Loading

0 comments on commit 3fd8731

Please sign in to comment.