Last active
March 8, 2017 05:41
-
-
Save torchhound/c99ca132a980de4aab2d8fe74c7b314e to your computer and use it in GitHub Desktop.
500px Blur View Library Implementation
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
<com.fivehundredpx.android.blur.BlurringView | |
android:id="@+id/blurring_view" | |
android:layout_width="match_parent" | |
android:layout_height="56dp" | |
app:blurRadius="2" | |
app:downsampleFactor="6" | |
app:overlayColor="@color/player_bottom"/> | |
app build.gradle | |
android{ | |
defaultConfig{ | |
renderscriptTargetApi 20 | |
renderscriptSupportModeEnabled true | |
} | |
} | |
dependencies { | |
repositories { | |
maven { url 'https://github.com/500px/500px-android-blur/raw/master/releases/' } | |
} | |
compile('com.fivehundredpx:blurringview:1.0.0') { | |
force = true; | |
} | |
} | |
final LayoutInflater factory = getActivity().getLayoutInflater(); | |
final View miniplayerView = factory.inflate(R.layout.miniplayer, null); | |
final BlurringView miniplayerBlurringView = (BlurringView) miniplayerView.findViewById(R.id.blurring_view); | |
final LinearLayout miniplayerBlurredView = (LinearLayout) miniplayerView.findViewById(R.id.miniplayer_linear); | |
miniplayerBlurringView.setBlurredView(miniplayerBlurredView); | |
newsfeedRecycler.addOnScrollListener(new RecyclerView.OnScrollListener() { | |
@Override | |
public void onScrollStateChanged(RecyclerView recyclerView, int newState) { | |
super.onScrollStateChanged(recyclerView, newState); | |
miniplayerBlurringView.invalidate(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment