顯示具有 image 標籤的文章。 顯示所有文章
顯示具有 image 標籤的文章。 顯示所有文章

2016年10月1日 星期六

Picasso:how to add a Reflect effect to the image




at the into function,add a callback


private void setImageUrl(ImageView imageView, String url) {
        Picasso.with(getContext())
                .load(url)
                .centerCrop().fit()
                .transform(new EffectTransformation())
                .into(imageView, new Callback() {
                    @Override
                    public void onSuccess() {
                        new Handler().postDelayed(new Runnable() {
                            @Override
                            public void run() {
                                if (imageVBackground.getDrawable() != null) {
                                    Bitmap bmp = ((BitmapDrawable) (imageVBackground.getDrawable())).getBitmap();
                                    int bmpWidth = bmp.getWidth();
                                    int bmpHeight = bmp.getHeight();
                                    Bitmap b = Bitmap.createBitmap(bmp, 0, bmpHeight * 5 / 6, bmpWidth, bmpHeight / 6, null, false);
                                    Bitmap newBitmap = addGradient(b);
                                    ivMirror.setImageBitmap(newBitmap);
//                                   ivMirror.setAlpha(0.1f);


                                }
                            }
                        }, 300);
                    }

                    @Override
                    public void onError() {

                    }
                });

    }

2016年8月11日 星期四

upload picture

14.upload picture

how to choose a picture?

need to create a image picker
1.

2.



how to make a circle image  view

Upload the profile picture
ok

need to do:
different people upload to different please

FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
if (user != null) {
   // Name, email address, and profile photo Url
   String name = user.getDisplayName();
   String email = user.getEmail();
   Uri photoUrl = user.getPhotoUrl();

   // The user's ID, unique to the Firebase project. Do NOT use this value to
   // authenticate with your backend server, if you have one. Use
   // FirebaseUser.getToken() instead.
   String uid = user.getUid();
}

save the link
use share preference first,later use~
need to use real time data base

login one time is ok
when finish the firest time login,use the SharedPreference to save the emaill abd password.
And use SharedPreference  to save that that is already login success

Can not goback to the login page

intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);

Logout
download the picture

set the profile picture default image