Android手机——读取手机电话+短信+网页+图片+音乐+视频+APK+通知栏消息+换头像

转自:http://blog.csdn.net/zhangyufeng0126/article/details/52174576



<!--拨打电话权限-->
 
<uses-permissionandroid:name="android.permission.CALL_PHONE"/>
 <!--连接网络权限-->
 
<uses-permissionandroid:name="android.permission.INTERNET"/>
 <!--读写文件的权限-->
 
<uses-permissionandroid:name="android.permission.READ_EXTERNAL_STORAGE"/>
 <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

 





  1. package com.example.jreduch06;  
  2.   
  3. import android.Manifest;  
  4. import android.app.Activity;  
  5. import android.app.Notification;  
  6. import android.app.NotificationManager;  
  7. import android.app.PendingIntent;  
  8. import android.content.Intent;  
  9. import android.content.pm.PackageManager;  
  10. import android.database.Cursor;  
  11. import android.graphics.Bitmap;  
  12. import android.graphics.drawable.ColorDrawable;  
  13. import android.net.Uri;  
  14. import android.os.Bundle;  
  15. import android.provider.MediaStore;  
  16. import android.support.v4.app.ActivityCompat;  
  17. import android.support.v4.app.NotificationCompat;  
  18. import android.support.v7.app.AppCompatActivity;  
  19. import android.view.Gravity;  
  20. import android.view.View;  
  21. import android.view.WindowManager;  
  22. import android.widget.Button;  
  23. import android.widget.LinearLayout;  
  24. import android.widget.PopupWindow;  
  25.   
  26. import java.io.File;  
  27.   
  28. public class MyIntentActivity  extends AppCompatActivity implements View.OnClickListener {  
  29.     private PopupWindow pw;  
  30.     private View popView;  
  31.     private RoundImageView riv;  
  32.     @Override  
  33.     protected void onCreate(Bundle savedInstanceState) {  
  34.         super.onCreate(savedInstanceState);  
  35.         setContentView(R.layout.activity_intent);  
  36.         //加载PopWindow中的布局  
  37.         popView = getLayoutInflater().inflate(R.layout.pop_layout, null);  
  38.         //从主布局中取得控件  
  39.         Button bt1 = (Button) findViewById(R.id.bt1);  
  40.         Button bt2 = (Button) findViewById(R.id.bt2);  
  41.         Button bt3 = (Button) findViewById(R.id.bt3);  
  42.         Button bt4 = (Button) findViewById(R.id.bt4);  
  43.         Button bt5 = (Button) findViewById(R.id.bt5);  
  44.         Button bt6 = (Button) findViewById(R.id.bt6);  
  45.         Button bt7 = (Button) findViewById(R.id.bt7);  
  46.         Button bt8 = (Button) findViewById(R.id.bt8);  
  47.         //从PopWindow布局中取得控件  
  48.         Button xc = (Button)popView.findViewById(R.id.xc);  
  49.         Button xj = (Button)popView.findViewById(R.id.xj);  
  50.         Button bt = (Button)popView.findViewById(R.id.bt);  
  51.   
  52.         riv = (RoundImageView) findViewById(R.id.riv);  
  53.         //注册   本类监听  
  54.         bt1.setOnClickListener(this);  
  55.         bt2.setOnClickListener(this);  
  56.         bt3.setOnClickListener(this);  
  57.         bt4.setOnClickListener(this);  
  58.         bt5.setOnClickListener(this);  
  59.         bt6.setOnClickListener(this);  
  60.         bt7.setOnClickListener(this);  
  61.         bt8.setOnClickListener(this);  
  62.         riv.setOnClickListener(this);  
  63.         xc.setOnClickListener(this);  
  64.         xj.setOnClickListener(this);  
  65.         bt.setOnClickListener(this);  
  66.         //显示Intent,明确指定要跳转的组件  
  67. //        Intent intent=new Intent(IntentActivity.this,SecondActivity.class);  
  68. //        startActivity(intent);  
  69.   
  70.         //---------------------------------------  
  71.   
  72.   
  73.     }  
  74.     @Override  
  75.     public void onClick(View v) {  
  76.         int id = v.getId();  
  77.         switch (id) {  
  78.             case R.id.bt1:  
  79.                 //隐式Intent 由Android系统帮助匹配  
  80.                 //匹配规则  清单文件中的Intent-filter标签中的action  
  81.                 Uri uri1 = Uri.parse("tel:188655555555");  
  82.                 Intent intent = new Intent(Intent.ACTION_CALL, uri1);  
  83.                 if (ActivityCompat.checkSelfPermission(this, Manifest.permission.CALL_PHONE) != PackageManager.PERMISSION_GRANTED) {  
  84.                     // TODO: Consider calling  
  85.                     //    ActivityCompat#requestPermissions  
  86.                     // here to request the missing permissions, and then overriding  
  87.                     //   public void onRequestPermissionsResult(int requestCode, String[] permissions,  
  88.                     //                                          int[] grantResults)  
  89.                     // to handle the case where the user grants the permission. See the documentation  
  90.                     // for ActivityCompat#requestPermissions for more details.  
  91.                     return;  
  92.                 }  
  93.                 startActivity(intent);  
  94.                 break;  
  95.             case R.id.bt2:  
  96.                 Intent it1=new Intent(Intent.ACTION_VIEW);  
  97.                 it1.putExtra("sms_body""代开发票");  
  98.                 it1.putExtra("sms_to""10086");  
  99.                 it1.setType("vnd.android-dir/mms-sms");  
  100.                 startActivity(it1);  
  101.                 break;  
  102.             case R.id.bt3:  
  103.                 Uri uri2=Uri.parse("http://www.baidu.com");  
  104.                 Intent it2=new Intent(Intent.ACTION_VIEW,uri2);  
  105.                 startActivity(it2);  
  106.                 break;  
  107.             case R.id.bt4:  
  108.                 Intent it3=new Intent(Intent.ACTION_VIEW);  
  109.                 File  file=new File("/sdcard/zyfzyf/Ifyou.aac");  
  110.                 it3.setDataAndType(Uri.fromFile(file), "audio/*");  
  111.                 startActivity(it3);  
  112.                 break;  
  113.             case R.id.bt5:  
  114.                 Intent it5=new Intent(Intent.ACTION_VIEW);  
  115.                 File  file1=new File("/sdcard/DCIM/Camera/IMG_20150613_103420.jpg");  
  116.                 it5.setDataAndType(Uri.fromFile(file1), "image/*");  
  117.                 startActivity(it5);  
  118.   
  119.                 break;  
  120.             case R.id.bt6:  
  121.                 Intent it4=new Intent(Intent.ACTION_VIEW);  
  122.                 File  file2=new File("/sdcard/DCIM/Camera/VID_20150703_195112.mp4");  
  123.                 it4.setDataAndType(Uri.fromFile(file2), "video/*");  
  124.                 startActivity(it4);  
  125.                 break;  
  126.             case R.id.bt7:  
  127.                 Intent it6=new Intent(Intent.ACTION_VIEW);  
  128.                 it6.setDataAndType(Uri.parse("file:///sdcard/Android/data/com.sankuai.meituan/files/group_meituan.apk"),  
  129.                         "application/vnd.android.package-archive");  
  130.                 startActivity(it6);  
  131.                 break;  
  132.             case R.id.bt8:  
  133.                 notification();  
  134.                 break;  
  135.             case R.id.riv://点击头像打开PopWindow  
  136.                 pw=getPopWindow(popView);  
  137.                 break;  
  138.             case R.id.xc:  
  139.                 phonePhoto();  
  140.                 break;  
  141.             case R.id.xj:  
  142.                 takephoto();  
  143.                 break;  
  144.             case R.id.bt:  
  145.                 pw.dismiss();  
  146.                 break;  
  147.         }  
  148.     }  
  149.     //消息栏通知  
  150.     public void notification(){  
  151.         //先定义一个Intent  
  152.         Intent intent=new Intent(this,SecondActivity.class);  
  153.   
  154.         //使用PendingIntent 封装Intent  
  155.   
  156.         /*  
  157.         *PendingIntent的第四个参数的说明:  
  158.         * 常量:  
  159.         * FLAG_CANCEL_CURRENT 生成一个新的对象  
  160.         * FLAG_NO_CREATE若不存在,则创建一个新的对象  
  161.         * FLAG_ONE_SHOT创建的对象只能使用一次  
  162.         * FLAG_UPDATE_CURRENT已存在则直接使用  
  163.         * */  
  164.   
  165.         PendingIntent pi=PendingIntent.getActivities(  
  166.                 this,0new Intent[]{intent},PendingIntent.FLAG_UPDATE_CURRENT);  
  167.         //获取通知服务  
  168.         NotificationManager nm= (NotificationManager)  
  169.                 getSystemService(Activity.NOTIFICATION_SERVICE);  
  170.         //构建一个通知  
  171.         Notification notification=new NotificationCompat.Builder(this)  
  172.                 .setSmallIcon(R.mipmap.ic_launcher)  
  173.                 .setTicker("A")  
  174.                 .setContentInfo("我是通知栏消息")  
  175.                 .setContentTitle("奥运会")  
  176.                 .setContentText("PendingIntent的使用方法")  
  177.                 .setAutoCancel(true)  
  178.                 .setDefaults(Notification.DEFAULT_ALL)  
  179.                 .setContentIntent(pi)  
  180.                 .build();  
  181.         //通过通知服务,显示通知  
  182.         nm.notify(0, notification);  
  183.   
  184.     }  
  185.   
  186.     /* 
  187.     * 调用图库 
  188.     * */  
  189.     public void phonePhoto(){  
  190.         Intent intent=new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);  
  191.         startActivityForResult(intent,2);  
  192.   
  193.     }  
  194.   
  195.     /* 
  196.     * 调用相机 
  197.     * */  
  198.     private String capturePath="";  
  199.     public void takephoto(){  
  200.         Intent camera=new Intent(MediaStore.ACTION_IMAGE_CAPTURE);  
  201.         File parent= FileUitlity.getInstance(getApplicationContext())  
  202.                 .makeDir("head_imag");  
  203.         capturePath=parent.getPath()+File.separatorChar+System.currentTimeMillis()+".jpg";  
  204.         camera.putExtra(MediaStore.EXTRA_OUTPUT,Uri.fromFile(new File(capturePath)));  
  205.         camera.putExtra(MediaStore.EXTRA_VIDEO_QUALITY,1);  
  206.         startActivityForResult(camera, 1);  
  207.     }  
  208.   
  209.     @Override  
  210.     protected void onActivityResult(int requestCode, int resultCode, Intent data) {  
  211.         super.onActivityResult(requestCode, resultCode, data);  
  212.   
  213.         if (resultCode!=Activity.RESULT_OK){  
  214.   
  215.             return;  
  216.         }  
  217.         //相机返回结果,调用系统裁剪啊  
  218.         if (requestCode==1){  
  219.           startPicZoom(Uri.fromFile(new File(capturePath)));  
  220.   
  221.         }  
  222.         //相册返回结果调用系统裁剪  
  223.         else if (requestCode==2){  
  224.             Cursor cursor=getContentResolver()  
  225.                     .query(data.getData(),new String[]{MediaStore.Images.Media.DATA}  
  226.                     ,null,null,null);  
  227.             cursor.moveToFirst();  
  228.             String  capturePath=cursor.getString(  
  229.                     cursor.getColumnIndex(  
  230.                             MediaStore.Images.Media.DATA));  
  231.             cursor.close();  
  232.             startPicZoom(Uri.fromFile(new File(capturePath)));  
  233.         }  
  234.         else if (requestCode==3){  
  235.           Bundle bundle= data.getExtras();  
  236.          if (bundle!=null){  
  237.              Bitmap bitmap=bundle.getParcelable("data");  
  238.              riv.setImageBitmap(bitmap);  
  239.   
  240.          }  
  241.         }  
  242.     }  
  243.   
  244.     /* 
  245.     调用系统裁剪功能 
  246.  
  247.      */  
  248.     public  void  startPicZoom(Uri  uri){  
  249.         Intent intent=new Intent("com.android.camera.action.CROP");  
  250.         intent.setDataAndType(uri,"image/*");  
  251.         intent.putExtra("crop","true");//允许裁剪  
  252.         intent.putExtra("aspectX",1);//设置裁剪比例  
  253.         intent.putExtra("aspectY",1);  
  254.         //设置图片宽度高度  
  255.         intent.putExtra("outputX",150);  
  256.         intent.putExtra("outputY",150);  
  257.         intent.putExtra("return-data",true);  
  258.         startActivityForResult(intent,3);  
  259.   
  260.     }  
  261.   
  262.   
  263.   
  264.     //设置屏幕背景透明度方法  
  265.     public void backgroundAlpha(float bgAlpha){  
  266.         WindowManager.LayoutParams ll=getWindow().getAttributes();  
  267.         ll.alpha=bgAlpha;  
  268.         getWindow().setAttributes(ll);  
  269.     }  
  270.     //构建一个PopWindow  
  271.     public PopupWindow getPopWindow(View view){  
  272.         PopupWindow popupWindow=new PopupWindow(view,  
  273.                 LinearLayout.LayoutParams.MATCH_PARENT,  
  274.                 LinearLayout.LayoutParams.WRAP_CONTENT,true);  
  275.         // popupWindow.setFocusable(true);  
  276.         //点击pop外面是否消失  
  277.         popupWindow.setOutsideTouchable(true);  
  278.   
  279.         popupWindow.setAnimationStyle(R.style.popStyle);  
  280.         //设置背景透明度  
  281.         backgroundAlpha(0.3f);  
  282.         //————————  
  283.         //设置View隐藏  
  284.         riv.setVisibility(View.GONE);  
  285.         popupWindow.setBackgroundDrawable(new ColorDrawable());  
  286.         popupWindow.showAtLocation(riv, Gravity.BOTTOM, 00);  
  287.         popupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {  
  288.             @Override  
  289.             public void onDismiss() {  
  290.                 //设置背景透明度  
  291.                 backgroundAlpha(1f);  
  292.                 //设置View可见  
  293.                 riv.setVisibility(View.VISIBLE);  
  294.             }  
  295.         });  
  296.         return popupWindow;  
  297.     }  
  298.   
  299. }  

  1. <?xml version="1.0" encoding="utf-8"?>  
  2. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"  
  3.     xmlns:tools="http://schemas.android.com/tools"  
  4.     android:layout_width="match_parent"  
  5.     android:layout_height="match_parent"  
  6.   
  7.     tools:context="com.example.jreduch06.IntentActivity">  
  8.   
  9.    <Button  
  10.        android:layout_width="match_parent"  
  11.        android:layout_height="wrap_content"  
  12.        android:id="@+id/bt1"  
  13.   
  14.        android:layout_below="@+id/riv"  
  15.        android:text="拨打电话"  
  16.        />  
  17.   
  18.     <Button  
  19.         android:layout_width="match_parent"  
  20.         android:layout_height="wrap_content"  
  21.         android:id="@+id/bt2"  
  22.         android:text="发送短信"  
  23.         android:layout_below="@+id/bt1"  
  24.         />  
  25.     <Button  
  26.     android:layout_width="match_parent"  
  27.     android:layout_height="wrap_content"  
  28.     android:id="@+id/bt3"  
  29.     android:text="打开网页"  
  30.     android:layout_below="@+id/bt2"  
  31.     />  
  32.     <Button  
  33.         android:layout_width="match_parent"  
  34.         android:layout_height="wrap_content"  
  35.         android:id="@+id/bt4"  
  36.         android:text="播放音乐"  
  37.         android:layout_below="@+id/bt3"  
  38.         />  
  39.     <Button  
  40.         android:layout_width="match_parent"  
  41.         android:layout_height="wrap_content"  
  42.         android:id="@+id/bt5"  
  43.         android:text="打开图片"  
  44.         android:layout_below="@+id/bt4"  
  45.         />  
  46.     <Button  
  47.         android:layout_width="match_parent"  
  48.         android:layout_height="wrap_content"  
  49.         android:id="@+id/bt6"  
  50.         android:text="播放视频"  
  51.         android:layout_below="@+id/bt5"  
  52.         />  
  53.   
  54.  <Button  
  55.      android:layout_width="match_parent"  
  56.      android:layout_height="wrap_content"  
  57.      android:id="@+id/bt7"  
  58.      android:text="安装APK"  
  59.      android:layout_below="@+id/bt6"  
  60.      />  
  61.  <Button  
  62.      android:layout_width="match_parent"  
  63.      android:layout_height="wrap_content"  
  64.      android:id="@+id/bt8"  
  65.      android:text="通知栏消息"  
  66.      android:layout_below="@+id/bt7"  
  67.      />  
  68.  <com.example.jreduch06.RoundImageView  
  69.      android:layout_width="60dp"  
  70.      android:layout_height="60dp"  
  71.      android:id="@+id/riv"  
  72.      android:src="@mipmap/zyf"  
  73.      android:background="#082fef"  
  74.      />  
  75. </RelativeLayout>  

  1. <?xml version="1.0" encoding="utf-8"?>  
  2. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"  
  3.     android:orientation="vertical" android:layout_width="match_parent"  
  4.     android:layout_height="150dp"  
  5.     android:background="#111111"  
  6.     >  
  7.     <Button  
  8.     android:layout_width="300dp"  
  9.     android:layout_height="wrap_content"  
  10.     android:id="@+id/xj"  
  11.     android:layout_weight="1"  
  12.         android:gravity="center"  
  13.         android:layout_marginLeft="40dp"  
  14.         android:text="相机"  
  15.         android:textSize="30sp"  
  16.     />  
  17.     <Button  
  18.         android:layout_width="300dp"  
  19.         android:layout_height="wrap_content"  
  20.         android:id="@+id/xc"  
  21.         android:text="相册"  
  22.         android:textSize="30sp"  
  23.         android:layout_weight="1"  
  24.         android:gravity="center"  
  25.         android:layout_marginLeft="40dp"  
  26.         />  
  27.     <Button  
  28.         android:layout_width="300dp"  
  29.         android:layout_height="wrap_content"  
  30.         android:id="@+id/bt"  
  31.         android:text="退出"  
  32.         android:gravity="center"  
  33.         android:layout_marginLeft="40dp"  
  34.         android:textSize="30sp"  
  35.         android:layout_weight="1"  
  36.         />  
  37.   
  38. </LinearLayout>  

