Commit 7b68c308 authored by wanglei's avatar wanglei

...ad

parent 542ae49d
......@@ -217,10 +217,6 @@
<service
android:name=".service.PermanentNotificationService"
android:permission="android.permission.FOREGROUND_SERVICE" /> <!-- 闪光灯 -->
<service
android:name=".service.FlashlightService"
android:exported="true"
tools:ignore="ExportedService" />
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
......
......@@ -52,10 +52,8 @@ class MyApplication : BaseApplication() {
initNotificationWork()
if (ConfigHelper.ifAgreePrivacy) {
if (context.canRequestAds()) {
MobileAds.initialize(this) { initializationStatus ->
}
}
InstallHelps.init()
}
initLifeListener()
......
package com.test.easy.easycleanerjunk.service
import android.app.Service
import android.content.Context
import android.content.Intent
import android.hardware.camera2.CameraAccessException
import android.hardware.camera2.CameraManager
import android.os.Build
import android.os.IBinder
import android.util.Log
class FlashlightService : Service() {
private var cameraManager: CameraManager? = null
private var flashlightOn = false
override fun onCreate() {
super.onCreate()
Log.e("MXL", "SerciveonCreate: ")
cameraManager = getSystemService(Context.CAMERA_SERVICE) as CameraManager?
}
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
try {
val cameraId = cameraManager!!.cameraIdList[0]
flashlightOn = if (flashlightOn) {
cameraManager?.setTorchMode(cameraId, false)
false
} else {
cameraManager?.setTorchMode(cameraId, true)
true
}
} catch (e: CameraAccessException) {
e.printStackTrace()
}
return START_NOT_STICKY
}
override fun onBind(p0: Intent?): IBinder? {
return null
}
}
\ No newline at end of file
......@@ -18,6 +18,7 @@ import com.test.easy.easycleanerjunk.activity.scanjunk.PrepareScanActivity
import com.test.easy.easycleanerjunk.activity.appmanager.AppManagerAnimationActivity
import com.test.easy.easycleanerjunk.activity.batteryinfo.BatteryInfoAnimationActivity
import com.test.easy.easycleanerjunk.activity.home.NewMainActivity
import com.test.easy.easycleanerjunk.activity.screenshot.ScreenShotAnimationActivity
import com.test.easy.easycleanerjunk.helps.ConfigHelper
......@@ -96,14 +97,19 @@ class PermanentNotificationService : Service() {
contentView.setOnClickPendingIntent(R.id.id_battery_info, pendingIntent3)
expendView.setOnClickPendingIntent(R.id.id_battery_info, pendingIntent3)
val intent4 = Intent()
val serviceComponent = ComponentName(context, FlashlightService::class.java)
intent4.component = serviceComponent
val pendingIntent4 =
PendingIntent.getService(context, 0, intent4, PendingIntent.FLAG_IMMUTABLE)
contentView.setOnClickPendingIntent(R.id.id_light, pendingIntent4)
expendView.setOnClickPendingIntent(R.id.id_light, pendingIntent4)
// val intent4 = Intent()
// val serviceComponent = ComponentName(context, FlashlightService::class.java)
// intent4.component = serviceComponent
// val pendingIntent4 =
// PendingIntent.getService(context, 0, intent4, PendingIntent.FLAG_IMMUTABLE)
// contentView.setOnClickPendingIntent(R.id.id_screenshot, pendingIntent4)
// expendView.setOnClickPendingIntent(R.id.id_screenshot, pendingIntent4)
val intent4 = Intent(context, ScreenShotAnimationActivity::class.java)
val pendingIntent4 =
PendingIntent.getActivity(context, 0, intent4, PendingIntent.FLAG_IMMUTABLE)
contentView.setOnClickPendingIntent(R.id.id_screenshot, pendingIntent4)
expendView.setOnClickPendingIntent(R.id.id_screenshot, pendingIntent4)
val nfIntent = Intent(context, NewMainActivity::class.java)
val pendingIntent =
......
......@@ -17,16 +17,30 @@
android:orientation="vertical"
tools:ignore="UseCompoundDrawables">
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:ignore="UselessParent">
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginBottom="8dp"
android:src="@mipmap/qinli"
android:layout_margin="2dp"
android:src="@mipmap/cleanjunk_ss"
tools:ignore="ContentDescription" />
<ImageView
android:layout_width="12dp"
android:layout_height="12dp"
android:layout_gravity="end"
android:src="@mipmap/tishi"
tools:ignore="ContentDescription" />
</FrameLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="Clean"
android:textColor="#666666"
android:textSize="12sp"
......@@ -47,7 +61,7 @@
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginBottom="8dp"
android:src="@mipmap/guanli"
android:src="@mipmap/manage_ss"
tools:ignore="ContentDescription" />
<TextView
......@@ -73,7 +87,7 @@
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginBottom="8dp"
android:src="@mipmap/dianchi"
android:src="@mipmap/battery_ss"
tools:ignore="ContentDescription" />
<TextView
......@@ -85,9 +99,9 @@
tools:ignore="HardcodedText" />
</LinearLayout>
<!--手电-->
<!--截图-->
<LinearLayout
android:id="@+id/id_light"
android:id="@+id/id_screenshot"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
......@@ -100,13 +114,13 @@
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginBottom="8dp"
android:src="@mipmap/shoudiantong"
android:src="@mipmap/screenshot_ss"
tools:ignore="ContentDescription" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Flash Light"
android:text="Screenshot"
android:textColor="#666666"
android:textSize="12sp"
tools:ignore="HardcodedText" />
......
......@@ -16,12 +16,26 @@
android:gravity="center"
android:orientation="vertical">
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:ignore="UselessParent">
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginBottom="4dp"
android:src="@mipmap/qinli"
android:layout_margin="2dp"
android:src="@mipmap/cleanjunk_ss"
tools:ignore="ContentDescription" />
<ImageView
android:layout_width="12dp"
android:layout_height="12dp"
android:layout_gravity="end"
android:src="@mipmap/tishi"
tools:ignore="ContentDescription" />
</FrameLayout>
</LinearLayout>
<!--app管理-->
......@@ -36,8 +50,8 @@
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginBottom="4dp"
android:src="@mipmap/guanli"
android:layout_margin="2dp"
android:src="@mipmap/manage_ss"
tools:ignore="ContentDescription" />
</LinearLayout>
......@@ -54,14 +68,14 @@
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginBottom="4dp"
android:src="@mipmap/dianchi"
android:layout_margin="2dp"
android:src="@mipmap/battery_ss"
tools:ignore="ContentDescription" />
</LinearLayout>
<!--手电-->
<!--截图-->
<LinearLayout
android:id="@+id/id_light"
android:id="@+id/id_screenshot"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
......@@ -72,8 +86,8 @@
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginBottom="4dp"
android:src="@mipmap/shoudiantong"
android:layout_margin="2dp"
android:src="@mipmap/screenshot_ss"
tools:ignore="ContentDescription" />
</LinearLayout>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment