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.app.Activity; | |
| import android.app.Application; | |
| import android.content.Context; | |
| import android.content.ContextWrapper; | |
| import android.os.Bundle; | |
| import android.os.Looper; | |
| import android.os.MessageQueue; | |
| import android.util.Log; | |
| import android.view.View; | |
| import android.view.ViewTreeObserver; |
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.Context; | |
| import android.content.res.TypedArray; | |
| import android.graphics.Canvas; | |
| import android.graphics.Rect; | |
| import android.graphics.drawable.Drawable; | |
| import android.support.v7.widget.LinearLayoutManager; | |
| import android.support.v7.widget.RecyclerView; | |
| import android.util.AttributeSet; | |
| import android.view.View; |
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
| <?xml version="1.0" encoding="utf-8"?> | |
| <resources> | |
| <!-- RED --> | |
| <color name="red_50">#FFEBEE</color> | |
| <color name="red_100">#FFCDD2</color> | |
| <color name="red_200">#EF9A9A</color> | |
| <color name="red_300">#E57373</color> | |
| <color name="red_400">#EF5350</color> | |
| <color name="red_500">#F44336</color> |
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
| /* | |
| * The MIT License (MIT) | |
| * | |
| * Copyright (c) 2014 Matthieu Harlé | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining a copy | |
| * of this software and associated documentation files (the "Software"), to deal | |
| * in the Software without restriction, including without limitation the rights | |
| * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| * copies of the Software, and to permit persons to whom the Software is |
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 class ParallaxPageTransformer implements ViewPager.PageTransformer { | |
| public void transformPage(View view, float position) { | |
| int pageWidth = view.getWidth(); | |
| if (position < -1) { // [-Infinity,-1) | |
| // This page is way off-screen to the left. | |
| view.setAlpha(1); |
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 void transformPage(View view, float position) { | |
| int pageWidth = view.getWidth(); | |
| if (position < -1) { // [-Infinity,-1) | |
| // This page is way off-screen to the left. | |
| view.setAlpha(0); | |
| } else if (position <= 1) { // [-1,1] | |
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
| /* | |
| * Copyright (C) 2014 The Android Open Source Project | |
| * | |
| * 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 |
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
| /* | |
| * Author: Felipe Herranz (felhr85@gmail.com) | |
| * Contributors:Francesco Verheye (verheye.francesco@gmail.com) | |
| * Israel Dominguez (dominguez.israel@gmail.com) | |
| */ | |
| import java.util.ArrayList; | |
| import java.util.List; | |
| import java.util.concurrent.atomic.AtomicBoolean; | |
| import android.os.Handler; |
NewerOlder