Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
HelloHuDi committed Jul 21, 2018
1 parent 26c1a92 commit 3011e0b
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 0 deletions.
Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
3 changes: 3 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
</activity>
<activity android:name=".CaptureConfigActivity">
</activity>
<activity android:name=".service.ServiceCaptureActivity"/>

<service android:name=".service.ScreenCaptureService"/>
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package com.hd.screen.capture.service;

import android.app.Service;
import android.content.Intent;
import android.os.Handler;
import android.os.IBinder;
import android.support.annotation.Nullable;


/**
* Created by hd on 2018/7/21 .
* 演示通过service 来实现调用录制
*/
public class ScreenCaptureService extends Service {

@Override
public void onCreate() {
super.onCreate();

new Handler().postDelayed(() -> {
Intent i = new Intent(this,ServiceCaptureActivity.class);
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(i);
}, 3000);
}

@Nullable
@Override
public IBinder onBind(Intent intent) {
return null;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.hd.screen.capture.service;

import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.Window;


/**
* Created by hd on 2018/7/21 .
* {@link com.hd.screen.capture.MainActivity}
*/
public class ServiceCaptureActivity extends AppCompatActivity {

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//设置透明
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
getWindow().setDimAmount(0f);
}

// ... start or stop
}

0 comments on commit 3011e0b

Please sign in to comment.