500px / 500px-android-blur

Android Blurring View
http://developers.500px.com/2015/03/17/a-blurring-view-for-android.html
MIT License
2.69k stars 326 forks source link

crash at the opening of the application #28

Open MSay2 opened 7 years ago

MSay2 commented 7 years ago

crash at the opening of the application

my layout :

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#FFFFFFFF">

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:clipChildren="false">

        <RelativeLayout
            android:background="#FF02ADEA"
            android:id="@+id/blurred_view"
            android:layout_width="600dp"
            android:layout_height="600dp"
            android:layout_gravity="center"
            android:clipChildren="false">

        </RelativeLayout>

    </FrameLayout>

    <com.fivehundredpx.android.blur.BlurringView
        android:id="@+id/blurring_view"
        android:layout_width="360dp"
        android:layout_height="360dp"
        android:layout_gravity="center"
        app:blurRadius="11"
        app:downsampleFactor="6"
        app:overlayColor="#99FFFFFF"/>

    <ImageView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:src="@drawable/ic_launcher"/>

</FrameLayout>

my java :

import android.os.*;
import android.app.*;

import com.fivehundredpx.android.blur.BlurringView;

import android.support.v7.app.AppCompatActivity;

import android.graphics.Color;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.FrameLayout;

public class ActivityIconThemeCyano extends AppCompatActivity
{
    private BlurringView blV;

    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.icon_themecyano);
        makeAppFullscreen();

        blV = (BlurringView)findViewById(R.id.blurring_view);
        View imgV = findViewById(R.id.blurred_view);

        blV.setBlurredView(imgV);
    }

    private void makeAppFullscreen()
    {
        getWindow().setStatusBarColor(Color.TRANSPARENT);
        getWindow().getDecorView().setSystemUiVisibility(
        View.SYSTEM_UI_FLAG_LAYOUT_STABLE | 
        View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
    }
}

did I do something wrong ? My API is 21-23

TriangleYJ commented 7 years ago

Did you add renderscriptTargetApi 21 renderscriptSupportModeEnabled true in build.gradle?

MSay2 commented 7 years ago

Yes my target API is 23

renderscriptTargetApi 23 renderscriptSupportModeEnabled true