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
//How do you find the largest and smallest number in an unsorted integer array? | |
fun main() { | |
val number = arrayOf(15, 24, 90, 4, 5, 1200, 8, 3, 47, 1, 45, 20) | |
println("Min ${number.minOrNull()}") | |
println("Max ${number.maxOrNull()}") | |
} |
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
import java.util.* | |
// How do you find the duplicate number on a given integer array? | |
fun main() { | |
val arr = arrayListOf(4, 5, 8, 3, 4, 11,5,8, 15, 3,4,4) | |
println(arr.groupingBy { | |
it |
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
package com.chart; | |
import android.content.Context; | |
import android.graphics.Color; | |
import android.support.annotation.Nullable; | |
import android.util.AttributeSet; | |
import android.util.Log; | |
import android.view.Gravity; | |
import android.view.View; | |
import android.view.ViewTreeObserver; |
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
package example.andrdoitechweb.viewpagertransformer.Transformation; | |
import android.support.v4.view.ViewPager; | |
import android.view.View; | |
public class ZoomOutTransformation implements ViewPager.PageTransformer { | |
private static final float MIN_SCALE = 0.65f; | |
private static final float MIN_ALPHA = 0.3f; |
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
package example.andrdoitechweb.viewpagertransformer.Transformation; | |
import android.support.v4.view.ViewPager; | |
import android.view.View; | |
public class VerticalShutTransformation implements ViewPager.PageTransformer{ | |
@Override | |
public void transformPage(View page, float position) { | |
page.setTranslationX(-position*page.getWidth()); |
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
package example.andrdoitechweb.viewpagertransformer.Transformation; | |
import android.support.v4.view.ViewPager; | |
import android.view.View; | |
public class VerticalFlipTransformation implements ViewPager.PageTransformer { | |
@Override | |
public void transformPage(View page, float position) { | |
page.setTranslationX(-position * page.getWidth()); |
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
package example.andrdoitechweb.viewpagertransformer.Transformation; | |
import android.support.v4.view.ViewPager; | |
import android.view.View; | |
public class TossTransformation implements ViewPager.PageTransformer { | |
@Override | |
public void transformPage(View page, float position) { | |
page.setTranslationX(-position * page.getWidth()); |
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
package example.andrdoitechweb.viewpagertransformer.Transformation; | |
import android.support.v4.view.ViewPager; | |
import android.view.View; | |
public class SpinnerTransformation implements ViewPager.PageTransformer { | |
@Override | |
public void transformPage(View page, float position) { | |
page.setTranslationX(-position * page.getWidth()); |
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
package example.andrdoitechweb.viewpagertransformer.Transformation; | |
import android.support.v4.view.ViewPager; | |
import android.view.View; | |
import android.widget.ImageButton; | |
import android.widget.TextView; | |
import example.andrdoitechweb.viewpagertransformer.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
package example.andrdoitechweb.viewpagertransformer.Transformation; | |
import android.support.v4.view.ViewPager; | |
import android.view.View; | |
public class SimpleTransformation implements ViewPager.PageTransformer { | |
@Override | |
public void transformPage(View page, float position) { | |
} |
NewerOlder