-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
46 changed files
with
438 additions
and
266 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
package soheilkd.BurninWiper | ||
|
||
import android.os.Bundle | ||
import android.os.SystemClock | ||
import android.util.DisplayMetrics | ||
import android.view.ViewGroup | ||
import android.widget.Toast | ||
import androidx.appcompat.app.AppCompatActivity | ||
|
||
import kotlinx.android.synthetic.main.activity_anim.* | ||
import pl.droidsonroids.gif.GifImageView | ||
import kotlin.math.roundToInt | ||
|
||
class AnimActivity : AppCompatActivity() { | ||
private val gifViews = arrayListOf<GifImageView>() | ||
private val gifs = arrayOf( | ||
R.drawable.gif_0, | ||
R.drawable.gif_1, | ||
R.drawable.gif_2, | ||
R.drawable.gif_3, | ||
R.drawable.gif_4, | ||
R.drawable.gif_5, | ||
R.drawable.gif_6, | ||
R.drawable.gif_7 | ||
) | ||
private var animThread = Thread(Runnable { | ||
while (true) { | ||
for (gif in gifs) { | ||
for (view in gifViews) { | ||
runOnUiThread { view.setImageResource(gif) } | ||
} | ||
SystemClock.sleep(20000) | ||
} | ||
} | ||
}) | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.activity_anim) | ||
anim_grid.setOnClickListener { finish() } | ||
|
||
Helper.makeImmersive(window, anim_grid) | ||
if (intent.getBooleanExtra("IsChecking", false)) | ||
return | ||
loadViews() | ||
animThread.start() | ||
Helper.setTimer(intent.getIntExtra("TimerIndex", 0)) { finish() } | ||
Toast.makeText(this, "Cautious: Device may heat up after a while", Toast.LENGTH_LONG).show() | ||
} | ||
|
||
private fun loadViews() { | ||
val metrics = DisplayMetrics() | ||
windowManager.defaultDisplay.getMetrics(metrics) | ||
|
||
anim_grid.columnCount = (metrics.widthPixels / metrics.density / 75).roundToInt() + 1 | ||
anim_grid.rowCount = (metrics.heightPixels / metrics.density / 75).roundToInt() + 1 | ||
val dps = (75 * metrics.scaledDensity + 0.5f).toInt() | ||
for (i in 0..anim_grid.columnCount * anim_grid.rowCount) { | ||
val view = GifImageView(this) | ||
view.layoutParams = ViewGroup.LayoutParams(dps, dps) | ||
view.setOnClickListener { finish() } | ||
gifViews.add(view) | ||
} | ||
for (view in gifViews) { | ||
anim_grid.addView(view) | ||
} | ||
} | ||
} |
100 changes: 26 additions & 74 deletions
100
app/src/main/java/soheilkd/burninwiper/ColorActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.