This file contains hidden or 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 onDestroy() { | |
| // Remove all callbacks when this activity is destroyed | |
| displayManagerHelper?.unregisterCoverDisplayEnabledCallback(applicationContext.packageName) | |
| displayManagerHelper?.unregisterSmartCoverCallback(smartCoverCallback) | |
| super.onDestroy() | |
| } |
This file contains hidden or 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
| package com.android.moveandscale | |
| import android.animation.ObjectAnimator | |
| import android.graphics.Point | |
| import android.os.Bundle | |
| import android.view.ViewGroup | |
| import android.widget.ImageView | |
| import android.widget.RelativeLayout | |
| import androidx.appcompat.app.AppCompatActivity | |
| import androidx.core.content.ContextCompat |
This file contains hidden or 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
| public static int dpToPx(float dp, Context context) { | |
| return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, context.getResources().getDisplayMetrics()); | |
| } |
This file contains hidden or 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
| import android.content.res.Resources | |
| import android.view.View | |
| import androidx.recyclerview.widget.RecyclerView | |
| import org.hamcrest.Description | |
| import org.hamcrest.Matcher | |
| import org.hamcrest.TypeSafeMatcher | |
| /** | |
| * Performing actions and matches on items by position. | |
| * @see <a href="https://github.com/dannyroa/espresso-samples">Android Espresso Samples by Danny Roa</a> |
This file contains hidden or 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
| import android.view.View | |
| import androidx.recyclerview.widget.RecyclerView | |
| import androidx.test.espresso.NoMatchingViewException | |
| import androidx.test.espresso.ViewAssertion | |
| import androidx.test.espresso.matcher.ViewMatchers.assertThat | |
| import org.hamcrest.Matcher | |
| import org.hamcrest.Matchers.`is` | |
| /** | |
| * Using assert item count of RecyclerView adapter |
This file contains hidden or 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
| import android.view.View | |
| import android.widget.HorizontalScrollView | |
| import android.widget.ListView | |
| import android.widget.ScrollView | |
| import androidx.core.widget.NestedScrollView | |
| import androidx.test.espresso.ViewAction | |
| import androidx.test.espresso.action.ViewActions | |
| import androidx.test.espresso.matcher.ViewMatchers.* | |
| import org.hamcrest.Matcher | |
| import org.hamcrest.Matchers |
This file contains hidden or 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
| apply plugin: 'jacoco' | |
| // Filter out modules | |
| def jacocoCoveredProject = subprojects.findAll { project -> | |
| project.name == "app" || project.name == "data" || project.name == "domain" | |
| } | |
| def coveredProject = subprojects | |
| println("All subprojects:") | |
| println(subprojects.name) |
This file contains hidden or 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
| import com.android.build.gradle.api.ApplicationVariant | |
| import com.android.build.gradle.api.BaseVariantOutput | |
| import com.android.build.gradle.internal.api.BaseVariantOutputImpl | |
| android { | |
| //... | |
| applicationVariants.all(ApplicationVariantAction()) | |
| } |
This file contains hidden or 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
| package com.filipkowicz.headeritemdecorator | |
| /* | |
| solution based on - based on Sevastyan answer on StackOverflow | |
| changes: | |
| - take to account views offsets | |
| - transformed to Kotlin | |
| - now works on viewHolders |
This file contains hidden or 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 App or Android Lib Module | |
| plugins { | |
| id(GradlePlugins.androidLib) | |
| id(GradlePlugins.kotlinAndroid) | |
| } | |
| android { | |
| kotlinOptions { | |
| jvmTarget = "1.8" | |
| } |