工具代码

  1. <span style="font-size:18px;">package com.example.jreduch06;  
  2.   
  3. import android.content.Context;  
  4. import android.os.Environment;  
  5.   
  6. import java.io.File;  
  7.   
  8. public class FileUitlity {  
  9.   
  10.   
  11.     public final static String USER_HAED="head";  
  12.   
  13.     private static String ROOT_CACHE;  
  14.     public static String ROOT_DIR="yt_xyt";  
  15.     private static FileUitlity instance = null;  
  16.     private FileUitlity() {  
  17.     }  
  18.     public static FileUitlity getInstance(Context context) {  
  19.         if (instance == null) {  
  20.             if (Environment.getExternalStorageState().equals(  
  21.                     Environment.MEDIA_MOUNTED)) {  
  22.                 ROOT_CACHE = (Environment.getExternalStorageDirectory() + "/"  
  23.                         + ROOT_DIR + "/");  
  24.             } else {  
  25.                 ROOT_CACHE = (context.getFilesDir().getAbsolutePath() + "/"+ROOT_DIR+"/");  
  26.             }  
  27.             File dir = new File(ROOT_CACHE);  
  28.             if (!dir.exists()) {  
  29.                 dir.mkdirs();  
  30.             }  
  31.             instance = new FileUitlity();  
  32.         }  
  33.         return instance;  
  34.     }  
  35.     public File makeDir(String dir) {  
  36.         File fileDir = new File(ROOT_CACHE + dir);  
  37.         if (fileDir.exists()) {  
  38.             return fileDir;  
  39.         } else {  
  40.             fileDir.mkdirs();  
  41.             return fileDir;  
  42.         }  
  43.     }  
  44.   
  45.       
  46. }  
  47. </span>  


  1. <span style="font-size:18px;">package com.example.jreduch06;  
  2.   
  3. import android.content.Context;  
  4. import android.graphics.Bitmap;  
  5. import android.graphics.Canvas;  
  6. import android.graphics.Color;  
  7. import android.graphics.Paint;  
  8. import android.graphics.PixelFormat;  
  9. import android.graphics.PorterDuff;  
  10. import android.graphics.PorterDuffXfermode;  
  11. import android.graphics.Rect;  
  12. import android.graphics.drawable.BitmapDrawable;  
  13. import android.graphics.drawable.Drawable;  
  14. import android.util.AttributeSet;  
  15. import android.widget.ImageView;  
  16.   
  17. public class RoundImageView extends ImageView {  
  18.     public RoundImageView(Context context) {  
  19.         super(context);  
  20.         // TODO Auto-generated constructor stub  
  21.     }  
  22.   
  23.     public RoundImageView(Context context, AttributeSet attrs) {  
  24.         super(context, attrs);  
  25.         // TODO Auto-generated constructor stub  
  26.     }  
  27.   
  28.     public RoundImageView(Context context, AttributeSet attrs, int defStyle) {  
  29.         super(context, attrs, defStyle);  
  30.         // TODO Auto-generated constructor stub  
  31.     }  
  32.   
  33.     @Override  
  34.     protected void onDraw(Canvas canvas) {  
  35.   
  36.         Drawable drawable = getDrawable();  
  37.   
  38.         if (drawable == null) {  
  39.             return;  
  40.         }  
  41.   
  42.         if (getWidth() == 0 || getHeight() == 0) {  
  43.             return;  
  44.         }  
  45.   
  46.         Bitmap b = null;  
  47.         if(drawable instanceof BitmapDrawable){  
  48.             b = ((BitmapDrawable) drawable).getBitmap();  
  49.         }else if(drawable instanceof Drawable){  
  50.             b = Bitmap.createBitmap(     
  51.                         getWidth(),     
  52.                         getHeight(),     
  53.                         drawable.getOpacity() != PixelFormat.OPAQUE ? Bitmap.Config.ARGB_8888  
  54.                         : Bitmap.Config.RGB_565);  
  55.                         Canvas canvas1 = new Canvas(b);     
  56.                         // canvas.setBitmap(bitmap);     
  57.                         drawable.setBounds(00, getWidth(),     
  58.                         getHeight());     
  59.                         drawable.draw(canvas1);    
  60.         }  
  61.   
  62.         if (null == b) {  
  63.             return;  
  64.         }  
  65.   
  66.         Bitmap bitmap = b.copy(Bitmap.Config.ARGB_8888, true);  
  67.         int w = getWidth(), h = getHeight();  
  68.   
  69.         Bitmap roundBitmap = getCroppedBitmap(bitmap, w);  
  70.         canvas.drawBitmap(roundBitmap, 00null);  
  71.   
  72.     }  
  73.   
  74.     public static Bitmap getCroppedBitmap(Bitmap bmp, int radius) {  
  75.         Bitmap sbmp;  
  76.         if (bmp.getWidth() != radius || bmp.getHeight() != radius)  
  77.             sbmp = Bitmap.createScaledBitmap(bmp, radius, radius, false);  
  78.         else  
  79.             sbmp = bmp;  
  80.         Bitmap output = Bitmap.createBitmap(sbmp.getWidth(), sbmp.getHeight(),  
  81.                 Bitmap.Config.ARGB_8888);  
  82.         Canvas canvas = new Canvas(output);  
  83.   
  84.         final int color = 0xffa19774;  
  85.         final Paint paint = new Paint();  
  86.         final Rect rect = new Rect(00, sbmp.getWidth(), sbmp.getHeight());  
  87.   
  88.         paint.setAntiAlias(true);  
  89.         paint.setFilterBitmap(true);  
  90.         paint.setDither(true);  
  91.         canvas.drawARGB(0000);  
  92.         paint.setColor(Color.parseColor("#BAB399"));  
  93.         canvas.drawCircle(sbmp.getWidth() / 2 + 0.7f,  
  94.                 sbmp.getHeight() / 2 + 0.7f, sbmp.getWidth() / 2 + 0.1f, paint);  
  95.         paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));  
  96.         canvas.drawBitmap(sbmp, rect, rect, paint);  
  97.         return output;  
  98.     }  
  99. }  
  100. </span>  






  1. <?xml version="1.0" encoding="utf-8"?>  
  2. <set xmlns:android="http://schemas.android.com/apk/res/android">  
  3. <alpha android:fromAlpha="0"  
  4.     android:toAlpha="1"  
  5.     android:duration="3000"  
  6.     ></alpha>  
  7.   
  8.   
  9. </set>  
  1. <?xml version="1.0" encoding="utf-8"?>  
  2. <set xmlns:android="http://schemas.android.com/apk/res/android">  
  3.     <alpha android:fromAlpha="1"  
  4.         android:toAlpha="0"  
  5.         android:duration="3000"  
  6.         ></alpha>  
  7. </set>  

  1. <?xml version="1.0" encoding="utf-8"?>  
  2. <set xmlns:android="http://schemas.android.com/apk/res/android">  
  3. <translate android:fromYDelta="100%p"  
  4.     android:toYDelta="0"  
  5.     android:duration="3000"  
  6.     />  
  7.     <alpha android:fromAlpha="0"  
  8.         android:toAlpha="1"  
  9.         android:duration="3000"  
  10.         ></alpha>  
  11. </set>  

  1. <?xml version="1.0" encoding="utf-8"?>  
  2. <set xmlns:android="http://schemas.android.com/apk/res/android">  
  3.     <translate android:fromYDelta="0"  
  4.         android:toYDelta="100%p"  
  5.         android:duration="3000"  
  6.         />  
  7.     <alpha android:fromAlpha="1"  
  8.         android:toAlpha="0"  
  9.         android:duration="3000"  
  10.         ></alpha>  
  11. </set>  




作者:冲天之峰         20160810

1
0

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值