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
private const val TAG = "ScreenshotsUtils" | |
fun takeScreenshot(screenShotName: String) { | |
Log.d(TAG, "Taking screenshot of '$screenShotName'") | |
val screenCapture = Screenshot.capture() | |
try { | |
screenCapture.apply { | |
name = screenShotName | |
process() | |
} |
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
android { | |
// The rest of you build.gradle | |
adbOptions { | |
installOptions '-g', '-r' | |
} | |
} |
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
class MyScreenCaptureProcessor : BasicScreenCaptureProcessor() { | |
init { | |
this.mDefaultScreenshotPath = File( | |
File( | |
getExternalStoragePublicDirectory(DIRECTORY_PICTURES), | |
"${BuildConfig.APPLICATION_ID}/${BuildConfig.BUILD_TYPE}" | |
).absolutePath, | |
SCREENSHOTS_FOLDER_NAME | |
) |
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
private const val TAG = "ScreenshotsUtils" | |
fun takeScreenshot(screenShotName: String) { | |
Log.d(TAG, "Taking screenshot of '$screenShotName'") | |
val screenCapture = Screenshot.capture() | |
val processors = setOf(MyScreenCaptureProcessor()) | |
try { | |
screenCapture.apply { | |
name = screenShotName | |
process(processors) |
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
android { | |
defaultConfig { | |
... | |
testInstrumentationRunnerArguments clearPackageData: 'true' | |
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" | |
} | |
testOptions { | |
execution 'ANDROID_TEST_ORCHESTRATOR' | |
} |
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
android { | |
testOptions { | |
... | |
animationsDisabled = true | |
} | |
} |
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
def appId = "com.patrykkosieradzki.moviebox" | |
android { | |
... | |
defaultConfig { | |
... | |
applicationId appId | |
} | |
} |
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
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder { | |
// return new ViewHolder reference here based on the viewType | |
} |
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
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) { | |
if (holder is CustomViewHolder) { | |
// bind data to the views of CustomViewHolder | |
} | |
... | |
} |
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
@Override | |
public int getItemCount() { | |
if (dataset == null) | |
return 0; | |
return dataset.size(); | |
} |
OlderNewer