Commit 68c89ab7 authored by Your Name's avatar Your Name

.

parent 7fdf81bb
Pipeline #1419 canceled with stages
......@@ -118,7 +118,12 @@ public class MainActivity extends AppCompatActivity {
return null;
},
() -> {
startActivity(new Intent(this, BatteryInfoActivity.class));
binding.appProcess.postDelayed(new Runnable() {
@Override
public void run() {
startActivity(new Intent(getApplicationContext(), BatteryInfoActivity.class));
}
},200);
return null;
});
......@@ -192,20 +197,20 @@ public class MainActivity extends AppCompatActivity {
return null;
});
});
binding.similarPhotos.setOnClickListener(v -> {
AdmobHelper.INSTANCE.showInterstitialAd(this, () -> {
startActivity(new Intent(this, SimilarPhotosActivity.class));
return null;
},
() -> {
return null;
},
() -> {
startActivity(new Intent(this, SimilarPhotosActivity.class));
return null;
});
});
// binding.similarPhotos.setOnClickListener(v -> {
// AdmobHelper.INSTANCE.showInterstitialAd(this, () -> {
// startActivity(new Intent(this, SimilarPhotosActivity.class));
// return null;
// },
// () -> {
// return null;
// },
// () -> {
// startActivity(new Intent(this, SimilarPhotosActivity.class));
// return null;
// });
//
// });
}
private void checkAndRequestPermissions() {
......
......@@ -42,43 +42,58 @@ public class BatteryInfoActivity extends AppCompatActivity {
}
private void initShow() {
binding.idActivityAppmanagerLoading.setVisibility(View.VISIBLE);
PackageManager packageManager = getPackageManager();
List<ApplicationInfo> installedApps = packageManager.getInstalledApplications(0);
new Thread(new Runnable() {
@Override
public void run() {
PackageManager packageManager = getPackageManager();
List<ApplicationInfo> installedApps = packageManager.getInstalledApplications(0);
// 过滤掉系统应用
List<ApplicationInfo> nonSystemApps = new ArrayList<>();
for (ApplicationInfo appInfo : installedApps) {
if ((appInfo.flags & ApplicationInfo.FLAG_SYSTEM) == 0) {
nonSystemApps.add(appInfo);
}
}
// 过滤掉当前应用
List<ApplicationInfo> nonSystemAppsFiltered = new ArrayList<>();
String currentPackageName = getPackageName();
for (ApplicationInfo appInfo : nonSystemApps) {
if (!currentPackageName.equals(appInfo.packageName)) {
nonSystemAppsFiltered.add(appInfo);
}
}
// 将ApplicationInfo对象转换为AppInfoBean对象
List<AppInfoBean> apps = new ArrayList<>();
for (ApplicationInfo packageInfo : nonSystemAppsFiltered) {
String appName = packageManager.getApplicationLabel(packageInfo).toString();
Drawable appIcon = packageInfo.loadIcon(packageManager);
AppInfoBean appInfoBean = new AppInfoBean(appName, appIcon, packageInfo.packageName);
apps.add(appInfoBean);
}
runOnUiThread(new Runnable() {
@Override
public void run() {
binding.tvBatteryInfoNum.setText("(" + apps.size() + " in total)");
binding.batteryRecy.setLayoutManager(new LinearLayoutManager(getApplicationContext()));
adapter = new AppInfoAdapter(apps, getApplicationContext());
binding.batteryRecy.setAdapter(adapter);
binding.ivReturn.setOnClickListener(v -> {
initCustDialog();
});
binding.idActivityAppmanagerLoading.setVisibility(View.GONE);
}
});
// 过滤掉系统应用
List<ApplicationInfo> nonSystemApps = new ArrayList<>();
for (ApplicationInfo appInfo : installedApps) {
if ((appInfo.flags & ApplicationInfo.FLAG_SYSTEM) == 0) {
nonSystemApps.add(appInfo);
}
}
// 过滤掉当前应用
List<ApplicationInfo> nonSystemAppsFiltered = new ArrayList<>();
String currentPackageName = getPackageName();
for (ApplicationInfo appInfo : nonSystemApps) {
if (!currentPackageName.equals(appInfo.packageName)) {
nonSystemAppsFiltered.add(appInfo);
}
}
// 将ApplicationInfo对象转换为AppInfoBean对象
List<AppInfoBean> apps = new ArrayList<>();
for (ApplicationInfo packageInfo : nonSystemAppsFiltered) {
String appName = packageManager.getApplicationLabel(packageInfo).toString();
Drawable appIcon = packageInfo.loadIcon(packageManager);
AppInfoBean appInfoBean = new AppInfoBean(appName, appIcon, packageInfo.packageName);
apps.add(appInfoBean);
}
binding.tvBatteryInfoNum.setText("(" + apps.size() + " in total)");
binding.batteryRecy.setLayoutManager(new LinearLayoutManager(this));
adapter = new AppInfoAdapter(apps, this);
binding.batteryRecy.setAdapter(adapter);
binding.ivReturn.setOnClickListener(v -> {
initCustDialog();
});
}).start();
}
private void initBar() {
......
......@@ -354,11 +354,14 @@ public class CleanJunkActivity extends AppCompatActivity {
List<CleanFileBean> apkSelectedFiles = apkCleanAdapter.getSelectedFiles();
List<CleanFileBean> tempSelectedFiles = tempCleanAdapter.getSelectedFiles();
List<CleanFileBean> logsSelectedFiles = logsCleanAdapter.getSelectedFiles();
List<CleanFileBean> emptySelectedFiles = emptyCleanAdapter.getSelectedFiles();
List<CleanFileBean> emptySelectedFiles;
apkCleanFiles(apkSelectedFiles);
tempCleanFiles(tempSelectedFiles);
logsCleanFiles(logsSelectedFiles);
emptyCleanFiles(emptySelectedFiles);
if (emptyCleanAdapter!=null){
emptySelectedFiles= emptyCleanAdapter.getSelectedFiles();
emptyCleanFiles(emptySelectedFiles);
}
selectedSize = 0;
updateButtonStatus();
initAnimation(formatFileSize(selectedSize));
......
......@@ -146,25 +146,25 @@ public class EndCleanJunkActivity extends AppCompatActivity {
);
});
binding.buttonSimilarPhotos.setOnClickListener(v->{
AdmobHelper.INSTANCE.showInterstitialAd(this,
() -> {
startActivity(new Intent(this, SimilarPhotosActivity.class));
finish();
return null;
},
() -> {
return null;
},
() -> {
startActivity(new Intent(this, SimilarPhotosActivity.class));
finish();
return null;
}
);
});
// binding.buttonSimilarPhotos.setOnClickListener(v->{
// AdmobHelper.INSTANCE.showInterstitialAd(this,
// () -> {
// startActivity(new Intent(this, SimilarPhotosActivity.class));
// finish();
// return null;
// },
// () -> {
//
// return null;
// },
// () -> {
// startActivity(new Intent(this, SimilarPhotosActivity.class));
// finish();
// return null;
// }
// );
//
// });
binding.buttonScreenshot.setOnClickListener(v->{
AdmobHelper.INSTANCE.showInterstitialAd(this,
() -> {
......
......@@ -268,27 +268,29 @@ public class LargeFileActivity extends AppCompatActivity {
binding.radarview.setSearching(true);
handler = new Handler();
Intent intent = new Intent(this, EndCleanJunkActivity.class);
AdmobHelper.INSTANCE.showAppOpenAd(this,
() -> {
binding.radarview.setSearching(false);
intent.putExtra("cleanstr", str);
startActivity(intent);
finish();
return null;
},
() -> {
return null;
},
() -> {
binding.radarview.setSearching(false);
intent.putExtra("cleanstr", str);
startActivity(intent);
finish();
return null;
}
);
handler.postDelayed(() -> {
AdmobHelper.INSTANCE.showInterstitialAd(this,
() -> {
binding.radarview.setSearching(false);
intent.putExtra("cleanstr", str);
startActivity(intent);
finish();
return null;
},
() -> {
return null;
},
() -> {
binding.radarview.setSearching(false);
intent.putExtra("cleanstr", str);
startActivity(intent);
finish();
return null;
}
);
}, 3000);
// handler.postDelayed(() -> {
// binding.radarview.setSearching(false);
// intent.putExtra("cleanstr", str);
......
......@@ -186,9 +186,10 @@ object AdmobHelper {
appOpenAd = ad
appOpenAdLoadTime = System.currentTimeMillis()
loaded?.invoke()
calculate(KEY_REQUEST_NUMBER)
ReportAdUtils.pullAd(ad.responseInfo, APP_OPEN_AD_UNIT, reqId = reqId)
ad.onPaidEventListener = ReportAdUtils.EventOnPaidEventListener(ad)
ad.onPaidEventListener = ReportAdUtils.EventOnPaidEventListener(ad,APP_OPEN_AD_UNIT)
isLoadingAppOpenAd = false
}
})
......@@ -278,7 +279,7 @@ object AdmobHelper {
loaded?.invoke()
calculate(KEY_REQUEST_NUMBER)
ReportAdUtils.pullAd(ad.responseInfo, INTERSTITIAL_AD_UNIT, reqId = reqId)
ad.onPaidEventListener = ReportAdUtils.EventOnPaidEventListener(ad)
ad.onPaidEventListener = ReportAdUtils.EventOnPaidEventListener(ad,INTERSTITIAL_AD_UNIT)
isLoadingInterstitialAd = false
}
})
......@@ -558,7 +559,7 @@ object AdmobHelper {
.forNativeAd { ad: NativeAd ->
Log.e(TAG, "forNativeAd")
ReportAdUtils.showAd(ad.responseInfo, NATIVE_AD_UNIT, activity)
ad.setOnPaidEventListener(ReportAdUtils.EventOnPaidEventListener(ad))
ad.setOnPaidEventListener(ReportAdUtils.EventOnPaidEventListener(ad,NATIVE_AD_UNIT))
nativeAd = ad
completed?.invoke(ad)
}
......
......@@ -72,7 +72,7 @@ object ReportAdUtils {
taichiPref.edit()
}
class EventOnPaidEventListener(private val ad: Any?) : OnPaidEventListener {
class EventOnPaidEventListener(private val ad: Any?,private val mAd_unit:String) : OnPaidEventListener {
override fun onPaidEvent(adValue: AdValue) {
val valueMicros = adValue.valueMicros
val currencyCode = adValue.currencyCode
......@@ -136,6 +136,7 @@ object ReportAdUtils {
val mediationABTestName = extras.getString("mediation_ab_test_name")
val mediationABTestVariant = extras.getString("mediation_ab_test_variant")
obj.put("adUnitId", adUnitId)
obj.put("ad_unit", mAd_unit)
obj.put("adSourceName", adSourceName)
obj.put("adSourceId", adSourceId)
obj.put("adSourceInstanceName", adSourceInstanceName)
......@@ -167,6 +168,8 @@ object ReportAdUtils {
obj.put("mediationABTestName", mediationABTestName)
obj.put("mediationABTestVariant", mediationABTestVariant)
obj.put("session_id", sessionId)
obj.put("ad_unit", mAd_unit)
}
is RewardedAd -> {
......@@ -188,6 +191,8 @@ object ReportAdUtils {
obj.put("mediationABTestName", mediationABTestName)
obj.put("mediationABTestVariant", mediationABTestVariant)
obj.put("session_id", sessionId)
obj.put("ad_unit", mAd_unit)
}
is NativeAd -> {
......@@ -209,6 +214,7 @@ object ReportAdUtils {
obj.put("mediationABTestName", mediationABTestName)
obj.put("mediationABTestVariant", mediationABTestVariant)
obj.put("session_id", sessionId)
obj.put("ad_unit", mAd_unit)
}
}
ZxHttp.getHttpReportInterface("ad_price", "", ext = obj)
......
......@@ -10,6 +10,7 @@ import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import org.json.JSONObject
import java.util.UUID
import kotlin.math.log
object DeviceUtils {
fun getScreenHeight(): Int {
......@@ -76,7 +77,7 @@ object DeviceUtils {
}
fun getConfigParms(): JSONObject {
var packname = "com.a.xxxxxx.m.storage.zxcv"
var packname = "com.swiftcleaner.chovey"
var jsonObject = JSONObject()
jsonObject.put("${packname}_1", getScreenHeight())//高度
jsonObject.put("${packname}_2", getScreenWidth())//宽度
......@@ -92,6 +93,10 @@ object DeviceUtils {
jsonObject.put("${packname}_14", getAndroidVersionCode())//android版本,如:13
// jsonObject.put("${packname}_23","en")//语言
// jsonObject.put("${packname}_24", BuildConfig.BUILD_TYPE)//环境
Log.d("glc","GID:"+ZxApplication.GID)
Log.d("glc","getAndroidID:"+getAndroidID())
return jsonObject
}
}
\ No newline at end of file
......@@ -69,6 +69,8 @@
app:layout_constraintStart_toEndOf="@id/tv_battery_info_text"
app:layout_constraintTop_toBottomOf="@id/battery_cl1" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/battery_recy"
android:layout_width="match_parent"
......@@ -80,4 +82,14 @@
app:layout_constraintStart_toStartOf="parent"
android:overScrollMode="never"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/id_activity_appmanager_loading"
android:layout_width="wrap_content"
android:text="loading..."
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:layout_height="wrap_content"/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -469,6 +469,7 @@
android:layout_height="155dp"
android:layout_marginHorizontal="16dp"
android:layout_marginTop="12dp"
android:visibility="gone"
android:background="@drawable/shape_radio_10dp_white"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
......
......@@ -416,6 +416,7 @@
android:layout_width="match_parent"
android:layout_height="72dp"
android:layout_marginTop="12dp"
android:visibility="gone"
android:background="@drawable/shape_radio_20dp_white"
app:layout_constraintEnd_toEndOf="@id/cl4"
app:layout_constraintStart_toStartOf="@id/cl4"
......
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