├── .gitignore ├── .travis.yml ├── LICENSE ├── NyanDroid ├── .gitignore ├── build.gradle.kts └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── powerje │ │ └── nyan │ │ ├── NyanActivity.kt │ │ ├── NyanAnimation.kt │ │ ├── NyanPaper.kt │ │ ├── NyanSettingsActivity.kt │ │ ├── NyanSettingsFragment.kt │ │ ├── NyanUtils.kt │ │ ├── NyanView.kt │ │ └── sprites │ │ ├── NyanDroid.kt │ │ ├── Rainbow.kt │ │ └── Stars.kt │ └── res │ ├── drawable-hdpi │ └── icon.png │ ├── drawable-mdpi │ └── icon.png │ ├── drawable │ ├── frame0.png │ ├── frame1.png │ ├── frame2.png │ ├── frame3.png │ ├── frame4.png │ ├── frame5.png │ ├── frame6.png │ ├── frame7.png │ ├── grump_frame_0.png │ ├── grump_frame_1.png │ ├── grump_frame_2.png │ ├── grump_frame_3.png │ ├── grump_frame_4.png │ ├── grump_frame_5.png │ ├── icon.png │ ├── monochrome_rainbow_0.png │ ├── monochrome_rainbow_1.png │ ├── neapolitan_rainbow_frame0.png │ ├── neapolitan_rainbow_frame1.png │ ├── no.png │ ├── nyandroid00.png │ ├── nyandroid01.png │ ├── nyandroid02.png │ ├── nyandroid03.png │ ├── nyandroid04.png │ ├── nyandroid05.png │ ├── nyandroid06.png │ ├── nyandroid07.png │ ├── nyandroid08.png │ ├── nyandroid09.png │ ├── nyandroid10.png │ ├── nyandroid11.png │ ├── rainbow_frame0.png │ ├── rainbow_frame1.png │ ├── star0.png │ ├── star1.png │ ├── star2.png │ ├── star3.png │ ├── star4.png │ ├── star5.png │ ├── star6.png │ ├── star7.png │ ├── star8.png │ ├── star9.png │ ├── superman0.png │ ├── superman1.png │ ├── superman_gtv0.png │ ├── superman_gtv1.png │ ├── tardis.png │ ├── yellow_star0.png │ ├── yellow_star1.png │ ├── yellow_star2.png │ ├── yellow_star3.png │ ├── yellow_star4.png │ ├── yellow_star5.png │ ├── yellow_star6.png │ ├── yellow_star7.png │ ├── yellow_star8.png │ └── yellow_star9.png │ ├── layout │ ├── nyan_activity.xml │ └── nyan_settings.xml │ ├── menu │ └── menu.xml │ ├── raw │ └── dyan_loop.mp3 │ ├── values │ ├── colors.xml │ ├── sprites.xml │ ├── strings.xml │ └── styles.xml │ └── xml │ ├── nyan_settings.xml │ └── wallpaper.xml ├── README.md ├── build.gradle ├── buildSrc └── build.gradle.kts ├── docs ├── _config.yml ├── index.html └── privacy_policy.html ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle.kts /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled source # 2 | ################### 3 | *.com 4 | *.class 5 | *.dll 6 | *.exe 7 | *.o 8 | *.so 9 | 10 | # Packages # 11 | ############ 12 | # it's better to unpack these files and commit the raw source 13 | # git has its own built in compression methods 14 | *.7z 15 | *.dmg 16 | *.gz 17 | *.iso 18 | *.jar 19 | *.rar 20 | *.tar 21 | *.zip 22 | 23 | # Logs and databases # 24 | ###################### 25 | *.log 26 | *.sql 27 | *.sqlite 28 | 29 | # OS generated files # 30 | ###################### 31 | .DS_Store? 32 | .DS_Store 33 | ehthumbs.db 34 | Icon? 35 | Thumbs.db 36 | 37 | gen 38 | out 39 | .idea 40 | *.swp 41 | *.iml 42 | 43 | *keystore 44 | local.* 45 | .gradle 46 | local.properties 47 | 48 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: android 2 | android: 3 | components: 4 | # The BuildTools version used by your project 5 | - tools # to get the new `repository-11.xml` 6 | - tools # see https://github.com/travis-ci/travis-ci/issues/6040#issuecomment-219367943) 7 | - platform-tools 8 | - build-tools-28.0.3 9 | - android-28 10 | 11 | before_install: 12 | - yes | sdkmanager "platforms;android-28" 13 | 14 | script: 15 | - ./gradlew assemble 16 | 17 | after_failure: "cat $TRAVIS_BUILD_DIR/app/build/outputs/lint-results-debug.xml" 18 | 19 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /NyanDroid/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /NyanDroid/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("com.android.application") 3 | kotlin("android") 4 | } 5 | 6 | allprojects { 7 | repositories { 8 | google() 9 | mavenCentral() 10 | } 11 | } 12 | 13 | android { 14 | compileSdk = 34 15 | defaultConfig { 16 | targetSdk = 34 17 | minSdk = 30 18 | versionCode = 17 19 | applicationId = "com.powerje.nyan" 20 | versionName = "2.0.6" 21 | } 22 | 23 | buildTypes { 24 | getByName("release") { 25 | isMinifyEnabled = true 26 | isShrinkResources = true 27 | proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") 28 | } 29 | } 30 | namespace = "com.powerje.nyan" 31 | compileOptions { 32 | sourceCompatibility = JavaVersion.VERSION_17 33 | targetCompatibility = JavaVersion.VERSION_17 34 | } 35 | buildToolsVersion = "34.0.0" 36 | } 37 | 38 | dependencies { 39 | implementation( "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.23") 40 | implementation("androidx.appcompat:appcompat:1.6.1") 41 | implementation("androidx.preference:preference:1.2.1") 42 | } 43 | -------------------------------------------------------------------------------- /NyanDroid/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 10 | 11 | 17 | 18 | 25 | 26 | 27 | 28 | 29 | 32 | 33 | 34 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /NyanDroid/src/main/java/com/powerje/nyan/NyanActivity.kt: -------------------------------------------------------------------------------- 1 | package com.powerje.nyan 2 | 3 | import android.content.Intent 4 | import android.graphics.Color 5 | import android.media.MediaPlayer 6 | import android.os.Build 7 | import android.os.Bundle 8 | import android.view.Menu 9 | import android.view.MenuItem 10 | import android.view.View 11 | import android.view.ViewGroup 12 | import android.view.WindowInsets 13 | import android.view.WindowInsetsController 14 | import androidx.appcompat.app.AppCompatActivity 15 | import androidx.appcompat.widget.Toolbar 16 | import androidx.core.view.ViewCompat 17 | import androidx.core.view.WindowInsetsCompat 18 | import java.io.IOException 19 | 20 | 21 | class NyanActivity : AppCompatActivity() { 22 | private var nyanView: NyanView? = null 23 | private var player: MediaPlayer? = null 24 | private var toolbar: Toolbar? = null 25 | 26 | public override fun onCreate(savedInstanceState: Bundle?) { 27 | super.onCreate(savedInstanceState) 28 | setContentView(R.layout.nyan_activity) 29 | toolbar = findViewById(R.id.toolbar) 30 | setSupportActionBar(toolbar) 31 | supportActionBar?.setDisplayShowTitleEnabled(false) 32 | window.setDecorFitsSystemWindows(false) 33 | val controller = window.insetsController 34 | if (controller != null) { 35 | controller.hide(WindowInsets.Type.statusBars() or WindowInsets.Type.navigationBars()) 36 | controller.systemBarsBehavior = WindowInsetsController.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE 37 | } 38 | window.statusBarColor = Color.TRANSPARENT 39 | window.navigationBarColor = Color.TRANSPARENT 40 | 41 | ViewCompat.setOnApplyWindowInsetsListener(toolbar!!) { v, insets -> 42 | val barsInsets = insets.getInsets(WindowInsetsCompat.Type.systemBars()) 43 | val topBarHeight = barsInsets.top 44 | val layoutParams = v.layoutParams as ViewGroup.MarginLayoutParams 45 | layoutParams.topMargin = topBarHeight 46 | v.layoutParams = layoutParams 47 | 48 | WindowInsetsCompat.CONSUMED 49 | } 50 | } 51 | 52 | public override fun onResume() { 53 | super.onResume() 54 | 55 | if (player == null) { 56 | player = MediaPlayer.create(this, R.raw.dyan_loop) 57 | player!!.isLooping = true 58 | } else { 59 | player!!.start() 60 | } 61 | 62 | player!!.setScreenOnWhilePlaying(true) 63 | 64 | try { 65 | player!!.prepare() 66 | } catch (e: IllegalStateException) { 67 | e.printStackTrace() 68 | } catch (e: IOException) { 69 | e.printStackTrace() 70 | } 71 | 72 | player?.run { 73 | setOnPreparedListener { 74 | it.start() 75 | } 76 | } 77 | 78 | nyanView = findViewById(R.id.nyan_view) 79 | nyanView!!.start() 80 | } 81 | 82 | override fun onOptionsItemSelected(item: MenuItem): Boolean { 83 | when (item.itemId) { 84 | R.id.menu_settings -> startActivity(Intent(this@NyanActivity, NyanSettingsActivity::class.java)) 85 | } 86 | return true 87 | } 88 | 89 | override fun onCreateOptionsMenu(menu: Menu): Boolean { 90 | menuInflater.inflate(R.menu.menu, menu) 91 | return true 92 | } 93 | 94 | public override fun onPause() { 95 | super.onPause() 96 | player?.pause() 97 | nyanView?.cancel() 98 | nyanView = null 99 | } 100 | 101 | public override fun onStop() { 102 | super.onStop() 103 | nyanView?.cancel() 104 | nyanView = null 105 | System.gc() 106 | } 107 | 108 | public override fun onDestroy() { 109 | super.onDestroy() 110 | nyanView = null 111 | } 112 | } -------------------------------------------------------------------------------- /NyanDroid/src/main/java/com/powerje/nyan/NyanAnimation.kt: -------------------------------------------------------------------------------- 1 | package com.powerje.nyan 2 | 3 | import android.content.Context 4 | import android.content.SharedPreferences 5 | import android.graphics.Canvas 6 | import android.graphics.Paint 7 | import android.view.SurfaceHolder 8 | import androidx.core.content.ContextCompat 9 | import com.powerje.nyan.sprites.NyanDroid 10 | import com.powerje.nyan.sprites.Rainbow 11 | import com.powerje.nyan.sprites.Stars 12 | 13 | class NyanAnimation(private val context: Context, private val holder: SurfaceHolder) : SharedPreferences.OnSharedPreferenceChangeListener, SurfaceHolder.Callback { 14 | private val paint = Paint().apply { 15 | color = -0x1 16 | } 17 | private val sharedPreferences: SharedPreferences = context.getSharedPreferences(context.getString(R.string.shared_preferences_name), 0) 18 | 19 | private var hasCenteredImages: Boolean = false 20 | private var hasLoadedImages: Boolean = false 21 | private var preferencesChanged: Boolean = false 22 | 23 | private var nyanDroid: NyanDroid? = null 24 | private var rainbow: Rainbow? = null 25 | private var stars: Stars? = null 26 | 27 | private var droidImage: String? = null 28 | private var rainbowImage: String? = null 29 | private var starImage: String? = null 30 | 31 | private var animationSpeed: Int = 0 32 | private var sizeMod: Int = 0 33 | private var maxDim: Int = 0 34 | 35 | private var frameCount: Int = 0 36 | 37 | private var showDroid: Boolean = false 38 | private var showRainbow: Boolean = false 39 | private var showStars: Boolean = false 40 | private var thread: DrawingThread? = null 41 | 42 | private var visible = false 43 | 44 | init { 45 | sharedPreferences.registerOnSharedPreferenceChangeListener(this) 46 | onSharedPreferenceChanged(sharedPreferences, null) 47 | } 48 | 49 | override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences, key: String?) { 50 | droidImage = sharedPreferences.getString("droid_image", "nyanwich") 51 | rainbowImage = sharedPreferences.getString("rainbow_image", "rainbow") 52 | starImage = sharedPreferences.getString("star_image", "white") 53 | sizeMod = sharedPreferences.getInt("size_mod", 5) + 1 54 | animationSpeed = sharedPreferences.getInt("animation_speed", 3) 55 | 56 | showDroid = "none" != droidImage 57 | showRainbow = "none" != rainbowImage 58 | showStars = "none" != starImage 59 | preferencesChanged = true 60 | } 61 | 62 | fun onVisibilityChanged(visible: Boolean) { 63 | this.visible = visible 64 | if (visible) { 65 | holder.addCallback(this) 66 | thread = DrawingThread(this) 67 | thread!!.setRunning(true) 68 | thread!!.start() 69 | } else { 70 | holder.removeCallback(this) 71 | thread?.setRunning(false) 72 | } 73 | } 74 | 75 | override fun surfaceCreated(holder: SurfaceHolder) { 76 | } 77 | 78 | override fun surfaceChanged(holder: SurfaceHolder, format: Int, width: Int, height: Int) { 79 | hasCenteredImages = false 80 | preferencesChanged = true 81 | } 82 | 83 | override fun surfaceDestroyed(holder: SurfaceHolder) { 84 | onVisibilityChanged(false) 85 | var retry = true 86 | thread!!.setRunning(false) 87 | while (retry) { 88 | try { 89 | thread!!.join() 90 | retry = false 91 | } catch (e: InterruptedException) { 92 | } 93 | } 94 | } 95 | 96 | private fun setupAnimations() { 97 | hasLoadedImages = false 98 | 99 | val c = context 100 | maxDim = 64 * sizeMod 101 | val width = c.resources.displayMetrics.widthPixels 102 | maxDim = if (maxDim < width) maxDim else width - 64 103 | nyanDroid = NyanDroid(c, maxDim, paint, droidImage!!) 104 | 105 | // initialize Rainbow 106 | maxDim = (nyanDroid!!.frameHeight * .4).toInt() 107 | rainbow = Rainbow(c, maxDim, paint, rainbowImage!!) 108 | 109 | // remember offset for when drawing rainbows 110 | rainbow!!.setOffset(nyanDroid!!.frameWidth / 2 - rainbow!!.frameWidth) 111 | stars = Stars(c, maxDim, paint, starImage!!, animationSpeed) 112 | 113 | hasLoadedImages = true 114 | } 115 | 116 | private fun drawFrame(c: Canvas?) { 117 | if (!visible) return 118 | 119 | if (preferencesChanged) { 120 | setupAnimations() 121 | preferencesChanged = false 122 | hasCenteredImages = false 123 | } 124 | 125 | frameCount++ 126 | if (c != null && hasLoadedImages) { 127 | if (!hasCenteredImages) { 128 | rainbow!!.setCenter(c.width / 2, c.height / 2) 129 | nyanDroid!!.setCenter(c.width / 2, c.height / 2) 130 | hasCenteredImages = true 131 | } 132 | 133 | c.drawColor(ContextCompat.getColor(context, R.color.nyanblue)) 134 | 135 | if (showStars) { 136 | stars!!.draw(c, frameCount % 3 == 0) 137 | } 138 | if (showRainbow) { 139 | rainbow!!.draw(c, frameCount % 12 == 0) 140 | } 141 | if (showDroid) { 142 | nyanDroid!!.draw(c, frameCount % 6 == 0) 143 | } 144 | } 145 | frameCount %= 24 146 | } 147 | 148 | private class DrawingThread(private val nyanAnimation: NyanAnimation) : Thread() { 149 | private var isRunning = false 150 | 151 | fun setRunning(running: Boolean) { 152 | isRunning = running 153 | } 154 | 155 | override fun run() { 156 | while (isRunning) { 157 | var c: Canvas? = null 158 | try { 159 | c = nyanAnimation.holder.lockCanvas(null) 160 | synchronized(nyanAnimation.holder) { 161 | nyanAnimation.drawFrame(c) 162 | } 163 | } catch (e: InterruptedException) { 164 | e.printStackTrace() 165 | } finally { 166 | if (c != null) { 167 | nyanAnimation.holder.unlockCanvasAndPost(c) 168 | } 169 | } 170 | } 171 | } 172 | } 173 | } -------------------------------------------------------------------------------- /NyanDroid/src/main/java/com/powerje/nyan/NyanPaper.kt: -------------------------------------------------------------------------------- 1 | package com.powerje.nyan 2 | 3 | import android.service.wallpaper.WallpaperService 4 | 5 | class NyanPaper : WallpaperService() { 6 | override fun onCreateEngine(): Engine { 7 | return NyanEngine() 8 | } 9 | 10 | internal inner class NyanEngine : WallpaperService.Engine() { 11 | private val nyanAnimation = NyanAnimation(applicationContext, surfaceHolder) 12 | 13 | override fun onVisibilityChanged(visible: Boolean) { 14 | nyanAnimation.onVisibilityChanged(visible) 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /NyanDroid/src/main/java/com/powerje/nyan/NyanSettingsActivity.kt: -------------------------------------------------------------------------------- 1 | package com.powerje.nyan 2 | 3 | import android.os.Bundle 4 | import androidx.appcompat.app.AppCompatActivity 5 | 6 | class NyanSettingsActivity : AppCompatActivity() { 7 | 8 | override fun onCreate(icicle: Bundle?) { 9 | super.onCreate(icicle) 10 | setContentView(R.layout.nyan_settings) 11 | setSupportActionBar(findViewById(R.id.toolbar)) 12 | supportActionBar?.setDisplayHomeAsUpEnabled(true) 13 | supportActionBar?.setDisplayShowHomeEnabled(true) 14 | } 15 | 16 | override fun onSupportNavigateUp(): Boolean { 17 | onBackPressed() 18 | return true 19 | } 20 | 21 | } 22 | 23 | -------------------------------------------------------------------------------- /NyanDroid/src/main/java/com/powerje/nyan/NyanSettingsFragment.kt: -------------------------------------------------------------------------------- 1 | package com.powerje.nyan 2 | 3 | import android.os.Bundle 4 | import androidx.preference.PreferenceFragmentCompat 5 | 6 | class NyanSettingsFragment : PreferenceFragmentCompat() { 7 | 8 | override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { 9 | preferenceManager.sharedPreferencesName = getString(R.string.shared_preferences_name) 10 | setPreferencesFromResource(R.xml.nyan_settings, rootKey) 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /NyanDroid/src/main/java/com/powerje/nyan/NyanUtils.kt: -------------------------------------------------------------------------------- 1 | package com.powerje.nyan 2 | 3 | import android.content.Context 4 | import android.graphics.Bitmap 5 | import android.graphics.BitmapFactory 6 | import android.graphics.Matrix 7 | 8 | object NyanUtils { 9 | 10 | fun maxHeightResourceToBitmap(c: Context, res: Int, 11 | maxHeight: Int): Bitmap { 12 | val bmp = imageResourceToBitmap(c, res, maxHeight) 13 | 14 | val width = bmp!!.width 15 | val height = bmp.height 16 | 17 | val newWidth = maxHeight / 2 18 | 19 | // calculate the scale 20 | val scaleHeight = maxHeight.toFloat() / height 21 | val scaleWidth = newWidth.toFloat() / width 22 | 23 | // create a matrix for the manipulation 24 | val matrix = Matrix() 25 | // resize the bit map 26 | matrix.postScale(scaleWidth, scaleHeight) 27 | 28 | // recreate the new Bitmap and return it 29 | return Bitmap.createBitmap(bmp, 0, 0, width, height, matrix, true) 30 | } 31 | 32 | fun scaleWithRatio(c: Context, res: Int, max: Int): Bitmap { 33 | val opts = BitmapFactory.Options() 34 | opts.inSampleSize = 2 35 | return Bitmap.createScaledBitmap(BitmapFactory.decodeResource(c.resources, res, opts), max, max, false) 36 | } 37 | 38 | private fun imageResourceToBitmap(c: Context, res: Int, maxDim: Int): Bitmap? { 39 | val opts = BitmapFactory.Options() 40 | opts.inJustDecodeBounds = true 41 | // compute the smallest size bitmap we need to read 42 | BitmapFactory.decodeResource(c.resources, res, opts) 43 | var w = opts.outWidth 44 | var h = opts.outHeight 45 | var s = 1 46 | while (true) { 47 | if (w / 2 < maxDim || h / 2 < maxDim) { 48 | break 49 | } 50 | w /= 2 51 | h /= 2 52 | s++ 53 | } 54 | // scale and read the data 55 | opts.inJustDecodeBounds = false 56 | opts.inSampleSize = s 57 | return BitmapFactory.decodeResource(c.resources, res, opts) 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /NyanDroid/src/main/java/com/powerje/nyan/NyanView.kt: -------------------------------------------------------------------------------- 1 | package com.powerje.nyan 2 | 3 | import android.content.Context 4 | import android.util.AttributeSet 5 | import android.view.SurfaceView 6 | 7 | /** 8 | * NyanView draws NyanDroid flying through space distributing Ice Cream Nyanwich. 9 | * @author powerj 10 | */ 11 | class NyanView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyle: Int = 0) : SurfaceView(context, attrs, defStyle) { 12 | private var nyanAnimation: NyanAnimation? = null 13 | 14 | fun start() { 15 | nyanAnimation = NyanAnimation(getContext(), holder) 16 | nyanAnimation!!.onVisibilityChanged(true) 17 | } 18 | 19 | fun cancel() { 20 | nyanAnimation?.onVisibilityChanged(false) 21 | nyanAnimation = null 22 | } 23 | } -------------------------------------------------------------------------------- /NyanDroid/src/main/java/com/powerje/nyan/sprites/NyanDroid.kt: -------------------------------------------------------------------------------- 1 | package com.powerje.nyan.sprites 2 | 3 | import android.content.Context 4 | import android.graphics.Bitmap 5 | import android.graphics.Canvas 6 | import android.graphics.Paint 7 | import com.powerje.nyan.NyanUtils 8 | import com.powerje.nyan.R 9 | import java.util.* 10 | 11 | /** 12 | * NyanDroid is a class for drawing an animated nyan droid. 13 | * 14 | * @author powerj 15 | */ 16 | class NyanDroid 17 | (context: Context, maxDim: Int, private val paint: Paint, private val droid: String) { 18 | /** NyanDroid frames. */ 19 | private val frames = ArrayList() 20 | 21 | /** Current y offset. */ 22 | private var yOffset: Int = 0 23 | /** True iff NyanDroid is moving upwards */ 24 | private var isMovingUp: Boolean = false 25 | /** Center x coordinate. */ 26 | private var centerX: Int = 0 27 | /** Center y coordinate. */ 28 | private var centerY: Int = 0 29 | /** Current frame NyanDroid is in. */ 30 | private var currentFrame: Int = 0 31 | 32 | private var isBlank = false 33 | 34 | /** 35 | * @return the height of an individual frame. 36 | */ 37 | val frameHeight: Int 38 | get() = if (isBlank) 256 else frames[0].height 39 | 40 | /** 41 | * @return the width of an individual frame. 42 | */ 43 | val frameWidth: Int 44 | get() = if (isBlank) 256 else frames[0].width 45 | 46 | init { 47 | var dim = maxDim 48 | var repeatingFrame: Bitmap 49 | 50 | when (droid) { 51 | "droidtv" -> { 52 | repeatingFrame = NyanUtils.scaleWithRatio(context, 53 | R.drawable.superman_gtv0, dim) 54 | frames.add(repeatingFrame) 55 | frames.add(repeatingFrame) 56 | frames.add(repeatingFrame) 57 | repeatingFrame = NyanUtils.scaleWithRatio(context, 58 | R.drawable.superman_gtv1, dim) 59 | frames.add(repeatingFrame) 60 | frames.add(repeatingFrame) 61 | frames.add(repeatingFrame) 62 | } 63 | "ics_egg" -> { 64 | // hack because image sizes are different 65 | dim += 20 66 | frames.add(NyanUtils.scaleWithRatio(context, 67 | R.drawable.nyandroid00, dim)) 68 | frames.add(NyanUtils.scaleWithRatio(context, 69 | R.drawable.nyandroid01, dim)) 70 | frames.add(NyanUtils.scaleWithRatio(context, 71 | R.drawable.nyandroid02, dim)) 72 | frames.add(NyanUtils.scaleWithRatio(context, 73 | R.drawable.nyandroid03, dim)) 74 | frames.add(NyanUtils.scaleWithRatio(context, 75 | R.drawable.nyandroid04, dim)) 76 | frames.add(NyanUtils.scaleWithRatio(context, 77 | R.drawable.nyandroid05, dim)) 78 | frames.add(NyanUtils.scaleWithRatio(context, 79 | R.drawable.nyandroid06, dim)) 80 | frames.add(NyanUtils.scaleWithRatio(context, 81 | R.drawable.nyandroid07, dim)) 82 | frames.add(NyanUtils.scaleWithRatio(context, 83 | R.drawable.nyandroid08, dim)) 84 | frames.add(NyanUtils.scaleWithRatio(context, 85 | R.drawable.nyandroid09, dim)) 86 | frames.add(NyanUtils.scaleWithRatio(context, 87 | R.drawable.nyandroid10, dim)) 88 | frames.add(NyanUtils.scaleWithRatio(context, 89 | R.drawable.nyandroid11, dim)) 90 | } 91 | "tardis" -> frames.add(NyanUtils.scaleWithRatio(context, R.drawable.tardis, 92 | dim)) 93 | "grump" -> { 94 | frames.add(NyanUtils.scaleWithRatio(context, R.drawable.grump_frame_0, dim)) 95 | frames.add(NyanUtils.scaleWithRatio(context, R.drawable.grump_frame_1, dim)) 96 | frames.add(NyanUtils.scaleWithRatio(context, R.drawable.grump_frame_2, dim)) 97 | frames.add(NyanUtils.scaleWithRatio(context, R.drawable.grump_frame_3, dim)) 98 | frames.add(NyanUtils.scaleWithRatio(context, R.drawable.grump_frame_4, dim)) 99 | frames.add(NyanUtils.scaleWithRatio(context, R.drawable.grump_frame_5, dim)) 100 | } 101 | "nyanwich" -> { 102 | frames.add(NyanUtils.scaleWithRatio(context, R.drawable.frame0, 103 | dim)) 104 | frames.add(NyanUtils.scaleWithRatio(context, R.drawable.frame1, 105 | dim)) 106 | frames.add(NyanUtils.scaleWithRatio(context, R.drawable.frame2, 107 | dim)) 108 | frames.add(NyanUtils.scaleWithRatio(context, R.drawable.frame3, 109 | dim)) 110 | frames.add(NyanUtils.scaleWithRatio(context, 111 | R.drawable.superman0, dim)) 112 | 113 | repeatingFrame = NyanUtils.scaleWithRatio(context, 114 | R.drawable.superman1, dim) 115 | frames.add(repeatingFrame) 116 | frames.add(repeatingFrame) 117 | frames.add(repeatingFrame) 118 | 119 | frames.add(NyanUtils.scaleWithRatio(context, R.drawable.frame4, 120 | dim)) 121 | frames.add(NyanUtils.scaleWithRatio(context, R.drawable.frame5, 122 | dim)) 123 | frames.add(NyanUtils.scaleWithRatio(context, R.drawable.frame6, 124 | dim)) 125 | frames.add(NyanUtils.scaleWithRatio(context, R.drawable.frame7, 126 | dim)) 127 | } 128 | else -> // Setting up to return some default values so 129 | // weirdos who disappear this but still have 130 | // the rainbow have it centered properly etc 131 | isBlank = true 132 | } 133 | } 134 | 135 | /** 136 | * Draw NyanDroid. 137 | * 138 | * @param c 139 | * canvas to draw on. 140 | * @param animate 141 | * move to next frame after drawing. 142 | */ 143 | fun draw(c: Canvas, animate: Boolean) { 144 | if (isBlank) return 145 | 146 | val toDraw = frames[currentFrame] 147 | c.drawBitmap(toDraw, (centerX - toDraw.width / 2).toFloat(), 148 | (centerY - toDraw.height / 2 + yOffset).toFloat(), paint) 149 | if (animate) { 150 | currentFrame = if (currentFrame == frames.size - 1) 151 | 0 152 | else 153 | currentFrame + 1 154 | 155 | if (droid != "ics_egg") { 156 | if (isMovingUp) { 157 | yOffset += 3 158 | if (yOffset > 2) 159 | isMovingUp = false 160 | } else { 161 | yOffset -= 3 162 | if (yOffset < -2) 163 | isMovingUp = true 164 | } 165 | } 166 | } 167 | } 168 | 169 | /** 170 | * Set the coordinates with which to center the drawing. 171 | * 172 | * @param x 173 | * center x coordinate 174 | * @param y 175 | * center y coordinate 176 | */ 177 | fun setCenter(x: Int, y: Int) { 178 | centerX = x 179 | centerY = y 180 | } 181 | } 182 | -------------------------------------------------------------------------------- /NyanDroid/src/main/java/com/powerje/nyan/sprites/Rainbow.kt: -------------------------------------------------------------------------------- 1 | package com.powerje.nyan.sprites 2 | 3 | import android.content.Context 4 | import android.graphics.Bitmap 5 | import android.graphics.Canvas 6 | import android.graphics.Paint 7 | import com.powerje.nyan.NyanUtils 8 | import com.powerje.nyan.R 9 | import java.util.* 10 | 11 | class Rainbow(mContext: Context, maxDim: Int, private val paint: Paint, image: String) { 12 | private val frames = ArrayList() 13 | private var rainbowWidth: Int = 0 14 | 15 | private var centerX: Int = 0 16 | private var centerY: Int = 0 17 | private var offset: Int = 0 18 | private var isBlank = false 19 | private var currentFrame: Int = 0 20 | 21 | val frameWidth: Int 22 | get() = if (isBlank) 0 else frames[0].width 23 | 24 | init { 25 | 26 | when (image) { 27 | "neapolitan" -> { 28 | frames.add(NyanUtils.maxHeightResourceToBitmap(mContext, 29 | R.drawable.neapolitan_rainbow_frame0, maxDim)) 30 | frames.add(NyanUtils.maxHeightResourceToBitmap(mContext, 31 | R.drawable.neapolitan_rainbow_frame1, maxDim)) 32 | } 33 | "mono" -> { 34 | frames.add(NyanUtils.maxHeightResourceToBitmap(mContext, 35 | R.drawable.monochrome_rainbow_0, maxDim)) 36 | frames.add(NyanUtils.maxHeightResourceToBitmap(mContext, 37 | R.drawable.monochrome_rainbow_1, maxDim)) 38 | } 39 | "rainbow" -> { 40 | frames.add(NyanUtils.maxHeightResourceToBitmap(mContext, 41 | R.drawable.rainbow_frame0, maxDim)) 42 | frames.add(NyanUtils.maxHeightResourceToBitmap(mContext, 43 | R.drawable.rainbow_frame1, maxDim)) 44 | } 45 | else -> isBlank = true 46 | } 47 | 48 | if (!isBlank) { 49 | rainbowWidth = frames[0].width 50 | } 51 | } 52 | 53 | fun draw(c: Canvas, animate: Boolean) { 54 | if (isBlank) return 55 | 56 | val numberRainbowsFromCenter = c.width / 2 / rainbowWidth 57 | 58 | for (i in 0 until numberRainbowsFromCenter) { 59 | val toDraw = frames[(currentFrame + i % 2) % 2] 60 | c.drawBitmap(toDraw, (centerX - toDraw.width / 2 - offset 61 | - i * rainbowWidth).toFloat(), (centerY - toDraw.height / 2).toFloat(), 62 | paint) 63 | } 64 | if (animate) { 65 | currentFrame++ 66 | currentFrame %= 2 67 | } 68 | } 69 | 70 | fun setOffset(offset: Int) { 71 | this.offset = offset 72 | } 73 | 74 | fun setCenter(x: Int, y: Int) { 75 | centerX = x 76 | centerY = y 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /NyanDroid/src/main/java/com/powerje/nyan/sprites/Stars.kt: -------------------------------------------------------------------------------- 1 | package com.powerje.nyan.sprites 2 | 3 | import android.content.Context 4 | import android.graphics.Bitmap 5 | import android.graphics.Canvas 6 | import android.graphics.Paint 7 | import com.powerje.nyan.NyanUtils 8 | import com.powerje.nyan.R 9 | import java.util.* 10 | 11 | class Stars(mContext: Context, maxDim: Int, private val paint: Paint, image: String, internal val speed: Int) { 12 | private val largeStarFrames: ArrayList 13 | private val mediumStarFrames: ArrayList 14 | private val smallStarFrames: ArrayList 15 | 16 | private val stars = ArrayList() 17 | private val reusableStars = ArrayList() 18 | 19 | private val random = Random() 20 | private var reverse = false 21 | private var isBlank = false 22 | 23 | private val whiteDrawableFrames = intArrayOf(R.drawable.star0, R.drawable.star1, R.drawable.star2, R.drawable.star3, R.drawable.star4, R.drawable.star5, R.drawable.star6, R.drawable.star7, R.drawable.star8, R.drawable.star9) 24 | private val yellowDrawableFrames = intArrayOf(R.drawable.yellow_star0, R.drawable.yellow_star1, R.drawable.yellow_star2, R.drawable.yellow_star3, R.drawable.yellow_star4, R.drawable.yellow_star5, R.drawable.yellow_star6, R.drawable.yellow_star7, R.drawable.yellow_star8, R.drawable.yellow_star9) 25 | private val noDrawableFrame = intArrayOf(R.drawable.no) 26 | private val icsDrawableFrames = intArrayOf(R.drawable.nyandroid00, R.drawable.nyandroid01, R.drawable.nyandroid02, R.drawable.nyandroid03, R.drawable.nyandroid04, R.drawable.nyandroid05, R.drawable.nyandroid06, R.drawable.nyandroid07, R.drawable.nyandroid08, R.drawable.nyandroid09, R.drawable.nyandroid10, R.drawable.nyandroid11) 27 | 28 | private val NUMBER_OF_FRAMES: Int 29 | private var MAX_TOTAL_STARS: Int 30 | private val WEIGHTED_NEW_STAR_COUNT = intArrayOf(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2) 31 | 32 | private var randomlyPlaceStars = true 33 | 34 | internal class Star { 35 | var x: Float = 0f 36 | var y: Float = 0f 37 | var frame: Int = 0 38 | var speed: Int = 0 39 | var width: Int = 0 40 | var frames: ArrayList? = null 41 | } 42 | 43 | init { 44 | val drawables: IntArray 45 | 46 | var dimMod = 1 47 | when (image) { 48 | "white" -> { 49 | drawables = whiteDrawableFrames 50 | MAX_TOTAL_STARS = 100 51 | } 52 | "yellow" -> { 53 | drawables = yellowDrawableFrames 54 | MAX_TOTAL_STARS = 100 55 | } 56 | "no" -> { 57 | drawables = noDrawableFrame 58 | MAX_TOTAL_STARS = 50 59 | } 60 | "ics_egg" -> { 61 | drawables = icsDrawableFrames 62 | reverse = true 63 | dimMod = 0 64 | MAX_TOTAL_STARS = 250 65 | } 66 | else -> { 67 | drawables = intArrayOf() 68 | MAX_TOTAL_STARS = 0 69 | } 70 | } 71 | NUMBER_OF_FRAMES = drawables.size 72 | 73 | largeStarFrames = ArrayList() 74 | for (i in drawables.indices) { 75 | largeStarFrames.add(NyanUtils.scaleWithRatio(mContext, drawables[i], maxDim / (dimMod + 1))) 76 | } 77 | 78 | mediumStarFrames = ArrayList() 79 | for (i in drawables.indices) { 80 | mediumStarFrames.add(NyanUtils.scaleWithRatio(mContext, drawables[i], maxDim / (dimMod + 2))) 81 | } 82 | 83 | smallStarFrames = ArrayList() 84 | for (i in drawables.indices) { 85 | smallStarFrames.add(NyanUtils.scaleWithRatio(mContext, drawables[i], maxDim / (dimMod + 3))) 86 | } 87 | 88 | if (MAX_TOTAL_STARS > 0) { 89 | (0..random.nextInt(MAX_TOTAL_STARS)).forEach { 90 | stars.add(generateStar()) 91 | } 92 | } 93 | } 94 | 95 | fun draw(c: Canvas, animate: Boolean) { 96 | if (isBlank) return 97 | if (animate) { addStars(c) } 98 | val height = c.height 99 | val width = c.width 100 | if (height == 0 || width == 0) return 101 | 102 | if (randomlyPlaceStars) { 103 | for (s in stars) { 104 | s.x = random.nextInt(width).toFloat() 105 | s.y = random.nextInt(height).toFloat() 106 | } 107 | randomlyPlaceStars = false 108 | } 109 | 110 | var i = 0 111 | while (i < stars.size) { 112 | val s = stars[i] 113 | c.drawBitmap(s.frames!![s.frame], s.x, s.y, paint) 114 | 115 | if (animate) { 116 | s.frame++ 117 | s.frame %= NUMBER_OF_FRAMES 118 | } 119 | if (reverse) { 120 | s.x += s.speed 121 | if (s.x > width) { 122 | val star = stars.removeAt(i) 123 | addReusableStarIfSpaceAvailable(star) 124 | i-- 125 | } 126 | } else { 127 | s.x -= s.speed 128 | if (s.x < -width) { 129 | val star = stars.removeAt(i) 130 | addReusableStarIfSpaceAvailable(star) 131 | i-- 132 | } 133 | } 134 | 135 | i++ 136 | } 137 | } 138 | 139 | private fun addStars(c: Canvas) { 140 | val newStarCount = WEIGHTED_NEW_STAR_COUNT.random() 141 | for (i in 0..newStarCount) { 142 | if (stars.count() >= MAX_TOTAL_STARS) break 143 | 144 | val s: Star 145 | if (reusableStars.isNotEmpty()) { 146 | s = reusableStars.removeAt(0) 147 | } else { 148 | s = generateStar() 149 | } 150 | 151 | if (reverse) { 152 | s.x = -(s.frames!![s.frame].width).toFloat() 153 | } else { 154 | s.x = c.width.toFloat() 155 | } 156 | if (c.height > 0) { 157 | s.y = random.nextInt(c.height).toFloat() 158 | } 159 | 160 | stars.add(s) 161 | } 162 | } 163 | 164 | private fun generateStar(): Star { 165 | val s = Star() 166 | s.frame = random.nextInt(NUMBER_OF_FRAMES) 167 | when (random.nextInt(3)) { 168 | 0 -> { 169 | s.speed = random.nextInt(10) 170 | s.width = largeStarFrames[0].width 171 | s.frames = largeStarFrames 172 | } 173 | 1 -> { 174 | s.speed = random.nextInt(5) 175 | s.width = mediumStarFrames[0].width 176 | s.frames = mediumStarFrames 177 | } 178 | else -> { 179 | s.speed = 1 180 | s.width = smallStarFrames[0].width 181 | s.frames = smallStarFrames 182 | } 183 | } 184 | s.speed += speed * 5 185 | return s 186 | } 187 | 188 | private fun addReusableStarIfSpaceAvailable(star: Star) { 189 | if (reusableStars.count() < MAX_TOTAL_STARS) { 190 | reusableStars.add(star) 191 | } 192 | } 193 | } 194 | -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/frame0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/frame0.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/frame1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/frame1.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/frame2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/frame2.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/frame3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/frame3.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/frame4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/frame4.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/frame5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/frame5.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/frame6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/frame6.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/frame7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/frame7.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/grump_frame_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/grump_frame_0.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/grump_frame_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/grump_frame_1.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/grump_frame_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/grump_frame_2.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/grump_frame_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/grump_frame_3.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/grump_frame_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/grump_frame_4.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/grump_frame_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/grump_frame_5.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/icon.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/monochrome_rainbow_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/monochrome_rainbow_0.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/monochrome_rainbow_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/monochrome_rainbow_1.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/neapolitan_rainbow_frame0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/neapolitan_rainbow_frame0.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/neapolitan_rainbow_frame1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/neapolitan_rainbow_frame1.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/no.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/no.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/nyandroid00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/nyandroid00.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/nyandroid01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/nyandroid01.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/nyandroid02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/nyandroid02.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/nyandroid03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/nyandroid03.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/nyandroid04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/nyandroid04.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/nyandroid05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/nyandroid05.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/nyandroid06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/nyandroid06.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/nyandroid07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/nyandroid07.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/nyandroid08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/nyandroid08.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/nyandroid09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/nyandroid09.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/nyandroid10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/nyandroid10.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/nyandroid11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/nyandroid11.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/rainbow_frame0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/rainbow_frame0.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/rainbow_frame1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/rainbow_frame1.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/star0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/star0.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/star1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/star1.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/star2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/star2.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/star3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/star3.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/star4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/star4.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/star5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/star5.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/star6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/star6.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/star7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/star7.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/star8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/star8.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/star9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/star9.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/superman0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/superman0.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/superman1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/superman1.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/superman_gtv0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/superman_gtv0.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/superman_gtv1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/superman_gtv1.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/tardis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/tardis.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/yellow_star0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/yellow_star0.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/yellow_star1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/yellow_star1.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/yellow_star2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/yellow_star2.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/yellow_star3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/yellow_star3.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/yellow_star4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/yellow_star4.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/yellow_star5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/yellow_star5.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/yellow_star6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/yellow_star6.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/yellow_star7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/yellow_star7.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/yellow_star8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/yellow_star8.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/drawable/yellow_star9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/drawable/yellow_star9.png -------------------------------------------------------------------------------- /NyanDroid/src/main/res/layout/nyan_activity.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 12 | 19 | 20 | -------------------------------------------------------------------------------- /NyanDroid/src/main/res/layout/nyan_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 13 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /NyanDroid/src/main/res/menu/menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | 10 | -------------------------------------------------------------------------------- /NyanDroid/src/main/res/raw/dyan_loop.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/NyanDroid/src/main/res/raw/dyan_loop.mp3 -------------------------------------------------------------------------------- /NyanDroid/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #00008b 4 | -------------------------------------------------------------------------------- /NyanDroid/src/main/res/values/sprites.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | "Nyandroid" 6 | "Superhero Nyandroid" 7 | "DroidTV" 8 | "Tardis" 9 | "Grumpy Cat" 10 | "None" 11 | 12 | 13 | 14 | "ics_egg" 15 | "nyanwich" 16 | "droidtv" 17 | "tardis" 18 | "grump" 19 | "none" 20 | 21 | 22 | 23 | "Neapolitan" 24 | "Rainbow" 25 | "Grumpy Rainbow" 26 | "None" 27 | 28 | 29 | 30 | "neapolitan" 31 | "rainbow" 32 | "mono" 33 | "none" 34 | 35 | 36 | 37 | "White" 38 | "Yellow" 39 | "No" 40 | "ICS Easter Egg" 41 | "None" 42 | 43 | 44 | 45 | "white" 46 | "yellow" 47 | "no" 48 | "ics_egg" 49 | "none" 50 | 51 | 52 | -------------------------------------------------------------------------------- /NyanDroid/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Nyan 4 | Nyandroid, bringing Ice Cream Sandwiches to all! 5 | Ice Cream Nyanwich Settings 6 | Droid 7 | Select a galactic traveler 8 | Rainbow 9 | Select burnoff 10 | 11 | Star 12 | Select star type 13 | 14 | nyandroidsettings 15 | 16 | -------------------------------------------------------------------------------- /NyanDroid/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /NyanDroid/src/main/res/xml/nyan_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 14 | 15 | 22 | 23 | 30 | 31 | 32 | 33 | 34 | 35 | 41 | 42 | 43 | 44 | 45 | 46 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /NyanDroid/src/main/res/xml/wallpaper.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://travis-ci.org/powerje/NyanDroid.svg?branch=master)](https://travis-ci.org/powerje/NyanDroid) 2 | [![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](https://www.apache.org/licenses/LICENSE-2.0) 3 | 4 | Live wallpaper celebrating Ice Cream Nyanwiches. Available on [Google Play](https://play.google.com/store/apps/details?id=com.powerje.nyan "NyanDroid on Google Play") and [F-Droid](https://www.f-droid.org/packages/com.powerje.nyan "NyanDroid on F-Droid"). 5 | 6 | NyanDroid created by [Daniel Sandler](https://twitter.com/dsandler "Daniel Sandler on Twitter"). 7 | 8 | MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM 9 | MMMMMMMMMMMMMMMMNNNNMMMNNNNNNNNNNNNNNNNNNMMMNNNNMMMMMMMMMMMMMMMM 10 | MMMMMMMMMMMMMMMMy++hMMd++++++++++++++++++dMMh++yMMMMMMMMMMMMMMMM 11 | MMMMMMMMMMMMMMMMdyyhhhs//////////////////shhhyydMMMMMMMMMMMMMMMM 12 | MMMMMMMMMMMMMMMMMMMy////////////////////////yMMMMMMMMMMMMMMMMMMM 13 | MMMMMMMMMMMMMMMMyoo+//smmmmmd//////dmmmmms//+ooyMMMMMMMMMMMMMMMM 14 | MMMMMMMMMMMMMMMMs/////ohhdMMN//////hhhNMMs/////sMMMMMMMMMMMMMMMM 15 | MMMMMMMMMMMMMMMMs/////- :MMN//////` dMMs/////sMMMMMMMMMMMMMMMM 16 | MMMMMMMMMMMMMyss+//////-:/sss//////:-:oss+/////+ssyMMMMMMMMMMMMM 17 | MMMMMMMMMMMMMo////////////////////////////////////oMMMMMMMMMMMMM 18 | MMMMMMMMMMMMMo////////////////////////////////////oMMMMMMMMMMMMM 19 | MMMMMMMMMMMMMhyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyhMMMMMMMMMMMMM 20 | MMMMNNNNNNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNNNNNNNMMMMMMNNNNNNMMMM 21 | MMMNooooooNMMmmmmmmmmmmmmmmmmmmmmmmmmmmmmo/////ommmMMNooooooNMMM 22 | MMMN//////NMMmddddddmmddddddddddmmmdddddd/...../ddmMMN//////NMMM 23 | MMMN//////NMMmdddddNMMNdddddddddMMMdddddd: :ddmMMN//////NMMM 24 | MMMN//////NMMmddddddmmmdddddddddmmmdddddd: :ddmMMN//////NMMM 25 | MMMN//////NMMmddddddddddddddddddddddddddd: :ddmMMN//////NMMM 26 | MMMN//////NMMmdddddddddddmMMMdddddddddddd: :ddmMMN//////NMMM 27 | MMMN//////NMMmddddddddddddmmmdddddddddddd: :ddmMMN//////NMMM 28 | MMMN//////NMMmddddddddddddddddddddddddddd: :ddmMMN//////NMMM 29 | MMMN//////NMMmdddddmMMNdddddddddMMMdddddd: :ddmMMN//////NMMM 30 | MMMN//////NMMmdddddmNNmdddddddddNNNdddddd: :ddmMMN//////NMMM 31 | MMMN//////NMMmddddddddddddddddddddddddddd: :ddmMMN//////NMMM 32 | MMMMddddddMMMmddddddddddddNNNdddddddddddd: :ddmMMMddddddMMMM 33 | MMMMMMMMMMMMMmdddddddddddmNNNdddddddddddd: :ddmMMMMMMMMMMMMM 34 | MMMMMMMMMMMMMmddddddddddddddddddddddddddd: :ddmMMMMMMMMMMMMM 35 | MMMMMMMMMMMMMmdddddmNNmdddddddddNNNdddddd: :ddmMMMMMMMMMMMMM 36 | MMMMMMMMMMMMMmdddddmMMNdddddddddMMMdddddd: :ddmMMMMMMMMMMMMM 37 | MMMMMMMMMMMMMmddddddddddddddddddddddddddd+-----+ddmMMMMMMMMMMMMM 38 | MMMMMMMMMMMMMmmmmmmmmmmmmmmmmmmmmmmmmmmmmyoooooymmmMMMMMMMMMMMMM 39 | MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM 40 | MMMMMMMMMMMMMMMMMMMdoooooyMMMMMMMMMMMMyooooodMMMMMMMMMMMMMMMMMMM 41 | MMMMMMMMMMMMMMMMMMMh/////oMMMMMMMMMMMMo/////hMMMMMMMMMMMMMMMMMMM 42 | MMMMMMMMMMMMMMMMMMMh/////oMMMMMMMMMMMMo/////hMMMMMMMMMMMMMMMMMMM 43 | MMMMMMMMMMMMMMMMMMMh/////oMMMMMMMMMMMMo/////hMMMMMMMMMMMMMMMMMMM 44 | MMMMMMMMMMMMMMMMMMMh+++++sMMMMMMMMMMMMs+++++hMMMMMMMMMMMMMMMMMMM 45 | MMMMMMMMMMMMMMMMMMMNNNNNNNMMMMMMMMMMMMNNNNNNNMMMMMMMMMMMMMMMMMMM 46 | MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM 47 | 48 | 49 | Licensing 50 | ========= 51 | 52 | Nyan Droid source is released under the [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0) license. 53 | 54 | [dyan.mp3](https://github.com/powerje/NyanDroid/blob/master/NyanDroid/src/main/res/raw/dyan_loop.mp3) (droid droid dr-dr-droid audio) created by [Jeff Sharkey](https://twitter.com/jsharkey "Jeff Sharkey on Twitter") and released under the [CC license](https://creativecommons.org/licenses/by-nc-sa/3.0). 55 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | buildscript { 3 | ext.kotlin_version = '1.9.23' 4 | repositories { 5 | google() 6 | jcenter() 7 | } 8 | dependencies { 9 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 10 | classpath 'com.android.tools.build:gradle:8.3.2' 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /buildSrc/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | `kotlin-dsl` 3 | } 4 | 5 | repositories { 6 | mavenCentral() 7 | } 8 | -------------------------------------------------------------------------------- /docs/_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-hacker -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | Nyan nyan nyan 2 | -------------------------------------------------------------------------------- /docs/privacy_policy.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Nyan Droid Live Wallpaper Privacy Policy 4 | 5 | 6 |

