Commit 7b68c308 authored by wanglei's avatar wanglei

...ad

parent 542ae49d
...@@ -217,10 +217,6 @@ ...@@ -217,10 +217,6 @@
<service <service
android:name=".service.PermanentNotificationService" android:name=".service.PermanentNotificationService"
android:permission="android.permission.FOREGROUND_SERVICE" /> <!-- 闪光灯 --> android:permission="android.permission.FOREGROUND_SERVICE" /> <!-- 闪光灯 -->
<service
android:name=".service.FlashlightService"
android:exported="true"
tools:ignore="ExportedService" />
<meta-data <meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID" android:name="com.google.android.gms.ads.APPLICATION_ID"
......
...@@ -52,10 +52,8 @@ class MyApplication : BaseApplication() { ...@@ -52,10 +52,8 @@ class MyApplication : BaseApplication() {
initNotificationWork() initNotificationWork()
if (ConfigHelper.ifAgreePrivacy) { if (ConfigHelper.ifAgreePrivacy) {
if (context.canRequestAds()) {
MobileAds.initialize(this) { initializationStatus -> MobileAds.initialize(this) { initializationStatus ->
} }
}
InstallHelps.init() InstallHelps.init()
} }
initLifeListener() 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 ...@@ -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.appmanager.AppManagerAnimationActivity
import com.test.easy.easycleanerjunk.activity.batteryinfo.BatteryInfoAnimationActivity import com.test.easy.easycleanerjunk.activity.batteryinfo.BatteryInfoAnimationActivity
import com.test.easy.easycleanerjunk.activity.home.NewMainActivity import com.test.easy.easycleanerjunk.activity.home.NewMainActivity
import com.test.easy.easycleanerjunk.activity.screenshot.ScreenShotAnimationActivity
import com.test.easy.easycleanerjunk.helps.ConfigHelper import com.test.easy.easycleanerjunk.helps.ConfigHelper
...@@ -96,14 +97,19 @@ class PermanentNotificationService : Service() { ...@@ -96,14 +97,19 @@ class PermanentNotificationService : Service() {
contentView.setOnClickPendingIntent(R.id.id_battery_info, pendingIntent3) contentView.setOnClickPendingIntent(R.id.id_battery_info, pendingIntent3)
expendView.setOnClickPendingIntent(R.id.id_battery_info, pendingIntent3) expendView.setOnClickPendingIntent(R.id.id_battery_info, pendingIntent3)
val intent4 = Intent() // val intent4 = Intent()
val serviceComponent = ComponentName(context, FlashlightService::class.java) // val serviceComponent = ComponentName(context, FlashlightService::class.java)
intent4.component = serviceComponent // intent4.component = serviceComponent
val pendingIntent4 = // val pendingIntent4 =
PendingIntent.getService(context, 0, intent4, PendingIntent.FLAG_IMMUTABLE) // PendingIntent.getService(context, 0, intent4, PendingIntent.FLAG_IMMUTABLE)
contentView.setOnClickPendingIntent(R.id.id_light, pendingIntent4) // contentView.setOnClickPendingIntent(R.id.id_screenshot, pendingIntent4)
expendView.setOnClickPendingIntent(R.id.id_light, 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 nfIntent = Intent(context, NewMainActivity::class.java)
val pendingIntent = val pendingIntent =
......
...@@ -17,16 +17,30 @@ ...@@ -17,16 +17,30 @@
android:orientation="vertical" android:orientation="vertical"
tools:ignore="UseCompoundDrawables"> tools:ignore="UseCompoundDrawables">
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:ignore="UselessParent">
<ImageView <ImageView
android:layout_width="30dp" android:layout_width="30dp"
android:layout_height="30dp" android:layout_height="30dp"
android:layout_marginBottom="8dp" android:layout_margin="2dp"
android:src="@mipmap/qinli" 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" /> tools:ignore="ContentDescription" />
</FrameLayout>
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="Clean" android:text="Clean"
android:textColor="#666666" android:textColor="#666666"
android:textSize="12sp" android:textSize="12sp"
...@@ -47,7 +61,7 @@ ...@@ -47,7 +61,7 @@
android:layout_width="30dp" android:layout_width="30dp"
android:layout_height="30dp" android:layout_height="30dp"
android:layout_marginBottom="8dp" android:layout_marginBottom="8dp"
android:src="@mipmap/guanli" android:src="@mipmap/manage_ss"
tools:ignore="ContentDescription" /> tools:ignore="ContentDescription" />
<TextView <TextView
...@@ -73,7 +87,7 @@ ...@@ -73,7 +87,7 @@
android:layout_width="30dp" android:layout_width="30dp"
android:layout_height="30dp" android:layout_height="30dp"
android:layout_marginBottom="8dp" android:layout_marginBottom="8dp"
android:src="@mipmap/dianchi" android:src="@mipmap/battery_ss"
tools:ignore="ContentDescription" /> tools:ignore="ContentDescription" />
<TextView <TextView
...@@ -85,9 +99,9 @@ ...@@ -85,9 +99,9 @@
tools:ignore="HardcodedText" /> tools:ignore="HardcodedText" />
</LinearLayout> </LinearLayout>
<!--手电--> <!--截图-->
<LinearLayout <LinearLayout
android:id="@+id/id_light" android:id="@+id/id_screenshot"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
...@@ -100,13 +114,13 @@ ...@@ -100,13 +114,13 @@
android:layout_width="30dp" android:layout_width="30dp"
android:layout_height="30dp" android:layout_height="30dp"
android:layout_marginBottom="8dp" android:layout_marginBottom="8dp"
android:src="@mipmap/shoudiantong" android:src="@mipmap/screenshot_ss"
tools:ignore="ContentDescription" /> tools:ignore="ContentDescription" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="Flash Light" android:text="Screenshot"
android:textColor="#666666" android:textColor="#666666"
android:textSize="12sp" android:textSize="12sp"
tools:ignore="HardcodedText" /> tools:ignore="HardcodedText" />
......
...@@ -16,12 +16,26 @@ ...@@ -16,12 +16,26 @@
android:gravity="center" android:gravity="center"
android:orientation="vertical"> android:orientation="vertical">
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:ignore="UselessParent">
<ImageView <ImageView
android:layout_width="30dp" android:layout_width="30dp"
android:layout_height="30dp" android:layout_height="30dp"
android:layout_marginBottom="4dp" android:layout_margin="2dp"
android:src="@mipmap/qinli" 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" /> tools:ignore="ContentDescription" />
</FrameLayout>
</LinearLayout> </LinearLayout>
<!--app管理--> <!--app管理-->
...@@ -36,8 +50,8 @@ ...@@ -36,8 +50,8 @@
<ImageView <ImageView
android:layout_width="30dp" android:layout_width="30dp"
android:layout_height="30dp" android:layout_height="30dp"
android:layout_marginBottom="4dp" android:layout_margin="2dp"
android:src="@mipmap/guanli" android:src="@mipmap/manage_ss"
tools:ignore="ContentDescription" /> tools:ignore="ContentDescription" />
</LinearLayout> </LinearLayout>
...@@ -54,14 +68,14 @@ ...@@ -54,14 +68,14 @@
<ImageView <ImageView
android:layout_width="30dp" android:layout_width="30dp"
android:layout_height="30dp" android:layout_height="30dp"
android:layout_marginBottom="4dp" android:layout_margin="2dp"
android:src="@mipmap/dianchi" android:src="@mipmap/battery_ss"
tools:ignore="ContentDescription" /> tools:ignore="ContentDescription" />
</LinearLayout> </LinearLayout>
<!--手电--> <!--截图-->
<LinearLayout <LinearLayout
android:id="@+id/id_light" android:id="@+id/id_screenshot"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
...@@ -72,8 +86,8 @@ ...@@ -72,8 +86,8 @@
<ImageView <ImageView
android:layout_width="30dp" android:layout_width="30dp"
android:layout_height="30dp" android:layout_height="30dp"
android:layout_marginBottom="4dp" android:layout_margin="2dp"
android:src="@mipmap/shoudiantong" android:src="@mipmap/screenshot_ss"
tools:ignore="ContentDescription" /> tools:ignore="ContentDescription" />
</LinearLayout> </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