forked from facebookarchive/shimmer-android
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from usefulness/updates
- Loading branch information
Showing
23 changed files
with
293 additions
and
227 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,34 @@ | ||
import com.karumi.shot.tasks.ExecuteScreenshotTests | ||
|
||
plugins { | ||
alias(libs.plugins.starter.application.android) | ||
id("shot") | ||
} | ||
|
||
android { | ||
namespace = "io.github.usefulness.shimmer.sample" | ||
defaultConfig { | ||
minSdk 28 | ||
applicationId "io.github.usefulness.shimmer.sample" | ||
testInstrumentationRunner "com.karumi.shot.ShotTestRunner" | ||
} | ||
buildFeatures { | ||
viewBinding = true | ||
} | ||
} | ||
|
||
|
||
dependencies { | ||
implementation("io.github.usefulness:shimmer-android-core") | ||
implementation(libs.appcompat.core) | ||
implementation(libs.constraintlayout.core) | ||
|
||
testImplementation(libs.junit.jupiter) | ||
|
||
androidTestImplementation(libs.appcompat.core) | ||
androidTestImplementation(libs.espresso.core) | ||
androidTestImplementation(libs.androidtest.core) | ||
androidTestImplementation(libs.androidtest.runner) | ||
androidTestImplementation(libs.androidtest.rules) | ||
androidTestImplementation(libs.androidtest.junitext) | ||
} |
Binary file added
BIN
+369 KB
...hots/debug/io.github.usefulness.shimmer.android.ShimmerTest_launchView-wide.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+330 KB
...reenshots/debug/io.github.usefulness.shimmer.android.ShimmerTest_launchView.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
30 changes: 30 additions & 0 deletions
30
sample/src/androidTest/kotlin/io/github/usefulness/shimmer/android/ShimmerTest.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,30 @@ | ||
package io.github.usefulness.shimmer.android | ||
|
||
import android.view.LayoutInflater | ||
import androidx.test.ext.junit.rules.activityScenarioRule | ||
import com.karumi.shot.ActivityScenarioUtils.waitForActivity | ||
import com.karumi.shot.ScreenshotTest | ||
import io.github.usefulness.shimmer.sample.MainActivity | ||
import io.github.usefulness.shimmer.sample.R | ||
import org.junit.Rule | ||
import org.junit.Test | ||
|
||
class ShimmerTest { | ||
|
||
val test = object : ScreenshotTest {} | ||
|
||
@get:Rule | ||
val rule = activityScenarioRule<MainActivity>() | ||
|
||
@Test | ||
fun launchView() { | ||
val activity = rule.scenario.waitForActivity() | ||
val inflater = LayoutInflater.from(activity) | ||
val view = inflater.inflate(R.layout.main, null, false) | ||
val shimmer = view.findViewById<ShimmerFrameLayout>(R.id.shimmer_view_container) | ||
shimmer.setStaticAnimationProgress(0.5f) | ||
|
||
test.compareScreenshot(view, 2000, 1200) | ||
test.compareScreenshot(view, 2000, 1600, name = "launchView-wide") | ||
} | ||
} |
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
Binary file not shown.
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,18 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="24dp" | ||
android:height="24dp" | ||
android:viewportWidth="24" | ||
android:viewportHeight="24" | ||
> | ||
<group | ||
android:scaleX="0.5392683" | ||
android:scaleY="0.5392683" | ||
android:translateX="5.5287805" | ||
android:translateY="5.5287805" | ||
> | ||
<path | ||
android:fillColor="#FFFFFF" | ||
android:pathData="M21,14L19,14L19,10L21,10L21,14ZM17,16L15,16L15,8L17,8L17,16ZM13,19L11,19L11,5L13,5L13,19ZM9,16L7,16L7,8L9,8L9,16ZM5,14L3,14L3,10L5,10L5,14Z" | ||
/> | ||
</group> | ||
</vector> |
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,10 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="24dp" | ||
android:height="24dp" | ||
android:viewportWidth="24" | ||
android:viewportHeight="24"> | ||
<path | ||
android:fillColor="#FFFF" | ||
android:pathData="M21,14L19,14L19,10L21,10L21,14ZM17,16L15,16L15,8L17,8L17,16ZM13,19L11,19L11,5L13,5L13,19ZM9,16L7,16L7,8L9,8L9,16ZM5,14L3,14L3,10L5,10L5,14Z" | ||
android:fillType="evenOdd"/> | ||
</vector> |
Binary file not shown.
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,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<background android:drawable="@color/ic_launcher_background" /> | ||
<foreground android:drawable="@drawable/ic_launcher_foreground" /> | ||
</adaptive-icon> |
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,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<color name="ic_launcher_background">#8D1F1F</color> | ||
</resources> |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<string name="app_name">Shimmer</string> | ||
<string name="mission_statement">Facebook’s mission is to give people the power to build community and bring the world closer together.</string> | ||
<string name="presets">Presets</string> | ||
<string name="app_name">Shimmer</string> | ||
<string name="sample_shimmered_copy">Lorem ipsum dolor sit amet. Est tenetur quaerat sed consequatur cumque in accusantium nemo nam sint voluptates non modi sint nam possimus laboriosam.</string> | ||
<string name="presets">Presets</string> | ||
</resources> |
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.