Nyan Droid Live Wallpaper Privacy Policy

7 | 8 |

9 | We don't store your data. We don't use your data. We don't share your data. Period. 10 |

11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | android.useAndroidX=true 2 | android.enableJetifier=true 3 | android.nonTransitiveRClass=false 4 | android.nonFinalResIds=false 5 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/powerje/NyanDroid/c5fef766377b9d8d314d6ce21550f8a02119f034/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Nov 14 21:39:01 EST 2022 2 | distributionBase=GRADLE_USER_HOME 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip 4 | distributionPath=wrapper/dists 5 | zipStorePath=wrapper/dists 6 | zipStoreBase=GRADLE_USER_HOME 7 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # 4 | # Copyright 2015 the original author or authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | ## 21 | ## Gradle start up script for UN*X 22 | ## 23 | ############################################################################## 24 | 25 | # Attempt to set APP_HOME 26 | # Resolve links: $0 may be a link 27 | PRG="$0" 28 | # Need this for relative symlinks. 29 | while [ -h "$PRG" ] ; do 30 | ls=`ls -ld "$PRG"` 31 | link=`expr "$ls" : '.*-> \(.*\)$'` 32 | if expr "$link" : '/.*' > /dev/null; then 33 | PRG="$link" 34 | else 35 | PRG=`dirname "$PRG"`"/$link" 36 | fi 37 | done 38 | SAVED="`pwd`" 39 | cd "`dirname \"$PRG\"`/" >/dev/null 40 | APP_HOME="`pwd -P`" 41 | cd "$SAVED" >/dev/null 42 | 43 | APP_NAME="Gradle" 44 | APP_BASE_NAME=`basename "$0"` 45 | 46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 48 | 49 | # Use the maximum available, or set MAX_FD != -1 to use that value. 50 | MAX_FD="maximum" 51 | 52 | warn () { 53 | echo "$*" 54 | } 55 | 56 | die () { 57 | echo 58 | echo "$*" 59 | echo 60 | exit 1 61 | } 62 | 63 | # OS specific support (must be 'true' or 'false'). 64 | cygwin=false 65 | msys=false 66 | darwin=false 67 | nonstop=false 68 | case "`uname`" in 69 | CYGWIN* ) 70 | cygwin=true 71 | ;; 72 | Darwin* ) 73 | darwin=true 74 | ;; 75 | MINGW* ) 76 | msys=true 77 | ;; 78 | NONSTOP* ) 79 | nonstop=true 80 | ;; 81 | esac 82 | 83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 84 | 85 | # Determine the Java command to use to start the JVM. 86 | if [ -n "$JAVA_HOME" ] ; then 87 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 88 | # IBM's JDK on AIX uses strange locations for the executables 89 | JAVACMD="$JAVA_HOME/jre/sh/java" 90 | else 91 | JAVACMD="$JAVA_HOME/bin/java" 92 | fi 93 | if [ ! -x "$JAVACMD" ] ; then 94 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 95 | 96 | Please set the JAVA_HOME variable in your environment to match the 97 | location of your Java installation." 98 | fi 99 | else 100 | JAVACMD="java" 101 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 102 | 103 | Please set the JAVA_HOME variable in your environment to match the 104 | location of your Java installation." 105 | fi 106 | 107 | # Increase the maximum file descriptors if we can. 108 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 109 | MAX_FD_LIMIT=`ulimit -H -n` 110 | if [ $? -eq 0 ] ; then 111 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 112 | MAX_FD="$MAX_FD_LIMIT" 113 | fi 114 | ulimit -n $MAX_FD 115 | if [ $? -ne 0 ] ; then 116 | warn "Could not set maximum file descriptor limit: $MAX_FD" 117 | fi 118 | else 119 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 120 | fi 121 | fi 122 | 123 | # For Darwin, add options to specify how the application appears in the dock 124 | if $darwin; then 125 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 126 | fi 127 | 128 | # For Cygwin or MSYS, switch paths to Windows format before running java 129 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then 130 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 131 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 132 | JAVACMD=`cygpath --unix "$JAVACMD"` 133 | 134 | # We build the pattern for arguments to be converted via cygpath 135 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 136 | SEP="" 137 | for dir in $ROOTDIRSRAW ; do 138 | ROOTDIRS="$ROOTDIRS$SEP$dir" 139 | SEP="|" 140 | done 141 | OURCYGPATTERN="(^($ROOTDIRS))" 142 | # Add a user-defined pattern to the cygpath arguments 143 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 144 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 145 | fi 146 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 147 | i=0 148 | for arg in "$@" ; do 149 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 150 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 151 | 152 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 153 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 154 | else 155 | eval `echo args$i`="\"$arg\"" 156 | fi 157 | i=$((i+1)) 158 | done 159 | case $i in 160 | (0) set -- ;; 161 | (1) set -- "$args0" ;; 162 | (2) set -- "$args0" "$args1" ;; 163 | (3) set -- "$args0" "$args1" "$args2" ;; 164 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 165 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 166 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 167 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 168 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 169 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 170 | esac 171 | fi 172 | 173 | # Escape application args 174 | save () { 175 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 176 | echo " " 177 | } 178 | APP_ARGS=$(save "$@") 179 | 180 | # Collect all arguments for the java command, following the shell quoting and substitution rules 181 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 182 | 183 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 184 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then 185 | cd "$(dirname "$0")" 186 | fi 187 | 188 | exec "$JAVACMD" "$@" 189 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 33 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 34 | 35 | @rem Find java.exe 36 | if defined JAVA_HOME goto findJavaFromJavaHome 37 | 38 | set JAVA_EXE=java.exe 39 | %JAVA_EXE% -version >NUL 2>&1 40 | if "%ERRORLEVEL%" == "0" goto init 41 | 42 | echo. 43 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 44 | echo. 45 | echo Please set the JAVA_HOME variable in your environment to match the 46 | echo location of your Java installation. 47 | 48 | goto fail 49 | 50 | :findJavaFromJavaHome 51 | set JAVA_HOME=%JAVA_HOME:"=% 52 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 53 | 54 | if exist "%JAVA_EXE%" goto init 55 | 56 | echo. 57 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 58 | echo. 59 | echo Please set the JAVA_HOME variable in your environment to match the 60 | echo location of your Java installation. 61 | 62 | goto fail 63 | 64 | :init 65 | @rem Get command-line arguments, handling Windows variants 66 | 67 | if not "%OS%" == "Windows_NT" goto win9xME_args 68 | 69 | :win9xME_args 70 | @rem Slurp the command line arguments. 71 | set CMD_LINE_ARGS= 72 | set _SKIP=2 73 | 74 | :win9xME_args_slurp 75 | if "x%~1" == "x" goto execute 76 | 77 | set CMD_LINE_ARGS=%* 78 | 79 | :execute 80 | @rem Setup the command line 81 | 82 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 83 | 84 | @rem Execute Gradle 85 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 86 | 87 | :end 88 | @rem End local scope for the variables with windows NT shell 89 | if "%ERRORLEVEL%"=="0" goto mainEnd 90 | 91 | :fail 92 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 93 | rem the _cmd.exe /c_ return code! 94 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 95 | exit /b 1 96 | 97 | :mainEnd 98 | if "%OS%"=="Windows_NT" endlocal 99 | 100 | :omega 101 | -------------------------------------------------------------------------------- /settings.gradle.kts: -------------------------------------------------------------------------------- 1 | include(":NyanDroid") 2 | --------------------------------------------------------------------------------