init
15
.gitignore
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
*.iml
|
||||
.gradle
|
||||
/local.properties
|
||||
/.idea/caches
|
||||
/.idea/libraries
|
||||
/.idea/modules.xml
|
||||
/.idea/workspace.xml
|
||||
/.idea/navEditor.xml
|
||||
/.idea/assetWizardSettings.xml
|
||||
.DS_Store
|
||||
/build
|
||||
/captures
|
||||
.externalNativeBuild
|
||||
.cxx
|
||||
local.properties
|
||||
73
LICENSE
Normal file
@ -0,0 +1,73 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
|
||||
|
||||
Copyright 2024 2-group-android
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
1
app/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
/build
|
||||
BIN
app/applockpro1
Normal file
70
app/build.gradle.kts
Normal file
@ -0,0 +1,70 @@
|
||||
import java.util.Date
|
||||
import java.text.SimpleDateFormat
|
||||
|
||||
val timestamp = SimpleDateFormat("MM_dd_HH_mm").format(Date())
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("org.jetbrains.kotlin.android")
|
||||
id("kotlin-kapt")
|
||||
// id("com.google.gms.google-services")
|
||||
// id("com.google.firebase.crashlytics")
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "com.tool.app.protectorpro"
|
||||
compileSdk = 34
|
||||
|
||||
defaultConfig {
|
||||
//com.tool.app.protectorpro
|
||||
applicationId = "com.tool.app.test"
|
||||
minSdk = 23
|
||||
targetSdk = 34
|
||||
versionCode = 1
|
||||
versionName = "1.0.0"
|
||||
setProperty("archivesBaseName", "AppLocker pro_V" + versionName + "(${versionCode})_$timestamp")
|
||||
testInstrumentationRunner = "androidx.protectorpro.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
isMinifyEnabled = true
|
||||
proguardFiles(
|
||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||
"proguard-rules.pro"
|
||||
)
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = "1.8"
|
||||
}
|
||||
buildFeatures {
|
||||
viewBinding = true
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("de.hdodenhof:circleimageview:3.1.0")
|
||||
|
||||
implementation("androidx.core:core-ktx:1.9.0")
|
||||
implementation("androidx.appcompat:appcompat:1.6.1")
|
||||
implementation("com.google.android.material:material:1.11.0")
|
||||
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
|
||||
implementation("androidx.room:room-ktx:2.6.1")
|
||||
implementation("androidx.room:room-runtime:2.6.1")
|
||||
kapt("androidx.room:room-compiler:2.6.1")
|
||||
|
||||
|
||||
|
||||
implementation(platform("com.google.firebase:firebase-bom:33.1.1"))
|
||||
implementation("com.google.firebase:firebase-crashlytics")
|
||||
implementation("com.google.firebase:firebase-analytics")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
5
app/keyinfo
Normal file
@ -0,0 +1,5 @@
|
||||
|
||||
|
||||
alids:key_lockpro
|
||||
|
||||
pass:12345600
|
||||
164
app/proguard-rules.pro
vendored
Normal file
@ -0,0 +1,164 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
#room
|
||||
-keepclassmembers class com.tool.app.protectorpro.MyApplication{
|
||||
public static final java.lang.String DB_Name;
|
||||
public static final int DB_Version;
|
||||
}
|
||||
-keepclassmembers class *{
|
||||
@androidx.room.Query <methods>;
|
||||
}
|
||||
|
||||
-keep class com.tool.app.protectorpro.mydb.MyDataBase { *; }
|
||||
-keep class com.tool.app.protectorpro.listener.ListenerDao { *; }
|
||||
-keep class com.tool.app.protectorpro.mydb.DataApp { *; }
|
||||
|
||||
|
||||
|
||||
#-----------------------------------------------------ironSource SDK
|
||||
-keepclassmembers class * implements android.os.Parcelable {
|
||||
public static final android.os.Parcelable$Creator *;
|
||||
}
|
||||
#noinspection ShrinkerUnresolvedReference
|
||||
#unity
|
||||
-keep class com.google.android.gms.ads.** {public *;}
|
||||
-keep class com.google.android.gms.appset.** { *; }
|
||||
-keep class com.google.android.gms.tasks.** { *; }
|
||||
#adapters
|
||||
-keep class com.ironsource.adapters.** { *; }
|
||||
#sdk
|
||||
-dontwarn com.ironsource.**
|
||||
-dontwarn com.ironsource.adapters.**
|
||||
-keepclassmembers class com.ironsource.** { public *; }
|
||||
-keep public class com.ironsource.**
|
||||
-keep class com.ironsource.adapters.** { *;
|
||||
}
|
||||
#omid
|
||||
-dontwarn com.iab.omid.**
|
||||
-keep class com.iab.omid.** {*;}
|
||||
#javascript
|
||||
-keepattributes JavascriptInterface
|
||||
-keepclassmembers class * { @android.webkit.JavascriptInterface <methods>; }
|
||||
#For AmazonAps integration
|
||||
-keep class com.amazon.device.ads.DtbThreadService {
|
||||
static *;
|
||||
}
|
||||
-keep public interface com.amazon.device.ads** {*; }
|
||||
#For AppLovin integration
|
||||
-keepclassmembers class com.applovin.sdk.AppLovinSdk {
|
||||
static *;
|
||||
}
|
||||
-keep public interface com.applovin.sdk** {*; }
|
||||
-keep public interface com.applovin.adview** {*; }
|
||||
-keep public interface com.applovin.mediation** {*; }
|
||||
-keep public interface com.applovin.communicator** {*; }
|
||||
#For Bytedance integration
|
||||
-keep public interface com.bytedance.sdk.openadsdk** {*; }
|
||||
#For Facebook integration
|
||||
-keepclassmembers class com.facebook.ads.internal.AdSdkVersion {
|
||||
static *;
|
||||
}
|
||||
-keepclassmembers class com.facebook.ads.internal.settings.AdSdkVersion {
|
||||
static *;
|
||||
}
|
||||
-keepclassmembers class com.facebook.ads.BuildConfig {
|
||||
static *;
|
||||
}
|
||||
-keep public interface com.facebook.ads** {*; }
|
||||
#For Fairbid
|
||||
-keep public interface com.fyber.fairbid.ads.interstitial** {*; }
|
||||
-keep public interface com.fyber.fairbid.ads.rewarded** {*; }
|
||||
-keep class com.fyber.offerwall.*
|
||||
#For Fivead
|
||||
-keep public interface com.five_corp.ad** {*; }
|
||||
#For Fyber(Inneractive) integration
|
||||
-keep public interface com.fyber.inneractive.sdk.external** {*; }
|
||||
-keep public interface com.fyber.inneractive.sdk.activities** {*; }
|
||||
-keep public interface com.fyber.inneractive.sdk.ui** {*; }
|
||||
#For HyprMX integration
|
||||
-keepclassmembers class com.hyprmx.android.sdk.utility.HyprMXProperties {
|
||||
static *;
|
||||
}
|
||||
-keepclassmembers class com.hyprmx.android.BuildConfig {
|
||||
static *;
|
||||
}
|
||||
-keep public interface com.hyprmx.android.sdk.activity** {*; }
|
||||
-keep public interface com.hyprmx.android.sdk.graphics** {*; }
|
||||
# For Inmobi integration
|
||||
-keep class com.inmobi.*
|
||||
-keep public interface com.inmobi.ads.listeners** {*; }
|
||||
-keep public interface com.inmobi.ads.InMobiInterstitial** {*; }
|
||||
-keep public interface com.inmobi.ads.InMobiBanner** {*; }
|
||||
# For ironSource integration
|
||||
-keep public interface com.ironsource.mediationsdk.sdk** {*; }
|
||||
-keep public interface com.ironsource.mediationsdk.impressionData.ImpressionDataListener {*; }
|
||||
#For Maio integration
|
||||
-keep public interface jp.maio.sdk.android.MaioAdsListenerInterface {*; }
|
||||
# For Mintergral integration
|
||||
-keep public interface com.mbridge.msdk.out** {*; }
|
||||
-keep public interface com.mbridge.msdk.videocommon.listener** {*; }
|
||||
-keep public interface com.mbridge.msdk.interstitialvideo.out** {*; }
|
||||
-keep public interface com.mintegral.msdk.out** {*; }
|
||||
-keep public interface com.mintegral.msdk.videocommon.listener** {*; }
|
||||
-keep public interface com.mintegral.msdk.interstitialvideo.out** {*; }
|
||||
#For MyTarget integration
|
||||
-keep class com.my.target.** {*;}
|
||||
#For Ogury integration
|
||||
-keep public interface io.presage.interstitial** {*; }
|
||||
-keep public interface io.presage.interstitial.PresageInterstitialCallback {*; }
|
||||
#For Pubnative integration
|
||||
-keep public interface net.pubnative.lite.sdk.interstitial.HyBidInterstitialAd** {*; }
|
||||
-keep public interface net.pubnative.lite.sdk.rewarded.HyBidRewardedAd** {*; }
|
||||
-keep public interface net.pubnative.lite.sdk.views.HyBidAdView** {*; }
|
||||
#For Smaato integration
|
||||
-keep public interface com.smaato.sdk.interstitial** {*; }
|
||||
-keep public interface com.smaato.sdk.video.vast** {*; }
|
||||
-keep public interface com.smaato.sdk.banner.widget** {*; }
|
||||
-keep public interface com.smaato.sdk.core.util** {*; }
|
||||
# For Tapjoy integration
|
||||
-keep public interface com.tapjoy.** {*; }
|
||||
# For Tencent integration
|
||||
-keep public interface com.qq.e.ads.interstitial2** {*; }
|
||||
-keep public interface com.qq.e.ads.interstitial3** {*; }
|
||||
-keep public interface com.qq.e.ads.rewardvideo** {*; }
|
||||
-keep public interface com.qq.e.ads.rewardvideo2** {*; }
|
||||
-keep public interface com.qq.e.ads.banner2** {*; }
|
||||
-keep public interface com.qq.e.comm.adevent** {*; }
|
||||
#For Verizon integration
|
||||
-keepclassmembers class com.verizon.ads.edition.BuildConfig {
|
||||
static *;
|
||||
}
|
||||
-keep public interface com.verizon.ads.interstitialplacement** {*; }
|
||||
-keep public interface com.verizon.ads.inlineplacement** {*; }
|
||||
-keep public interface com.verizon.ads.vastcontroller** {*; }
|
||||
-keep public interface com.verizon.ads.webcontroller** {*; }
|
||||
#For Vungle integration
|
||||
-keep public interface com.vungle.warren.PlayAdCallback {*; }
|
||||
-keep public interface com.vungle.warren.ui.contract** {*; }
|
||||
-keep public interface com.vungle.warren.ui.view** {*; }
|
||||
#For AndroidX
|
||||
-keep class androidx.localbroadcastmanager.content.LocalBroadcastManager { *;}
|
||||
-keep class androidx.recyclerview.widget.RecyclerView { *;}
|
||||
-keep class androidx.recyclerview.widget.RecyclerView$OnScrollListener { *;}
|
||||
#For Android
|
||||
-keep class * extends android.app.Activity
|
||||
#-----------------------------------------------------ironSource SDK
|
||||
58
app/src/main/AndroidManifest.xml
Normal file
@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
|
||||
<uses-permission
|
||||
android:name="android.permission.PACKAGE_USAGE_STATS"
|
||||
tools:ignore="ProtectedPermissions" />
|
||||
<queries>
|
||||
<intent>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
</intent>
|
||||
</queries>
|
||||
|
||||
<application
|
||||
android:name="com.tool.app.protectorpro.MyApplication"
|
||||
android:allowBackup="true"
|
||||
android:dataExtractionRules="@xml/data_extraction_rules"
|
||||
android:fullBackupContent="@xml/backup_rules"
|
||||
android:icon="@mipmap/logo"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/logo"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.AppLock"
|
||||
tools:targetApi="31">
|
||||
<activity
|
||||
android:name="com.tool.app.protectorpro.activity.ActivityMain"
|
||||
android:exported="true"
|
||||
android:launchMode="singleTask"
|
||||
android:excludeFromRecents="true"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<service android:name="com.tool.app.protectorpro.service.LockService" />
|
||||
<activity
|
||||
android:name="com.tool.app.protectorpro.activity.ActivityWel"
|
||||
android:screenOrientation="portrait"
|
||||
android:excludeFromRecents="true"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name="com.tool.app.protectorpro.activity.ActivityComplete"
|
||||
android:screenOrientation="portrait"
|
||||
android:excludeFromRecents="true"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name="com.tool.app.protectorpro.activity.ActivitySetPwd"
|
||||
android:screenOrientation="portrait"
|
||||
android:excludeFromRecents="true"
|
||||
android:exported="false"/>
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@ -0,0 +1,82 @@
|
||||
package com.tool.app.protectorpro;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
|
||||
import com.tool.app.protectorpro.mydb.DataApp;
|
||||
import com.tool.app.protectorpro.mydb.MyDataBase;
|
||||
import com.tool.app.protectorpro.tools.Common;
|
||||
import com.tool.app.protectorpro.tools.MyThread;
|
||||
|
||||
public class MyApplication extends Application {
|
||||
public static String spName = "share_name";
|
||||
|
||||
public static MyApplication appContext;
|
||||
|
||||
public static final int reqCodeUsage = 1;
|
||||
public static final int DB_Version = 1;
|
||||
public static final String Table_Name = "DataApp";
|
||||
public static final int reqCodeOverlays = 2;
|
||||
public static final String DB_Name = "app_locker";
|
||||
|
||||
|
||||
public static SharedPreferences sp;
|
||||
public static final String PWD_KEY = "locker_pwd";
|
||||
|
||||
public static SharedPreferences.Editor SpEditor;
|
||||
public static final int type_0 = 0;
|
||||
|
||||
public static final int type_1 = 1;
|
||||
|
||||
public static final int type_2 = 2;
|
||||
public static final String init_pwd_key = "pwd_type";
|
||||
public static int userOption = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
appContext = this;
|
||||
initSDk();
|
||||
initSp();
|
||||
MyThread.runIO(() -> {
|
||||
for (DataApp dataApp : MyDataBase.getInstance().getRoomDao().findApp()) {
|
||||
Boolean needDelete = Common.delUnInstallApp(this, dataApp.getPackageName());
|
||||
if (needDelete) {
|
||||
MyDataBase.getInstance().getRoomDao().deleteData(dataApp);
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
String pwd = getPwd();
|
||||
if (pwd.isEmpty()) {
|
||||
Common.getAppList(this, false);
|
||||
} else {
|
||||
Common.getAppList(this, true);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
private void initSDk() {
|
||||
|
||||
}
|
||||
|
||||
public static void updatePwd(String pwd) {
|
||||
SpEditor.putString(PWD_KEY, pwd);
|
||||
SpEditor.apply();
|
||||
}
|
||||
|
||||
public static String getPwd() {
|
||||
return sp.getString(PWD_KEY, "");
|
||||
}
|
||||
|
||||
private void initSp() {
|
||||
sp = MyApplication.appContext.getSharedPreferences(spName, Context.MODE_PRIVATE);
|
||||
SpEditor = sp.edit();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,26 @@
|
||||
package com.tool.app.protectorpro.activity
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.graphics.Color
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import com.tool.app.protectorpro.R
|
||||
|
||||
class ActivityComplete : AppCompatActivity() {
|
||||
@SuppressLint("MissingInflatedId")
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_complete)
|
||||
findViewById<View>(R.id.im_back).setOnClickListener { finish() }
|
||||
initStatusBar()
|
||||
}
|
||||
|
||||
private fun initStatusBar() {
|
||||
val decorView = window.decorView
|
||||
val flag = (View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
||||
or View.SYSTEM_UI_FLAG_LAYOUT_STABLE)
|
||||
decorView.systemUiVisibility = flag
|
||||
window.statusBarColor = Color.TRANSPARENT
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,272 @@
|
||||
package com.tool.app.protectorpro.activity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.SearchView;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentStatePagerAdapter;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialog;
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
import com.tool.app.protectorpro.MyApplication;
|
||||
import com.tool.app.protectorpro.R;
|
||||
import com.tool.app.protectorpro.databinding.ActivityMainLayoutBinding;
|
||||
import com.tool.app.protectorpro.databinding.TabViewBinding;
|
||||
import com.tool.app.protectorpro.listener.onPermssionListener;
|
||||
import com.tool.app.protectorpro.service.LockService;
|
||||
import com.tool.app.protectorpro.tools.Common;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ActivityMain extends AppCompatActivity implements SearchView.OnQueryTextListener, onPermssionListener {
|
||||
private ActivityMainLayoutBinding binding;
|
||||
|
||||
private DialogPer dialogPer;
|
||||
|
||||
List<Fragment> fragmentList = new ArrayList<>();
|
||||
|
||||
private void initStatusBar() {
|
||||
View decorView = getWindow().getDecorView();
|
||||
int flag = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
||||
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
|
||||
decorView.setSystemUiVisibility(flag);
|
||||
getWindow().setStatusBarColor(Color.TRANSPARENT);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
binding = ActivityMainLayoutBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
binding.searchItem.setOnQueryTextListener(this);
|
||||
initStatusBar();
|
||||
openPermission();
|
||||
startService(new Intent(this, LockService.class));
|
||||
initTab();
|
||||
initClick();
|
||||
}
|
||||
|
||||
private void initTab() {
|
||||
|
||||
String[] titles = new String[]{getString(R.string.text_system), getString(R.string.text_third), getString(R.string.text_recommended)};
|
||||
Drawable[] tabIcon = new Drawable[]{getDrawable(R.drawable.bg_tab_sys), getDrawable(R.drawable.bg_tab_three), getDrawable(R.drawable.bg_tab_lock)};
|
||||
|
||||
fragmentList.add(FragmentMy.newInstance(1));
|
||||
fragmentList.add(FragmentMy.newInstance(2));
|
||||
fragmentList.add(FragmentMy.newInstance(3));
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
TabLayout.Tab tab = binding.tab.newTab();
|
||||
TabViewBinding viewBinding = TabViewBinding.inflate(getLayoutInflater());
|
||||
|
||||
viewBinding.tvTabtext.setText(titles[i]);
|
||||
viewBinding.ivTabIcon.setImageDrawable(tabIcon[i]);
|
||||
|
||||
tab.setCustomView(viewBinding.getRoot());
|
||||
binding.tab.addTab(tab);
|
||||
}
|
||||
binding.viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
|
||||
@Override
|
||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageSelected(int position) {
|
||||
|
||||
TabLayout.Tab tabAt = binding.tab.getTabAt(position);
|
||||
if (tabAt != null) {
|
||||
binding.tvAppTabname.setText(titles[position]);
|
||||
tabAt.select();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageScrollStateChanged(int state) {
|
||||
|
||||
}
|
||||
});
|
||||
binding.viewPager.setAdapter(new FragmentStatePagerAdapter(getSupportFragmentManager()) {
|
||||
@NonNull
|
||||
@Override
|
||||
public Fragment getItem(int position) {
|
||||
return fragmentList.get(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return fragmentList.size();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public CharSequence getPageTitle(int position) {
|
||||
return titles[position];
|
||||
}
|
||||
});
|
||||
|
||||
TabLayout.Tab tabAt = binding.tab.getTabAt(1);
|
||||
if (tabAt != null)
|
||||
updateTab(tabAt, false);
|
||||
binding.tab.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
|
||||
@Override
|
||||
public void onTabSelected(TabLayout.Tab tab) {
|
||||
updateTab(tab, true);
|
||||
binding.viewPager.setCurrentItem(tab.getPosition());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTabUnselected(TabLayout.Tab tab) {
|
||||
updateTab(tab, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTabReselected(TabLayout.Tab tab) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initClick() {
|
||||
binding.imSetPwd.setOnClickListener(v -> setBottomSheetView());
|
||||
}
|
||||
|
||||
private void setBottomSheetView() {
|
||||
if (isDestroyed())
|
||||
return;
|
||||
|
||||
BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(ActivityMain.this);
|
||||
View bottomSheetView = LayoutInflater.from(ActivityMain.this).inflate(R.layout.set_bottom_sheet_layout, null);
|
||||
bottomSheetDialog.setContentView(bottomSheetView);
|
||||
|
||||
ImageView ivClose = bottomSheetView.findViewById(R.id.ivClose);
|
||||
TextView btnOption1 = bottomSheetView.findViewById(R.id.btnOption1);
|
||||
TextView btnOption2 = bottomSheetView.findViewById(R.id.btnOption2);
|
||||
|
||||
ivClose.setOnClickListener(v -> bottomSheetDialog.dismiss());
|
||||
|
||||
// 按钮1点击事件
|
||||
btnOption1.setOnClickListener(v -> {
|
||||
// TODO: 2024/7/19
|
||||
Intent intent = new Intent(ActivityMain.this, ActivitySetPwd.class);
|
||||
intent.putExtra(MyApplication.init_pwd_key, MyApplication.type_1);
|
||||
startActivity(intent);
|
||||
bottomSheetDialog.dismiss();
|
||||
|
||||
});
|
||||
|
||||
// 按钮2点击事件
|
||||
btnOption2.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
bottomSheetDialog.dismiss();
|
||||
}
|
||||
});
|
||||
|
||||
bottomSheetDialog.show();
|
||||
}
|
||||
|
||||
private void updateTab(TabLayout.Tab tab, boolean isSelected) {
|
||||
View customView = tab.getCustomView();
|
||||
if (customView == null) return;
|
||||
TextView tv = customView.findViewById(R.id.tv_tabtext);
|
||||
tv.setSelected(isSelected);
|
||||
ImageView iv = customView.findViewById(R.id.iv_tab_icon);
|
||||
|
||||
iv.setSelected(isSelected);
|
||||
|
||||
}
|
||||
|
||||
private boolean checkPermission() {
|
||||
boolean b = Common.checkPermission(this);
|
||||
boolean canDrawOverlays = Common.getCanDrawOverlays(this);
|
||||
return b && canDrawOverlays;
|
||||
}
|
||||
|
||||
private void openPermission() {
|
||||
if (!checkPermission()) {
|
||||
if (dialogPer == null) {
|
||||
dialogPer = DialogPer.newInstance();
|
||||
dialogPer.setListener(this);
|
||||
}
|
||||
dialogPer.show(getSupportFragmentManager(), "");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (requestCode == MyApplication.reqCodeUsage) {
|
||||
if (checkPermission()) {
|
||||
dialogPer.dismiss();
|
||||
return;
|
||||
}
|
||||
boolean canDrawOverlays = Common.getCanDrawOverlays(this);
|
||||
if (!canDrawOverlays) {
|
||||
Common.goDrawOverlays(this, MyApplication.reqCodeOverlays);
|
||||
}
|
||||
} else if (requestCode == MyApplication.reqCodeOverlays) {
|
||||
if (checkPermission()) {
|
||||
dialogPer.dismiss();
|
||||
} else {
|
||||
Toast.makeText(this, getString(R.string.text_permission_hint), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onToSetting() {
|
||||
boolean b = Common.checkPermission(this);
|
||||
boolean canDrawOverlays = Common.getCanDrawOverlays(this);
|
||||
|
||||
if (!b) {
|
||||
Common.toSetUsagePermission(ActivityMain.this, MyApplication.reqCodeUsage);
|
||||
} else {
|
||||
|
||||
if (!canDrawOverlays) {
|
||||
Common.goDrawOverlays(this, MyApplication.reqCodeOverlays);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void filterApps(String query) {
|
||||
// 获取当前显示的Fragment
|
||||
int position = binding.viewPager.getCurrentItem();
|
||||
Fragment fragment = fragmentList.get(position);
|
||||
|
||||
// 如果Fragment是FragmentMy,则调用其filter方法
|
||||
if ((fragment instanceof FragmentMy)) {
|
||||
((FragmentMy) fragment).filter(query);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onQueryTextSubmit(String query) {
|
||||
|
||||
filterApps(query);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onQueryTextChange(String newText) {
|
||||
filterApps(newText);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,283 @@
|
||||
package com.tool.app.protectorpro.activity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.text.Editable;
|
||||
import android.text.InputType;
|
||||
import android.text.TextWatcher;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.tool.app.protectorpro.MyApplication;
|
||||
import com.tool.app.protectorpro.R;
|
||||
import com.tool.app.protectorpro.customerview.MyLockView;
|
||||
import com.tool.app.protectorpro.customerview.MyPasswordInputView;
|
||||
import com.tool.app.protectorpro.databinding.ActivitySetPwdBinding;
|
||||
import com.tool.app.protectorpro.listener.ListenerLock;
|
||||
|
||||
public class ActivitySetPwd extends AppCompatActivity {
|
||||
|
||||
private static final String TAG = "ActivitySetPwd";
|
||||
|
||||
private ActivitySetPwdBinding binding;
|
||||
private int type;
|
||||
private MyPasswordInputView passwordInputView;
|
||||
private StringBuilder surePassword = new StringBuilder();
|
||||
private StringBuilder tempPassword = new StringBuilder();
|
||||
|
||||
private void initStatusBar() {
|
||||
View decorView = getWindow().getDecorView();
|
||||
int flag = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
||||
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
|
||||
decorView.setSystemUiVisibility(flag);
|
||||
getWindow().setStatusBarColor(Color.TRANSPARENT);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
binding = ActivitySetPwdBinding.inflate(getLayoutInflater());
|
||||
initStatusBar();
|
||||
setContentView(binding.getRoot());
|
||||
passwordInputView = binding.layoutEt;
|
||||
type = getIntent().getIntExtra(MyApplication.init_pwd_key, MyApplication.type_0);
|
||||
initView();
|
||||
initInput();
|
||||
initClick();
|
||||
initKeyboard();
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
// 0 设置 1 修改 2 确认
|
||||
switch (type) {
|
||||
case MyApplication.type_0:
|
||||
binding.imBack.setVisibility(View.GONE);
|
||||
binding.tvPassName.setText(R.string.text_original_pwd);
|
||||
// binding.tvTitle.setText(getString(R.string.text_original_pwd));
|
||||
binding.tvSub.setText(getString(R.string.text_original_pwd_describe));
|
||||
// binding.tvContinue.setText(getString(R.string.text_continue));
|
||||
break;
|
||||
case MyApplication.type_1:
|
||||
binding.imBack.setVisibility(View.VISIBLE);
|
||||
binding.tvPassName.setText(R.string.sheet_change_password);
|
||||
// binding.tvTitle.setText(getString(R.string.text_change_pwd));
|
||||
binding.tvSub.setText(getString(R.string.text_change_pwd_sub));
|
||||
// binding.tvContinue.setText(getString(R.string.text_save));
|
||||
break;
|
||||
case MyApplication.type_2:
|
||||
binding.imBack.setVisibility(View.VISIBLE);
|
||||
binding.tvPassName.setText(R.string.text_confirm_pwd);
|
||||
// binding.tvTitle.setText(getString(R.string.text_confirm_pwd));
|
||||
// binding.tvSub.setText(getString(R.string.text_change_pwd_sub));
|
||||
// binding.tvContinue.setText(getString(R.string.text_save));
|
||||
break;
|
||||
}
|
||||
updateEditText();
|
||||
}
|
||||
|
||||
private void initInput() {
|
||||
for (int i = 0; i < binding.layoutEt.getChildCount(); i++) {
|
||||
EditText editText = (EditText) binding.layoutEt.getChildAt(i);
|
||||
EditText nextEditText = null;
|
||||
if ((i + 1) < binding.layoutEt.getChildCount()) {
|
||||
nextEditText = (EditText) binding.layoutEt.getChildAt(i + 1);
|
||||
}
|
||||
|
||||
editText.setInputType(InputType.TYPE_NULL);
|
||||
|
||||
EditText finalNextEditText = nextEditText;
|
||||
editText.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
if (s.length() > 0 && finalNextEditText != null) {
|
||||
finalNextEditText.requestFocus();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void initKeyboard() {
|
||||
binding.lockSetPassword.setPinLockListener(new ListenerLock() {
|
||||
@Override
|
||||
public void onInPutComplete(String pin) {
|
||||
Log.d(TAG, "onInPutComplete: " + pin);
|
||||
|
||||
if (type == MyApplication.type_0 || type == MyApplication.type_1) {
|
||||
Log.d(TAG, "在设置界面");
|
||||
if (pin.length() == 4) {
|
||||
Log.d(TAG, "跳转到二次");
|
||||
type = MyApplication.type_2;
|
||||
initView();
|
||||
}
|
||||
|
||||
} else {
|
||||
initView();
|
||||
Log.d(TAG, "在二次确认界面");
|
||||
checkPassword();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNumberClickComplete(String keyValue) {
|
||||
Log.d(TAG, "onNumberClickComplete: " + keyValue);
|
||||
|
||||
if (type == MyApplication.type_0 || type == MyApplication.type_1) {
|
||||
|
||||
if (tempPassword.length() < 4) {
|
||||
tempPassword.append(keyValue);
|
||||
passwordInputView.setInput(tempPassword);
|
||||
Log.d(TAG, "tempPassword: " + tempPassword.toString());
|
||||
}
|
||||
|
||||
} else if (type == MyApplication.type_2) {
|
||||
if (surePassword.length() < 4) {
|
||||
surePassword.append(keyValue);
|
||||
passwordInputView.setInput(surePassword);
|
||||
Log.d(TAG, "passwordBuilder: " + surePassword.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onKeyBordDelete(int pin) {
|
||||
|
||||
Log.d("fsdafsd", pin + "__dfs");
|
||||
if (pin == 1) {
|
||||
surePassword.setLength(0);
|
||||
tempPassword.setLength(0);
|
||||
initView();
|
||||
}
|
||||
|
||||
if (type == MyApplication.type_2) {
|
||||
passwordInputView.setInput(surePassword);
|
||||
// 删除 surePassword 中的字符
|
||||
if (surePassword.length() > 0) {
|
||||
surePassword.deleteCharAt(surePassword.length() - 1);
|
||||
passwordInputView.deleteLastInput();
|
||||
|
||||
|
||||
}
|
||||
// 如果 surePassword 被删完了,将 type 设置为 type_0,并重新初始化视图和更新 EditText
|
||||
if (surePassword.length() == 0) {
|
||||
type = MyApplication.type_0;
|
||||
initView();
|
||||
}
|
||||
} else if (type == MyApplication.type_0 || type == MyApplication.type_1) {
|
||||
passwordInputView.setInput(tempPassword);
|
||||
// 删除 tempPassword 中的字符
|
||||
if (tempPassword.length() > 0) {
|
||||
tempPassword.deleteCharAt(tempPassword.length() - 1);
|
||||
passwordInputView.deleteLastInput();
|
||||
|
||||
}
|
||||
}
|
||||
Log.d(TAG, "onKeyBordDelete: Deleted last input. tempPassword: " + tempPassword.toString() + ", surePassword: " + surePassword.toString());
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
Log.d(TAG, "initKeyboard: Initialized pin lock listener");
|
||||
}
|
||||
|
||||
private void initClick() {
|
||||
binding.imBack.setOnClickListener(v -> {
|
||||
finish();
|
||||
Log.d(TAG, "onClick: Back button clicked");
|
||||
});
|
||||
|
||||
binding.tvContinue.setOnClickListener(v -> {
|
||||
// Placeholder for specific logic
|
||||
Log.d(TAG, "onClick: Continue button clicked");
|
||||
});
|
||||
Log.d(TAG, "initClick: Initialized click listeners");
|
||||
}
|
||||
|
||||
private void checkPassword() {
|
||||
if (surePassword.toString().equals(tempPassword.toString())) {
|
||||
savePassword();
|
||||
Log.d(TAG, "checkPassword: Passwords matched, saving password");
|
||||
} else {
|
||||
|
||||
if ((surePassword.length() == tempPassword.length())) {
|
||||
Toast.makeText(ActivitySetPwd.this, getString(R.string.text_pass_sure), Toast.LENGTH_SHORT).show();
|
||||
|
||||
}
|
||||
Log.d(TAG, "checkPassword: Passwords do not match, showing toast");
|
||||
}
|
||||
}
|
||||
|
||||
private void savePassword() {
|
||||
String password = surePassword.toString();
|
||||
if (password.length() == 4) {
|
||||
MyApplication.updatePwd(password);
|
||||
|
||||
switch (type) {
|
||||
case MyApplication.type_0:
|
||||
case MyApplication.type_2:
|
||||
startActivity(new Intent(ActivitySetPwd.this, ActivityMain.class));
|
||||
break;
|
||||
case MyApplication.type_1:
|
||||
startActivity(new Intent(ActivitySetPwd.this, ActivityComplete.class));
|
||||
break;
|
||||
}
|
||||
finish();
|
||||
Log.d(TAG, "savePassword: Password saved successfully");
|
||||
} else {
|
||||
Toast.makeText(ActivitySetPwd.this, getString(R.string.text_hint), Toast.LENGTH_SHORT).show();
|
||||
Log.d(TAG, "savePassword: Password length is not 4, showing hint toast");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void updateEditText() {
|
||||
for (int i = 0; i < binding.layoutEt.getChildCount(); i++) {
|
||||
EditText editText = (EditText) binding.layoutEt.getChildAt(i);
|
||||
editText.setText("");
|
||||
}
|
||||
|
||||
// 根据当前的 type 决定显示哪个密码
|
||||
String displayText = "";
|
||||
if (type == MyApplication.type_0 || type == MyApplication.type_1) {
|
||||
|
||||
displayText = tempPassword.toString();
|
||||
} else if (type == MyApplication.type_2) {
|
||||
displayText = surePassword.toString();
|
||||
}
|
||||
|
||||
Log.d("dsafsdaf", tempPassword.toString() + "___" + surePassword.toString());
|
||||
// 设置 EditText 的内容
|
||||
for (int i = 0; i < displayText.length(); i++) {
|
||||
if (i < binding.layoutEt.getChildCount()) {
|
||||
EditText editText = (EditText) binding.layoutEt.getChildAt(i);
|
||||
editText.setText(String.valueOf(displayText.charAt(i)));
|
||||
}
|
||||
}
|
||||
|
||||
// 重新设置光标位置
|
||||
if (binding.layoutEt.getChildCount() > 0) {
|
||||
EditText editText = (EditText) binding.layoutEt.getChildAt(0);
|
||||
editText.requestFocus();
|
||||
}
|
||||
|
||||
Log.d(TAG, "updateEditText: Updated EditText fields");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,55 @@
|
||||
package com.tool.app.protectorpro.activity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.os.CountDownTimer;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.tool.app.protectorpro.MyApplication;
|
||||
import com.tool.app.protectorpro.databinding.ActivityWelBinding;
|
||||
|
||||
public class ActivityWel extends AppCompatActivity {
|
||||
|
||||
private ActivityWelBinding binding;
|
||||
|
||||
|
||||
private CountDownTimer countDownTimer;
|
||||
private long totalTime = 11000;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
binding = ActivityWelBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
initBar();
|
||||
|
||||
goMain();
|
||||
}
|
||||
|
||||
private void goMain() {
|
||||
String pwd = MyApplication.getPwd();
|
||||
if (pwd.isEmpty()) {
|
||||
startActivity(new Intent(ActivityWel.this, ActivitySetPwd.class));
|
||||
} else {
|
||||
startActivity(new Intent(ActivityWel.this, ActivityMain.class));
|
||||
}
|
||||
finish();
|
||||
}
|
||||
|
||||
private void initBar() {
|
||||
View decorView = getWindow().getDecorView();
|
||||
int flag = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
||||
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
|
||||
decorView.setSystemUiVisibility(flag);
|
||||
getWindow().setStatusBarColor(Color.TRANSPARENT);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
countDownTimer.cancel();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,78 @@
|
||||
package com.tool.app.protectorpro.activity;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.os.Bundle;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
|
||||
import com.tool.app.protectorpro.R;
|
||||
import com.tool.app.protectorpro.databinding.DialogMessageBinding;
|
||||
import com.tool.app.protectorpro.listener.onPermssionListener;
|
||||
import com.tool.app.protectorpro.tools.Common;
|
||||
|
||||
public class DialogMessage extends DialogFragment {
|
||||
private DialogMessageBinding messageBinding;
|
||||
private static String KEY_MSG = "key_msg";
|
||||
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
messageBinding = DialogMessageBinding.inflate(getLayoutInflater());
|
||||
Dialog dialog = getDialog();
|
||||
if (dialog != null) {
|
||||
dialog.setCanceledOnTouchOutside(true);
|
||||
final Window window = dialog.getWindow();
|
||||
if (window != null) {
|
||||
window.setBackgroundDrawableResource(R.color.transparent);
|
||||
window.getDecorView().setPadding(0, 0, 0, 0);
|
||||
WindowManager.LayoutParams wlp = window.getAttributes();
|
||||
wlp.gravity = Gravity.CENTER;
|
||||
wlp.width = WindowManager.LayoutParams.MATCH_PARENT;
|
||||
wlp.height = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
window.setAttributes(wlp);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
initView();
|
||||
messageBinding.tvOK.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
dismiss();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
return messageBinding.getRoot();
|
||||
}
|
||||
|
||||
|
||||
public static DialogMessage newInstance(String msg) {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(KEY_MSG, msg);
|
||||
DialogMessage dialogMessage = new DialogMessage();
|
||||
dialogMessage.setArguments(bundle);
|
||||
return dialogMessage;
|
||||
}
|
||||
|
||||
|
||||
private void initView() {
|
||||
Bundle arguments = getArguments();
|
||||
String string = arguments.getString(KEY_MSG);
|
||||
messageBinding.msg.setText(string);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,93 @@
|
||||
package com.tool.app.protectorpro.activity;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
|
||||
import com.tool.app.protectorpro.R;
|
||||
import com.tool.app.protectorpro.databinding.DialogPermisBinding;
|
||||
import com.tool.app.protectorpro.listener.onPermssionListener;
|
||||
import com.tool.app.protectorpro.tools.Common;
|
||||
|
||||
public class DialogPer extends DialogFragment {
|
||||
private DialogPermisBinding layoutPermissionBinding;
|
||||
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
layoutPermissionBinding = DialogPermisBinding.inflate(getLayoutInflater());
|
||||
|
||||
getDialog().setCanceledOnTouchOutside(false);
|
||||
getDialog().setCancelable(false);
|
||||
|
||||
final Window window = getDialog().getWindow();
|
||||
window.setBackgroundDrawableResource(R.color.transparent);
|
||||
window.getDecorView().setPadding(0, 0, 0, 0);
|
||||
WindowManager.LayoutParams wlp = window.getAttributes();
|
||||
wlp.gravity = Gravity.CENTER;
|
||||
wlp.width = WindowManager.LayoutParams.MATCH_PARENT;
|
||||
wlp.height = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
window.setAttributes(wlp);
|
||||
|
||||
|
||||
layoutPermissionBinding.llSet1.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
if (!layoutPermissionBinding.tvSelect.isSelected()) {
|
||||
listener.onToSetting();
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
layoutPermissionBinding.llSet2.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
listener.onToSetting();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
return layoutPermissionBinding.getRoot();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
initView();
|
||||
}
|
||||
|
||||
private onPermssionListener listener;
|
||||
|
||||
public void setListener(onPermssionListener listener) {
|
||||
this.listener = listener;
|
||||
}
|
||||
|
||||
public static DialogPer newInstance() {
|
||||
return new DialogPer();
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
boolean b = Common.checkPermission(getActivity());
|
||||
if (!b) {
|
||||
layoutPermissionBinding.llSet1.setSelected(false);
|
||||
layoutPermissionBinding.ivSet1.setVisibility(View.INVISIBLE);
|
||||
} else {
|
||||
layoutPermissionBinding.diaCheck.setSelected(true);
|
||||
layoutPermissionBinding.llSet2.setSelected(false);
|
||||
layoutPermissionBinding.ivSet1.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,90 @@
|
||||
package com.tool.app.protectorpro.activity;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.appcompat.widget.SearchView;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.tool.app.protectorpro.databinding.FragmentMyBinding;
|
||||
import com.tool.app.protectorpro.listadapter.AdapterAllApp;
|
||||
import com.tool.app.protectorpro.listener.OnShowDialogMsgListener;
|
||||
import com.tool.app.protectorpro.mydb.DataApp;
|
||||
import com.tool.app.protectorpro.mydb.MyDataBase;
|
||||
import com.tool.app.protectorpro.tools.MyThread;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class FragmentMy extends Fragment {
|
||||
private int appType;
|
||||
private FragmentMyBinding binding;
|
||||
private static final String ARG_PARAM1 = "key_data";
|
||||
private AdapterAllApp adapterAllApp;
|
||||
|
||||
public FragmentMy() {
|
||||
}
|
||||
|
||||
|
||||
public static FragmentMy newInstance(int appType) {
|
||||
FragmentMy fragment = new FragmentMy();
|
||||
Bundle args = new Bundle();
|
||||
args.putInt(ARG_PARAM1, appType);
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
if (getArguments() != null) {
|
||||
appType = getArguments().getInt(ARG_PARAM1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
|
||||
binding = FragmentMyBinding.inflate(getLayoutInflater());
|
||||
|
||||
adapterAllApp = new AdapterAllApp(requireContext(),requireActivity());
|
||||
adapterAllApp.setListener(new OnShowDialogMsgListener() {
|
||||
@Override
|
||||
public void showDialogMsg(String msg) {
|
||||
DialogMessage dialogMessage = DialogMessage.newInstance(msg);
|
||||
dialogMessage.show(getParentFragmentManager(),"");
|
||||
}
|
||||
});
|
||||
binding.listApp.setAdapter(adapterAllApp);
|
||||
binding.listApp.setLayoutManager(new LinearLayoutManager(requireContext()));
|
||||
|
||||
MyThread.runIO(() -> {
|
||||
List<DataApp> data;
|
||||
if (appType == 1) {
|
||||
data = MyDataBase.getInstance().getRoomDao().findByType(true, false);
|
||||
} else if (appType == 2) {
|
||||
data = MyDataBase.getInstance().getRoomDao().findByType(false, false);
|
||||
} else if (appType == 3) {
|
||||
data = MyDataBase.getInstance().getRoomDao().findByLock(true);
|
||||
} else {
|
||||
data = new ArrayList<>();
|
||||
}
|
||||
|
||||
MyThread.runUI(() -> {
|
||||
adapterAllApp.updateSyStemApp(data);
|
||||
});
|
||||
});
|
||||
|
||||
return binding.getRoot();
|
||||
}
|
||||
public void filter(String query) {
|
||||
if (adapterAllApp != null) {
|
||||
adapterAllApp.filter(query);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package com.tool.app.protectorpro.customerview
|
||||
|
||||
import android.graphics.drawable.Drawable
|
||||
|
||||
class CustomBundle {
|
||||
@JvmField
|
||||
var textColor = 0
|
||||
@JvmField
|
||||
var textSize = 0
|
||||
|
||||
|
||||
var isShowDeleteButton = false
|
||||
@JvmField
|
||||
var buttonSize = 0
|
||||
@JvmField
|
||||
var backgroundDrawable: Drawable? = null
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,45 @@
|
||||
package com.tool.app.protectorpro.customerview;
|
||||
|
||||
import android.graphics.Rect;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
public class LockSpace extends RecyclerView.ItemDecoration {
|
||||
|
||||
private final int HSpace;
|
||||
|
||||
private final int mSpanCount;
|
||||
private final boolean mInclude;
|
||||
private final int mVSpace;
|
||||
|
||||
public LockSpace(int horizontalSpaceWidth, int verticalSpaceHeight, int spanCount, boolean includeEdge) {
|
||||
this.HSpace = horizontalSpaceWidth;
|
||||
this.mVSpace = verticalSpaceHeight;
|
||||
this.mSpanCount = spanCount;
|
||||
this.mInclude = includeEdge;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
|
||||
|
||||
int position = parent.getChildAdapterPosition(view);
|
||||
int column = position % mSpanCount;
|
||||
|
||||
if (mInclude) {
|
||||
outRect.left = HSpace - column * HSpace / mSpanCount;
|
||||
outRect.right = (column + 1) * HSpace / mSpanCount;
|
||||
|
||||
if (position < mSpanCount) {
|
||||
outRect.top = mVSpace;
|
||||
}
|
||||
outRect.bottom = mVSpace;
|
||||
} else {
|
||||
outRect.left = column * HSpace / mSpanCount;
|
||||
outRect.right = HSpace - (column + 1) * HSpace / mSpanCount;
|
||||
if (position >= mSpanCount) {
|
||||
outRect.top = mVSpace;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,102 @@
|
||||
package com.tool.app.protectorpro.customerview;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import androidx.core.view.ViewCompat;
|
||||
|
||||
import com.tool.app.protectorpro.R;
|
||||
import com.tool.app.protectorpro.tools.Common;
|
||||
|
||||
|
||||
public class MyDots extends LinearLayout {
|
||||
|
||||
|
||||
private static final int DEFAULT_PIN_LENGTH = 4;
|
||||
private int mPinLength;
|
||||
|
||||
|
||||
private int mPreviousLength;
|
||||
private int mDotDiameter;
|
||||
private int mDotSpacing;
|
||||
private int mFillDrawable;
|
||||
private int mEmptyDrawable;
|
||||
|
||||
private void initView(Context context) {
|
||||
ViewCompat.setLayoutDirection(this, ViewCompat.LAYOUT_DIRECTION_LTR);
|
||||
for (int i = 0; i < mPinLength; i++) {
|
||||
View dot = new View(context);
|
||||
emptyDot(dot);
|
||||
|
||||
LayoutParams params = new LayoutParams(mDotDiameter,
|
||||
mDotDiameter);
|
||||
params.setMargins(mDotSpacing, 0, mDotSpacing, 0);
|
||||
dot.setLayoutParams(params);
|
||||
|
||||
addView(dot);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public MyDots(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
public MyDots(Context context, AttributeSet attrs) {
|
||||
this(context, attrs, 0);
|
||||
}
|
||||
|
||||
public MyDots(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
|
||||
TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.MyLock);
|
||||
|
||||
try {
|
||||
mDotDiameter = (int) typedArray.getDimension(R.styleable.MyLock_dotDiameter, Common.getPx(getContext(), R.dimen.default_dot_diameter));
|
||||
mDotSpacing = (int) typedArray.getDimension(R.styleable.MyLock_dotSpacing, Common.getPx(getContext(), R.dimen.default_dot_spacing));
|
||||
mFillDrawable = typedArray.getResourceId(R.styleable.MyLock_dotFilledBackground,
|
||||
R.drawable.oval_black);
|
||||
mEmptyDrawable = typedArray.getResourceId(R.styleable.MyLock_dotEmptyBackground,
|
||||
R.drawable.pwd_bg);
|
||||
mPinLength = typedArray.getInt(R.styleable.MyLock_pinLength, DEFAULT_PIN_LENGTH);
|
||||
} finally {
|
||||
typedArray.recycle();
|
||||
}
|
||||
|
||||
initView(context);
|
||||
}
|
||||
|
||||
|
||||
private void emptyDot(View dot) {
|
||||
dot.setBackgroundResource(mEmptyDrawable);
|
||||
dot.animate().scaleX(1.0f).scaleY(1.0f).setDuration(100).start();
|
||||
}
|
||||
|
||||
private void fillDot(View dot) {
|
||||
dot.setBackgroundResource(mFillDrawable);
|
||||
dot.animate().scaleX(1.2f).scaleY(1.2f).setDuration(100).start();
|
||||
}
|
||||
|
||||
|
||||
void updateDot(int length) {
|
||||
if (length > 0) {
|
||||
if (length > mPreviousLength) {
|
||||
fillDot(getChildAt(length - 1));
|
||||
} else {
|
||||
emptyDot(getChildAt(length));
|
||||
}
|
||||
mPreviousLength = length;
|
||||
} else {
|
||||
for (int i = 0; i < getChildCount(); i++) {
|
||||
View v = getChildAt(i);
|
||||
emptyDot(v);
|
||||
}
|
||||
mPreviousLength = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,226 @@
|
||||
package com.tool.app.protectorpro.customerview;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.tool.app.protectorpro.MyApplication;
|
||||
import com.tool.app.protectorpro.R;
|
||||
import com.tool.app.protectorpro.listadapter.AdapterLockView;
|
||||
import com.tool.app.protectorpro.listener.ListenerLock;
|
||||
import com.tool.app.protectorpro.tools.Common;
|
||||
|
||||
public class MyLockView extends RecyclerView {
|
||||
private String mPin = "";
|
||||
private int mPinLength;
|
||||
private int mHorizontalSpacing, mVerticalSpacing;
|
||||
private int mTextColor;
|
||||
private int mTextSize, mButtonSize;
|
||||
private Drawable mButtonBgDraw;
|
||||
private AdapterLockView mAdapter;
|
||||
private ListenerLock mPinLockListener;
|
||||
private CustomBundle mCustomBundle;
|
||||
|
||||
private boolean mShowDelete;
|
||||
private static final int DEFAULT_PWD_LENGTH = 4;
|
||||
private MyDots mMyDots;
|
||||
|
||||
|
||||
private AdapterLockView.OnNumberClickListener numberClickListener
|
||||
= new AdapterLockView.OnNumberClickListener() {
|
||||
@Override
|
||||
public void onNumberClicked(int keyValue) {
|
||||
|
||||
|
||||
if (mPinLockListener != null) {
|
||||
mPinLockListener.onNumberClickComplete(String.valueOf(keyValue));
|
||||
}
|
||||
|
||||
if (mPin.length() < getPinLength()) {
|
||||
mPin = mPin.concat(String.valueOf(keyValue));
|
||||
|
||||
if (isIndicatorDotsAttached()) {
|
||||
mMyDots.updateDot(mPin.length());
|
||||
|
||||
}
|
||||
|
||||
if (mPin.length() == 1) {
|
||||
mAdapter.setPinLength(mPin.length());
|
||||
mAdapter.notifyItemChanged(mAdapter.getItemCount() - 1);
|
||||
}
|
||||
|
||||
if (mPinLockListener != null) {
|
||||
if (mPin.length() == mPinLength) {
|
||||
mPinLockListener.onInPutComplete(mPin);
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!isShowDeleteButton()) {
|
||||
resetPinLockView();
|
||||
mPin = mPin.concat(String.valueOf(keyValue));
|
||||
|
||||
if (isIndicatorDotsAttached()) {
|
||||
mMyDots.updateDot(mPin.length());
|
||||
}
|
||||
|
||||
if (mPinLockListener != null) {
|
||||
// mPinLockListener.onPinChange(mPin.length(), mPin);
|
||||
}
|
||||
|
||||
} else {
|
||||
if (mPinLockListener != null) {
|
||||
mPinLockListener.onInPutComplete(mPin);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
private AdapterLockView.OnDeleteClickListener mOnDeleteClickListener
|
||||
= new AdapterLockView.OnDeleteClickListener() {
|
||||
@Override
|
||||
public void onDeleteClicked() {
|
||||
Log.d("key_delete", mPin.length() + "...");
|
||||
|
||||
if (!mPin.isEmpty()) {
|
||||
mPinLockListener.onKeyBordDelete(mPin.length());
|
||||
|
||||
mPin = mPin.substring(0, mPin.length() - 1);
|
||||
|
||||
if (isIndicatorDotsAttached()) {
|
||||
mMyDots.updateDot(mPin.length());
|
||||
|
||||
}
|
||||
|
||||
if (mPin.length() == 0) {
|
||||
mAdapter.setPinLength(mPin.length());
|
||||
mAdapter.notifyItemChanged(mAdapter.getItemCount() - 1);
|
||||
}
|
||||
|
||||
if (mPinLockListener != null) {
|
||||
if (mPin.length() == 0) {
|
||||
// mPinLockListener.onEmpty();
|
||||
clearInternalPin();
|
||||
} else {
|
||||
// mPinLockListener.onPinChange(mPin.length(), mPin);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (mPinLockListener != null) {
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
public MyLockView(Context context) {
|
||||
super(context);
|
||||
init(null, 0);
|
||||
}
|
||||
|
||||
public MyLockView(Context context, @Nullable AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
init(attrs, 0);
|
||||
}
|
||||
|
||||
public MyLockView(Context context, @Nullable AttributeSet attrs, int defStyle) {
|
||||
super(context, attrs, defStyle);
|
||||
init(attrs, defStyle);
|
||||
}
|
||||
|
||||
private void init(AttributeSet attributeSet, int defStyle) {
|
||||
|
||||
TypedArray typedArray = getContext().obtainStyledAttributes(attributeSet, R.styleable.MyLock);
|
||||
|
||||
try {
|
||||
mPinLength = typedArray.getInt(R.styleable.MyLock_pinLength, DEFAULT_PWD_LENGTH);
|
||||
mHorizontalSpacing = (int) typedArray.getDimension(R.styleable.MyLock_keypadHorizontalSpacing, Common.getPx(getContext(), R.dimen.default_horizontal_spacing));
|
||||
mVerticalSpacing = (int) typedArray.getDimension(R.styleable.MyLock_keypadVerticalSpacing, Common.getPx(getContext(), R.dimen.default_vertical_spacing));
|
||||
mTextColor = typedArray.getColor(R.styleable.MyLock_keypadTextColor, Common.getColor(getContext(), R.color.color_keyboard_num));
|
||||
mTextSize = (int) typedArray.getDimension(R.styleable.MyLock_keypadTextSize, Common.getPx(getContext(), R.dimen.default_text_size));
|
||||
mButtonSize = (int) typedArray.getDimension(R.styleable.MyLock_keypadButtonSize, Common.getPx(getContext(), R.dimen.default_button_size));
|
||||
mButtonBgDraw = typedArray.getDrawable(R.styleable.MyLock_keypadButtonBackgroundDrawable);
|
||||
|
||||
mShowDelete = typedArray.getBoolean(R.styleable.MyLock_keypadShowDeleteButton, true);
|
||||
} finally {
|
||||
typedArray.recycle();
|
||||
}
|
||||
|
||||
mCustomBundle = new CustomBundle();
|
||||
mCustomBundle.textColor = mTextColor;
|
||||
mCustomBundle.textSize = mTextSize;
|
||||
mCustomBundle.buttonSize = mButtonSize;
|
||||
mCustomBundle.backgroundDrawable = mButtonBgDraw;
|
||||
mCustomBundle.setShowDeleteButton(mShowDelete);
|
||||
|
||||
|
||||
initView();
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
mAdapter = new AdapterLockView();
|
||||
setLayoutManager(new GridLayoutManager(getContext(), 3));
|
||||
|
||||
|
||||
mAdapter.setOnItemClickListener(numberClickListener);
|
||||
mAdapter.setOnDeleteClickListener(mOnDeleteClickListener);
|
||||
mAdapter.setCustomizationOptions(mCustomBundle);
|
||||
setAdapter(mAdapter);
|
||||
|
||||
addItemDecoration(new LockSpace(mHorizontalSpacing, mVerticalSpacing, 3, false));
|
||||
setOverScrollMode(OVER_SCROLL_NEVER);
|
||||
}
|
||||
|
||||
|
||||
public void setPinLockListener(ListenerLock pinLockListener) {
|
||||
this.mPinLockListener = pinLockListener;
|
||||
}
|
||||
|
||||
public int getPinLength() {
|
||||
return mPinLength;
|
||||
}
|
||||
|
||||
public boolean isShowDeleteButton() {
|
||||
return mShowDelete;
|
||||
}
|
||||
|
||||
private void clearInternalPin() {
|
||||
mPin = "";
|
||||
}
|
||||
|
||||
|
||||
public void resetPinLockView() {
|
||||
clearInternalPin();
|
||||
mAdapter.setPinLength(mPin.length());
|
||||
mAdapter.notifyItemChanged(mAdapter.getItemCount() - 1);
|
||||
|
||||
if (mMyDots != null) {
|
||||
mMyDots.updateDot(mPin.length());
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isIndicatorDotsAttached() {
|
||||
return mMyDots != null;
|
||||
}
|
||||
|
||||
|
||||
public void setPinLength(){
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void attachIndicatorDots(MyDots mMyDots) {
|
||||
this.mMyDots = mMyDots;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,85 @@
|
||||
package com.tool.app.protectorpro.customerview;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.InputFilter;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
import android.widget.EditText;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.tool.app.protectorpro.R;
|
||||
|
||||
public class MyPasswordInputView extends LinearLayout {
|
||||
|
||||
private EditText[] mEditTexts = new EditText[4];
|
||||
|
||||
public MyPasswordInputView(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
public MyPasswordInputView(Context context, @Nullable AttributeSet attrs) {
|
||||
this(context, attrs, 0);
|
||||
}
|
||||
|
||||
public MyPasswordInputView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
LayoutInflater.from(context).inflate(R.layout.custom_password_input_view, this, true);
|
||||
mEditTexts[0] = findViewById(R.id.et1);
|
||||
mEditTexts[1] = findViewById(R.id.et2);
|
||||
mEditTexts[2] = findViewById(R.id.et3);
|
||||
mEditTexts[3] = findViewById(R.id.et4);
|
||||
setupEditTexts();
|
||||
}
|
||||
|
||||
private void setupEditTexts() {
|
||||
for (EditText editText : mEditTexts) {
|
||||
editText.setFilters(new InputFilter[]{new InputFilter.LengthFilter(1)});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void appendInput(String input) {
|
||||
String currentInput = getInput();
|
||||
String newInput = currentInput + input;
|
||||
|
||||
clearInput();
|
||||
|
||||
for (int i = 0; i < newInput.length() && i < mEditTexts.length; i++) {
|
||||
mEditTexts[i].setText(String.valueOf(newInput.charAt(i)));
|
||||
}
|
||||
}
|
||||
|
||||
public void deleteLastInput() {
|
||||
for (int i = mEditTexts.length - 1; i >= 0; i--) {
|
||||
EditText editText = mEditTexts[i];
|
||||
if (editText.getText().length() > 0) {
|
||||
editText.setText("");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public String getInput() {
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
for (EditText editText : mEditTexts) {
|
||||
stringBuilder.append(editText.getText().toString());
|
||||
}
|
||||
return stringBuilder.toString();
|
||||
}
|
||||
|
||||
public void clearInput() {
|
||||
for (EditText editText : mEditTexts) {
|
||||
editText.setText("");
|
||||
}
|
||||
}
|
||||
|
||||
// 新增一个方法来设置输入内容
|
||||
public void setInput(StringBuilder input) {
|
||||
clearInput();
|
||||
for (int i = 0; i < input.length() && i < mEditTexts.length; i++) {
|
||||
mEditTexts[i].setText(String.valueOf(input.charAt(i)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,167 @@
|
||||
package com.tool.app.protectorpro.listadapter;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.widget.SwitchCompat;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.tool.app.protectorpro.MyApplication;
|
||||
import com.tool.app.protectorpro.R;
|
||||
import com.tool.app.protectorpro.listener.OnShowDialogMsgListener;
|
||||
import com.tool.app.protectorpro.mydb.DataApp;
|
||||
import com.tool.app.protectorpro.mydb.MyDataBase;
|
||||
import com.tool.app.protectorpro.tools.MyThread;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class AdapterAllApp extends RecyclerView.Adapter<AdapterAllApp.AppViewHolder> {
|
||||
|
||||
private List<DataApp> list = new ArrayList<>();
|
||||
private List<DataApp> filterList = new ArrayList<>();
|
||||
private Context mContext;
|
||||
private Activity mActivity;
|
||||
private PackageManager packageManager;
|
||||
|
||||
|
||||
private OnShowDialogMsgListener listener;
|
||||
|
||||
public void setListener(OnShowDialogMsgListener listener) {
|
||||
this.listener = listener;
|
||||
}
|
||||
|
||||
public AdapterAllApp(Context context, Activity activity) {
|
||||
mContext = context;
|
||||
mActivity = activity;
|
||||
packageManager = context.getPackageManager();
|
||||
}
|
||||
|
||||
public void updateSyStemApp(List<DataApp> infoList) {
|
||||
list.clear();
|
||||
filterList.clear();
|
||||
if (infoList != null && !infoList.isEmpty()) {
|
||||
list.addAll(infoList);
|
||||
filterList.addAll(list);
|
||||
Log.d("AdapterAllApp", "List updated, size: " + list.size());
|
||||
} else {
|
||||
Log.d("AdapterAllApp", "Received empty or null list");
|
||||
}
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public void filter(String query) {
|
||||
filterList.clear();
|
||||
if (query.isEmpty()) {
|
||||
filterList.addAll(list);
|
||||
if (!list.isEmpty()) {
|
||||
Log.d("AdapterAllApp", "List size: " + list.size());
|
||||
Log.d("AdapterAllApp", "First item: " + list.get(0).getAppName());
|
||||
} else {
|
||||
Log.d("AdapterAllApp", "List is empty");
|
||||
}
|
||||
} else {
|
||||
for (DataApp item : list) {
|
||||
if (item.getAppName().toLowerCase().contains(query.toLowerCase())) {
|
||||
filterList.add(item);
|
||||
Log.d("AdapterAllApp", "Filtered item: " + item.getAppName());
|
||||
}
|
||||
}
|
||||
}
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public AppViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
AppViewHolder appViewHolder = new AppViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_systapp, parent, false));
|
||||
return appViewHolder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull AppViewHolder holder, int position) {
|
||||
holder.switchCompat.setOnCheckedChangeListener(null);
|
||||
DataApp dataApp = filterList.get(position); // 使用filterList
|
||||
String appName = dataApp.getAppName();
|
||||
boolean lock = dataApp.isLock();
|
||||
holder.switchCompat.setChecked(lock);
|
||||
holder.switchCompat.setOnCheckedChangeListener((CompoundButton buttonView, boolean isChecked) -> {
|
||||
if(MyApplication.userOption%5==0){
|
||||
// TODO: 2024/7/19
|
||||
MyThread.runIO(() -> {
|
||||
dataApp.setLock(isChecked);
|
||||
MyDataBase.getInstance().getRoomDao().updateData(dataApp);
|
||||
});
|
||||
String format;
|
||||
if (isChecked) {
|
||||
format = String.format(mContext.getString(R.string.text_locked), appName);
|
||||
} else {
|
||||
format = String.format(mContext.getString(R.string.text_unlocked), appName);
|
||||
}
|
||||
if(listener!= null){
|
||||
listener.showDialogMsg(format);
|
||||
}
|
||||
}else {
|
||||
MyThread.runIO(() -> {
|
||||
dataApp.setLock(isChecked);
|
||||
MyDataBase.getInstance().getRoomDao().updateData(dataApp);
|
||||
});
|
||||
String format;
|
||||
if (isChecked) {
|
||||
format = String.format(mContext.getString(R.string.text_locked), appName);
|
||||
} else {
|
||||
format = String.format(mContext.getString(R.string.text_unlocked), appName);
|
||||
}
|
||||
Toast.makeText(mContext, format, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
MyApplication.userOption++;
|
||||
});
|
||||
|
||||
try {
|
||||
Drawable appLogo = getLogo(dataApp.getPackageName());
|
||||
holder.imageView.setImageDrawable(appLogo);
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
// Handle exception
|
||||
}
|
||||
|
||||
holder.textView.setText(appName);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private Drawable getLogo(String packageName) throws PackageManager.NameNotFoundException {
|
||||
ApplicationInfo appInfo = packageManager.getApplicationInfo(packageName, PackageManager.GET_UNINSTALLED_PACKAGES);
|
||||
return packageManager.getApplicationIcon(appInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return filterList.size(); // 使用filterList
|
||||
}
|
||||
|
||||
public static class AppViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
private ImageView imageView;
|
||||
private TextView textView;
|
||||
private SwitchCompat switchCompat;
|
||||
|
||||
public AppViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
imageView = itemView.findViewById(R.id.logo);
|
||||
textView = itemView.findViewById(R.id.name);
|
||||
switchCompat = itemView.findViewById(R.id.app_switch);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,186 @@
|
||||
package com.tool.app.protectorpro.listadapter;
|
||||
|
||||
|
||||
|
||||
import android.util.TypedValue;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.tool.app.protectorpro.R;
|
||||
import com.tool.app.protectorpro.customerview.CustomBundle;
|
||||
import com.tool.app.protectorpro.customerview.CustomBundle;
|
||||
|
||||
public class AdapterLockView extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
||||
|
||||
private static final int TYPE_NUMBER = 0;
|
||||
|
||||
private OnNumberClickListener mOnNumberListener;
|
||||
private OnDeleteClickListener mOnDeleteListener;
|
||||
|
||||
private static final int VIEW_TYPE_DELETE = 1;
|
||||
private CustomBundle mCustomBundle;
|
||||
private int mCurLength;
|
||||
|
||||
private int[] mKeyValues;
|
||||
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
RecyclerView.ViewHolder viewHolder;
|
||||
LayoutInflater inflater = LayoutInflater.from(parent.getContext());
|
||||
|
||||
if (viewType == TYPE_NUMBER) {
|
||||
View view = inflater.inflate(R.layout.item_number, parent, false);
|
||||
viewHolder = new NumberViewHolder(view);
|
||||
} else {
|
||||
View view = inflater.inflate(R.layout.item_delete, parent, false);
|
||||
viewHolder = new DeleteViewHolder(view);
|
||||
}
|
||||
return viewHolder;
|
||||
}
|
||||
public AdapterLockView() {
|
||||
this.mKeyValues = getKeyValues(new int[]{1, 2, 3, 4, 5, 6, 7, 8, 9, 0});
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
|
||||
if (holder.getItemViewType() == TYPE_NUMBER) {
|
||||
NumberViewHolder vh1 = (NumberViewHolder) holder;
|
||||
setNumberBtn(vh1, position);
|
||||
}
|
||||
}
|
||||
|
||||
private void setNumberBtn(NumberViewHolder holder, int position) {
|
||||
if (holder != null) {
|
||||
if (position == 9) {
|
||||
holder.mNumberButton.setVisibility(View.GONE);
|
||||
} else {
|
||||
holder.mNumberButton.setText(String.valueOf(mKeyValues[position]));
|
||||
holder.mNumberButton.setVisibility(View.VISIBLE);
|
||||
holder.mNumberButton.setTag(mKeyValues[position]);
|
||||
}
|
||||
|
||||
if (mCustomBundle != null) {
|
||||
holder.mNumberButton.setTextColor(mCustomBundle.textColor);
|
||||
if (mCustomBundle.backgroundDrawable != null) {
|
||||
holder.mNumberButton.setBackground(mCustomBundle.backgroundDrawable);
|
||||
}
|
||||
holder.mNumberButton.setTextSize(TypedValue.COMPLEX_UNIT_PX,
|
||||
mCustomBundle.textSize);
|
||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
|
||||
mCustomBundle.buttonSize,
|
||||
mCustomBundle.buttonSize);
|
||||
holder.mNumberButton.setLayoutParams(params);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return 12;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemViewType(int position) {
|
||||
if (position == getItemCount() - 1) {
|
||||
return VIEW_TYPE_DELETE;
|
||||
}
|
||||
return TYPE_NUMBER;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setPinLength(int pinLength) {
|
||||
this.mCurLength = pinLength;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private int[] getKeyValues(int[] keyValues) {
|
||||
int[] adjustedKeyValues = new int[keyValues.length + 1];
|
||||
for (int i = 0; i < keyValues.length; i++) {
|
||||
if (i < 9) {
|
||||
adjustedKeyValues[i] = keyValues[i];
|
||||
} else {
|
||||
adjustedKeyValues[i] = -1;
|
||||
adjustedKeyValues[i + 1] = keyValues[i];
|
||||
}
|
||||
}
|
||||
return adjustedKeyValues;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setOnItemClickListener(OnNumberClickListener onNumberClickListener) {
|
||||
this.mOnNumberListener = onNumberClickListener;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setOnDeleteClickListener(OnDeleteClickListener onDeleteClickListener) {
|
||||
this.mOnDeleteListener = onDeleteClickListener;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setCustomizationOptions(CustomBundle customBundle) {
|
||||
this.mCustomBundle = customBundle;
|
||||
}
|
||||
|
||||
public class NumberViewHolder extends RecyclerView.ViewHolder {
|
||||
TextView mNumberButton;
|
||||
|
||||
public NumberViewHolder(final View itemView) {
|
||||
super(itemView);
|
||||
mNumberButton = (TextView) itemView.findViewById(R.id.deleteLayout);
|
||||
mNumberButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (mOnNumberListener != null) {
|
||||
mOnNumberListener.onNumberClicked((Integer) v.getTag());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
public interface OnNumberClickListener {
|
||||
void onNumberClicked(int keyValue);
|
||||
}
|
||||
|
||||
public interface OnDeleteClickListener {
|
||||
void onDeleteClicked();
|
||||
}
|
||||
public class DeleteViewHolder extends RecyclerView.ViewHolder {
|
||||
LinearLayout mDeleteLayout;
|
||||
ImageView mDeleteImage;
|
||||
|
||||
public DeleteViewHolder(final View itemView) {
|
||||
super(itemView);
|
||||
mDeleteLayout = (LinearLayout) itemView.findViewById(R.id.deleteLayout);
|
||||
mDeleteImage = (ImageView) itemView.findViewById(R.id.deleteImage);
|
||||
|
||||
if (mCustomBundle.isShowDeleteButton() && mCurLength > 0) {
|
||||
mDeleteLayout.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (mOnDeleteListener != null) {
|
||||
mOnDeleteListener.onDeleteClicked();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
package com.tool.app.protectorpro.listener
|
||||
|
||||
import androidx.room.Dao
|
||||
import androidx.room.Delete
|
||||
import androidx.room.Insert
|
||||
import androidx.room.OnConflictStrategy
|
||||
import androidx.room.Query
|
||||
import androidx.room.Update
|
||||
import com.tool.app.protectorpro.mydb.DataApp
|
||||
|
||||
@Dao
|
||||
interface ListenerDao {
|
||||
@Delete
|
||||
fun deleteData(dataApp: DataApp)
|
||||
|
||||
@Query("select * from DataApp where packageName=:packName")
|
||||
fun findByPackName(packName: String): DataApp?
|
||||
|
||||
@Query("select * from DataApp where isSyStem=:system AND isRecommend = :recommend")
|
||||
fun findByType(system: Boolean, recommend: Boolean): List<DataApp>?
|
||||
|
||||
@Update
|
||||
fun updateData(dataApp: DataApp)
|
||||
|
||||
@Insert(onConflict = OnConflictStrategy.IGNORE)
|
||||
fun insertData(dataApp: DataApp)
|
||||
|
||||
@Query("select * from DataApp")
|
||||
fun findApp(): List<DataApp>?
|
||||
|
||||
@Query("select * from DataApp where isLock =:isLock")
|
||||
fun findByLock(isLock: Boolean): List<DataApp>?
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
package com.tool.app.protectorpro.listener;
|
||||
|
||||
|
||||
public interface ListenerLock {
|
||||
|
||||
|
||||
void onInPutComplete(String pin);
|
||||
|
||||
void onNumberClickComplete(String keyValue);
|
||||
|
||||
void onKeyBordDelete( int pin);
|
||||
}
|
||||
@ -0,0 +1,5 @@
|
||||
package com.tool.app.protectorpro.listener;
|
||||
|
||||
public interface OnShowDialogMsgListener {
|
||||
void showDialogMsg(String msg);
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
package com.tool.app.protectorpro.listener;
|
||||
|
||||
|
||||
public interface onPermssionListener {
|
||||
|
||||
void onToSetting();
|
||||
|
||||
}
|
||||
@ -0,0 +1,74 @@
|
||||
package com.tool.app.protectorpro.mydb;
|
||||
|
||||
import androidx.room.Entity;
|
||||
import androidx.room.Index;
|
||||
import androidx.room.PrimaryKey;
|
||||
|
||||
import com.tool.app.protectorpro.MyApplication;
|
||||
|
||||
|
||||
@Entity(tableName = MyApplication.Table_Name,indices = {@Index(value = {"packageName"}, unique = true)})
|
||||
public class DataApp {
|
||||
|
||||
@PrimaryKey(autoGenerate = true)
|
||||
private int id;
|
||||
private String packageName;
|
||||
|
||||
private String appName;
|
||||
|
||||
private boolean isLock = false;
|
||||
|
||||
private boolean isSyStem ;
|
||||
|
||||
private boolean isRecommend = false;
|
||||
|
||||
public boolean isRecommend() {
|
||||
return isRecommend;
|
||||
}
|
||||
|
||||
public void setRecommend(boolean recommend) {
|
||||
isRecommend = recommend;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public void setSyStem(boolean syStem) {
|
||||
isSyStem = syStem;
|
||||
}
|
||||
|
||||
public boolean isSyStem() {
|
||||
return isSyStem;
|
||||
}
|
||||
|
||||
|
||||
public void setAppName(String appName) {
|
||||
this.appName = appName;
|
||||
}
|
||||
|
||||
public void setLock(boolean lock) {
|
||||
isLock = lock;
|
||||
}
|
||||
|
||||
public void setPackageName(String packageName) {
|
||||
this.packageName = packageName;
|
||||
}
|
||||
|
||||
|
||||
public String getAppName() {
|
||||
return appName;
|
||||
}
|
||||
|
||||
public String getPackageName() {
|
||||
return packageName;
|
||||
}
|
||||
|
||||
public boolean isLock() {
|
||||
return isLock;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
package com.tool.app.protectorpro.mydb;
|
||||
|
||||
import androidx.room.Database;
|
||||
import androidx.room.Room;
|
||||
import androidx.room.RoomDatabase;
|
||||
|
||||
import com.tool.app.protectorpro.MyApplication;
|
||||
import com.tool.app.protectorpro.listener.ListenerDao;
|
||||
|
||||
@Database(
|
||||
entities = {DataApp.class},
|
||||
version = MyApplication.DB_Version,
|
||||
exportSchema = false
|
||||
)
|
||||
public abstract class MyDataBase extends RoomDatabase {
|
||||
|
||||
private static MyDataBase INSTANCE;
|
||||
|
||||
public static synchronized MyDataBase getInstance() {
|
||||
if (INSTANCE == null) {
|
||||
INSTANCE = Room.databaseBuilder(MyApplication.appContext, MyDataBase.class, MyApplication.DB_Name).build();
|
||||
}
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
public abstract ListenerDao getRoomDao();
|
||||
|
||||
}
|
||||
@ -0,0 +1,65 @@
|
||||
package com.tool.app.protectorpro.service;
|
||||
|
||||
import android.app.IntentService;
|
||||
import android.content.Intent;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.tool.app.protectorpro.mydb.DataApp;
|
||||
import com.tool.app.protectorpro.mydb.MyDataBase;
|
||||
import com.tool.app.protectorpro.tools.LockManager;
|
||||
import com.tool.app.protectorpro.tools.Common;
|
||||
import com.tool.app.protectorpro.tools.MyThread;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class LockService extends IntentService {
|
||||
|
||||
private String lastLockPackName = "";
|
||||
private LockManager instance;
|
||||
private Boolean checkTop = true;
|
||||
|
||||
@Override
|
||||
protected void onHandleIntent(@Nullable Intent intent) {
|
||||
instance = LockManager.getInstance(this);
|
||||
while (checkTop) {
|
||||
String packageName = Common.checkUsageStats(this);
|
||||
if(Objects.equals(packageName, "")){
|
||||
continue;
|
||||
}
|
||||
DataApp dataApp = MyDataBase.getInstance().getRoomDao().findByPackName(packageName);
|
||||
if(dataApp == null){
|
||||
MyThread.runUI(()->{
|
||||
instance.unLock();
|
||||
});
|
||||
lastLockPackName = packageName;
|
||||
|
||||
continue;
|
||||
}
|
||||
if(Objects.equals(packageName, lastLockPackName)){
|
||||
continue;
|
||||
}
|
||||
if (dataApp.isLock() ) {
|
||||
if(!Objects.equals(packageName, lastLockPackName)){
|
||||
MyThread.runUI(()->{
|
||||
instance.showLockView();
|
||||
});
|
||||
}else {
|
||||
}
|
||||
}else {
|
||||
|
||||
MyThread.runUI(()->{
|
||||
instance.unLock();
|
||||
});
|
||||
}
|
||||
lastLockPackName = packageName;
|
||||
}
|
||||
|
||||
}
|
||||
public LockService() {
|
||||
super("");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
219
app/src/main/java/com/tool/app/protectorpro/tools/Common.java
Normal file
@ -0,0 +1,219 @@
|
||||
package com.tool.app.protectorpro.tools;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AppOpsManager;
|
||||
import android.app.usage.UsageEvents;
|
||||
import android.app.usage.UsageStatsManager;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.ResolveInfo;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import androidx.annotation.ColorRes;
|
||||
import androidx.annotation.DimenRes;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.tool.app.protectorpro.mydb.DataApp;
|
||||
import com.tool.app.protectorpro.mydb.MyDataBase;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public class Common {
|
||||
public static float getPx(Context context, @DimenRes int id) {
|
||||
return context.getResources().getDimension(id);
|
||||
}
|
||||
|
||||
private static void addDb(List<DataApp> list, boolean isSystem, boolean isUpdate) {
|
||||
// HashSet<Integer> randomIndex = getRandomIndex(list.size());
|
||||
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
DataApp dataApp = list.get(i);
|
||||
dataApp.setSyStem(isSystem);
|
||||
if (isUpdate) {
|
||||
DataApp dataApp1 = MyDataBase.getInstance().getRoomDao().findByPackName(dataApp.getPackageName());
|
||||
if (dataApp1 == null) {
|
||||
MyDataBase.getInstance().getRoomDao().insertData(dataApp);
|
||||
|
||||
}
|
||||
} else {
|
||||
// boolean contains = randomIndex.contains(i);
|
||||
dataApp.setRecommend(false);
|
||||
MyDataBase.getInstance().getRoomDao().insertData(dataApp);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static List<DataApp> getAppList(Context context, boolean isUpdate) {
|
||||
PackageManager packageManager = context.getPackageManager();
|
||||
Intent intent = new Intent(Intent.ACTION_MAIN, null);
|
||||
intent.addCategory(Intent.CATEGORY_LAUNCHER);
|
||||
List<ResolveInfo> resolveInfos = packageManager.queryIntentActivities(intent, 0);
|
||||
|
||||
List<DataApp> systemAppList = new ArrayList<>();
|
||||
List<DataApp> threeAppList = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < resolveInfos.size(); i++) {
|
||||
ResolveInfo resolveInfo = resolveInfos.get(i);
|
||||
String packageName = resolveInfo.activityInfo.packageName;
|
||||
if (Objects.equals(packageName, context.getPackageName())) {
|
||||
continue;
|
||||
}
|
||||
ApplicationInfo appInfo;
|
||||
try {
|
||||
appInfo = packageManager.getApplicationInfo(packageName, PackageManager.GET_UNINSTALLED_PACKAGES);
|
||||
String appName = packageManager.getApplicationLabel(appInfo).toString();
|
||||
|
||||
DataApp dataApp = new DataApp();
|
||||
dataApp.setPackageName(packageName);
|
||||
dataApp.setAppName(appName);
|
||||
boolean systemApp = checkSystemApp(context, packageName);
|
||||
if (systemApp) {
|
||||
systemAppList.add(dataApp);
|
||||
} else {
|
||||
threeAppList.add(dataApp);
|
||||
}
|
||||
} catch (PackageManager.NameNotFoundException nameNotFoundException) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
List<DataApp> uniqueSystemList = removeDuplApp(systemAppList);
|
||||
List<DataApp> uniqueThreeList = removeDuplApp(threeAppList);
|
||||
|
||||
|
||||
MyThread.runIO(() -> {
|
||||
addDb(uniqueSystemList, true, isUpdate);
|
||||
addDb(uniqueThreeList, false, isUpdate);
|
||||
|
||||
});
|
||||
|
||||
return uniqueThreeList;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static int getColor(Context context, @ColorRes int id) {
|
||||
return ContextCompat.getColor(context, id);
|
||||
}
|
||||
|
||||
|
||||
// private static HashSet<Integer> getRandomIndex(int size) {
|
||||
// Random random = new Random();
|
||||
// HashSet<Integer> uniqueNumbers = new HashSet<>();
|
||||
// while (uniqueNumbers.size() < 4) {
|
||||
// int randomNumber = random.nextInt(size + 1);
|
||||
// uniqueNumbers.add(randomNumber);
|
||||
// }
|
||||
// return uniqueNumbers;
|
||||
//
|
||||
// }
|
||||
|
||||
private static boolean checkSystemApp(Context context, String packageName) {
|
||||
|
||||
try {
|
||||
PackageInfo info = context.getPackageManager().getPackageInfo(packageName, PackageManager.GET_SIGNATURES);
|
||||
if ((info.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0) {
|
||||
return true;
|
||||
}
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public static List<DataApp> removeDuplApp(List<DataApp> list) {
|
||||
HashMap<String, DataApp> hashMap = new HashMap<>();
|
||||
for (DataApp dataApp : list) {
|
||||
if (!hashMap.containsKey(dataApp.getPackageName())) {
|
||||
hashMap.put(dataApp.getPackageName(), dataApp);
|
||||
}
|
||||
}
|
||||
List<DataApp> data = new ArrayList<>();
|
||||
for (HashMap.Entry<String, DataApp> entry : hashMap.entrySet()) {
|
||||
data.add(entry.getValue());
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
public static String checkUsageStats(Context context) {
|
||||
UsageStatsManager sUsageStatsManager = (UsageStatsManager) context.getSystemService(Context.USAGE_STATS_SERVICE);
|
||||
long endTime = System.currentTimeMillis();
|
||||
long beginTime = endTime - 10000;
|
||||
String result = "";
|
||||
UsageEvents.Event event = new UsageEvents.Event();
|
||||
UsageEvents usageEvents = sUsageStatsManager.queryEvents(beginTime, endTime);
|
||||
while (usageEvents.hasNextEvent()) {
|
||||
usageEvents.getNextEvent(event);
|
||||
if (event.getEventType() == UsageEvents.Event.MOVE_TO_FOREGROUND) {
|
||||
result = event.getPackageName();
|
||||
}
|
||||
}
|
||||
if (!TextUtils.isEmpty(result)) {
|
||||
return result;
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
public static Boolean delUnInstallApp(Context context, String packName) {
|
||||
PackageManager packageManager = context.getPackageManager();
|
||||
try {
|
||||
packageManager.getApplicationInfo(packName, PackageManager.GET_UNINSTALLED_PACKAGES);
|
||||
return false;
|
||||
} catch (PackageManager.NameNotFoundException nameNotFoundException) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static boolean checkPermission(Context context) {
|
||||
|
||||
// 检查当前应用是否具有 "android:get_usage_stats" 权限
|
||||
AppOpsManager appOps = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE);
|
||||
int mode = 0;
|
||||
mode = appOps.checkOpNoThrow("android:get_usage_stats", android.os.Process.myUid(), context.getPackageName());
|
||||
return mode == AppOpsManager.MODE_ALLOWED;
|
||||
}
|
||||
|
||||
public static void goDrawOverlays(Activity activity, int requestCode) {
|
||||
Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION);
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && Build.VERSION.SDK_INT < Build.VERSION_CODES.P) {
|
||||
//8.0
|
||||
} else {
|
||||
// 6.0、7.0、9.0
|
||||
Uri uri = Uri.fromParts("package", activity.getPackageName(), null);
|
||||
intent.setData(uri);
|
||||
// intent.setData(Uri.parse("package:" + activity.getPackageName()));
|
||||
}
|
||||
activity.startActivityForResult(intent, requestCode);
|
||||
}
|
||||
|
||||
|
||||
public static void toSetUsagePermission(Activity context, int requestCode) {
|
||||
Intent intent = new Intent(Settings.ACTION_USAGE_ACCESS_SETTINGS);
|
||||
// Uri uri = Uri.fromParts("package", context.getPackageName(), null);
|
||||
// intent.setData(uri);
|
||||
context.startActivityForResult(intent, requestCode);
|
||||
}
|
||||
|
||||
public static boolean getCanDrawOverlays(Context context) {
|
||||
return Settings.canDrawOverlays(context);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,168 @@
|
||||
package com.tool.app.protectorpro.tools;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.PixelFormat;
|
||||
import android.graphics.Point;
|
||||
import android.os.Build;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
|
||||
import com.google.android.material.snackbar.Snackbar;
|
||||
import com.tool.app.protectorpro.MyApplication;
|
||||
import com.tool.app.protectorpro.R;
|
||||
import com.tool.app.protectorpro.customerview.MyDots;
|
||||
import com.tool.app.protectorpro.listener.ListenerLock;
|
||||
import com.tool.app.protectorpro.customerview.MyLockView;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class LockManager {
|
||||
|
||||
private static LockManager lockManager;
|
||||
private Context mContext;
|
||||
|
||||
private View mView;
|
||||
|
||||
private WindowManager windowManager;
|
||||
|
||||
|
||||
private WindowManager.LayoutParams layoutParams;
|
||||
|
||||
private MyLockView lockView;
|
||||
|
||||
public LockManager(Context context) {
|
||||
mContext = context;
|
||||
mView = LayoutInflater.from(context).inflate(R.layout.float_view, null, false);
|
||||
windowManager = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
|
||||
|
||||
|
||||
initView();
|
||||
|
||||
MyDots dots = mView.findViewById(R.id.indicator_dots);
|
||||
lockView = mView.findViewById(R.id.pin_lock_view);
|
||||
lockView.attachIndicatorDots(dots);
|
||||
lockView.setPinLockListener(new ListenerLock() {
|
||||
@Override
|
||||
public void onNumberClickComplete(String keyValue) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onKeyBordDelete(int pin) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInPutComplete(String pin) {
|
||||
|
||||
String pwd = MyApplication.getPwd();
|
||||
if (Objects.equals(pin, pwd)) {
|
||||
unLock();
|
||||
} else {
|
||||
lockView.resetPinLockView();
|
||||
|
||||
// Toast.makeText(mContext,"Password error",Toast.LENGTH_SHORT).show();
|
||||
|
||||
// showCustomSnackbar(mView, "Password error", Color.argb(1, 224, 224, 224));
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static LockManager getInstance(Context context) {
|
||||
if (lockManager == null) {
|
||||
lockManager = new LockManager(context);
|
||||
}
|
||||
return lockManager;
|
||||
|
||||
}
|
||||
|
||||
private void showCustomSnackbar(View view, String message, int backgroundColor) {
|
||||
Snackbar snackbar = Snackbar.make(view, "", Snackbar.LENGTH_LONG);
|
||||
|
||||
// 获取Snackbar的View
|
||||
View snackbarView = snackbar.getView();
|
||||
|
||||
// 获取Snackbar的父布局
|
||||
ViewGroup snackbarLayout = (ViewGroup) snackbarView.findViewById(com.google.android.material.R.id.snackbar_text).getParent();
|
||||
|
||||
// 移除默认的TextView
|
||||
snackbarLayout.removeAllViews();
|
||||
|
||||
// 自定义布局
|
||||
LayoutInflater inflater = LayoutInflater.from(view.getContext());
|
||||
View customView = inflater.inflate(R.layout.custom_float_snackbar, null);
|
||||
|
||||
// 设置背景颜色
|
||||
snackbarView.setBackgroundColor(backgroundColor);
|
||||
|
||||
// 设置描述文字
|
||||
TextView snackbarText = customView.findViewById(R.id.snackbar_text);
|
||||
snackbarText.setText(message);
|
||||
|
||||
// 将自定义布局添加到Snackbar的布局中
|
||||
snackbarLayout.addView(customView);
|
||||
|
||||
// 设置居中
|
||||
FrameLayout.LayoutParams params = (FrameLayout.LayoutParams) snackbarView.getLayoutParams();
|
||||
params.gravity = Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM;
|
||||
snackbarView.setLayoutParams(params);
|
||||
|
||||
snackbar.show();
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
int type = 0;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
type = WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY;
|
||||
} else {
|
||||
type = WindowManager.LayoutParams.TYPE_PHONE;
|
||||
}
|
||||
DisplayMetrics displayMetrics = new DisplayMetrics();
|
||||
windowManager.getDefaultDisplay().getMetrics(displayMetrics);
|
||||
layoutParams = new WindowManager.LayoutParams();
|
||||
layoutParams.type = type;
|
||||
layoutParams.width = ViewGroup.LayoutParams.MATCH_PARENT;
|
||||
layoutParams.height = ViewGroup.LayoutParams.MATCH_PARENT;
|
||||
|
||||
layoutParams.format = PixelFormat.RGBA_8888;
|
||||
layoutParams.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE |
|
||||
WindowManager.LayoutParams.FLAG_FULLSCREEN |
|
||||
WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN |
|
||||
WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS |
|
||||
WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR | WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL;
|
||||
|
||||
layoutParams.gravity = Gravity.START | Gravity.TOP;
|
||||
|
||||
Point screenSize = new Point();
|
||||
windowManager.getDefaultDisplay().getRealSize(screenSize);
|
||||
layoutParams.width = screenSize.x;
|
||||
layoutParams.height = screenSize.y;
|
||||
}
|
||||
|
||||
|
||||
public void showLockView() {
|
||||
lockView.resetPinLockView();
|
||||
windowManager.addView(mView, layoutParams);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void unLock() {
|
||||
try {
|
||||
windowManager.removeView(mView);
|
||||
} catch (Exception exception) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
package com.tool.app.protectorpro.tools;
|
||||
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
public class MyThread {
|
||||
|
||||
private static Handler mMainHandler;
|
||||
|
||||
private static ExecutorService executorService;
|
||||
|
||||
private static Handler getmMainHandler() {
|
||||
if (mMainHandler == null) {
|
||||
mMainHandler = new Handler(Looper.getMainLooper());
|
||||
}
|
||||
return mMainHandler;
|
||||
}
|
||||
public static void runIO(Runnable task) {
|
||||
getExecutorService().execute(task);
|
||||
}
|
||||
|
||||
private static ExecutorService getExecutorService() {
|
||||
if (executorService == null) {
|
||||
executorService = Executors.newSingleThreadExecutor();
|
||||
}
|
||||
return executorService;
|
||||
}
|
||||
|
||||
public static void runUI(Runnable task) {
|
||||
getmMainHandler().post(task);
|
||||
}
|
||||
}
|
||||
6
app/src/main/res/color/selector_text_color.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:color="@color/color_f0582ef" android:state_selected="true"/>
|
||||
<item android:color="@color/color_white" android:state_selected="false"/>
|
||||
|
||||
</selector>
|
||||
30
app/src/main/res/drawable-v24/ic_launcher_foreground.xml
Normal file
@ -0,0 +1,30 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="85.84757"
|
||||
android:endY="92.4963"
|
||||
android:startX="42.9492"
|
||||
android:startY="49.59793"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
|
||||
android:strokeWidth="1"
|
||||
android:strokeColor="#00000000" />
|
||||
</vector>
|
||||
9
app/src/main/res/drawable/back.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="64dp"
|
||||
android:height="64dp"
|
||||
android:viewportWidth="1024"
|
||||
android:viewportHeight="1024">
|
||||
<path
|
||||
android:pathData="M538.3,198.6l-11.3,-11.3a16,16 0,0 0,-22.6 0L187.3,504.3a16,16 0,0 0,0 22.6L504.3,844a16,16 0,0 0,22.6 0l11.3,-11.3a16,16 0,0 0,0 -22.6l-294.4,-294.4 294.4,-294.4a16,16 0,0 0,0 -22.6z"
|
||||
android:fillColor="#ffffff"/>
|
||||
</vector>
|
||||
7
app/src/main/res/drawable/bg_12_white.xml
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="12dp"/>
|
||||
<solid android:color="@color/white"/>
|
||||
|
||||
</shape>
|
||||
7
app/src/main/res/drawable/bg_30_green.xml
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="30dp"/>
|
||||
<solid android:color="@color/color_green"/>
|
||||
|
||||
</shape>
|
||||
7
app/src/main/res/drawable/bg_36_4cd080.xml
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="36dp"/>
|
||||
<solid android:color="@color/color_main"/>
|
||||
|
||||
</shape>
|
||||
7
app/src/main/res/drawable/bg_36_b1dbff.xml
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="36dp" />
|
||||
<solid android:color="@color/color_main_en" />
|
||||
|
||||
</shape>
|
||||
7
app/src/main/res/drawable/bg_dia_step.xml
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:drawable="@drawable/bg_36_b1dbff" android:state_selected="true" />
|
||||
<item android:drawable="@drawable/bg_36_4cd080" android:state_selected="false" />
|
||||
|
||||
</selector>
|
||||
7
app/src/main/res/drawable/bg_fragment.xml
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@color/color_input" />
|
||||
<corners android:radius="25dp"/>
|
||||
|
||||
</shape>
|
||||
7
app/src/main/res/drawable/bg_sw.xml
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:drawable="@mipmap/track_sw_green_ic" android:state_checked="true" />
|
||||
<item android:drawable="@mipmap/track_sw_white_ic" android:state_checked="false" />
|
||||
|
||||
</selector>
|
||||
7
app/src/main/res/drawable/bg_tab_lock.xml
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:drawable="@mipmap/main_tab_lock_en" android:state_selected="true" />
|
||||
<item android:drawable="@mipmap/main_tab_lock_def" android:state_selected="false" />
|
||||
|
||||
</selector>
|
||||
7
app/src/main/res/drawable/bg_tab_sys.xml
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:drawable="@mipmap/main_tab_sys_en" android:state_selected="true" />
|
||||
<item android:drawable="@mipmap/main_tab_sys_def" android:state_selected="false" />
|
||||
|
||||
</selector>
|
||||
7
app/src/main/res/drawable/bg_tab_three.xml
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:drawable="@mipmap/main_tab_three_en" android:state_selected="true" />
|
||||
<item android:drawable="@mipmap/main_tab_three_def" android:state_selected="false" />
|
||||
|
||||
</selector>
|
||||
8
app/src/main/res/drawable/bottom_sheet_bg.xml
Normal file
@ -0,0 +1,8 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@android:color/white" />
|
||||
<corners
|
||||
android:topLeftRadius="40dp"
|
||||
android:topRightRadius="40dp" />
|
||||
|
||||
</shape>
|
||||
33
app/src/main/res/drawable/delete.xml
Normal file
@ -0,0 +1,33 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="25dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="25"
|
||||
android:viewportHeight="24">
|
||||
|
||||
<path
|
||||
android:fillColor="@android:color/transparent"
|
||||
android:pathData="M8.41987,5C7.83602,5 7.28132,5.25513 6.90136,5.69842L2.61564,10.6984C1.97366,11.4474 1.97366,12.5526 2.61564,13.3016L6.90136,18.3016C7.28132,18.7449 7.83602,19 8.41987,19L19.5,19C20.6046,19 21.5,18.1046 21.5,17L21.5,7C21.5,5.89543 20.6046,5 19.5,5L8.41987,5Z"
|
||||
android:strokeColor="#292929"
|
||||
android:strokeWidth="2"
|
||||
android:strokeLineCap="round"
|
||||
android:strokeLineJoin="round"/>
|
||||
|
||||
<path
|
||||
android:fillColor="@android:color/transparent"
|
||||
android:pathData="M15.5,10L11.5,14"
|
||||
android:strokeColor="#292929"
|
||||
android:strokeWidth="2"
|
||||
android:strokeLineCap="round"
|
||||
android:strokeLineJoin="round"/>
|
||||
|
||||
<path
|
||||
android:fillColor="@android:color/transparent"
|
||||
android:pathData="M11.5,10L15.5,14"
|
||||
android:strokeColor="#292929"
|
||||
android:strokeWidth="2"
|
||||
android:strokeLineCap="round"
|
||||
android:strokeLineJoin="round"/>
|
||||
|
||||
</vector>
|
||||
|
||||
|
||||
11
app/src/main/res/drawable/dia_choose.xml
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:pathData="M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z"/>
|
||||
</vector>
|
||||
13
app/src/main/res/drawable/main_pwd.xml
Normal file
@ -0,0 +1,13 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<group>
|
||||
<path
|
||||
android:pathData="M3 6H21M3 12H21M3 18H21"
|
||||
android:strokeColor="#3A3938"
|
||||
android:strokeWidth="2"
|
||||
/>
|
||||
</group>
|
||||
</vector>
|
||||
5
app/src/main/res/drawable/oval_black.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<solid android:color="@color/black" />
|
||||
</shape>
|
||||
5
app/src/main/res/drawable/oval_gray.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<solid android:color="@color/greyish" />
|
||||
</shape>
|
||||
5
app/src/main/res/drawable/oval_white.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<solid android:color="@color/white" />
|
||||
</shape>
|
||||
7
app/src/main/res/drawable/pwd_bg.xml
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="10dp"/>
|
||||
<solid android:color="@color/greyish"/>
|
||||
|
||||
</shape>
|
||||
7
app/src/main/res/drawable/tab_bg.xml
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="12dp"/>
|
||||
<solid android:color="@color/white"/>
|
||||
|
||||
</shape>
|
||||
16
app/src/main/res/drawable/thumb_sw.xml
Normal file
@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item
|
||||
android:bottom="2dp"
|
||||
android:left="2dp"
|
||||
android:right="2dp"
|
||||
android:top="2dp">
|
||||
|
||||
<shape android:shape="oval">
|
||||
<solid android:color="@color/white" />
|
||||
<size
|
||||
android:width="18dp"
|
||||
android:height="18dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
10
app/src/main/res/drawable/track_sw_green.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@color/color_green" />
|
||||
<corners android:radius="100dp" />
|
||||
<size
|
||||
android:width="36dp"
|
||||
android:height="22dp" />
|
||||
|
||||
</shape>
|
||||
10
app/src/main/res/drawable/track_sw_white.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@color/color_E5E5E5" />
|
||||
<corners android:radius="100dp" />
|
||||
<size
|
||||
android:width="36dp"
|
||||
android:height="22dp" />
|
||||
|
||||
</shape>
|
||||
BIN
app/src/main/res/font/inter.ttf
Normal file
41
app/src/main/res/layout/activity_complete.xml
Normal file
@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/color_home_bg"
|
||||
android:orientation="vertical"
|
||||
tools:context="com.tool.app.protectorpro.activity.ActivityComplete">
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/im_back"
|
||||
android:layout_width="34dp"
|
||||
android:layout_height="34dp"
|
||||
android:layout_marginStart="30dp"
|
||||
android:layout_marginTop="48dp"
|
||||
android:src="@drawable/back" />
|
||||
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="150dp"
|
||||
android:src="@mipmap/logo" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginStart="25dp"
|
||||
android:layout_marginTop="17dp"
|
||||
android:layout_marginEnd="25dp"
|
||||
android:gravity="center"
|
||||
android:lineSpacingExtra="12dp"
|
||||
android:text="@string/text_success"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="23sp" />
|
||||
|
||||
</LinearLayout>
|
||||
76
app/src/main/res/layout/activity_main_layout.xml
Normal file
@ -0,0 +1,76 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/color_home_bg"
|
||||
android:orientation="vertical"
|
||||
tools:context="com.tool.app.protectorpro.activity.ActivityMain">
|
||||
|
||||
<androidx.appcompat.widget.SearchView
|
||||
android:id="@+id/search_item"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="25dp"
|
||||
android:layout_marginTop="45dp"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/im_set_pwd"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_alignTop="@id/search_item"
|
||||
android:layout_alignBottom="@id/search_item"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_gravity="center"
|
||||
android:paddingEnd="25dp"
|
||||
android:src="@drawable/main_pwd" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_app_tabname"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/im_set_pwd"
|
||||
android:layout_marginStart="14dp"
|
||||
android:layout_marginTop="32dp"
|
||||
android:fontFamily="@font/inter"
|
||||
android:text="@string/text_system"
|
||||
android:textColor="@color/color_ff3a3938"
|
||||
android:textSize="24sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:id="@+id/viewPager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_above="@id/tab"
|
||||
android:layout_below="@id/tv_app_tabname"
|
||||
android:layout_marginStart="14dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginEnd="14dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:background="@drawable/bg_fragment" />
|
||||
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/tab"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="80dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginTop="127dp"
|
||||
android:background="@drawable/bg_fragment"
|
||||
app:tabGravity="center"
|
||||
app:tabIndicatorHeight="0dp"
|
||||
app:tabMaxWidth="0dp"
|
||||
app:tabMode="fixed"
|
||||
app:tabPaddingBottom="0dp"
|
||||
app:tabPaddingEnd="0dp"
|
||||
app:tabPaddingStart="0dp"
|
||||
app:tabPaddingTop="0dp" />
|
||||
|
||||
|
||||
<com.google.android.material.bottomsheet.BottomSheetDragHandleView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
</RelativeLayout>
|
||||
92
app/src/main/res/layout/activity_set_pwd.xml
Normal file
@ -0,0 +1,92 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
tools:context="com.tool.app.protectorpro.activity.ActivitySetPwd">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/im_back"
|
||||
android:layout_width="34dp"
|
||||
android:layout_height="34dp"
|
||||
android:layout_marginStart="30dp"
|
||||
android:layout_marginTop="48dp"
|
||||
android:src="@drawable/back" />
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/im"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="103dp"
|
||||
android:src="@mipmap/logo" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_pass_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/im"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="38dp"
|
||||
android:text="@string/text_original_pwd"
|
||||
android:textColor="@color/color_ff3a3938"
|
||||
android:textSize="20sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_sub"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="10dp"
|
||||
android:layout_below="@id/tv_pass_name"
|
||||
android:layout_alignStart="@id/tv_pass_name"
|
||||
android:layout_alignEnd="@id/tv_pass_name"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="38dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/text_original_pwd_describe"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="12sp"
|
||||
android:visibility="invisible" />
|
||||
|
||||
|
||||
<com.tool.app.protectorpro.customerview.MyPasswordInputView
|
||||
android:id="@+id/layout_et"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/tv_sub"
|
||||
android:gravity="center_horizontal"
|
||||
android:minHeight="40dp"
|
||||
android:orientation="horizontal" />
|
||||
|
||||
<com.tool.app.protectorpro.customerview.MyLockView
|
||||
android:id="@+id/lock_set_password"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/layout_et"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="38dp"
|
||||
app:keypadHorizontalSpacing="64dp"
|
||||
app:keypadShowDeleteButton="true"
|
||||
app:keypadTextColor="@color/black"
|
||||
app:keypadTextSize="36sp"
|
||||
app:keypadVerticalSpacing="24dp"
|
||||
app:pinLength="4" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_continue"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="63dp"
|
||||
android:layout_marginStart="30dp"
|
||||
android:layout_marginTop="40dp"
|
||||
android:layout_marginEnd="30dp"
|
||||
android:background="@drawable/bg_36_4cd080"
|
||||
android:gravity="center"
|
||||
android:text="@string/text_continue"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold"
|
||||
android:visibility="gone" />
|
||||
</RelativeLayout>
|
||||
40
app/src/main/res/layout/activity_wel.xml
Normal file
@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/color_home_bg"
|
||||
tools:context="com.tool.app.protectorpro.activity.ActivityWel">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/im_wel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="227dp"
|
||||
android:src="@mipmap/logo" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/im_wel"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginStart="0dp"
|
||||
android:layout_marginTop="25dp"
|
||||
android:layout_marginEnd="0dp"
|
||||
android:fontFamily="@font/inter"
|
||||
android:gravity="center"
|
||||
android:text="@string/app_name"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="24sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<ProgressBar
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/im_wel"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="100dp"
|
||||
android:indeterminateTint="@color/color_5aa2f1" />
|
||||
</RelativeLayout>
|
||||
23
app/src/main/res/layout/custom_float_snackbar.xml
Normal file
@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:padding="16dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/snackbar_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/float_snack_ic" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/snackbar_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="Your custom message"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="16sp" />
|
||||
</LinearLayout>
|
||||
57
app/src/main/res/layout/custom_password_input_view.xml
Normal file
@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merge xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et1"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="42dp"
|
||||
android:background="@drawable/pwd_bg"
|
||||
android:fontFamily="@font/inter"
|
||||
android:gravity="center"
|
||||
android:imeOptions="actionNext"
|
||||
android:inputType="number"
|
||||
android:maxLength="1"
|
||||
android:text=""
|
||||
android:textColor="@color/black"
|
||||
android:textSize="23sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et2"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="42dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:background="@drawable/pwd_bg"
|
||||
android:gravity="center"
|
||||
android:imeOptions="actionNext"
|
||||
android:inputType="number"
|
||||
android:maxLength="1"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="23sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et3"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="42dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:background="@drawable/pwd_bg"
|
||||
android:gravity="center"
|
||||
android:imeOptions="actionNext"
|
||||
android:inputType="number"
|
||||
android:maxLength="1"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="23sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et4"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="42dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:background="@drawable/pwd_bg"
|
||||
android:gravity="center"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="number"
|
||||
android:maxLength="1"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="23sp" />
|
||||
|
||||
</merge>
|
||||
46
app/src/main/res/layout/dialog_message.xml
Normal file
@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="30dp"
|
||||
android:layout_marginEnd="30dp"
|
||||
android:background="@drawable/bg_12_white"
|
||||
android:padding="20dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imlogo"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:src="@mipmap/logo" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/msg"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/imlogo"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="12dp"
|
||||
android:text="@string/app_name"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="19sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvOK"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_below="@id/msg"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="30dp"
|
||||
android:background="@drawable/bg_36_4cd080"
|
||||
android:gravity="center"
|
||||
android:text="@string/text_OK"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
</RelativeLayout>
|
||||
|
||||
</FrameLayout>
|
||||
177
app/src/main/res/layout/dialog_permis.xml
Normal file
@ -0,0 +1,177 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/dia_check"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="20dp"
|
||||
android:background="@drawable/bg_12_white"
|
||||
android:paddingStart="32dp"
|
||||
android:paddingEnd="32dp"
|
||||
android:paddingBottom="12dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/search_item"
|
||||
android:layout_width="260dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="10dp"
|
||||
android:fontFamily="@font/inter"
|
||||
android:gravity="center"
|
||||
android:text="@string/text_dialog"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="24sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_step1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/search_item"
|
||||
android:layout_marginTop="52dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:src="@mipmap/ic_dia_step1" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="260dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/inter"
|
||||
android:lineSpacingExtra="10dp"
|
||||
android:text="@string/text_dialog_step1_title"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="260dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/text_dialog_step1_text" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_step2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/ll_step1"
|
||||
android:layout_marginTop="32dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:src="@mipmap/ic_dia_step2" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="260dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/inter"
|
||||
android:lineSpacingExtra="10dp"
|
||||
android:text="@string/text_dialog_step2_title"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="260dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/text_dialog_step2_text" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/ll_set1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="43dp"
|
||||
android:layout_below="@id/ll_step2"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_marginTop="40dp"
|
||||
android:background="@drawable/bg_dia_step"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_select"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_gravity="center"
|
||||
android:fontFamily="@font/inter"
|
||||
android:gravity="center|start"
|
||||
android:text="@string/text_select"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_set1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="10dp"
|
||||
|
||||
android:layout_toEndOf="@id/tv_select"
|
||||
android:src="@drawable/dia_choose" />
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/ll_set2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="43dp"
|
||||
android:layout_below="@id/ll_set1"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_marginTop="24dp"
|
||||
android:background="@drawable/bg_dia_step"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_go"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_centerInParent="true"
|
||||
android:background="@drawable/bg_36_4cd080"
|
||||
android:fontFamily="@font/inter"
|
||||
android:gravity="center|start"
|
||||
android:text="@string/text_go"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_toEndOf="@id/tv_go"
|
||||
android:src="@drawable/dia_choose"
|
||||
android:visibility="invisible" />
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
</FrameLayout>
|
||||
56
app/src/main/res/layout/float_view.xml
Normal file
@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<ImageView
|
||||
android:layout_width="85dp"
|
||||
android:layout_height="85dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="140dp"
|
||||
android:src="@mipmap/logo" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_password_tip"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="14dp"
|
||||
android:layout_marginBottom="36dp"
|
||||
android:fontFamily="@font/inter"
|
||||
android:text="@string/text_float_name"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
|
||||
<com.tool.app.protectorpro.customerview.MyDots
|
||||
android:id="@+id/indicator_dots"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="20dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginBottom="22dp"
|
||||
android:gravity="center_vertical"
|
||||
app:dotDiameter="12dp"
|
||||
app:dotSpacing="20dp"
|
||||
app:indicatorType="fixed" />
|
||||
|
||||
<com.tool.app.protectorpro.customerview.MyLockView
|
||||
android:id="@+id/pin_lock_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="28dp"
|
||||
app:keypadHorizontalSpacing="64dp"
|
||||
app:keypadShowDeleteButton="true"
|
||||
app:keypadTextColor="@color/black"
|
||||
app:keypadTextSize="36sp"
|
||||
app:keypadVerticalSpacing="24dp"
|
||||
app:pinLength="4" />
|
||||
|
||||
</LinearLayout>
|
||||
14
app/src/main/res/layout/fragment_my.xml
Normal file
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context="com.tool.app.protectorpro.activity.FragmentMy">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/list_app"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingBottom="10dp" />
|
||||
|
||||
</FrameLayout>
|
||||
20
app/src/main/res/layout/item_delete.xml
Normal file
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/deleteLayout"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="64dp"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/deleteImage"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:clickable="false"
|
||||
android:focusable="false"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/delete" />
|
||||
</LinearLayout>
|
||||
18
app/src/main/res/layout/item_number.xml
Normal file
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/deleteLayout"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="64dp"
|
||||
android:background="@drawable/oval_gray"
|
||||
android:fontFamily="@font/inter"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/color_keyboard_num" />
|
||||
|
||||
</LinearLayout>
|
||||
43
app/src/main/res/layout/item_systapp.xml
Normal file
@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginTop="17dp"
|
||||
android:paddingStart="28dp"
|
||||
android:paddingEnd="28dp">
|
||||
|
||||
<de.hdodenhof.circleimageview.CircleImageView
|
||||
android:id="@+id/logo"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:src="@mipmap/ic_launcher" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignTop="@id/logo"
|
||||
android:layout_alignBottom="@id/logo"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_toEndOf="@id/logo"
|
||||
android:fontFamily="@font/inter"
|
||||
android:gravity="center"
|
||||
android:text="@string/app_name"
|
||||
|
||||
android:textColor="@color/color_ff3a3938"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/app_switch"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:thumb="@drawable/bg_sw"
|
||||
app:track="@color/transparent" />
|
||||
|
||||
</RelativeLayout>
|
||||
95
app/src/main/res/layout/set_bottom_sheet_layout.xml
Normal file
@ -0,0 +1,95 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingEnd="16dp">
|
||||
|
||||
<!-- 标题部分 -->
|
||||
<TextView
|
||||
android:id="@+id/tvTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentTop="true"
|
||||
android:fontFamily="@font/inter"
|
||||
android:gravity="center"
|
||||
android:text="@string/sheet_settings"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="20sp" />
|
||||
|
||||
<!-- 关闭按钮 -->
|
||||
<ImageView
|
||||
android:id="@+id/ivClose"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_gravity="end"
|
||||
android:src="@mipmap/ic_close" />
|
||||
|
||||
<!-- 分隔线 -->
|
||||
<View
|
||||
android:id="@+id/view1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_below="@+id/tvTitle"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp" />
|
||||
|
||||
<!-- 按钮部分 -->
|
||||
<LinearLayout
|
||||
android:id="@+id/ll2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/view1"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btnOption1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/pwd_bg"
|
||||
android:drawableStart="@mipmap/ic_change"
|
||||
android:drawableEnd="@mipmap/ic_next"
|
||||
android:drawablePadding="20dp"
|
||||
android:fontFamily="@font/inter"
|
||||
android:gravity="start|center_vertical"
|
||||
android:paddingStart="30dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingEnd="20dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:text="@string/sheet_change_password"
|
||||
android:textColor="@color/black" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btnOption2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:background="@drawable/pwd_bg"
|
||||
android:drawableStart="@mipmap/ic_plaicy"
|
||||
android:drawableEnd="@mipmap/ic_next"
|
||||
android:drawablePadding="20dp"
|
||||
android:fontFamily="@font/inter"
|
||||
android:gravity="start|center_vertical"
|
||||
android:paddingStart="30dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingEnd="20dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:text="@string/sheet_privacy_policy"
|
||||
android:textColor="@color/black"
|
||||
android:visibility="invisible" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@+id/ll2"
|
||||
android:layout_marginTop="20dp" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
30
app/src/main/res/layout/tab_view.xml
Normal file
@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:paddingStart="14dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingEnd="14dp"
|
||||
android:paddingBottom="10dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_tab_icon"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_gravity="center" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_tabtext"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:paddingTop="2dp"
|
||||
android:paddingBottom="2dp"
|
||||
android:text="@string/text_system"
|
||||
android:textColor="@color/selector_text_color"
|
||||
android:textSize="14sp" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
BIN
app/src/main/res/mipmap-hdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
app/src/main/res/mipmap-hdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
app/src/main/res/mipmap-mdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 982 B |
BIN
app/src/main/res/mipmap-mdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/float_snack_ic.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/ic_backspace.png
Normal file
|
After Width: | Height: | Size: 783 B |
BIN
app/src/main/res/mipmap-xxxhdpi/ic_change.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/ic_close.png
Normal file
|
After Width: | Height: | Size: 919 B |
BIN
app/src/main/res/mipmap-xxxhdpi/ic_dia_step1.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/ic_dia_step2.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 7.6 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/ic_next.png
Normal file
|
After Width: | Height: | Size: 743 B |
BIN
app/src/main/res/mipmap-xxxhdpi/ic_plaicy.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/logo.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/main_tab_lock_def.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/main_tab_lock_en.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/main_tab_sys_def.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/main_tab_sys_en.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/main_tab_three_def.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/main_tab_three_en.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |