├── .gitignore
├── LICENSE
├── README.md
├── assets
└── wally_logo.png
├── build.gradle
├── dataprovider
├── .gitignore
├── build.gradle
├── proguard-rules.txt
└── src
│ └── main
│ ├── AndroidManifest.xml
│ └── java
│ └── com
│ └── musenkishi
│ └── wally
│ └── dataprovider
│ ├── DataProvider.java
│ ├── FileManager.java
│ ├── NetworkDataProvider.java
│ ├── SharedPreferencesDataProvider.java
│ ├── models
│ ├── DataProviderError.java
│ └── SaveImageRequest.java
│ ├── okhttp
│ ├── OkHttpStreamFetcher.java
│ └── OkHttpUrlLoader.java
│ └── util
│ └── Parser.java
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── models
├── .gitignore
├── build.gradle
├── proguard-rules.txt
└── src
│ └── main
│ ├── AndroidManifest.xml
│ └── java
│ └── com
│ └── musenkishi
│ └── wally
│ └── models
│ ├── Author.java
│ ├── ExceptionReporter.java
│ ├── Filter.java
│ ├── Image.java
│ ├── ImagePage.java
│ ├── ListFilterGroup.java
│ ├── Rating.java
│ ├── SavedImageData.java
│ ├── Size.java
│ ├── Tag.java
│ └── filters
│ ├── FilterAspectRatioKeys.java
│ ├── FilterBoards.java
│ ├── FilterBoardsKeys.java
│ ├── FilterGroup.java
│ ├── FilterGroupsStructure.java
│ ├── FilterPurity.java
│ ├── FilterPurityKeys.java
│ ├── FilterResOpt.java
│ ├── FilterResOptKeys.java
│ ├── FilterResolutionKeys.java
│ └── FilterTimeSpanKeys.java
├── settings.gradle
└── wally
├── .gitignore
├── build.gradle
├── proguard-project.txt
├── src
└── main
│ ├── AndroidManifest.xml
│ ├── assets
│ └── fonts
│ │ └── Lobster_1.3.otf
│ ├── java
│ ├── com
│ │ └── musenkishi
│ │ │ └── wally
│ │ │ ├── activities
│ │ │ ├── ImageDetailsActivity.java
│ │ │ └── MainActivity.java
│ │ │ ├── adapters
│ │ │ ├── RecyclerImagesAdapter.java
│ │ │ ├── RecyclerSavedImagesAdapter.java
│ │ │ ├── SmartFragmentPagerAdapter.java
│ │ │ └── SmartFragmentStatePagerAdapter.java
│ │ │ ├── anim
│ │ │ ├── BaseItemAnimator.java
│ │ │ ├── ScaleInOutItemAnimator.java
│ │ │ └── interpolator
│ │ │ │ ├── EaseInOutBezierInterpolator.java
│ │ │ │ ├── FastOutLinearInInterpolator.java
│ │ │ │ ├── FastOutSlowInInterpolator.java
│ │ │ │ └── LinearOutSlowInInterpolator.java
│ │ │ ├── base
│ │ │ ├── BaseActivity.java
│ │ │ ├── BaseFragment.java
│ │ │ ├── GridFragment.java
│ │ │ └── WallyApplication.java
│ │ │ ├── fragments
│ │ │ ├── CustomResolutionDialogFragment.java
│ │ │ ├── FilterDialogFragment.java
│ │ │ ├── ImageZoomFragment.java
│ │ │ ├── LatestFragment.java
│ │ │ ├── MaterialDialogFragment.java
│ │ │ ├── RandomImagesFragment.java
│ │ │ ├── SavedImagesFragment.java
│ │ │ ├── SearchFragment.java
│ │ │ └── ToplistFragment.java
│ │ │ ├── muzei
│ │ │ └── WallyArtSource.java
│ │ │ ├── notification
│ │ │ └── NotificationProvider.java
│ │ │ ├── observers
│ │ │ ├── FileReceiver.java
│ │ │ └── FiltersChangeReceiver.java
│ │ │ ├── util
│ │ │ ├── Blur.java
│ │ │ ├── SparseBooleanArrayParcelable.java
│ │ │ ├── TextClickableSpan.java
│ │ │ ├── TextLinkBuilder.java
│ │ │ └── TypefaceSpan.java
│ │ │ └── views
│ │ │ ├── AutoGridView.java
│ │ │ ├── FlowLayout.java
│ │ │ ├── GridRecyclerView.java
│ │ │ ├── ObservableScrollView.java
│ │ │ ├── OverlayLinearLayout.java
│ │ │ ├── TabBarView.java
│ │ │ ├── TabView.java
│ │ │ └── swipeclearlayout
│ │ │ └── SwipeClearLayout.java
│ ├── net
│ │ └── margaritov
│ │ │ └── preference
│ │ │ └── colorpicker
│ │ │ ├── dialog
│ │ │ └── ColorPickerDialogFragment.java
│ │ │ ├── drawable
│ │ │ └── AlphaPatternDrawable.java
│ │ │ ├── preference
│ │ │ └── ColorPickerPreference.java
│ │ │ └── view
│ │ │ ├── ColorPanelView.java
│ │ │ └── ColorPickerView.java
│ └── nl
│ │ └── codesoup
│ │ └── cubicbezier
│ │ └── CubicBezierInterpolator.java
│ └── res
│ ├── anim
│ ├── fade_in.xml
│ ├── fade_in_instant.xml
│ ├── fade_out_instant.xml
│ ├── grow_in.xml
│ ├── layout_details_animation.xml
│ ├── list_cell_animation.xml
│ ├── slide_in_down.xml
│ ├── slide_in_from_left.xml
│ ├── slide_in_from_right.xml
│ └── slide_in_up.xml
│ ├── drawable-hdpi
│ ├── drawer_shadow.9.png
│ └── ic_drawer.png
│ ├── drawable-mdpi
│ ├── drawer_shadow.9.png
│ └── ic_drawer.png
│ ├── drawable-nodpi
│ └── ic_source.png
│ ├── drawable-v21
│ ├── default_selector.xml
│ └── default_selector_check.xml
│ ├── drawable-xhdpi
│ ├── drawer_shadow.9.png
│ ├── ic_drawer.png
│ ├── ic_logo.png
│ ├── ic_logo_transparent.png
│ └── ic_notification_launcher.png
│ ├── drawable-xxhdpi
│ ├── alpha_welcome_drawer.png
│ ├── card_background.9.png
│ ├── chip_background.9.png
│ ├── drawer_shadow.9.png
│ ├── floating_action_button.9.png
│ ├── ic_action_cancel.png
│ ├── ic_action_color.png
│ ├── ic_action_color_clear.png
│ ├── ic_action_color_picker.png
│ ├── ic_action_fullscreen.png
│ ├── ic_action_heart.png
│ ├── ic_action_heart_empty.png
│ ├── ic_action_heart_full.png
│ ├── ic_action_latest.png
│ ├── ic_action_open.png
│ ├── ic_action_overflow.png
│ ├── ic_action_random.png
│ ├── ic_action_refresh.png
│ ├── ic_action_saved.png
│ ├── ic_action_search.png
│ ├── ic_action_set_as.png
│ ├── ic_action_set_as_light.png
│ ├── ic_action_share.png
│ ├── ic_action_toplist.png
│ ├── ic_action_trash.png
│ ├── ic_action_up_material.png
│ ├── ic_check.9.png
│ ├── ic_drawer.png
│ ├── ic_logo.png
│ ├── ic_logo_transparent.png
│ ├── ic_mask_fullscreen.png
│ ├── ic_notification_launcher.png
│ ├── ic_progress_download.png
│ ├── ic_progress_download_light.png
│ ├── ic_search_small.png
│ ├── ic_toolbar_heart.png
│ ├── ic_toolbar_heart_filled.png
│ ├── ic_toolbar_image.png
│ ├── ic_toolbar_open.png
│ ├── ic_toolbar_share.png
│ ├── ic_toolbar_trash.png
│ └── sad_cloud.png
│ ├── drawable-xxxhdpi
│ ├── ic_drawer.png
│ ├── ic_logo.png
│ ├── ic_logo_transparent.png
│ ├── ic_notification_launcher.png
│ └── ic_recent.png
│ ├── drawable
│ ├── circle.xml
│ ├── clip_heart_full.xml
│ ├── clip_random.xml
│ ├── custom_progress_circle.xml
│ ├── custom_progress_circle_light.xml
│ ├── default_selector.xml
│ ├── drawer_cell_background.xml
│ ├── drop_shadow_top.xml
│ ├── ic_heart_download_animation.xml
│ ├── protective_shadow_topdown.xml
│ ├── quick_return_protective_shadow_topdown.xml
│ └── transparent.xml
│ ├── layout-land
│ └── tab_view_merge.xml
│ ├── layout
│ ├── activity_image_details.xml
│ ├── activity_image_zoom.xml
│ ├── activity_main.xml
│ ├── autogridview.xml
│ ├── dialog_base_material.xml
│ ├── dialog_content_custom_resolution.xml
│ ├── dialog_content_filter.xml
│ ├── error_backend.xml
│ ├── fragment_main.xml
│ ├── fragment_main_swiperefresh.xml
│ ├── fragment_search.xml
│ ├── preference_preview_layout.xml
│ ├── tab_bar.xml
│ ├── tab_view_merge.xml
│ ├── view_cell_thumb_tile.xml
│ ├── view_cell_thumb_tile_saved.xml
│ ├── view_color_picker_dialog.xml
│ ├── view_custom_progressbar.xml
│ ├── view_filter_list_item.xml
│ └── view_tag_item.xml
│ ├── menu
│ ├── global.xml
│ ├── image_details.xml
│ ├── images_list.xml
│ ├── images_random.xml
│ ├── images_saved.xml
│ ├── main.xml
│ └── saved_images_context.xml
│ ├── mipmap-xxhdpi
│ └── ic_launcher.png
│ ├── mipmap-xxxhdpi
│ └── ic_launcher.png
│ ├── raw
│ └── notices.xml
│ ├── values-h360dp
│ └── styles.xml
│ ├── values-land
│ └── dimens.xml
│ ├── values-sw600dp-land
│ └── dimens.xml
│ ├── values-sw600dp
│ └── dimens.xml
│ ├── values-v16
│ └── styles.xml
│ ├── values-v19
│ └── styles.xml
│ ├── values-v21
│ ├── refs.xml
│ └── styles.xml
│ └── values
│ ├── arrays.xml
│ ├── attrs.xml
│ ├── colors.xml
│ ├── dimens.xml
│ ├── integers.xml
│ ├── plurals.xml
│ ├── refs.xml
│ ├── strings.xml
│ └── styles.xml
└── version.properties
/.gitignore:
--------------------------------------------------------------------------------
1 | # Created by https://www.gitignore.io
2 |
3 | ### OSX ###
4 | .DS_Store
5 | .AppleDouble
6 | .LSOverride
7 |
8 | # Icon must end with two \r
9 | Icon
10 |
11 |
12 | # Thumbnails
13 | ._*
14 |
15 | # Files that might appear on external disk
16 | .Spotlight-V100
17 | .Trashes
18 |
19 | # Directories potentially created on remote AFP share
20 | .AppleDB
21 | .AppleDesktop
22 | Network Trash Folder
23 | Temporary Items
24 | .apdisk
25 |
26 |
27 | ### Windows ###
28 | # Windows image file caches
29 | Thumbs.db
30 | ehthumbs.db
31 |
32 | # Folder config file
33 | Desktop.ini
34 |
35 | # Recycle Bin used on file shares
36 | $RECYCLE.BIN/
37 |
38 | # Windows Installer files
39 | *.cab
40 | *.msi
41 | *.msm
42 | *.msp
43 |
44 | # Windows shortcuts
45 | *.lnk
46 |
47 |
48 | ### Android ###
49 | # Built application files
50 | *.apk
51 | *.ap_
52 |
53 | # Files for the Dalvik VM
54 | *.dex
55 |
56 | # Java class files
57 | *.class
58 |
59 | # Generated files
60 | bin/
61 | gen/
62 |
63 | # Gradle files
64 | .gradle/
65 | build/
66 |
67 | # Local configuration file (sdk path, etc)
68 | local.properties
69 |
70 | # Proguard folder generated by Eclipse
71 | proguard/
72 |
73 | # Log Files
74 | *.log
75 |
76 |
77 | ### Intellij ###
78 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm
79 |
80 | *.iml
81 |
82 | ## Directory-based project format:
83 | .idea/
84 | # if you remove the above rule, at least ignore the following:
85 |
86 | # User-specific stuff:
87 | # .idea/workspace.xml
88 | # .idea/tasks.xml
89 | # .idea/dictionaries
90 |
91 | # Sensitive or high-churn files:
92 | # .idea/dataSources.ids
93 | # .idea/dataSources.xml
94 | # .idea/sqlDataSources.xml
95 | # .idea/dynamic.xml
96 | # .idea/uiDesigner.xml
97 |
98 | # Gradle:
99 | # .idea/gradle.xml
100 | # .idea/libraries
101 |
102 | # Mongo Explorer plugin:
103 | # .idea/mongoSettings.xml
104 |
105 | ## File-based project format:
106 | *.ipr
107 | *.iws
108 |
109 | ## Plugin-specific files:
110 |
111 | # IntelliJ
112 | out/
113 |
114 | # mpeltonen/sbt-idea plugin
115 | .idea_modules/
116 |
117 | # JIRA plugin
118 | atlassian-ide-plugin.xml
119 |
120 | # Crashlytics plugin (for Android Studio and IntelliJ)
121 | com_crashlytics_export_strings.xml
122 | crashlytics.properties
123 | crashlytics-build.properties
124 |
125 |
126 | ### Gradle ###
127 | .gradle
128 | build/
129 |
130 | # Ignore Gradle GUI config
131 | gradle-app.setting
132 |
133 |
134 | ### Eclipse ###
135 | *.pydevproject
136 | .metadata
137 | .gradle
138 | bin/
139 | tmp/
140 | *.tmp
141 | *.bak
142 | *.swp
143 | *~.nib
144 | local.properties
145 | .settings/
146 | .loadpath
147 |
148 | # External tool builders
149 | .externalToolBuilders/
150 |
151 | # Locally stored "Eclipse launch configurations"
152 | *.launch
153 |
154 | # CDT-specific
155 | .cproject
156 |
157 | # PDT-specific
158 | .buildpath
159 |
160 | # sbteclipse plugin
161 | .target
162 |
163 | # TeXlipse plugin
164 | .texlipse
165 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Wally
2 | =====
3 |
4 | Wally is a fast and efficient open source wallpaper application for Android.
5 |
6 | 
7 |
8 | Wally gets its source of images from [Wallhaven][1]. By scraping the website, it provides the user
9 | with a fast and smooth experience filled with subtle animations and a minimal design. The main goal
10 | of Wally is to provide the same functionality as the website but in a more mobile friendly way.
11 |
12 | Development
13 | -----------
14 | Wally is a gradle project built with Android Studio 0.8.x. To get started, import the project in
15 | Android Studio by choosing the build.gradle
located in the root folder.
16 |
17 | However, you might notice that it won't build right away. This is because you have to provide it
18 | with/generate your own release- and debug keystore. The debug keystore can be generated the same
19 | way as a release keystore. Put the release- and debug keystore files in a directory of your choice
20 | and reference them in a local.properties
file in the root folder of this project.
21 |
22 | Architecture
23 | ------------
24 | Wally is divided into multiple modules; Models, Data Provider, and the main module Wally (UI). This
25 | architecture allows a project to more easily expand to other platforms (e.g. Android Wear
26 | or Android Auto).
27 |
28 | License
29 | -------
30 | Apache 2.0 where applicable. See LICENSE file for details.
31 |
32 | Contributing
33 | ------------
34 | Pull requests are welcome!
35 |
36 | Thanks
37 | ------
38 | * All alpha testers.
39 | * Everyone who has contributed ideas and reported issues!
40 |
41 | Author
42 | ------
43 | Freddie Lust-Hed - @musenkishi
44 |
45 | Disclaimer
46 | ---------
47 | This is not an official Wallhaven product.
48 |
49 | [1]: http://alpha.wallhaven.cc
--------------------------------------------------------------------------------
/assets/wally_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/assets/wally_logo.png
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | mavenCentral()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:1.1.0'
9 | classpath 'com.neenbedankt.gradle.plugins:android-apt:1.2'
10 | }
11 | }
12 |
13 | allprojects {
14 | repositories {
15 | mavenCentral()
16 | maven {
17 | url "https://jitpack.io"
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/dataprovider/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/dataprovider/build.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Freddie (Musenkishi) Lust-Hed
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | apply plugin: 'com.android.library'
18 |
19 | android {
20 | compileSdkVersion 21
21 | buildToolsVersion '21.1.2'
22 | defaultConfig {
23 | minSdkVersion 14
24 | targetSdkVersion 20
25 | versionCode 1
26 | versionName '1.0'
27 | }
28 | buildTypes {
29 | release {
30 | minifyEnabled false
31 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
32 | }
33 | }
34 | productFlavors {
35 | }
36 | }
37 |
38 | dependencies {
39 | compile 'com.squareup.okhttp:okhttp:2.2.0'
40 | compile 'com.github.bumptech.glide:glide:3.5.1'
41 | compile 'org.jsoup:jsoup:1.8.1'
42 | compile 'commons-io:commons-io:2.4'
43 | compile project(':models')
44 | }
45 |
--------------------------------------------------------------------------------
/dataprovider/proguard-rules.txt:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in D:/android-studio/sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the ProGuard
5 | # include property in project.properties.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
--------------------------------------------------------------------------------
/dataprovider/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/dataprovider/src/main/java/com/musenkishi/wally/dataprovider/FileManager.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Freddie (Musenkishi) Lust-Hed
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.musenkishi.wally.dataprovider;
18 |
19 | import android.net.Uri;
20 | import android.os.Environment;
21 |
22 | import java.io.File;
23 | import java.util.ArrayList;
24 |
25 | /**
26 | * Use this to manage files on the external storage.
27 | * Created by Musenkishi on 2014-03-04 19:24.
28 | */
29 | public class FileManager {
30 |
31 | public static final String DIRECTORY_BASE = "/Wally";
32 |
33 | public FileManager() {
34 | }
35 |
36 | public boolean fileExists(String filename){
37 | String root = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES).toString();
38 | File myDir = new File(root + DIRECTORY_BASE);
39 | myDir.mkdirs();
40 | File[] listOfFiles = myDir.listFiles();
41 |
42 | for (File file : listOfFiles)
43 | {
44 | if (file.isFile())
45 | {
46 | String[] filenames = file.getName().split("\\.(?=[^\\.]+$)"); //split filename from it's extension
47 | if(filenames[0].equalsIgnoreCase(filename)) { //matching defined filename
48 | return true;
49 | }
50 | }
51 | }
52 | return false;
53 | }
54 |
55 | public File getFile(String filename){
56 | String root = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES).toString();
57 | File myDir = new File(root + DIRECTORY_BASE);
58 | myDir.mkdirs();
59 | File[] listOfFiles = myDir.listFiles();
60 |
61 | for (File file : listOfFiles)
62 | {
63 | if (file.isFile())
64 | {
65 | String[] filenames = file.getName().split("\\.(?=[^\\.]+$)"); //split filename from it's extension
66 | if(filenames[0].equalsIgnoreCase(filename)) { //matching defined filename
67 | return file;
68 | }
69 | }
70 | }
71 | return null;
72 | }
73 |
74 | public ArrayList getFiles(){
75 | String root = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES).toString();
76 |
77 | ArrayList f = new ArrayList();// list of file paths
78 | File[] listFile;
79 | File myDir = new File(root + DIRECTORY_BASE);
80 |
81 | if (myDir.isDirectory()) {
82 | listFile = myDir.listFiles();
83 | for (int i = 0; i < listFile.length; i++) {
84 | String path = listFile[i].getAbsolutePath();
85 | f.add(Uri.parse(path));
86 | }
87 | }
88 | return f;
89 | }
90 |
91 | }
92 |
--------------------------------------------------------------------------------
/dataprovider/src/main/java/com/musenkishi/wally/dataprovider/models/DataProviderError.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Freddie (Musenkishi) Lust-Hed
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.musenkishi.wally.dataprovider.models;
18 |
19 | /**
20 | * A class used for errors by the DataProvider.
21 | * Created by Musenkishi on 2014-03-01 16:18.
22 | */
23 | public class DataProviderError {
24 |
25 | public enum Type { NETWORK, LOCAL }
26 |
27 | private Type type;
28 | private int httpStatusCode;
29 |
30 | private String message;
31 |
32 | public DataProviderError(Type mType, int httpStatusCode, String message) {
33 | this.type = mType;
34 | this.httpStatusCode = httpStatusCode;
35 | this.message = message;
36 | }
37 |
38 | public Type getType() {
39 | return type;
40 | }
41 |
42 | public int getHttpStatusCode() {
43 | return httpStatusCode;
44 | }
45 |
46 | public String getMessage() {
47 | return message;
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/dataprovider/src/main/java/com/musenkishi/wally/dataprovider/models/SaveImageRequest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Freddie (Musenkishi) Lust-Hed
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.musenkishi.wally.dataprovider.models;
18 |
19 | import android.net.Uri;
20 |
21 | /**
22 | * A class that contains either a download ID, or a SavedImageData. Not both.
23 | *
24 | * Created by Musenkishi on 2014-08-21.
25 | */
26 | public class SaveImageRequest {
27 |
28 | private Long downloadID;
29 | private Uri filePath;
30 |
31 | public SaveImageRequest(Long downloadID) {
32 | this.downloadID = downloadID;
33 | filePath = null;
34 | }
35 |
36 | public SaveImageRequest(Uri filePath) {
37 | this.filePath = filePath;
38 | downloadID = null;
39 | }
40 |
41 | public Long getDownloadID() {
42 | return downloadID;
43 | }
44 |
45 | public void setDownloadID(Long downloadID) {
46 | this.downloadID = downloadID;
47 | }
48 |
49 | public Uri getFilePath() {
50 | return filePath;
51 | }
52 |
53 | public void setFilePath(Uri filePath) {
54 | this.filePath = filePath;
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/dataprovider/src/main/java/com/musenkishi/wally/dataprovider/okhttp/OkHttpStreamFetcher.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Freddie (Musenkishi) Lust-Hed
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.musenkishi.wally.dataprovider.okhttp;
18 |
19 | import com.bumptech.glide.Priority;
20 | import com.bumptech.glide.load.data.DataFetcher;
21 | import com.bumptech.glide.load.model.GlideUrl;
22 | import com.squareup.okhttp.OkHttpClient;
23 | import com.squareup.okhttp.Request;
24 |
25 | import java.io.IOException;
26 | import java.io.InputStream;
27 |
28 | /**
29 | * Fetches an {@link InputStream} using the okhttp library.
30 | */
31 | public class OkHttpStreamFetcher implements DataFetcher {
32 | private final OkHttpClient client;
33 | private final GlideUrl url;
34 | private volatile Request request;
35 | private InputStream stream;
36 |
37 | public OkHttpStreamFetcher(OkHttpClient client, GlideUrl url) {
38 | this.client = client;
39 | this.url = url;
40 | }
41 |
42 | @Override
43 | public InputStream loadData(Priority priority) throws Exception {
44 | request = new Request.Builder()
45 | .url(url.toString())
46 | .build();
47 |
48 | stream = client.newCall(request)
49 | .execute()
50 | .body()
51 | .byteStream();
52 | return stream;
53 | }
54 |
55 | @Override
56 | public void cleanup() {
57 | if (stream == null) {
58 | return;
59 | }
60 | try {
61 | stream.close();
62 | } catch (IOException e) {
63 | // Ignored
64 | }
65 | }
66 |
67 | @Override
68 | public String getId() {
69 | return url.toString();
70 | }
71 |
72 | @Override
73 | public void cancel() {
74 | if (request != null) {
75 | client.cancel(request);
76 | }
77 | }
78 | }
--------------------------------------------------------------------------------
/dataprovider/src/main/java/com/musenkishi/wally/dataprovider/okhttp/OkHttpUrlLoader.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Freddie (Musenkishi) Lust-Hed
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.musenkishi.wally.dataprovider.okhttp;
18 |
19 | import android.content.Context;
20 |
21 | import com.bumptech.glide.load.data.DataFetcher;
22 | import com.bumptech.glide.load.model.GenericLoaderFactory;
23 | import com.bumptech.glide.load.model.GlideUrl;
24 | import com.bumptech.glide.load.model.ModelLoader;
25 | import com.bumptech.glide.load.model.ModelLoaderFactory;
26 | import com.squareup.okhttp.OkHttpClient;
27 |
28 | import java.io.InputStream;
29 |
30 | /**
31 | * A simple model loader for fetching media over http/https using OkHttp.
32 | */
33 | public class OkHttpUrlLoader implements ModelLoader {
34 |
35 | /**
36 | * The default factory for {@link OkHttpUrlLoader}s.
37 | */
38 | public static class Factory implements ModelLoaderFactory {
39 | private static volatile OkHttpClient internalClient;
40 | private OkHttpClient client;
41 |
42 | private static OkHttpClient getInternalClient() {
43 | if (internalClient == null) {
44 | synchronized (Factory.class) {
45 | if (internalClient == null) {
46 | internalClient = new OkHttpClient();
47 | }
48 | }
49 | }
50 | return internalClient;
51 | }
52 |
53 | /**
54 | * Constructor for a new Factory that runs requests using a static singleton client.
55 | */
56 | public Factory() {
57 | this(getInternalClient());
58 | }
59 |
60 | /**
61 | * Constructor for a new Factory that runs requests using given client.
62 | */
63 | public Factory(OkHttpClient client) {
64 | this.client = client;
65 | }
66 |
67 | @Override
68 | public ModelLoader build(Context context, GenericLoaderFactory factories) {
69 | return new OkHttpUrlLoader(client);
70 | }
71 |
72 | @Override
73 | public void teardown() {
74 | // Do nothing, this instance doesn't own the client.
75 | }
76 | }
77 |
78 | private final OkHttpClient client;
79 |
80 | public OkHttpUrlLoader(OkHttpClient client) {
81 | this.client = client;
82 | }
83 |
84 | @Override
85 | public DataFetcher getResourceFetcher(GlideUrl model, int width, int height) {
86 | return new OkHttpStreamFetcher(client, model);
87 | }
88 | }
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Settings specified in this file will override any Gradle settings
5 | # configured through the IDE.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sat Jan 10 13:14:21 CET 2015
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/models/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/models/build.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Freddie (Musenkishi) Lust-Hed
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | apply plugin: 'com.android.library'
18 | apply plugin: 'android-apt'
19 |
20 | android {
21 | compileSdkVersion 21
22 | buildToolsVersion '21.1.2'
23 | defaultConfig {
24 | minSdkVersion 14
25 | targetSdkVersion 20
26 | versionCode 1
27 | versionName '1.0'
28 | }
29 | buildTypes {
30 | release {
31 | minifyEnabled false
32 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
33 | }
34 | }
35 | productFlavors {
36 | }
37 | }
38 |
39 | dependencies {
40 | compile fileTree(dir: 'libs', include: ['*.jar'])
41 | compile 'com.github.frankiesardo:auto-parcel:0.2'
42 | apt 'com.github.frankiesardo:auto-parcel-processor:0.2'
43 | }
44 |
--------------------------------------------------------------------------------
/models/proguard-rules.txt:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in D:/android-studio/sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the ProGuard
5 | # include property in project.properties.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
--------------------------------------------------------------------------------
/models/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/models/src/main/java/com/musenkishi/wally/models/Author.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Freddie (Musenkishi) Lust-Hed
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.musenkishi.wally.models;
18 |
19 | import android.net.Uri;
20 | import android.os.Parcelable;
21 |
22 | import auto.parcel.AutoParcel;
23 |
24 | /**
25 | * Class for the original author
26 | * Created by Musenkishi on 2014-04-05 21:17.
27 | */
28 |
29 | @AutoParcel
30 | public abstract class Author implements Parcelable {
31 |
32 | public abstract String name();
33 | public abstract Uri page();
34 |
35 | public static Author create(String name, Uri page) {
36 | return new AutoParcel_Author(name, page);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/models/src/main/java/com/musenkishi/wally/models/ExceptionReporter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Freddie (Musenkishi) Lust-Hed
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.musenkishi.wally.models;
18 |
19 | /**
20 | * A class to send crash reports throughout the project.
21 | * Created by Freddie (Musenkishi) Lust-Hed on 2014-10-17.
22 | */
23 | public class ExceptionReporter {
24 |
25 | private Class fromClass;
26 | private String customMessage;
27 | private String exceptionMessage;
28 |
29 | public interface OnReportListener {
30 | abstract void report(Class fromClass, String reason, String exceptionMessage);
31 | }
32 |
33 | public ExceptionReporter(Class fromClass, String customMessage, String exceptionMessage) {
34 | this.fromClass = fromClass;
35 | this.customMessage = customMessage;
36 | this.exceptionMessage = exceptionMessage;
37 | }
38 |
39 | public Class getFromClass() {
40 | return fromClass;
41 | }
42 |
43 | public String getCustomMessage() {
44 | return customMessage;
45 | }
46 |
47 | public String getExceptionMessage() {
48 | return exceptionMessage;
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/models/src/main/java/com/musenkishi/wally/models/Filter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Freddie (Musenkishi) Lust-Hed
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.musenkishi.wally.models;
18 |
19 | /**
20 | * A class for defining Filter items.
21 | * Created by Musenkishi on 2014-03-12 22:20.
22 | */
23 | public class Filter {
24 |
25 | private K key;
26 | private V value;
27 | private boolean isCustom = false;
28 |
29 | public Filter(K key, V value) {
30 | this.key = key;
31 | this.value = value;
32 | }
33 |
34 | public Filter(K key, V value, boolean isCustom) {
35 | this.key = key;
36 | this.value = value;
37 | this.isCustom = isCustom;
38 | }
39 |
40 | public K getKey() {
41 | return key;
42 | }
43 |
44 | public void setKey(K key) {
45 | this.key = key;
46 | }
47 |
48 | public V getValue() {
49 | return value;
50 | }
51 |
52 | public void setValue(V value) {
53 | this.value = value;
54 | }
55 |
56 | public boolean isCustom() {
57 | return isCustom;
58 | }
59 |
60 | public void setCustom(boolean isCustom) {
61 | this.isCustom = isCustom;
62 | }
63 |
64 | @Override
65 | public String toString() {
66 | return key + "";
67 | }
68 |
69 | @Override
70 | public boolean equals(Object o) {
71 | if (this == o) return true;
72 | if (!(o instanceof Filter)) return false;
73 |
74 | Filter filter = (Filter) o;
75 |
76 | if (isCustom != filter.isCustom) return false;
77 | if (key != null ? !key.equals(filter.key) : filter.key != null) return false;
78 | if (value != null ? !value.equals(filter.value) : filter.value != null) return false;
79 |
80 | return true;
81 | }
82 |
83 | @Override
84 | public int hashCode() {
85 | int result = key != null ? key.hashCode() : 0;
86 | result = 31 * result + (value != null ? value.hashCode() : 0);
87 | result = 31 * result + (isCustom ? 1 : 0);
88 | return result;
89 | }
90 | }
91 |
--------------------------------------------------------------------------------
/models/src/main/java/com/musenkishi/wally/models/Image.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Freddie (Musenkishi) Lust-Hed
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.musenkishi.wally.models;
18 |
19 | import android.net.Uri;
20 | import android.os.Parcelable;
21 |
22 | import auto.parcel.AutoParcel;
23 |
24 | /**
25 | * Class used for handling an image.
26 | * Created by Musenkishi on 2014-02-23.
27 | */
28 | @AutoParcel
29 | public abstract class Image implements Parcelable {
30 |
31 | public static final String TAG = "com.musenkishi.wally.model.image.tag";
32 |
33 | public abstract String imageId();
34 | public abstract String thumbURL();
35 | public abstract String imagePageURL();
36 | public abstract String resolution();
37 |
38 | public static Image create(String imageId, String thumbURL, String imageURL, String resolution) {
39 | return new AutoParcel_Image(imageId, thumbURL, imageURL, resolution);
40 | }
41 |
42 | public int getWidth(){
43 | if (resolution() != null && resolution().contains("x")) {
44 | String[] parts = resolution().split("x");
45 | String width = parts[0]; // width
46 | if (width != null) {
47 | return Integer.parseInt(width.trim());
48 | } else {
49 | return 0;
50 | }
51 | } else {
52 | return 0;
53 | }
54 | }
55 |
56 | public int getHeight(){
57 | if (resolution() != null && resolution().contains("x")) {
58 | String[] parts = resolution().split("x");
59 | String height = parts[1]; // height
60 | if (height != null) {
61 | return Integer.parseInt(height.trim());
62 | } else {
63 | return 0;
64 | }
65 | } else {
66 | return 0;
67 | }
68 | }
69 |
70 | /**
71 | * Builds and returns the image page URL as a Uri with the scheme replaced with 'wally://'.
72 | */
73 | public Uri generateWallyUri() {
74 | return Uri.parse(imagePageURL()).buildUpon().scheme("wally").build();
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/models/src/main/java/com/musenkishi/wally/models/ImagePage.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Freddie (Musenkishi) Lust-Hed
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.musenkishi.wally.models;
18 |
19 | import android.net.Uri;
20 | import android.os.Parcelable;
21 |
22 | import java.util.ArrayList;
23 |
24 | import auto.parcel.AutoParcel;
25 |
26 | /**
27 | * Contains all available data on an Image.
28 | * Created by Musenkishi on 2014-04-05 21:11.
29 | */
30 | @AutoParcel
31 | public abstract class ImagePage implements Parcelable {
32 |
33 | public abstract String title();
34 | public abstract String imageId();
35 | public abstract Uri imagePath();
36 | public abstract String resolution();
37 | public abstract String category();
38 | public abstract String rating();
39 | public abstract String uploader();
40 | public abstract String uploadDate();
41 | public abstract Author author();
42 | public abstract ArrayList tags();
43 |
44 | public static ImagePage create(String title, String imageId, Uri imagePath, String resolution, String category, String rating, String uploader, String uploadDate, Author author, ArrayList tags) {
45 | return new AutoParcel_ImagePage(title, imageId, imagePath, resolution, category, rating, uploader, uploadDate, author, tags);
46 | }
47 |
48 | public int getImageHeight() {
49 | String height = resolution().split("x")[1].trim();
50 | return Integer.parseInt(height);
51 | }
52 |
53 | public int getImageWidth() {
54 | String width = resolution().split("x")[0].trim();
55 | return Integer.parseInt(width);
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/models/src/main/java/com/musenkishi/wally/models/ListFilterGroup.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Freddie (Musenkishi) Lust-Hed
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.musenkishi.wally.models;
18 |
19 | import com.musenkishi.wally.models.filters.FilterGroup;
20 |
21 | import java.util.List;
22 |
23 | /**
24 | * A Filter class for choosing an option in a list. Could be used with a Spinner.
25 | * Created by Musenkishi on 2014-03-12 19:22.
26 | */
27 | public class ListFilterGroup extends FilterGroup {
28 |
29 | private List> filters;
30 | private Filter selectedFilter;
31 |
32 | public ListFilterGroup(String tag, List> filters) {
33 | this.tag = tag;
34 | this.filters = filters;
35 | }
36 |
37 | public List> getFilters() {
38 | return filters;
39 | }
40 |
41 | public Filter getFilter(int index){
42 | return filters.get(index);
43 | }
44 |
45 | @Override
46 | public void setSelectedOption(Filter filter) {
47 | this.selectedFilter = filter;
48 | }
49 |
50 | public Filter getSelectedFilter(){
51 | return selectedFilter;
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/models/src/main/java/com/musenkishi/wally/models/Rating.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Freddie (Musenkishi) Lust-Hed
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.musenkishi.wally.models;
18 |
19 | /**
20 | * This should be used for rating of Images
21 | * Created by Musenkishi on 2014-02-23.
22 | */
23 | public enum Rating {
24 | NSFW,
25 | SKETCHY,
26 | SFW
27 | }
28 |
--------------------------------------------------------------------------------
/models/src/main/java/com/musenkishi/wally/models/SavedImageData.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Freddie (Musenkishi) Lust-Hed
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.musenkishi.wally.models;
18 |
19 | import android.graphics.Bitmap;
20 | import android.net.Uri;
21 | import android.os.Parcelable;
22 |
23 | import auto.parcel.AutoParcel;
24 |
25 | /**
26 | * Created by Musenkishi on 2014-03-02 23:16.
27 | * Used for notifications.
28 | */
29 | @AutoParcel
30 | public abstract class SavedImageData implements Parcelable {
31 |
32 | public abstract Uri path();
33 | public abstract Bitmap bitmap();
34 |
35 | public static SavedImageData create(Uri path, Bitmap bitmap){
36 | return new AutoParcel_SavedImageData(path, bitmap);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/models/src/main/java/com/musenkishi/wally/models/Size.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Freddie (Musenkishi) Lust-Hed
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.musenkishi.wally.models;
18 |
19 | /**
20 | * Created by Freddie (Musenkishi) Lust-Hed on 2014-10-01.
21 | */
22 | public class Size {
23 |
24 | private int width;
25 | private int height;
26 |
27 | public Size(int width, int height) {
28 | this.width = width;
29 | this.height = height;
30 | }
31 |
32 | public int getHeight() {
33 | return height;
34 | }
35 |
36 | public void setHeight(int height) {
37 | this.height = height;
38 | }
39 |
40 | public int getWidth() {
41 | return width;
42 | }
43 |
44 | public void setWidth(int width) {
45 | this.width = width;
46 | }
47 |
48 | @Override
49 | public boolean equals(Object o) {
50 | if (this == o) return true;
51 | if (!(o instanceof Size)) return false;
52 |
53 | Size size = (Size) o;
54 |
55 | if (height != size.height) return false;
56 | if (width != size.width) return false;
57 |
58 | return true;
59 | }
60 |
61 | @Override
62 | public int hashCode() {
63 | int result = height;
64 | result = 31 * result + width;
65 | return result;
66 | }
67 |
68 | @Override
69 | public String toString() {
70 | return width + "x" + height;
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/models/src/main/java/com/musenkishi/wally/models/Tag.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Freddie (Musenkishi) Lust-Hed
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.musenkishi.wally.models;
18 |
19 | import android.os.Parcelable;
20 |
21 | import auto.parcel.AutoParcel;
22 |
23 | /**
24 | * Placeholder for tags
25 | * Created by Musenkishi on 2014-02-23.
26 | */
27 | @AutoParcel
28 | public abstract class Tag implements Parcelable {
29 |
30 | public abstract String name();
31 |
32 | public static Tag create(String name) {
33 | return new AutoParcel_Tag(name);
34 | }
35 | }
--------------------------------------------------------------------------------
/models/src/main/java/com/musenkishi/wally/models/filters/FilterAspectRatioKeys.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Freddie (Musenkishi) Lust-Hed
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.musenkishi.wally.models.filters;
18 |
19 | import com.musenkishi.wally.models.Filter;
20 |
21 | import java.util.ArrayList;
22 | import java.util.List;
23 |
24 | /**
25 | * Final class containing all values needed for the timespan filter.
26 | * Created by Musenkishi on 2014-03-13 19:30.
27 | */
28 | public final class FilterAspectRatioKeys {
29 |
30 | public static final String PARAMETER_KEY = "ratios";
31 |
32 | public static final Filter RATIO_ALL = new Filter("All", "");
33 | public static final Filter RATIO_PORTRAIT = new Filter("Portrait", "24x32,23x32,22x32,21x32,20x32,19x32,18x32,17x32,16x32,15x32,14x32,13x32,12x32");
34 | public static final Filter RATIO_4_3 = new Filter("4:3", "4x3");
35 | public static final Filter RATIO_5_4 = new Filter("5:4", "5x4");
36 | public static final Filter RATIO_16_9 = new Filter("16:9", "16x9");
37 | public static final Filter RATIO_16_10 = new Filter("16:10", "16x10");
38 | public static final Filter RATIO_32_9 = new Filter("32:9", "32x9");
39 | public static final Filter RATIO_48_9 = new Filter("48:9", "48x9");
40 |
41 | public static List> getOrderedList(){
42 |
43 | ArrayList> ratios = new ArrayList>();
44 |
45 | ratios.add(RATIO_ALL);
46 | ratios.add(RATIO_PORTRAIT);
47 | ratios.add(RATIO_4_3);
48 | ratios.add(RATIO_5_4);
49 | ratios.add(RATIO_16_9);
50 | ratios.add(RATIO_16_10);
51 | ratios.add(RATIO_32_9);
52 | ratios.add(RATIO_48_9);
53 |
54 | return ratios;
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/models/src/main/java/com/musenkishi/wally/models/filters/FilterBoards.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Freddie (Musenkishi) Lust-Hed
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.musenkishi.wally.models.filters;
18 |
19 | /**
20 | * A class for the board filtering.
21 | * Created by Musenkishi on 2014-03-14 20:32.
22 | */
23 | public class FilterBoards {
24 |
25 | private boolean generalChecked = true;
26 | private boolean animeChecked = true;
27 | private boolean peopleChecked = false;
28 |
29 | public FilterBoards(boolean generalChecked, boolean animeChecked, boolean peopleChecked) {
30 | this.generalChecked = generalChecked;
31 | this.animeChecked = animeChecked;
32 | this.peopleChecked = peopleChecked;
33 | }
34 |
35 | public FilterBoards(String paramValue) {
36 | this.generalChecked = "1".equals(paramValue.subSequence(0,1));
37 | this.animeChecked = "1".equals(paramValue.subSequence(1,2));
38 | this.peopleChecked = "1".equals(paramValue.subSequence(2,3));
39 | }
40 |
41 | public boolean isGeneralChecked() {
42 | return generalChecked;
43 | }
44 |
45 | public void setGeneralChecked(boolean generalChecked) {
46 | this.generalChecked = generalChecked;
47 | }
48 |
49 | public boolean isAnimeChecked() {
50 | return animeChecked;
51 | }
52 |
53 | public void setAnimeChecked(boolean animeChecked) {
54 | this.animeChecked = animeChecked;
55 | }
56 |
57 | public boolean isPeopleChecked() {
58 | return peopleChecked;
59 | }
60 |
61 | public void setPeopleChecked(boolean peopleChecked) {
62 | this.peopleChecked = peopleChecked;
63 | }
64 |
65 | /**
66 | * This will return a formatted String that can be used as a parameter value.
67 | * @return returns a formatted value depending on the boolean values.
68 | */
69 | public String getFormattedValue(){
70 | String formattedString = "";
71 |
72 | formattedString += generalChecked ? "1" : "0";
73 |
74 | formattedString += animeChecked ? "1" : "0";
75 |
76 | formattedString += peopleChecked ? "1" : "0";
77 |
78 | return formattedString;
79 | }
80 |
81 | @Override
82 | public boolean equals(Object o) {
83 | if (this == o) return true;
84 | if (!(o instanceof FilterBoards)) return false;
85 |
86 | FilterBoards that = (FilterBoards) o;
87 |
88 | if (animeChecked != that.animeChecked) return false;
89 | if (generalChecked != that.generalChecked) return false;
90 | if (peopleChecked != that.peopleChecked) return false;
91 |
92 | return true;
93 | }
94 |
95 | @Override
96 | public int hashCode() {
97 | int result = (generalChecked ? 1 : 0);
98 | result = 31 * result + (animeChecked ? 1 : 0);
99 | result = 31 * result + (peopleChecked ? 1 : 0);
100 | return result;
101 | }
102 | }
103 |
--------------------------------------------------------------------------------
/models/src/main/java/com/musenkishi/wally/models/filters/FilterBoardsKeys.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Freddie (Musenkishi) Lust-Hed
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.musenkishi.wally.models.filters;
18 |
19 | /**
20 | * Final class containing all values needed for the boards filter.
21 | * Created by Musenkishi on 2014-03-14 20:20.
22 | */
23 | public final class FilterBoardsKeys {
24 |
25 | public static final String PARAMETER_KEY = "categories";
26 | public static final String BOARD_GENERAL_KEY = "1";
27 | public static final String BOARD_ANIME_KEY = "1";
28 | public static final String BOARD_PEOPLE = "1";
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/models/src/main/java/com/musenkishi/wally/models/filters/FilterGroup.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Freddie (Musenkishi) Lust-Hed
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.musenkishi.wally.models.filters;
18 |
19 | import com.musenkishi.wally.models.Filter;
20 |
21 | /**
22 | * Interface for defining a filter
23 | * Created by Musenkishi on 2014-03-12 19:16.
24 | */
25 | public abstract class FilterGroup {
26 |
27 | protected String tag;
28 |
29 | protected abstract void setSelectedOption(Filter filter);
30 |
31 | public String getTag(){
32 | return tag;
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/models/src/main/java/com/musenkishi/wally/models/filters/FilterGroupsStructure.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Freddie (Musenkishi) Lust-Hed
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.musenkishi.wally.models.filters;
18 |
19 | import com.musenkishi.wally.models.Filter;
20 |
21 | /**
22 | * Class with all filters gathered in one place.
23 | * Created by Musenkishi on 2014-03-13 21:34.
24 | */
25 | public class FilterGroupsStructure {
26 |
27 | //timespan
28 | private Filter timespanFilter;
29 | //boards
30 | private String boardsFilter;
31 | //maturity
32 | private String purityFilter;
33 | //aspect ratio
34 | private Filter aspectRatioFilter;
35 | //resolution-option
36 | private String resOptFilter;
37 | //resolution
38 | private Filter resolutionFilter;
39 |
40 | public FilterGroupsStructure() {
41 | }
42 |
43 | public Filter getTimespanFilter() {
44 | return timespanFilter;
45 | }
46 |
47 | public void setTimespanFilter(Filter timespanFilter) {
48 | this.timespanFilter = timespanFilter;
49 | }
50 |
51 | public String getBoardsFilter() {
52 | return boardsFilter;
53 | }
54 |
55 | public void setBoardsFilter(String boardsFilter) {
56 | this.boardsFilter = boardsFilter;
57 | }
58 |
59 | public String getPurityFilter() {
60 | return purityFilter;
61 | }
62 |
63 | public void setPurityFilter(String maturityFilter) {
64 | this.purityFilter = maturityFilter;
65 | }
66 |
67 | public Filter getAspectRatioFilter() {
68 | return aspectRatioFilter;
69 | }
70 |
71 | public void setAspectRatioFilter(Filter aspectRatioFilter) {
72 | this.aspectRatioFilter = aspectRatioFilter;
73 | }
74 |
75 | public String getResOptFilter() {
76 | return resOptFilter;
77 | }
78 |
79 | public void setResOptFilter(String resOptFilter) {
80 | this.resOptFilter = resOptFilter;
81 | }
82 |
83 | public Filter getResolutionFilter() {
84 | return resolutionFilter;
85 | }
86 |
87 | public void setResolutionFilter(Filter resolutionFilter) {
88 | this.resolutionFilter = resolutionFilter;
89 | }
90 | }
91 |
--------------------------------------------------------------------------------
/models/src/main/java/com/musenkishi/wally/models/filters/FilterPurity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Freddie (Musenkishi) Lust-Hed
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.musenkishi.wally.models.filters;
18 |
19 | /**
20 | * A class for the board filtering.
21 | * Created by Musenkishi on 2014-03-14 21:17.
22 | */
23 | public class FilterPurity {
24 |
25 | private boolean sfwChecked = true;
26 | private boolean sketchyChecked = true;
27 |
28 | public FilterPurity(boolean sfwChecked, boolean sketchyChecked) {
29 | this.sfwChecked = sfwChecked;
30 | this.sketchyChecked = sketchyChecked;
31 | }
32 |
33 | public FilterPurity(String paramValue) {
34 | this.sfwChecked = String.valueOf(paramValue.charAt(0)).equalsIgnoreCase("1");
35 | this.sketchyChecked = String.valueOf(paramValue.charAt(1)).equalsIgnoreCase("1");
36 | }
37 |
38 | public boolean isSfwChecked() {
39 | return sfwChecked;
40 | }
41 |
42 | public void setSfwChecked(boolean sfwChecked) {
43 | this.sfwChecked = sfwChecked;
44 | }
45 |
46 | public boolean isSketchyChecked() {
47 | return sketchyChecked;
48 | }
49 |
50 | public void setSketchyChecked(boolean sketchyChecked) {
51 | this.sketchyChecked = sketchyChecked;
52 | }
53 |
54 | /**
55 | * This will return a formatted String that can be used as a parameter value.
56 | *
57 | * @return returns a formatted value depending on the boolean values.
58 | */
59 | public String getFormattedValue() {
60 | String formattedString = "";
61 | formattedString += sfwChecked ? FilterPurityKeys.SFW_KEY : "0";
62 | formattedString += sketchyChecked ? FilterPurityKeys.SKETCHY_KEY : "0";
63 | formattedString += "0";
64 | return formattedString;
65 | }
66 |
67 | @Override
68 | public boolean equals(Object o) {
69 | if (this == o) return true;
70 | if (!(o instanceof FilterPurity)) return false;
71 |
72 | FilterPurity that = (FilterPurity) o;
73 |
74 | if (sketchyChecked != that.sketchyChecked) return false;
75 | if (sfwChecked != that.sfwChecked) return false;
76 |
77 | return true;
78 | }
79 |
80 | @Override
81 | public int hashCode() {
82 | int result = (sfwChecked ? 1 : 0);
83 | result = 31 * result + (sketchyChecked ? 1 : 0);
84 | return result;
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/models/src/main/java/com/musenkishi/wally/models/filters/FilterPurityKeys.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Freddie (Musenkishi) Lust-Hed
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.musenkishi.wally.models.filters;
18 |
19 | /**
20 | * Final class containing all values needed for the boards filter.
21 | * Created by Musenkishi on 2014-03-14 21:17.
22 | */
23 | public final class FilterPurityKeys {
24 |
25 | public static final String PARAMETER_KEY = "purity";
26 | public static final String SFW_KEY = "1";
27 | public static final String SKETCHY_KEY = "1";
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/models/src/main/java/com/musenkishi/wally/models/filters/FilterResOpt.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Freddie (Musenkishi) Lust-Hed
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.musenkishi.wally.models.filters;
18 |
19 | /**
20 | * A class for the resolution option filter.
21 | * Created by Musenkishi on 2014-03-15 00:23.
22 | */
23 | public class FilterResOpt {
24 |
25 | private boolean exactly = true;
26 | private boolean atLeast = true;
27 |
28 | public FilterResOpt(boolean exactly, boolean atLeast) {
29 | this.exactly = exactly;
30 | this.atLeast = atLeast;
31 | }
32 |
33 | public FilterResOpt(String paramValue) {
34 | this.exactly = paramValue.contains(FilterResOptKeys.EXACTLY);
35 | this.atLeast = paramValue.contains(FilterResOptKeys.AT_LEAST);
36 | }
37 |
38 | public boolean isExactly() {
39 | return exactly;
40 | }
41 |
42 | public void setExactly(boolean exactly) {
43 | this.exactly = exactly;
44 | }
45 |
46 | public boolean isAtLeast() {
47 | return atLeast;
48 | }
49 |
50 | public void setAtLeast(boolean atLeast) {
51 | this.atLeast = atLeast;
52 | }
53 |
54 | /**
55 | * This will return a formatted String that can be used as a parameter value.
56 | *
57 | * @return returns a formatted value depending on the boolean values.
58 | */
59 | public String getFormattedValue() {
60 | return exactly ? FilterResOptKeys.EXACTLY : FilterResOptKeys.AT_LEAST;
61 | }
62 |
63 | @Override
64 | public boolean equals(Object o) {
65 | if (this == o) return true;
66 | if (!(o instanceof FilterResOpt)) return false;
67 |
68 | FilterResOpt that = (FilterResOpt) o;
69 |
70 | if (atLeast != that.atLeast) return false;
71 | if (exactly != that.exactly) return false;
72 |
73 | return true;
74 | }
75 |
76 | @Override
77 | public int hashCode() {
78 | int result = (exactly ? 1 : 0);
79 | result = 31 * result + (atLeast ? 1 : 0);
80 | return result;
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/models/src/main/java/com/musenkishi/wally/models/filters/FilterResOptKeys.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Freddie (Musenkishi) Lust-Hed
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.musenkishi.wally.models.filters;
18 |
19 | /**
20 | * Final class containing all values needed for the resolution option filter.
21 | * Created by Musenkishi on 2014-03-15 00:24.
22 | */
23 | public final class FilterResOptKeys {
24 |
25 | public static final String PARAMETER_KEY = "res_opt";
26 | public static final String EXACTLY = "eqeq";
27 | public static final String AT_LEAST = "gteq";
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/models/src/main/java/com/musenkishi/wally/models/filters/FilterTimeSpanKeys.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Freddie (Musenkishi) Lust-Hed
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.musenkishi.wally.models.filters;
18 |
19 | import com.musenkishi.wally.models.Filter;
20 |
21 | import java.util.ArrayList;
22 | import java.util.List;
23 |
24 | /**
25 | * Final class containing all values needed for the timespan filter.
26 | * Created by Musenkishi on 2014-03-13 19:30.
27 | */
28 | public final class FilterTimeSpanKeys {
29 |
30 | public static final String PARAMETER_KEY = "ts";
31 |
32 | public static final Filter TIMESPAN_24H = new Filter("1 day (24h)", "1d");
33 | public static final Filter TIMESPAN_3_DAYS = new Filter("3 days", "3d");
34 | public static final Filter TIMESPAN_1_WEEK = new Filter("1 week", "1w");
35 | public static final Filter TIMESPAN_2_WEEKS = new Filter("2 weeks", "2w");
36 | public static final Filter TIMESPAN_1_MONTH = new Filter("1 month", "1m");
37 | public static final Filter TIMESPAN_2_MONTHS = new Filter("2 months", "2m");
38 | public static final Filter TIMESPAN_3_MONTHS = new Filter("3 months", "3m");
39 | public static final Filter TIMESPAN_ALL_TIME = new Filter("All time", "1");
40 |
41 | public static List> getOrderedList(){
42 |
43 | ArrayList> filters = new ArrayList>();
44 |
45 | filters.add(TIMESPAN_24H);
46 | filters.add(TIMESPAN_3_DAYS);
47 | filters.add(TIMESPAN_1_WEEK);
48 | filters.add(TIMESPAN_2_WEEKS);
49 | filters.add(TIMESPAN_1_MONTH);
50 | filters.add(TIMESPAN_2_MONTHS);
51 | filters.add(TIMESPAN_3_MONTHS);
52 | filters.add(TIMESPAN_ALL_TIME);
53 |
54 | return filters;
55 | }
56 |
57 | }
58 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':dataprovider', ':models', 'wally'
2 |
--------------------------------------------------------------------------------
/wally/.gitignore:
--------------------------------------------------------------------------------
1 | # Created by https://www.gitignore.io
2 |
3 | ### OSX ###
4 | .DS_Store
5 | .AppleDouble
6 | .LSOverride
7 |
8 | # Icon must end with two \r
9 | Icon
10 |
11 |
12 | # Thumbnails
13 | ._*
14 |
15 | # Files that might appear on external disk
16 | .Spotlight-V100
17 | .Trashes
18 |
19 | # Directories potentially created on remote AFP share
20 | .AppleDB
21 | .AppleDesktop
22 | Network Trash Folder
23 | Temporary Items
24 | .apdisk
25 |
26 |
27 | ### Windows ###
28 | # Windows image file caches
29 | Thumbs.db
30 | ehthumbs.db
31 |
32 | # Folder config file
33 | Desktop.ini
34 |
35 | # Recycle Bin used on file shares
36 | $RECYCLE.BIN/
37 |
38 | # Windows Installer files
39 | *.cab
40 | *.msi
41 | *.msm
42 | *.msp
43 |
44 | # Windows shortcuts
45 | *.lnk
46 |
47 |
48 | ### Android ###
49 | # Built application files
50 | *.apk
51 | *.ap_
52 |
53 | # Files for the Dalvik VM
54 | *.dex
55 |
56 | # Java class files
57 | *.class
58 |
59 | # Generated files
60 | bin/
61 | gen/
62 |
63 | # Gradle files
64 | .gradle/
65 | build/
66 |
67 | # Local configuration file (sdk path, etc)
68 | local.properties
69 |
70 | # Proguard folder generated by Eclipse
71 | proguard/
72 |
73 | # Log Files
74 | *.log
75 |
76 |
77 | ### Intellij ###
78 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm
79 |
80 | *.iml
81 |
82 | ## Directory-based project format:
83 | .idea/
84 | # if you remove the above rule, at least ignore the following:
85 |
86 | # User-specific stuff:
87 | # .idea/workspace.xml
88 | # .idea/tasks.xml
89 | # .idea/dictionaries
90 |
91 | # Sensitive or high-churn files:
92 | # .idea/dataSources.ids
93 | # .idea/dataSources.xml
94 | # .idea/sqlDataSources.xml
95 | # .idea/dynamic.xml
96 | # .idea/uiDesigner.xml
97 |
98 | # Gradle:
99 | # .idea/gradle.xml
100 | # .idea/libraries
101 |
102 | # Mongo Explorer plugin:
103 | # .idea/mongoSettings.xml
104 |
105 | ## File-based project format:
106 | *.ipr
107 | *.iws
108 |
109 | ## Plugin-specific files:
110 |
111 | # IntelliJ
112 | out/
113 |
114 | # mpeltonen/sbt-idea plugin
115 | .idea_modules/
116 |
117 | # JIRA plugin
118 | atlassian-ide-plugin.xml
119 |
120 | # Crashlytics plugin (for Android Studio and IntelliJ)
121 | com_crashlytics_export_strings.xml
122 | crashlytics.properties
123 | crashlytics-build.properties
124 |
125 |
126 | ### Gradle ###
127 | .gradle
128 | build/
129 |
130 | # Ignore Gradle GUI config
131 | gradle-app.setting
132 |
133 |
134 | ### Eclipse ###
135 | *.pydevproject
136 | .metadata
137 | .gradle
138 | bin/
139 | tmp/
140 | *.tmp
141 | *.bak
142 | *.swp
143 | *~.nib
144 | local.properties
145 | .settings/
146 | .loadpath
147 |
148 | # External tool builders
149 | .externalToolBuilders/
150 |
151 | # Locally stored "Eclipse launch configurations"
152 | *.launch
153 |
154 | # CDT-specific
155 | .cproject
156 |
157 | # PDT-specific
158 | .buildpath
159 |
160 | # sbteclipse plugin
161 | .target
162 |
163 | # TeXlipse plugin
164 | .texlipse
165 |
--------------------------------------------------------------------------------
/wally/proguard-project.txt:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in D:/android-studio/sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the ProGuard
5 | # include property in project.properties.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
19 | -keep class android.support.v7.widget.ShareActionProvider { *; }
20 | -keep public class * extends android.app,backup.BackupAgent
21 | -keep public class org.jsoup.**
22 | -dontwarn com.squareup.okhttp.**
23 | -dontwarn com.squareup.okio.**
24 | -dontwarn okio.**
25 | -keep class * implements android.os.Parcelable {
26 | public static final android.os.Parcelable$Creator *;
27 | static ** CREATOR;
28 | }
29 | -keep class com.musenkishi.wally.models.** {
30 | public protected private *;
31 | }
32 | -keep public class com.bumptech.glide.**
33 | -keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** {
34 | **[] $VALUES;
35 | public *;
36 | }
--------------------------------------------------------------------------------
/wally/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
35 |
36 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
58 |
59 |
60 |
61 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
--------------------------------------------------------------------------------
/wally/src/main/assets/fonts/Lobster_1.3.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/assets/fonts/Lobster_1.3.otf
--------------------------------------------------------------------------------
/wally/src/main/java/com/musenkishi/wally/adapters/SmartFragmentPagerAdapter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Freddie (Musenkishi) Lust-Hed
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.musenkishi.wally.adapters;
18 |
19 | import android.support.v4.app.Fragment;
20 | import android.support.v4.app.FragmentManager;
21 |
22 | import com.musenkishi.wally.fragments.LatestFragment;
23 | import com.musenkishi.wally.fragments.RandomImagesFragment;
24 | import com.musenkishi.wally.fragments.SavedImagesFragment;
25 | import com.musenkishi.wally.fragments.SearchFragment;
26 | import com.musenkishi.wally.fragments.ToplistFragment;
27 |
28 | /**
29 | * Created by Musenkishi on 2014-05-26 17:26.
30 | */
31 | public class SmartFragmentPagerAdapter extends SmartFragmentStatePagerAdapter {
32 | private static int NUM_ITEMS = 5;
33 |
34 | public SmartFragmentPagerAdapter(FragmentManager fragmentManager) {
35 | super(fragmentManager);
36 | }
37 |
38 | // Returns total number of pages
39 | @Override
40 | public int getCount() {
41 | return NUM_ITEMS;
42 | }
43 |
44 | // Returns the fragment to display for that page
45 | @Override
46 | public Fragment getItem(int position) {
47 | switch (position) {
48 | case 0:
49 | return ToplistFragment.newInstance();
50 | case 1:
51 | return LatestFragment.newInstance();
52 | case 2:
53 | return SearchFragment.newInstance();
54 | case 3:
55 | return RandomImagesFragment.newInstance();
56 | case 4:
57 | return SavedImagesFragment.newInstance();
58 | default:
59 | return null;
60 | }
61 | }
62 |
63 | // Returns the page title for the top indicator
64 | @Override
65 | public CharSequence getPageTitle(int position) {
66 | return "Page " + position;
67 | }
68 |
69 | }
70 |
--------------------------------------------------------------------------------
/wally/src/main/java/com/musenkishi/wally/adapters/SmartFragmentStatePagerAdapter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Freddie (Musenkishi) Lust-Hed
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.musenkishi.wally.adapters;
18 |
19 | import android.support.v4.app.Fragment;
20 | import android.support.v4.app.FragmentManager;
21 | import android.support.v4.app.FragmentStatePagerAdapter;
22 | import android.util.SparseArray;
23 | import android.view.ViewGroup;
24 |
25 | /**
26 | * Extension of FragmentStatePagerAdapter which intelligently caches
27 | * all active fragments and manages the fragment lifecycles.
28 | * Usage involves extending from SmartFragmentStatePagerAdapter as you would any other PagerAdapter.
29 | *
30 | * Created by Musenkishi on 2014-05-26.
31 | */
32 | public abstract class SmartFragmentStatePagerAdapter extends FragmentStatePagerAdapter {
33 | // Sparse array to keep track of registered fragments in memory
34 | private SparseArray registeredFragments = new SparseArray();
35 |
36 | public SmartFragmentStatePagerAdapter(FragmentManager fragmentManager) {
37 | super(fragmentManager);
38 | }
39 |
40 | // Register the fragment when the item is instantiated
41 | @Override
42 | public Object instantiateItem(ViewGroup container, int position) {
43 | Fragment fragment = (Fragment) super.instantiateItem(container, position);
44 | registeredFragments.put(position, fragment);
45 | return fragment;
46 | }
47 |
48 | // Unregister when the item is inactive
49 | @Override
50 | public void destroyItem(ViewGroup container, int position, Object object) {
51 | registeredFragments.remove(position);
52 | super.destroyItem(container, position, object);
53 | }
54 |
55 | // Returns the fragment for the position (if instantiated)
56 | public Fragment getRegisteredFragment(int position) {
57 | return registeredFragments.get(position);
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/wally/src/main/java/com/musenkishi/wally/anim/interpolator/EaseInOutBezierInterpolator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Freddie (Musenkishi) Lust-Hed
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.musenkishi.wally.anim.interpolator;
18 |
19 | import nl.codesoup.cubicbezier.CubicBezierInterpolator;
20 |
21 | /**
22 | * Created by Freddie (Musenkishi) Lust-Hed on 2014-09-26.
23 | */
24 | public class EaseInOutBezierInterpolator extends CubicBezierInterpolator {
25 |
26 | public EaseInOutBezierInterpolator() {
27 | super(0.6f, 0.0f, 0.4f, 1.0f);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/wally/src/main/java/com/musenkishi/wally/anim/interpolator/FastOutLinearInInterpolator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Freddie (Musenkishi) Lust-Hed
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.musenkishi.wally.anim.interpolator;
18 |
19 | import nl.codesoup.cubicbezier.CubicBezierInterpolator;
20 |
21 | /**
22 | * Created by Freddie (Musenkishi) Lust-Hed on 2014-09-26.
23 | */
24 | public class FastOutLinearInInterpolator extends CubicBezierInterpolator {
25 |
26 | public FastOutLinearInInterpolator() {
27 | super(0.4f, 0.0f, 1.0f, 1.0f);
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/wally/src/main/java/com/musenkishi/wally/anim/interpolator/FastOutSlowInInterpolator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Freddie (Musenkishi) Lust-Hed
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.musenkishi.wally.anim.interpolator;
18 |
19 | import nl.codesoup.cubicbezier.CubicBezierInterpolator;
20 |
21 | /**
22 | * Created by Freddie (Musenkishi) Lust-Hed on 2014-09-26.
23 | */
24 | public class FastOutSlowInInterpolator extends CubicBezierInterpolator {
25 |
26 | public FastOutSlowInInterpolator() {
27 | super(0.4f, 0.0f, 0.2f, 1.0f);
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/wally/src/main/java/com/musenkishi/wally/anim/interpolator/LinearOutSlowInInterpolator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Freddie (Musenkishi) Lust-Hed
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.musenkishi.wally.anim.interpolator;
18 |
19 | import nl.codesoup.cubicbezier.CubicBezierInterpolator;
20 |
21 | /**
22 | * Created by Freddie (Musenkishi) Lust-Hed on 2014-09-26.
23 | */
24 | public class LinearOutSlowInInterpolator extends CubicBezierInterpolator {
25 |
26 | public LinearOutSlowInInterpolator() {
27 | super(0.0f, 0.0f, 0.2f, 1.0f);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/wally/src/main/java/com/musenkishi/wally/base/BaseFragment.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Freddie (Musenkishi) Lust-Hed
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.musenkishi.wally.base;
18 |
19 | import android.app.Activity;
20 | import android.os.Bundle;
21 | import android.support.v4.app.Fragment;
22 | import android.view.View;
23 |
24 | import com.musenkishi.wally.R;
25 |
26 | /**
27 | * A base class where you can put logic that is needed in all fragments.
28 | * Created by Musenkishi on 2014-03-07 15:03.
29 | */
30 | public abstract class BaseFragment extends Fragment {
31 |
32 | protected int color;
33 |
34 | @Override
35 | public void onActivityCreated(Bundle savedInstanceState) {
36 | super.onActivityCreated(savedInstanceState);
37 | }
38 |
39 | /**
40 | * Will be called when the fragment comes visible to the user (e.g. inside a viewpager)
41 | */
42 | @Override
43 | public void setUserVisibleHint(boolean isVisibleToUser) {
44 | super.setUserVisibleHint(isVisibleToUser);
45 | if (isVisibleToUser && color != 0) {
46 | ((BaseActivity) getActivity()).colorizeActionBar(color);
47 | }
48 | }
49 |
50 | protected void setActionBarColor(int color){
51 | this.color = color;
52 | }
53 |
54 | public int getAppBarColor(){
55 | return color;
56 | }
57 |
58 | public static void setInsets(Activity context, View view, boolean useStatusBarHeight, int extraHeight, int extraBottom) {
59 | int otherPadding = view.getResources().getDimensionPixelSize(R.dimen.gridview_other_padding);
60 | int bottomPadding = otherPadding + extraBottom;
61 | int statusbarHeight = 0;
62 | view.setPadding(
63 | otherPadding,
64 | statusbarHeight + extraHeight + otherPadding,
65 | otherPadding,
66 | bottomPadding
67 | );
68 | }
69 |
70 | }
71 |
--------------------------------------------------------------------------------
/wally/src/main/java/com/musenkishi/wally/muzei/WallyArtSource.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Freddie (Musenkishi) Lust-Hed
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.musenkishi.wally.muzei;
18 |
19 | import android.content.Intent;
20 | import android.util.Log;
21 |
22 | import com.google.android.apps.muzei.api.Artwork;
23 | import com.google.android.apps.muzei.api.RemoteMuzeiArtSource;
24 | import com.musenkishi.wally.base.WallyApplication;
25 | import com.musenkishi.wally.dataprovider.NetworkDataProvider;
26 | import com.musenkishi.wally.models.Image;
27 | import com.musenkishi.wally.models.ImagePage;
28 |
29 | import java.util.ArrayList;
30 | import java.util.Random;
31 |
32 | /**
33 | * A very basic Muzei extension, providing the top number of wallpapers from the toplist.
34 | * It's based on the user's filter preferences.
35 | *
36 | * Created by Freddie (Musenkishi) Lust-Hed on 2014-08-23.
37 | */
38 | public class WallyArtSource extends RemoteMuzeiArtSource {
39 |
40 | public static final String TAG = "WallyArtSource";
41 |
42 | private static final String SOURCE_NAME = "WallyArtSource";
43 | private static final int ROTATE_TIME_MILLIS = 3 * 60 * 60 * 1000; // rotate every 3 hours
44 |
45 | public WallyArtSource(){
46 | super(SOURCE_NAME);
47 | }
48 |
49 | @Override
50 | public void onCreate() {
51 | super.onCreate();
52 | setUserCommands(BUILTIN_COMMAND_ID_NEXT_ARTWORK);
53 | }
54 |
55 | @Override
56 | protected void onTryUpdate(int reason) throws RetryException {
57 | final ArrayList images = WallyApplication.getDataProviderInstance().getImagesSync(NetworkDataProvider.PATH_TOPLIST, 1, WallyApplication.getFilterSettings());
58 | if (images != null) {
59 | if (images.size() == 0) {
60 | scheduleUpdate(System.currentTimeMillis() + ROTATE_TIME_MILLIS);
61 | return;
62 | }
63 | pickImage(images);
64 | } else {
65 | Log.e(TAG, "images was null");
66 | throw new RetryException();
67 | }
68 | }
69 |
70 | private void pickImage(ArrayList images) throws RetryException {
71 | final Random random = new Random();
72 | final Image image = images.get(random.nextInt(images.size()));
73 | final String newToken = image.imageId();
74 | getImageAndPublish(image, newToken);
75 | }
76 |
77 | private void getImageAndPublish(final Image image, final String newToken) throws RetryException {
78 | ImagePage imagePage = WallyApplication.getDataProviderInstance().getPageDataSync(image.imagePageURL());
79 |
80 | if (imagePage != null) {
81 | publishArtwork(new Artwork.Builder()
82 | .title(imagePage.title())
83 | .byline(image.imagePageURL())
84 | .imageUri(imagePage.imagePath())
85 | .token(newToken)
86 | .viewIntent(new Intent(Intent.ACTION_VIEW,
87 | image.generateWallyUri()))
88 | .build());
89 |
90 | scheduleUpdate(System.currentTimeMillis() + ROTATE_TIME_MILLIS);
91 | } else {
92 | throw new RetryException();
93 | }
94 | }
95 |
96 | }
97 |
--------------------------------------------------------------------------------
/wally/src/main/java/com/musenkishi/wally/observers/FiltersChangeReceiver.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Freddie (Musenkishi) Lust-Hed
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.musenkishi.wally.observers;
18 |
19 | import android.content.BroadcastReceiver;
20 | import android.content.Context;
21 | import android.content.Intent;
22 |
23 | import java.util.ArrayList;
24 |
25 | /**
26 | * A BroadcastReceiver that can be used when you want to be notified when
27 | * "com.musenkishi.wally.observers.FILTERS_CHANGED" is broadcast.
28 | *
29 | * Created by Freddie (Musenkishi) Lust-Hed on 2014-09-24.
30 | */
31 | public class FiltersChangeReceiver extends BroadcastReceiver {
32 |
33 | public static final String FILTERS_CHANGED = "com.musenkishi.wally.observers.FILTERS_CHANGED";
34 |
35 | private ArrayList onFiltersChangeListeners;
36 |
37 | public interface OnFiltersChangeListener{
38 | void onFiltersChange();
39 | }
40 |
41 | public FiltersChangeReceiver() {
42 | onFiltersChangeListeners = new ArrayList();
43 | }
44 |
45 | public void addListener(OnFiltersChangeListener onFileChangeListener){
46 | if (onFileChangeListener != null) {
47 | onFiltersChangeListeners.add(onFileChangeListener);
48 | }
49 | }
50 |
51 | @Override
52 | public void onReceive(Context context, Intent intent) {
53 | if (FILTERS_CHANGED.equals(intent.getAction())){
54 | if (onFiltersChangeListeners != null) {
55 | for (OnFiltersChangeListener listener : onFiltersChangeListeners){
56 | if (listener != null) {
57 | listener.onFiltersChange();
58 | }
59 | }
60 | }
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/wally/src/main/java/com/musenkishi/wally/util/SparseBooleanArrayParcelable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Freddie (Musenkishi) Lust-Hed
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.musenkishi.wally.util;
18 |
19 | import android.os.Parcel;
20 | import android.os.Parcelable;
21 | import android.util.SparseBooleanArray;
22 |
23 | public class SparseBooleanArrayParcelable extends SparseBooleanArray implements Parcelable {
24 | public static Parcelable.Creator CREATOR = new Parcelable.Creator() {
25 | @Override
26 | public SparseBooleanArrayParcelable createFromParcel(Parcel source) {
27 | SparseBooleanArrayParcelable read = new SparseBooleanArrayParcelable();
28 | int size = source.readInt();
29 |
30 | int[] keys = new int[size];
31 | boolean[] values = new boolean[size];
32 |
33 | source.readIntArray(keys);
34 | source.readBooleanArray(values);
35 |
36 | for (int i = 0; i < size; i++) {
37 | read.put(keys[i], values[i]);
38 | }
39 |
40 | return read;
41 | }
42 |
43 | @Override
44 | public SparseBooleanArrayParcelable[] newArray(int size) {
45 | return new SparseBooleanArrayParcelable[size];
46 | }
47 | };
48 |
49 | public SparseBooleanArrayParcelable() {
50 |
51 | }
52 |
53 | public SparseBooleanArrayParcelable(SparseBooleanArray sparseBooleanArray) {
54 | for (int i = 0; i < sparseBooleanArray.size(); i++) {
55 | this.put(sparseBooleanArray.keyAt(i), sparseBooleanArray.valueAt(i));
56 | }
57 | }
58 |
59 | @Override
60 | public int describeContents() {
61 | return 0;
62 | }
63 |
64 | @Override
65 | public void writeToParcel(Parcel dest, int flags) {
66 | int[] keys = new int[size()];
67 | boolean[] values = new boolean[size()];
68 |
69 | for (int i = 0; i < size(); i++) {
70 | keys[i] = keyAt(i);
71 | values[i] = valueAt(i);
72 | }
73 |
74 | dest.writeInt(size());
75 | dest.writeIntArray(keys);
76 | dest.writeBooleanArray(values);
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/wally/src/main/java/com/musenkishi/wally/util/TextClickableSpan.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Freddie (Musenkishi) Lust-Hed
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.musenkishi.wally.util;
18 |
19 | import android.text.TextPaint;
20 | import android.text.style.ClickableSpan;
21 |
22 | /**
23 | * ClickableSpan with specified color (default is light blue)
24 | *
25 | * Created by Freddie (Musenkishi) Lust-Hed on 2014-04-23.
26 | */
27 | public abstract class TextClickableSpan extends ClickableSpan {
28 |
29 | private int color = 0xFF0E84FC; // light blue default
30 |
31 | public TextClickableSpan(int color) {
32 | this.color = color;
33 | }
34 |
35 | @Override
36 | public void updateDrawState(TextPaint textPaint) {
37 | if (textPaint != null) {
38 | textPaint.setColor(color);
39 | textPaint.setUnderlineText(false); // set to false to remove underline
40 | }
41 | }
42 | }
--------------------------------------------------------------------------------
/wally/src/main/java/com/musenkishi/wally/util/TypefaceSpan.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Freddie (Musenkishi) Lust-Hed
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.musenkishi.wally.util;
18 |
19 | import android.content.Context;
20 | import android.graphics.Paint;
21 | import android.graphics.Typeface;
22 | import android.text.TextPaint;
23 | import android.text.style.MetricAffectingSpan;
24 | import android.util.LruCache;
25 |
26 | /**
27 | * Class for loading custom fonts for spannable strings.
28 | *
29 | * Created by Freddie (Musenkishi) Lust-Hed on 2014-04-09.
30 | */
31 | public class TypefaceSpan extends MetricAffectingSpan {
32 |
33 | private static LruCache typefaceCache =
34 | new LruCache(12);
35 |
36 | private Typeface typeface;
37 |
38 | public TypefaceSpan(Context context, String typefaceName) {
39 | typeface = typefaceCache.get(typefaceName);
40 |
41 | if (typeface == null) {
42 | typeface = Typeface.createFromAsset(context.getApplicationContext().getAssets(), String.format("fonts/%s", typefaceName));
43 |
44 | // Cache the loaded Typeface
45 | typefaceCache.put(typefaceName, typeface);
46 | }
47 | }
48 |
49 | @Override
50 | public void updateMeasureState(TextPaint p) {
51 | p.setTypeface(typeface);
52 |
53 | // Note: This flag is required for proper typeface rendering
54 | p.setFlags(p.getFlags() | Paint.SUBPIXEL_TEXT_FLAG);
55 | }
56 |
57 | @Override
58 | public void updateDrawState(TextPaint tp) {
59 | tp.setTypeface(typeface);
60 |
61 | // Note: This flag is required for proper typeface rendering
62 | tp.setFlags(tp.getFlags() | Paint.SUBPIXEL_TEXT_FLAG);
63 | }
64 |
65 | }
66 |
--------------------------------------------------------------------------------
/wally/src/main/java/com/musenkishi/wally/views/AutoGridView.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Freddie (Musenkishi) Lust-Hed
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.musenkishi.wally.views;
18 |
19 | import android.content.Context;
20 | import android.content.res.Resources;
21 | import android.content.res.TypedArray;
22 | import android.util.AttributeSet;
23 |
24 | import com.musenkishi.wally.R;
25 |
26 | /**
27 | * A Custom GridView where you can set the default width of a cell
28 | * and it will set the numbers of columns accordingly.
29 | * Created by Musenkishi on 2014-03-04 21:08.
30 | */
31 | public class AutoGridView extends GridRecyclerView {
32 |
33 | private int defaultCellWidth;
34 |
35 | public AutoGridView(Context context) {
36 | super(context);
37 | }
38 |
39 | public AutoGridView(Context context, AttributeSet attrs) {
40 | super(context, attrs);
41 | init(context, attrs);
42 | }
43 |
44 | public AutoGridView(Context context, AttributeSet attrs, int defStyle) {
45 | super(context, attrs, defStyle);
46 | init(context, attrs);
47 | }
48 |
49 | private void init(Context context, AttributeSet attrs) {
50 | Resources.Theme theme = context.getTheme();
51 | if (theme != null) {
52 | TypedArray typedArray = theme.obtainStyledAttributes(
53 | attrs,
54 | R.styleable.AutoGridView,
55 | 0, 0);
56 | if (typedArray != null) {
57 | try {
58 | defaultCellWidth = (int) typedArray.getDimension(R.styleable.AutoGridView_defaultCellWidth, 0);
59 | } finally {
60 | typedArray.recycle();
61 | }
62 | }
63 | }
64 | }
65 |
66 | public int getDefaultCellWidth(){
67 | return defaultCellWidth;
68 | }
69 |
70 | public void setDefaultCellWidth(int width){
71 | this.defaultCellWidth = width;
72 | }
73 |
74 | }
75 |
--------------------------------------------------------------------------------
/wally/src/main/java/com/musenkishi/wally/views/FlowLayout.java:
--------------------------------------------------------------------------------
1 | package com.musenkishi.wally.views;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.view.View;
6 | import android.view.ViewGroup;
7 |
8 |
9 | /**
10 | * A view container with layout behavior like that of the Swing FlowLayout.
11 | * Originally from http://nishantvnair.wordpress.com/2010/09/28/flowlayout-in-android/
12 | *
13 | * @author Melinda Green
14 | */
15 | public class FlowLayout extends ViewGroup {
16 | private final static int PAD_H = 2, PAD_V = 2; // Space between child views.
17 | private int mHeight;
18 |
19 | public FlowLayout(Context context) {
20 | super(context);
21 | }
22 |
23 | public FlowLayout(Context context, AttributeSet attrs) {
24 | super(context, attrs);
25 | }
26 |
27 | @Override
28 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
29 | assert (MeasureSpec.getMode(widthMeasureSpec) != MeasureSpec.UNSPECIFIED);
30 | final int width = MeasureSpec.getSize(widthMeasureSpec) - getPaddingLeft() - getPaddingRight();
31 | int height = MeasureSpec.getSize(heightMeasureSpec) - getPaddingTop() - getPaddingBottom();
32 | final int count = getChildCount();
33 | int xpos = getPaddingLeft();
34 | int ypos = getPaddingTop();
35 | int childHeightMeasureSpec;
36 | if(MeasureSpec.getMode(heightMeasureSpec) == MeasureSpec.AT_MOST)
37 | childHeightMeasureSpec = MeasureSpec.makeMeasureSpec(height, MeasureSpec.AT_MOST);
38 | else
39 | childHeightMeasureSpec = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED);
40 | mHeight = 0;
41 | for(int i = 0; i < count; i++) {
42 | final View child = getChildAt(i);
43 | if(child.getVisibility() != GONE) {
44 | child.measure(MeasureSpec.makeMeasureSpec(width, MeasureSpec.AT_MOST), childHeightMeasureSpec);
45 | final int childw = child.getMeasuredWidth();
46 | mHeight = Math.max(mHeight, child.getMeasuredHeight() + PAD_V);
47 | if(xpos + childw > width) {
48 | xpos = getPaddingLeft();
49 | ypos += mHeight;
50 | }
51 | xpos += childw + PAD_H;
52 | }
53 | }
54 | if(MeasureSpec.getMode(heightMeasureSpec) == MeasureSpec.UNSPECIFIED) {
55 | height = ypos + mHeight;
56 | } else if(MeasureSpec.getMode(heightMeasureSpec) == MeasureSpec.AT_MOST) {
57 | if(ypos + mHeight < height) {
58 | height = ypos + mHeight;
59 | }
60 | }
61 | height += 5; // Fudge to avoid clipping bottom of last row.
62 | setMeasuredDimension(width, height);
63 | } // end onMeasure()
64 |
65 | @Override
66 | protected void onLayout(boolean changed, int l, int t, int r, int b) {
67 | final int width = r - l;
68 | int xpos = getPaddingLeft();
69 | int ypos = getPaddingTop();
70 | for(int i = 0; i < getChildCount(); i++) {
71 | final View child = getChildAt(i);
72 | if(child.getVisibility() != GONE) {
73 | final int childw = child.getMeasuredWidth();
74 | final int childh = child.getMeasuredHeight();
75 | if(xpos + childw > width) {
76 | xpos = getPaddingLeft();
77 | ypos += mHeight;
78 | }
79 | child.layout(xpos, ypos, xpos + childw, ypos + childh);
80 | xpos += childw + PAD_H;
81 | }
82 | }
83 | } // end onLayout()
84 |
85 | }
--------------------------------------------------------------------------------
/wally/src/main/java/com/musenkishi/wally/views/GridRecyclerView.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Freddie (Musenkishi) Lust-Hed
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.musenkishi.wally.views;
18 |
19 | import android.content.Context;
20 | import android.support.v7.widget.GridLayoutManager;
21 | import android.support.v7.widget.RecyclerView;
22 | import android.util.AttributeSet;
23 | import android.view.View;
24 | import android.view.ViewGroup;
25 | import android.view.animation.GridLayoutAnimationController;
26 |
27 | /**
28 | * An extension of RecyclerView, focused more on resembling a GridView.
29 | * Unlike {@link android.support.v7.widget.RecyclerView}, this view can handle
30 | * {@code } as long as you provide it a
31 | * {@link android.support.v7.widget.GridLayoutManager} in
32 | * {@code setLayoutManager(LayoutManager layout)}.
33 | *
34 | * Created by Freddie (Musenkishi) Lust-Hed on 14-11-01.
35 | */
36 | public class GridRecyclerView extends RecyclerView {
37 |
38 | public GridRecyclerView(Context context) {
39 | super(context);
40 | }
41 |
42 | public GridRecyclerView(Context context, AttributeSet attrs) {
43 | super(context, attrs);
44 | }
45 |
46 | public GridRecyclerView(Context context, AttributeSet attrs, int defStyle) {
47 | super(context, attrs, defStyle);
48 | }
49 |
50 | @Override
51 | public void setLayoutManager(LayoutManager layout) {
52 | if (layout instanceof GridLayoutManager){
53 | super.setLayoutManager(layout);
54 | } else {
55 | throw new ClassCastException("You should only use a GridLayoutManager with GridRecyclerView.");
56 | }
57 | }
58 |
59 | @Override
60 | protected void attachLayoutAnimationParameters(View child, ViewGroup.LayoutParams params, int index, int count) {
61 |
62 | if (getAdapter() != null && getLayoutManager() instanceof GridLayoutManager){
63 |
64 | GridLayoutAnimationController.AnimationParameters animationParams =
65 | (GridLayoutAnimationController.AnimationParameters) params.layoutAnimationParameters;
66 |
67 | if (animationParams == null) {
68 | animationParams = new GridLayoutAnimationController.AnimationParameters();
69 | params.layoutAnimationParameters = animationParams;
70 | }
71 |
72 | int columns = ((GridLayoutManager) getLayoutManager()).getSpanCount();
73 |
74 | animationParams.count = count;
75 | animationParams.index = index;
76 | animationParams.columnsCount = columns;
77 | animationParams.rowsCount = count / columns;
78 |
79 | final int invertedIndex = count - 1 - index;
80 | animationParams.column = columns - 1 - (invertedIndex % columns);
81 | animationParams.row = animationParams.rowsCount - 1 - invertedIndex / columns;
82 |
83 | } else {
84 | super.attachLayoutAnimationParameters(child, params, index, count);
85 | }
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/wally/src/main/java/com/musenkishi/wally/views/ObservableScrollView.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Freddie (Musenkishi) Lust-Hed
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.musenkishi.wally.views;
18 |
19 | import android.content.Context;
20 | import android.util.AttributeSet;
21 | import android.widget.ScrollView;
22 |
23 | /**
24 | * An Observable ScrollView. With the included ScrollViewListener,
25 | * it's possible to be notified when the user scrolls the content.
26 | *
27 | * Created by Freddie (Musenkishi) Lust-Hed on 2014-09-29.
28 | */
29 | public class ObservableScrollView extends ScrollView {
30 |
31 | private ScrollViewListener scrollViewListener = null;
32 |
33 | public interface ScrollViewListener {
34 | void onScrollChanged(ObservableScrollView scrollView, int x, int y, int oldx, int oldy);
35 | }
36 |
37 | public ObservableScrollView(Context context) {
38 | super(context);
39 | }
40 |
41 | public ObservableScrollView(Context context, AttributeSet attrs, int defStyle) {
42 | super(context, attrs, defStyle);
43 | }
44 |
45 | public ObservableScrollView(Context context, AttributeSet attrs) {
46 | super(context, attrs);
47 | }
48 |
49 | public void setScrollViewListener(ScrollViewListener scrollViewListener) {
50 | this.scrollViewListener = scrollViewListener;
51 | }
52 |
53 | @Override
54 | protected void onScrollChanged(int x, int y, int oldx, int oldy) {
55 | super.onScrollChanged(x, y, oldx, oldy);
56 | if(scrollViewListener != null) {
57 | scrollViewListener.onScrollChanged(this, x, y, oldx, oldy);
58 | }
59 | }
60 |
61 | }
62 |
--------------------------------------------------------------------------------
/wally/src/main/java/nl/codesoup/cubicbezier/CubicBezierInterpolator.java:
--------------------------------------------------------------------------------
1 | package nl.codesoup.cubicbezier;
2 |
3 | import android.graphics.PointF;
4 | import android.view.animation.Interpolator;
5 |
6 | /**
7 | * Derived from: https://github.com/rdallasgray/bez
8 | */
9 | public class CubicBezierInterpolator implements Interpolator {
10 |
11 | protected PointF start;
12 | protected PointF end;
13 | protected PointF a = new PointF();
14 | protected PointF b = new PointF();
15 | protected PointF c = new PointF();
16 |
17 | public CubicBezierInterpolator(PointF start, PointF end) throws IllegalArgumentException {
18 | if (start.x < 0 || start.x > 1) {
19 | throw new IllegalArgumentException("startX value must be in the range [0, 1]");
20 | }
21 | if (end.x < 0 || end.x > 1) {
22 | throw new IllegalArgumentException("endX value must be in the range [0, 1]");
23 | }
24 | this.start = start;
25 | this.end = end;
26 | }
27 |
28 | public CubicBezierInterpolator(float startX, float startY, float endX, float endY) {
29 | this(new PointF(startX, startY), new PointF(endX, endY));
30 | }
31 |
32 | public CubicBezierInterpolator(double startX, double startY, double endX, double endY) {
33 | this((float) startX, (float) startY, (float) endX, (float) endY);
34 | }
35 |
36 | @Override
37 | public float getInterpolation(float time) {
38 | return getBezierCoordinateY(getXForTime(time));
39 | }
40 |
41 | protected float getBezierCoordinateY(float time) {
42 | c.y = 3 * start.y;
43 | b.y = 3 * (end.y - start.y) - c.y;
44 | a.y = 1 - c.y - b.y;
45 | return time * (c.y + time * (b.y + time * a.y));
46 | }
47 |
48 | protected float getXForTime(float time) {
49 | float x = time;
50 | float z;
51 | for (int i = 1; i < 14; i++) {
52 | z = getBezierCoordinateX(x) - time;
53 | if (Math.abs(z) < 1e-3) {
54 | break;
55 | }
56 | x -= z / getXDerivate(x);
57 | }
58 | return x;
59 | }
60 |
61 | private float getXDerivate(float t) {
62 | return c.x + t * (2 * b.x + 3 * a.x * t);
63 | }
64 |
65 | private float getBezierCoordinateX(float time) {
66 | c.x = 3 * start.x;
67 | b.x = 3 * (end.x - start.x) - c.x;
68 | a.x = 1 - c.x - b.x;
69 | return time * (c.x + time * (b.x + time * a.x));
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/wally/src/main/res/anim/fade_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
--------------------------------------------------------------------------------
/wally/src/main/res/anim/fade_in_instant.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
--------------------------------------------------------------------------------
/wally/src/main/res/anim/fade_out_instant.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
--------------------------------------------------------------------------------
/wally/src/main/res/anim/grow_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
20 |
21 |
33 |
--------------------------------------------------------------------------------
/wally/src/main/res/anim/layout_details_animation.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
--------------------------------------------------------------------------------
/wally/src/main/res/anim/list_cell_animation.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
27 |
--------------------------------------------------------------------------------
/wally/src/main/res/anim/slide_in_down.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
21 |
25 |
29 |
--------------------------------------------------------------------------------
/wally/src/main/res/anim/slide_in_from_left.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
21 |
26 |
31 |
--------------------------------------------------------------------------------
/wally/src/main/res/anim/slide_in_from_right.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
21 |
26 |
31 |
--------------------------------------------------------------------------------
/wally/src/main/res/anim/slide_in_up.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
21 |
25 |
29 |
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-hdpi/drawer_shadow.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-hdpi/drawer_shadow.9.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-hdpi/ic_drawer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-hdpi/ic_drawer.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-mdpi/drawer_shadow.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-mdpi/drawer_shadow.9.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-mdpi/ic_drawer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-mdpi/ic_drawer.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-nodpi/ic_source.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-nodpi/ic_source.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-v21/default_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
20 |
22 |
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-v21/default_selector_check.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
20 |
22 | -
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-xhdpi/drawer_shadow.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-xhdpi/drawer_shadow.9.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-xhdpi/ic_drawer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-xhdpi/ic_drawer.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-xhdpi/ic_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-xhdpi/ic_logo.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-xhdpi/ic_logo_transparent.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-xhdpi/ic_logo_transparent.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-xhdpi/ic_notification_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-xhdpi/ic_notification_launcher.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-xxhdpi/alpha_welcome_drawer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-xxhdpi/alpha_welcome_drawer.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-xxhdpi/card_background.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-xxhdpi/card_background.9.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-xxhdpi/chip_background.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-xxhdpi/chip_background.9.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-xxhdpi/drawer_shadow.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-xxhdpi/drawer_shadow.9.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-xxhdpi/floating_action_button.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-xxhdpi/floating_action_button.9.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-xxhdpi/ic_action_cancel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-xxhdpi/ic_action_cancel.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-xxhdpi/ic_action_color.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-xxhdpi/ic_action_color.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-xxhdpi/ic_action_color_clear.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-xxhdpi/ic_action_color_clear.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-xxhdpi/ic_action_color_picker.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-xxhdpi/ic_action_color_picker.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-xxhdpi/ic_action_fullscreen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-xxhdpi/ic_action_fullscreen.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-xxhdpi/ic_action_heart.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-xxhdpi/ic_action_heart.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-xxhdpi/ic_action_heart_empty.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-xxhdpi/ic_action_heart_empty.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-xxhdpi/ic_action_heart_full.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-xxhdpi/ic_action_heart_full.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-xxhdpi/ic_action_latest.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-xxhdpi/ic_action_latest.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-xxhdpi/ic_action_open.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-xxhdpi/ic_action_open.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-xxhdpi/ic_action_overflow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-xxhdpi/ic_action_overflow.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-xxhdpi/ic_action_random.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-xxhdpi/ic_action_random.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-xxhdpi/ic_action_refresh.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-xxhdpi/ic_action_refresh.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-xxhdpi/ic_action_saved.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-xxhdpi/ic_action_saved.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-xxhdpi/ic_action_search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-xxhdpi/ic_action_search.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-xxhdpi/ic_action_set_as.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-xxhdpi/ic_action_set_as.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-xxhdpi/ic_action_set_as_light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-xxhdpi/ic_action_set_as_light.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-xxhdpi/ic_action_share.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-xxhdpi/ic_action_share.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-xxhdpi/ic_action_toplist.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-xxhdpi/ic_action_toplist.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-xxhdpi/ic_action_trash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-xxhdpi/ic_action_trash.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-xxhdpi/ic_action_up_material.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-xxhdpi/ic_action_up_material.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-xxhdpi/ic_check.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-xxhdpi/ic_check.9.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-xxhdpi/ic_drawer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-xxhdpi/ic_drawer.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-xxhdpi/ic_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-xxhdpi/ic_logo.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-xxhdpi/ic_logo_transparent.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-xxhdpi/ic_logo_transparent.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-xxhdpi/ic_mask_fullscreen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-xxhdpi/ic_mask_fullscreen.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-xxhdpi/ic_notification_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-xxhdpi/ic_notification_launcher.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-xxhdpi/ic_progress_download.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-xxhdpi/ic_progress_download.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-xxhdpi/ic_progress_download_light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-xxhdpi/ic_progress_download_light.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-xxhdpi/ic_search_small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-xxhdpi/ic_search_small.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-xxhdpi/ic_toolbar_heart.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-xxhdpi/ic_toolbar_heart.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-xxhdpi/ic_toolbar_heart_filled.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-xxhdpi/ic_toolbar_heart_filled.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-xxhdpi/ic_toolbar_image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-xxhdpi/ic_toolbar_image.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-xxhdpi/ic_toolbar_open.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-xxhdpi/ic_toolbar_open.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-xxhdpi/ic_toolbar_share.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-xxhdpi/ic_toolbar_share.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-xxhdpi/ic_toolbar_trash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-xxhdpi/ic_toolbar_trash.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-xxhdpi/sad_cloud.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-xxhdpi/sad_cloud.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-xxxhdpi/ic_drawer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-xxxhdpi/ic_drawer.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-xxxhdpi/ic_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-xxxhdpi/ic_logo.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-xxxhdpi/ic_logo_transparent.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-xxxhdpi/ic_logo_transparent.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-xxxhdpi/ic_notification_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-xxxhdpi/ic_notification_launcher.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable-xxxhdpi/ic_recent.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/drawable-xxxhdpi/ic_recent.png
--------------------------------------------------------------------------------
/wally/src/main/res/drawable/circle.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
21 |
22 |
23 |
24 |
25 |
28 |
--------------------------------------------------------------------------------
/wally/src/main/res/drawable/clip_heart_full.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
--------------------------------------------------------------------------------
/wally/src/main/res/drawable/clip_random.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
--------------------------------------------------------------------------------
/wally/src/main/res/drawable/custom_progress_circle.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/wally/src/main/res/drawable/custom_progress_circle_light.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/wally/src/main/res/drawable/default_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/wally/src/main/res/drawable/drawer_cell_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/wally/src/main/res/drawable/drop_shadow_top.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
24 |
25 |
--------------------------------------------------------------------------------
/wally/src/main/res/drawable/ic_heart_download_animation.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 |
24 |
25 |
29 |
30 |
--------------------------------------------------------------------------------
/wally/src/main/res/drawable/protective_shadow_topdown.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
24 |
25 |
--------------------------------------------------------------------------------
/wally/src/main/res/drawable/quick_return_protective_shadow_topdown.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
24 |
25 |
--------------------------------------------------------------------------------
/wally/src/main/res/drawable/transparent.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
20 |
25 |
--------------------------------------------------------------------------------
/wally/src/main/res/layout-land/tab_view_merge.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
20 |
21 |
27 |
28 |
41 |
42 |
--------------------------------------------------------------------------------
/wally/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 |
23 |
24 |
34 |
35 |
43 |
44 |
--------------------------------------------------------------------------------
/wally/src/main/res/layout/autogridview.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
--------------------------------------------------------------------------------
/wally/src/main/res/layout/dialog_content_custom_resolution.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
30 |
31 |
39 |
40 |
48 |
49 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/wally/src/main/res/layout/error_backend.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
24 |
25 |
29 |
30 |
41 |
42 |
49 |
50 |
59 |
60 |
--------------------------------------------------------------------------------
/wally/src/main/res/layout/fragment_main.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 |
22 |
23 |
24 |
25 |
32 |
33 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/wally/src/main/res/layout/fragment_main_swiperefresh.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 |
23 |
24 |
30 |
31 |
32 |
33 |
34 |
35 |
42 |
43 |
--------------------------------------------------------------------------------
/wally/src/main/res/layout/preference_preview_layout.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 |
--------------------------------------------------------------------------------
/wally/src/main/res/layout/tab_bar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
28 |
29 |
39 |
40 |
50 |
51 |
61 |
62 |
72 |
73 |
83 |
84 |
--------------------------------------------------------------------------------
/wally/src/main/res/layout/tab_view_merge.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
20 |
21 |
27 |
28 |
40 |
41 |
--------------------------------------------------------------------------------
/wally/src/main/res/layout/view_cell_thumb_tile.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
29 |
30 |
36 |
37 |
43 |
44 |
55 |
56 |
66 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/wally/src/main/res/layout/view_cell_thumb_tile_saved.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
30 |
31 |
37 |
38 |
--------------------------------------------------------------------------------
/wally/src/main/res/layout/view_custom_progressbar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
--------------------------------------------------------------------------------
/wally/src/main/res/layout/view_filter_list_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
--------------------------------------------------------------------------------
/wally/src/main/res/layout/view_tag_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
23 |
24 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/wally/src/main/res/menu/global.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 |
23 |
--------------------------------------------------------------------------------
/wally/src/main/res/menu/image_details.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 |
30 |
--------------------------------------------------------------------------------
/wally/src/main/res/menu/images_list.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 |
26 |
--------------------------------------------------------------------------------
/wally/src/main/res/menu/images_random.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 |
--------------------------------------------------------------------------------
/wally/src/main/res/menu/images_saved.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 |
24 |
--------------------------------------------------------------------------------
/wally/src/main/res/menu/main.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 |
24 |
--------------------------------------------------------------------------------
/wally/src/main/res/menu/saved_images_context.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
--------------------------------------------------------------------------------
/wally/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/wally/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/musenkishi/wally/a289fb3f66787e2958c1c8ff604d089ffe4434bd/wally/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/wally/src/main/res/values-h360dp/styles.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 |
22 |
23 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/wally/src/main/res/values-land/dimens.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 | 96dp
19 | 48dp
20 |
21 | 72dp
22 |
23 |
24 |
--------------------------------------------------------------------------------
/wally/src/main/res/values-sw600dp-land/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 | 64dp
21 | 320dp
22 |
23 |
--------------------------------------------------------------------------------
/wally/src/main/res/values-sw600dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 | 64dp
21 |
22 |
--------------------------------------------------------------------------------
/wally/src/main/res/values-v16/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
23 |
--------------------------------------------------------------------------------
/wally/src/main/res/values-v19/styles.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 |
23 |
24 |
27 |
28 |
--------------------------------------------------------------------------------
/wally/src/main/res/values-v21/refs.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 | @drawable/default_selector_check
20 |
--------------------------------------------------------------------------------
/wally/src/main/res/values-v21/styles.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 |
25 |
26 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/wally/src/main/res/values/arrays.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 | - All
21 | - 1280x800
22 | - 1680x1050
23 | - 1920x1080
24 |
25 |
26 |
27 | - All
28 | - 4:3
29 | - 16:9
30 | - 16:10
31 |
32 |
33 |
34 | - 24h
35 | - 3 days
36 | - 1 week
37 | - 2 weeks
38 | - 1 month
39 | - 2 months
40 | - 3 months
41 | - All time
42 |
43 |
--------------------------------------------------------------------------------
/wally/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/wally/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 | 56dp
19 | 16dp
20 | 16dp
21 |
22 | 14dp
23 | 14dp
24 |
25 | 0dp
26 |
27 | 240dp
28 |
29 | 8dp
30 |
31 | 16dp
32 | 48dp
33 | 48dp
34 | 32dp
35 | 250dp
36 | 250dp
37 | 96dp
38 | 2dp
39 |
40 | 68dp
41 |
42 | 48dp
43 | 32dp
44 | 0dp
45 | 96dp
46 | 48dp
47 | 16dp
48 | 16dp
49 | 2dp
50 | 36dp
51 | 48dp
52 | 72dp
53 | 31dp
54 | -31dp
55 | 72dp
56 |
57 |
58 |
--------------------------------------------------------------------------------
/wally/src/main/res/values/integers.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 | 300
21 | 200
22 | 1000
23 |
24 |
--------------------------------------------------------------------------------
/wally/src/main/res/values/plurals.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
21 | - wallpapers
22 | - wallpaper
23 | - wallpapers
24 |
25 |
--------------------------------------------------------------------------------
/wally/src/main/res/values/refs.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 | @drawable/default_selector
20 |
--------------------------------------------------------------------------------
/wally/version.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2014 Freddie (Musenkishi) Lust-Hed
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | #
16 |
17 | code = 29
18 | name = 1.6.0
19 |
20 | # Latest beta number for this version. Only applies to beta builds.
21 | betaNumber = Beta 0
22 |
23 | alphaNumber = Alpha 6
--------------------------------------------------------------------------------