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.animation.Animator; | |
import android.os.Handler; | |
import android.os.Message; | |
import android.view.MotionEvent; | |
import android.view.View; | |
import android.view.ViewConfiguration; | |
import java.util.Timer; | |
import java.util.TimerTask; |
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
AndroidManifest.xml | |
----------------------------------- | |
<activity | |
android:name=".DemoActivity" | |
android:screenOrientation="unspecified" | |
android:configChanges="orientation|screenSize" | |
/> | |
DemoActivity.java | |
------------------------------- |
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
MediaProjectionManager mediaProjectionManager = | |
(MediaProjectionManager) getApplication().getSystemService( | |
Context.MEDIA_PROJECTION_SERVICE); | |
startActivityForResult( | |
mediaProjectionManager.createScreenCaptureIntent(), CAPTURE_PERMISSION_REQUEST_CODE); |
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
/** | |
* 檢查 uri 從google相簿app回來,需要另外處理取得Uri | |
* @param photoUri | |
* @return Uri | |
*/ | |
public static Uri getExternalMediaUriFormContentUri(Uri photoUri){ | |
if(photoUri.getAuthority() != null){ | |
if(photoUri.getAuthority().equals("com.google.android.apps.photos.contentprovider")){ | |
List<String> paths = photoUri.getPathSegments(); | |
if(paths != null && paths.size() > 0){ |
NewerOlder