-
Notifications
You must be signed in to change notification settings - Fork 212
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
28 changed files
with
964 additions
and
194 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
22 changes: 22 additions & 0 deletions
22
paparazzi-gradle-plugin/src/test/projects/verify-gif/build.gradle
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,22 @@ | ||
plugins { | ||
id 'com.android.library' | ||
id 'kotlin-android' | ||
id 'app.cash.paparazzi' | ||
} | ||
|
||
android { | ||
namespace 'app.cash.paparazzi.plugin.test' | ||
compileSdk libs.versions.compileSdk.get() as int | ||
defaultConfig { | ||
minSdk libs.versions.minSdk.get() as int | ||
} | ||
compileOptions { | ||
sourceCompatibility = libs.versions.javaTarget.get() | ||
targetCompatibility = libs.versions.javaTarget.get() | ||
} | ||
kotlinOptions { | ||
jvmTarget = libs.versions.javaTarget.get() | ||
} | ||
} | ||
|
||
apply from: '../guava-fix.gradle' |
68 changes: 68 additions & 0 deletions
68
paparazzi-gradle-plugin/src/test/projects/verify-gif/src/main/res/layout/keypad.xml
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 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:orientation="vertical" | ||
android:background="@color/bolt" | ||
android:padding="30dp" | ||
> | ||
|
||
<TextView | ||
android:id="@+id/amount" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:text=".01 BTC" | ||
android:textSize="70dp" | ||
android:gravity="center" | ||
android:textColor="@color/keypadDarkGrey" | ||
android:textFontWeight="100" | ||
android:layout_weight="2" | ||
/> | ||
|
||
<TextView | ||
android:id="@+id/amount123" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:text="1 2 3" | ||
android:textSize="45dp" | ||
android:gravity="center" | ||
android:textFontWeight="200" | ||
android:textColor="@color/keypadDarkGrey" | ||
android:layout_weight="1" | ||
/> | ||
<TextView | ||
android:id="@+id/amount456" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:text="4 5 6" | ||
android:textFontWeight="400" | ||
android:textSize="45dp" | ||
android:gravity="center" | ||
android:textColor="@color/keypadDarkGrey" | ||
android:layout_weight="1" | ||
/> | ||
<TextView | ||
android:id="@+id/amount789" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:text="7 8 9" | ||
android:textFontWeight="600" | ||
android:textSize="45dp" | ||
android:gravity="center" | ||
android:textColor="@color/keypadDarkGrey" | ||
android:layout_weight="1" | ||
/> | ||
<TextView | ||
android:id="@+id/amount0" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:text="# 0 . " | ||
android:textSize="45dp" | ||
android:textFontWeight="800" | ||
android:gravity="center" | ||
android:textColor="@color/keypadDarkGrey" | ||
android:layout_weight="1" | ||
/> | ||
|
||
</LinearLayout> |
5 changes: 5 additions & 0 deletions
5
paparazzi-gradle-plugin/src/test/projects/verify-gif/src/main/res/values/colors.xml
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,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<color name="bolt">#EBFF00</color> | ||
<color name="keypadDarkGrey">#595959</color> | ||
</resources> |
43 changes: 43 additions & 0 deletions
43
...c/test/projects/verify-gif/src/test/java/app/cash/paparazzi/plugin/test/KeypadViewTest.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright (C) 2023 Square, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package app.cash.paparazzi.plugin.test | ||
|
||
import android.animation.ObjectAnimator | ||
import android.view.View | ||
import android.widget.LinearLayout | ||
import android.widget.TextView | ||
import app.cash.paparazzi.Paparazzi | ||
import org.junit.Rule | ||
import org.junit.Test | ||
|
||
class KeypadViewTest { | ||
@get:Rule | ||
val paparazzi = Paparazzi(showSystemUi = true) | ||
|
||
@Test | ||
fun testViews() { | ||
val keypad = paparazzi.inflate<LinearLayout>(R.layout.keypad) | ||
val amount = keypad.findViewById<TextView>(R.id.amount) | ||
|
||
val rotation = ObjectAnimator.ofFloat(amount, View.ROTATION, 0.0f, 360.0f).apply { | ||
duration = 500 | ||
startDelay = 500 | ||
} | ||
rotation.start() | ||
|
||
paparazzi.gif(keypad, "spin", start = 500, end = 1500, fps = 30) | ||
} | ||
} |
Binary file added
BIN
+147 KB
...apshots/videos/app.cash.paparazzi.plugin.test_KeypadViewTest_testViews_spin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Oops, something went wrong.