-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make it easier to migrate Echo to a new year
Also, add a new screen background
- Loading branch information
1 parent
3852d50
commit c6be58e
Showing
5 changed files
with
63 additions
and
16 deletions.
There are no files selected for viewing
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
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
38 changes: 38 additions & 0 deletions
38
ui/echo/src/main/java/de/danoeh/antennapod/ui/echo/screens/WavesScreen.java
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,38 @@ | ||
package de.danoeh.antennapod.ui.echo.screens; | ||
|
||
import android.content.Context; | ||
import android.graphics.Canvas; | ||
import android.graphics.Paint; | ||
import androidx.annotation.NonNull; | ||
|
||
public class WavesScreen extends BaseScreen { | ||
protected static final int NUM_PARTICLES = 10; | ||
|
||
public WavesScreen(Context context) { | ||
super(context); | ||
paintParticles.setStyle(Paint.Style.STROKE); | ||
for (int i = 0; i < NUM_PARTICLES; i++) { | ||
particles.add(new Particle(0, 0, 1.0f * i / NUM_PARTICLES, 0)); | ||
} | ||
} | ||
|
||
@Override | ||
public void draw(@NonNull Canvas canvas) { | ||
paintParticles.setStrokeWidth(0.05f * getBounds().height()); | ||
super.draw(canvas); | ||
} | ||
|
||
@Override | ||
protected void drawParticle(@NonNull Canvas canvas, Particle p, float width, float height, | ||
float innerBoxX, float innerBoxY, float innerBoxSize) { | ||
canvas.drawCircle(width / 2, 1.1f * height, (float) (p.positionZ * 1.2f * height), paintParticles); | ||
} | ||
|
||
@Override | ||
protected void particleTick(Particle p, long timeSinceLastFrame) { | ||
p.positionZ += 0.00005 * timeSinceLastFrame; | ||
if (p.positionZ > 1f) { | ||
p.positionZ -= 1f; | ||
} | ||
} | ||
} |