├── .gitignore ├── .idea ├── gradle.xml └── misc.xml ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── easyandroid │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── assets │ │ └── html.html │ ├── java │ │ └── com │ │ │ └── easyandroid │ │ │ ├── BaseActivity.java │ │ │ ├── ForegroundAppUtil.java │ │ │ ├── ItemBean.java │ │ │ ├── KeyBoardActivity.java │ │ │ ├── MainActivity.java │ │ │ ├── MyAdapter.java │ │ │ ├── PopupKeyboardUtil.java │ │ │ ├── TestActivity.java │ │ │ ├── TestConstraintLayoutActivity.java │ │ │ ├── TestJsActivity.java │ │ │ ├── TestRunning.java │ │ │ └── ToastUtils.java │ └── res │ │ ├── anim │ │ ├── down_to_up.xml │ │ └── up_to_hide.xml │ │ ├── drawable │ │ ├── abcd.gif │ │ ├── bitmap.xml │ │ ├── blue_s.9.png │ │ ├── custom_shape_toast.xml │ │ ├── keyboard_delete.png │ │ ├── keyboard_key.xml │ │ ├── keyboard_shift.png │ │ └── transparency_n.9.png │ │ ├── layout │ │ ├── activity_main.xml │ │ ├── activity_testjs.xml │ │ ├── activity_testrunning.xml │ │ ├── custom_toast.xml │ │ ├── item_check.xml │ │ ├── keyboardview_layout.xml │ │ └── test_activity.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── testpic.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── modify_title.png │ │ ├── mipmap-xxxhdpi │ │ └── ic_launcher.png │ │ ├── values-w820dp │ │ └── dimens.xml │ │ ├── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ │ └── xml │ │ ├── allkeys1.xml │ │ └── small_keyboard.xml │ └── test │ └── java │ └── com │ └── easyandroid │ └── ExampleUnitTest.java ├── build.gradle ├── config.gradle ├── easytools ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── easytools │ │ ├── constant │ │ ├── MemoryConstants.java │ │ ├── PermissionConstants.java │ │ └── TimeConstants.java │ │ └── tools │ │ ├── ACache.java │ │ ├── ActivityManager.java │ │ ├── ActivityUtils.java │ │ ├── AdaptScreenUtils.java │ │ ├── AndroidUtils.java │ │ ├── AnimationUtils.java │ │ ├── AppUtils.java │ │ ├── ArrayUtils.java │ │ ├── AssetDatabaseOpenHelper.java │ │ ├── BadgeUtils.java │ │ ├── Base64Utils.java │ │ ├── BitmapUtils.java │ │ ├── BrightnessUtils.java │ │ ├── BuildProperties.java │ │ ├── CheckAdapter.java │ │ ├── CheckUtils.java │ │ ├── ClassUtils.java │ │ ├── CleanUtils.java │ │ ├── ClipboardUtils.java │ │ ├── CloseUtils.java │ │ ├── ConstantUtils.java │ │ ├── ConvertUtils.java │ │ ├── Countdown.java │ │ ├── CrashUtils.java │ │ ├── DateUtils.java │ │ ├── DebouncingUtils.java │ │ ├── DeviceUtils.java │ │ ├── DeviceUuidFactory.java │ │ ├── DialogUtils.java │ │ ├── DisplayUtils.java │ │ ├── DoubleClickExitDetector.java │ │ ├── EncodeUtils.java │ │ ├── EncryptUtils.java │ │ ├── FileIOUtils.java │ │ ├── FileProvider7.java │ │ ├── FileUtils.java │ │ ├── FlashlightUtils.java │ │ ├── FragmentUtils.java │ │ ├── GsonUtils.java │ │ ├── HexUtils.java │ │ ├── ImageLoader.java │ │ ├── IntentUtils.java │ │ ├── JsonUtils.java │ │ ├── KeyboardUtils.java │ │ ├── LanguageUtils.java │ │ ├── LogUtils.java │ │ ├── LongLogUtils.java │ │ ├── LoopTimer.java │ │ ├── LunarUtils.java │ │ ├── M3U8ParserUtils.java │ │ ├── MD5Utils.java │ │ ├── MapUtils.java │ │ ├── MediaPlayerUtils.java │ │ ├── MemoryFileHelper.java │ │ ├── MetaDataUtils.java │ │ ├── Money.java │ │ ├── MyTypefaceSpan.java │ │ ├── NetworkUtils.java │ │ ├── NotificationUtils.java │ │ ├── ObjectUtils.java │ │ ├── PaletteUtils.java │ │ ├── PathUtils.java │ │ ├── PermissionUtils.java │ │ ├── PollingUtils.java │ │ ├── Preconditions.java │ │ ├── ProcessUtils.java │ │ ├── RandomUtils.java │ │ ├── ReflectUtils.java │ │ ├── RegexUtils.java │ │ ├── ResourceUtils.java │ │ ├── RomUtils.java │ │ ├── RoundUtils.java │ │ ├── SDCardUtils.java │ │ ├── SMSUtils.java │ │ ├── ServiceUtils.java │ │ ├── ShellUtils.java │ │ ├── SnackbarUtils.java │ │ ├── SpUtils.java │ │ ├── SpanSimpleUtils.java │ │ ├── SpanUtils.java │ │ ├── StatusBarUtils.java │ │ ├── StatusTextUtils.java │ │ ├── StringUtils.java │ │ ├── ThreadPoolUtils.java │ │ ├── TimeUtils.java │ │ ├── ToastUtils.java │ │ ├── TouchUtils.java │ │ ├── UriUtils.java │ │ ├── Utils.java │ │ ├── UtilsActivityLifecycleImpl.java │ │ ├── UtilsBridge.java │ │ ├── ViewUtils.java │ │ ├── WeakHandler.java │ │ ├── WebViewUtils.java │ │ ├── ZipUtils.java │ │ └── log │ │ ├── EasyLog.java │ │ └── LogPrinterParser.java │ └── res │ ├── animator │ └── loading.xml │ ├── drawable │ └── loading_d.png │ ├── layout │ └── loading_dialog.xml │ ├── values │ ├── ids.xml │ ├── strings.xml │ └── styles.xml │ └── xml │ └── file_paths.xml ├── fingerprintrecognition ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── css │ │ └── fingerprint │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── css │ │ │ ├── fingerdemo │ │ │ └── DemoActivity.java │ │ │ └── fingerprint │ │ │ ├── CipherHelper.java │ │ │ ├── FingerManager.java │ │ │ ├── FingerManagerBuilder.java │ │ │ ├── SharePreferenceUtil.java │ │ │ ├── callback │ │ │ └── SimpleFingerCallback.java │ │ │ ├── dialog │ │ │ ├── BaseFingerDialog.java │ │ │ ├── CommonTipDialog.java │ │ │ └── DefaultFingerDialog.java │ │ │ ├── impl │ │ │ ├── BiometricPromptImpl23.java │ │ │ └── BiometricPromptImpl28.java │ │ │ ├── interfaces │ │ │ ├── IBiometricPrompt.java │ │ │ └── IFingerCallback.java │ │ │ └── util │ │ │ └── PhoneInfoCheck.java │ └── res │ │ ├── anim │ │ ├── fade_in.xml │ │ └── fade_out.xml │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable │ │ ├── common_round_corner_white_bg.xml │ │ ├── gray_round_bg.xml │ │ ├── ic_launcher_background.xml │ │ ├── icon_fingerprint.png │ │ └── top_round_white_bg.xml │ │ ├── layout │ │ ├── activity_demo.xml │ │ ├── common_tip_dialog.xml │ │ └── dialog_finger.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── values-night │ │ └── themes.xml │ │ └── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ ├── styles.xml │ │ └── themes.xml │ └── test │ └── java │ └── com │ └── css │ └── fingerprint │ └── ExampleUnitTest.java ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── pictures └── fileprovider.png ├── publish-mavencentral.gradle ├── secring.gpg └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | .idea/gradle.xml 4 | /local.properties 5 | /.idea/caches 6 | /.idea/libraries 7 | /.idea/modules.xml 8 | /.idea/workspace.xml 9 | /.idea/navEditor.xml 10 | /.idea/assetWizardSettings.xml 11 | .DS_Store 12 | /build 13 | /captures 14 | .externalNativeBuild 15 | 16 | 17 | # Built application files 18 | *.apk 19 | *.ap_ 20 | 21 | # Files for the ART/Dalvik VM 22 | *.dex 23 | 24 | # Java class files 25 | *.class 26 | 27 | # Generated files 28 | bin/ 29 | gen/ 30 | out/ 31 | 32 | # Gradle files 33 | .gradle/ 34 | build/ 35 | 36 | # Local configuration file (sdk path, etc) 37 | local.properties 38 | 39 | # Proguard folder generated by Eclipse 40 | proguard/ 41 | 42 | # Log Files 43 | *.log 44 | 45 | # Android Studio Navigation editor temp files 46 | .navigation/ 47 | 48 | # Android Studio captures folder 49 | captures/ 50 | 51 | # Intellij 52 | *.iml 53 | .idea/workspace.xml 54 | .idea/tasks.xml 55 | .idea/gradle.xml 56 | .idea/dictionaries 57 | .idea/libraries 58 | .idea/dictigitonaries 59 | .idea/misc.xml 60 | #.idea/modules.xml 61 | .idea/vcs.xml 62 | .idea/encodings.xml 63 | .DS_Store 64 | 65 | # Keystore files 66 | # *.jks 67 | 68 | # External native build folder generated in Android Studio 2.2 and later 69 | .externalNativeBuild 70 | 71 | # Google Services (e.g. APIs or Firebase) 72 | google-services.json 73 | 74 | # Freeline 75 | freeline.py 76 | freeline/ 77 | freeline_project_description.json 78 | /.idea 79 | /gradlew.bat 80 | /gradlew -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 20 | 21 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 34 | 54 | 55 | 56 | 57 | 58 | 59 | 61 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion rootProject.ext.android["compileSdkVersion"] 5 | buildToolsVersion rootProject.ext.android["buildToolsVersion"] 6 | defaultConfig { 7 | applicationId "com.easyandroid" 8 | minSdkVersion rootProject.ext.android["minSdkVersion"] 9 | targetSdkVersion rootProject.ext.android["targetSdkVersion"] 10 | versionCode rootProject.ext.android["versionCode"] 11 | versionName rootProject.ext.android["versionName"] 12 | flavorDimensions "versionCode" 13 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 14 | } 15 | buildTypes { 16 | release { 17 | minifyEnabled false 18 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 19 | } 20 | } 21 | 22 | compileOptions { 23 | sourceCompatibility = rootProject.ext.jdk["sourceCompatibility"] 24 | targetCompatibility = rootProject.ext.jdk["targetCompatibility"] 25 | } 26 | 27 | lintOptions { 28 | abortOnError false 29 | } 30 | } 31 | 32 | dependencies { 33 | implementation fileTree(include: ['*.jar'], dir: 'libs') 34 | androidTestImplementation rootProject.ext.dependencies["espresso-core"] 35 | implementation rootProject.ext.dependencies["appcompat"] 36 | implementation 'androidx.constraintlayout:constraintlayout:2.0.4' 37 | implementation 'com.jaredrummler:android-processes:1.1.1' 38 | implementation 'com.github.lzyzsd:jsbridge:1.0.4' 39 | testImplementation rootProject.ext.dependencies["junit"] 40 | implementation project(':easytools') 41 | } 42 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in G:\AndroidSDK/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/easyandroid/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.easyandroid; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.easyandroid", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /app/src/main/assets/html.html: -------------------------------------------------------------------------------- 1 | 2 |

html模块

3 |

4 | 5 |

6 |

7 |

8 |

9 | 59 | -------------------------------------------------------------------------------- /app/src/main/java/com/easyandroid/BaseActivity.java: -------------------------------------------------------------------------------- 1 | package com.easyandroid; 2 | 3 | import android.os.Bundle; 4 | import android.util.Log; 5 | 6 | import androidx.annotation.Nullable; 7 | import androidx.appcompat.app.AppCompatActivity; 8 | 9 | /** 10 | * package: com.easyandroid.BaseActivity 11 | * author: gyc 12 | * description: 13 | * time: create at 2017/2/13 10:52 14 | */ 15 | 16 | public abstract class BaseActivity extends AppCompatActivity { 17 | 18 | @Override 19 | protected void onCreate(@Nullable Bundle savedInstanceState) { 20 | super.onCreate(savedInstanceState); 21 | Log.d("******************Super", "onCreate"); 22 | } 23 | 24 | @Override 25 | protected void onDestroy() { 26 | super.onDestroy(); 27 | Log.d("******************Super", "onDestroy"); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/java/com/easyandroid/ForegroundAppUtil.java: -------------------------------------------------------------------------------- 1 | package com.easyandroid; 2 | 3 | import android.app.ActivityManager; 4 | import android.app.usage.UsageStats; 5 | import android.app.usage.UsageStatsManager; 6 | import android.content.Context; 7 | import android.content.Intent; 8 | import android.os.Build; 9 | import android.provider.Settings; 10 | import android.text.TextUtils; 11 | 12 | import java.util.List; 13 | 14 | /** 15 | * package: com.easyandroid.ForegroundAppUtil 16 | * author: gyc 17 | * description: 18 | * time: create at 2019/12/12 11:11 19 | */ 20 | public class ForegroundAppUtil { 21 | private static final long END_TIME = System.currentTimeMillis(); 22 | private static final long TIME_INTERVAL = 7 * 24 * 60 * 60 * 1000L; 23 | private static final long START_TIME = END_TIME - TIME_INTERVAL; 24 | 25 | /** 26 | * 获取栈顶的应用包名 27 | */ 28 | public static String getForegroundActivityName(Context context) { 29 | String currentClassName = ""; 30 | if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { 31 | ActivityManager manager = (ActivityManager) context.getApplicationContext().getSystemService(Context.ACTIVITY_SERVICE); 32 | currentClassName = manager.getRunningTasks(1).get(0).topActivity.getPackageName(); 33 | } else if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP_MR1){ 34 | ActivityManager manager = (ActivityManager) context.getApplicationContext().getSystemService(Context.ACTIVITY_SERVICE); 35 | currentClassName = manager.getRunningAppProcesses().get(0).processName; 36 | } else { 37 | UsageStats initStat = getForegroundUsageStats(context, START_TIME, END_TIME); 38 | if (initStat != null) { 39 | currentClassName = initStat.getPackageName(); 40 | } 41 | } 42 | return currentClassName; 43 | } 44 | 45 | /** 46 | * 判断当前应用是否在前台 47 | */ 48 | public static boolean isForegroundApp(Context context) { 49 | return TextUtils.equals(getForegroundActivityName(context), context.getPackageName()); 50 | } 51 | 52 | /** 53 | * 获取时间段内, 54 | */ 55 | public static long getTotleForegroundTime(Context context) { 56 | UsageStats usageStats = getCurrentUsageStats(context, START_TIME, END_TIME); 57 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { 58 | return usageStats != null ? usageStats.getTotalTimeInForeground() : 0; 59 | } 60 | return 0; 61 | } 62 | 63 | /** 64 | * 获取记录前台应用的UsageStats对象 65 | */ 66 | private static UsageStats getForegroundUsageStats(Context context, long startTime, long endTime) { 67 | UsageStats usageStatsResult = null; 68 | if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { 69 | List usageStatses = getUsageStatsList(context, startTime, endTime); 70 | if (usageStatses == null || usageStatses.isEmpty()) return null; 71 | for (UsageStats usageStats : usageStatses) { 72 | if (usageStatsResult == null || usageStatsResult.getLastTimeUsed() < usageStats.getLastTimeUsed()) { 73 | usageStatsResult = usageStats; 74 | } 75 | } 76 | } 77 | return usageStatsResult; 78 | } 79 | 80 | /** 81 | * 获取记录当前应用的UsageStats对象 82 | */ 83 | public static UsageStats getCurrentUsageStats(Context context, long startTime, long endTime) { 84 | if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { 85 | List usageStatses = getUsageStatsList(context, startTime, endTime); 86 | if (usageStatses == null || usageStatses.isEmpty()) return null; 87 | for (UsageStats usageStats : usageStatses) { 88 | if (TextUtils.equals(usageStats.getPackageName(), context.getPackageName())) { 89 | return usageStats; 90 | } 91 | } 92 | } 93 | return null; 94 | } 95 | 96 | /** 97 | * 通过UsageStatsManager获取List集合 98 | */ 99 | public static List getUsageStatsList(Context context, long startTime, long endTime) { 100 | if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { 101 | UsageStatsManager manager = (UsageStatsManager) context.getApplicationContext().getSystemService(Context.USAGE_STATS_SERVICE); 102 | //UsageStatsManager.INTERVAL_WEEKLY,UsageStatsManager的参数定义了5个,具体查阅源码 103 | List usageStatses = manager.queryUsageStats(UsageStatsManager.INTERVAL_DAILY, startTime, endTime); 104 | if (usageStatses == null || usageStatses.size() == 0) {// 没有权限,获取不到数据 105 | Intent intent = new Intent(Settings.ACTION_USAGE_ACCESS_SETTINGS); 106 | intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 107 | context.getApplicationContext().startActivity(intent); 108 | return null; 109 | } 110 | return usageStatses; 111 | } 112 | return null; 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /app/src/main/java/com/easyandroid/ItemBean.java: -------------------------------------------------------------------------------- 1 | package com.easyandroid; 2 | 3 | import com.easytools.tools.CheckAdapter; 4 | 5 | /** 6 | * package: com.easyandroid.ItemBean 7 | * author: gyc 8 | * description: 9 | * time: create at 2017/1/8 15:38 10 | */ 11 | 12 | public class ItemBean implements CheckAdapter.CheckItem{ 13 | 14 | private String name; 15 | private String age; 16 | private boolean isChecked; 17 | 18 | public String getName() { 19 | return name; 20 | } 21 | 22 | public void setName(String name) { 23 | this.name = name; 24 | } 25 | 26 | public String getAge() { 27 | return age; 28 | } 29 | 30 | public void setAge(String age) { 31 | this.age = age; 32 | } 33 | 34 | @Override 35 | public boolean isChecked() { 36 | return isChecked; 37 | } 38 | 39 | @Override 40 | public void setChecked(boolean checked) { 41 | this.isChecked = checked; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /app/src/main/java/com/easyandroid/KeyBoardActivity.java: -------------------------------------------------------------------------------- 1 | package com.easyandroid; 2 | 3 | import android.app.Activity; 4 | import android.os.Bundle; 5 | import android.view.View; 6 | import android.widget.EditText; 7 | 8 | import androidx.annotation.Nullable; 9 | import androidx.appcompat.app.AppCompatActivity; 10 | 11 | /** 12 | * package: com.easyandroid.KeyBoardActivity 13 | * author: gyc 14 | * description: 15 | * time: create at 2018/10/10 11:43 16 | */ 17 | public class KeyBoardActivity extends AppCompatActivity { 18 | EditText edittext1; 19 | PopupKeyboardUtil smallKeyboardUtil; 20 | private View viewContainer; 21 | 22 | @Override 23 | protected void onCreate(@Nullable Bundle savedInstanceState) { 24 | super.onCreate(savedInstanceState); 25 | setContentView(R.layout.test_activity); 26 | 27 | edittext1 = findViewById(R.id.edittext1); 28 | 29 | smallKeyboardUtil = new PopupKeyboardUtil(self()); 30 | smallKeyboardUtil.attachTo(edittext1, false); 31 | } 32 | 33 | public void onClickView(View view) { 34 | if (view.getId() == R.id.btn1) 35 | smallKeyboardUtil.showSoftKeyboard(); 36 | if (view.getId() == R.id.btn2) 37 | smallKeyboardUtil.hideSoftKeyboard(); 38 | 39 | } 40 | 41 | private Activity self() { 42 | return this; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /app/src/main/java/com/easyandroid/MyAdapter.java: -------------------------------------------------------------------------------- 1 | package com.easyandroid; 2 | 3 | import android.content.Context; 4 | import android.view.LayoutInflater; 5 | import android.view.View; 6 | import android.view.ViewGroup; 7 | import android.widget.CheckBox; 8 | import android.widget.CompoundButton; 9 | import android.widget.TextView; 10 | 11 | import com.easytools.tools.CheckAdapter; 12 | 13 | import java.util.List; 14 | 15 | /** 16 | * package: com.easyandroid.MyAdapter 17 | * author: gyc 18 | * description: 19 | * time: create at 2017/1/8 15:39 20 | */ 21 | 22 | public class MyAdapter extends CheckAdapter{ 23 | 24 | private List items; 25 | private LayoutInflater inflater; 26 | 27 | public MyAdapter(Context context,List items) { 28 | super(items); 29 | inflater = LayoutInflater.from(context); 30 | this.items = items; 31 | } 32 | 33 | @Override 34 | public View getView(int position, View convertView, ViewGroup parent) { 35 | ViewHolder holder = null; 36 | if (convertView == null) { 37 | holder = new ViewHolder(); 38 | convertView = inflater.inflate(R.layout.item_check, parent, false); 39 | holder.checkBox = (CheckBox) convertView.findViewById(R.id.cb); 40 | holder.tvName = (TextView) convertView.findViewById(R.id.tv_name); 41 | holder.tvAge = (TextView) convertView.findViewById(R.id.tv_age); 42 | convertView.setTag(holder); 43 | } else { 44 | holder = (ViewHolder) convertView.getTag(); 45 | } 46 | holder.checkBox.setChecked(items.get(position).isChecked()); 47 | holder.tvName.setText(items.get(position).getName()); 48 | holder.tvAge.setText(items.get(position).getAge()); 49 | handleCompoundButton(holder.checkBox,items.get(position)); 50 | return convertView; 51 | } 52 | 53 | public class ViewHolder{ 54 | CheckBox checkBox; 55 | TextView tvName, tvAge; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /app/src/main/java/com/easyandroid/TestConstraintLayoutActivity.java: -------------------------------------------------------------------------------- 1 | package com.easyandroid; 2 | 3 | import android.os.Bundle; 4 | 5 | import androidx.annotation.Nullable; 6 | import androidx.appcompat.app.AppCompatActivity; 7 | 8 | /** 9 | * package: com.easyandroid.TestConstraintLayoutActivity 10 | * author: gyc 11 | * description: 12 | * time: create at 2020/11/6 15:00 13 | */ 14 | public class TestConstraintLayoutActivity extends AppCompatActivity { 15 | 16 | @Override 17 | protected void onCreate(@Nullable Bundle savedInstanceState) { 18 | super.onCreate(savedInstanceState); 19 | 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/src/main/java/com/easyandroid/TestJsActivity.java: -------------------------------------------------------------------------------- 1 | package com.easyandroid; 2 | 3 | import android.os.Bundle; 4 | import android.view.View; 5 | import android.webkit.WebSettings; 6 | import android.widget.TextView; 7 | 8 | import androidx.annotation.Nullable; 9 | import androidx.appcompat.app.AppCompatActivity; 10 | 11 | import com.easytools.tools.PathUtils; 12 | import com.github.lzyzsd.jsbridge.BridgeHandler; 13 | import com.github.lzyzsd.jsbridge.BridgeWebView; 14 | import com.github.lzyzsd.jsbridge.CallBackFunction; 15 | 16 | import java.io.BufferedWriter; 17 | import java.io.File; 18 | import java.io.FileWriter; 19 | import java.io.IOException; 20 | 21 | /** 22 | * package: com.easyandroid.TestJsActivity 23 | * author: gyc 24 | * description: 25 | * time: create at 2019/12/16 11:51 26 | */ 27 | public class TestJsActivity extends AppCompatActivity { 28 | 29 | TextView tvJs, tvShowmsg; 30 | BridgeWebView webview; 31 | 32 | FileWriter fw = null; 33 | BufferedWriter bw = null; 34 | 35 | @Override 36 | protected void onCreate(@Nullable Bundle savedInstanceState) { 37 | super.onCreate(savedInstanceState); 38 | setContentView(R.layout.activity_testjs); 39 | 40 | tvJs = (TextView) findViewById(R.id.tv_androidcalljs); 41 | tvShowmsg = (TextView) findViewById(R.id.tv_showmsg); 42 | 43 | webview = (BridgeWebView) findViewById(R.id.webview); 44 | WebSettings webSettings = webview.getSettings(); 45 | webSettings.setBuiltInZoomControls(true); 46 | webSettings.setSupportZoom(true); 47 | //与js交互必须设置 48 | webSettings.setJavaScriptEnabled(true); 49 | webview.loadUrl("file:///android_asset/html.html"); 50 | 51 | callJs(); 52 | registerInJs(); 53 | 54 | 55 | int type = 0; 56 | String logPath = PathUtils.getExternalStoragePath() + File.separator + "公文下载路径WIFI版.txt"; 57 | try { 58 | fw = new FileWriter(logPath, true); 59 | bw = new BufferedWriter(fw); 60 | 61 | for (int i = 0; i < 10; i++) { 62 | String url = ""; 63 | if (type == 0) {//批件 64 | url = "http://www.baidu.com" + i; 65 | } 66 | bw.write(url + "\n"); 67 | } 68 | } catch (IOException e) { 69 | } finally { 70 | try { 71 | bw.close(); 72 | fw.close(); 73 | } catch (IOException e) { 74 | e.printStackTrace(); 75 | } 76 | } 77 | 78 | } 79 | 80 | private void callJs() { 81 | tvJs.setOnClickListener(new View.OnClickListener() { 82 | @Override 83 | public void onClick(View v) { 84 | webview.callHandler("functionInJs", "Android传递给js的数据", new CallBackFunction() { 85 | @Override 86 | public void onCallBack(String data) { 87 | tvShowmsg.setText(data); 88 | } 89 | }); 90 | } 91 | }); 92 | } 93 | 94 | private void registerInJs() { 95 | webview.registerHandler("functionInAndroid", new BridgeHandler() { 96 | @Override 97 | public void handler(String data, CallBackFunction function) { 98 | tvShowmsg.setText("js调用了Android"); 99 | //返回给html 100 | function.onCallBack("Android回传给js的数据"); 101 | } 102 | }); 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /app/src/main/java/com/easyandroid/TestRunning.java: -------------------------------------------------------------------------------- 1 | package com.easyandroid; 2 | 3 | import android.content.pm.PackageInfo; 4 | import android.content.pm.PackageManager; 5 | import android.os.Bundle; 6 | import android.widget.TextView; 7 | 8 | import androidx.annotation.Nullable; 9 | import androidx.appcompat.app.AppCompatActivity; 10 | 11 | import com.jaredrummler.android.processes.AndroidProcesses; 12 | import com.jaredrummler.android.processes.models.AndroidAppProcess; 13 | import com.jaredrummler.android.processes.models.Stat; 14 | import com.jaredrummler.android.processes.models.Statm; 15 | 16 | import java.util.List; 17 | 18 | /** 19 | * package: com.easyandroid.TestRunning 20 | * author: gyc 21 | * description: 22 | * time: create at 2019/12/12 10:23 23 | */ 24 | public class TestRunning extends AppCompatActivity { 25 | 26 | @Override 27 | protected void onCreate(@Nullable Bundle savedInstanceState) { 28 | super.onCreate(savedInstanceState); 29 | setContentView(R.layout.activity_testrunning); 30 | 31 | TextView tv = findViewById(R.id.tv); 32 | 33 | StringBuilder sb = new StringBuilder(); 34 | 35 | List processes = AndroidProcesses.getRunningAppProcesses(); 36 | 37 | for (AndroidAppProcess process : processes) { 38 | // Get some information about the process 39 | String processName = process.name; 40 | 41 | try { 42 | Stat stat = process.stat(); 43 | int pid = stat.getPid(); 44 | int parentProcessId = stat.ppid(); 45 | long startTime = stat.stime(); 46 | int policy = stat.policy(); 47 | char state = stat.state(); 48 | 49 | Statm statm = process.statm(); 50 | long totalSizeOfProcess = statm.getSize(); 51 | long residentSetSize = statm.getResidentSetSize(); 52 | 53 | PackageManager pm = getPackageManager(); 54 | PackageInfo packageInfo = process.getPackageInfo(this, 0); 55 | String appName = packageInfo.applicationInfo.loadLabel(pm).toString(); 56 | 57 | sb.append("processName:" + processName + "," + "appName:" + appName + "\n"); 58 | 59 | } catch (Exception e) { 60 | } 61 | 62 | tv.setText(sb.toString()); 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /app/src/main/java/com/easyandroid/ToastUtils.java: -------------------------------------------------------------------------------- 1 | package com.easyandroid; 2 | 3 | import android.content.Context; 4 | import android.view.Gravity; 5 | import android.view.LayoutInflater; 6 | import android.view.View; 7 | import android.widget.TextView; 8 | import android.widget.Toast; 9 | 10 | /** 11 | * ToastUtils 12 | * 13 | * @author Trinea 2013-12-9 14 | */ 15 | public class ToastUtils { 16 | private static Toast toast = null; //Toast的对象! 17 | 18 | public static void showToast(Context context, String msg) { 19 | if (toast == null) { 20 | View toastview = LayoutInflater.from(context).inflate(R.layout.custom_toast, null); 21 | TextView text = toastview.findViewById(R.id.tv_content); 22 | text.setText(msg); 23 | toast = new Toast(context); 24 | toast.setGravity(Gravity.CENTER, 0, 0); 25 | toast.setDuration(Toast.LENGTH_SHORT); 26 | toast.setView(toastview); 27 | } else { 28 | View toastview = toast.getView(); 29 | TextView text = toastview.findViewById(R.id.tv_content); 30 | text.setText(msg); 31 | } 32 | if (toast.getView().isShown()) return; 33 | toast.show(); 34 | } 35 | 36 | 37 | public static void cancel() { 38 | if (toast != null) { 39 | toast.cancel(); 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /app/src/main/res/anim/down_to_up.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/anim/up_to_hide.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/abcd.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gycold/EasyAndroid/9cb415afabedaa80014e99bf2e98972b417223c6/app/src/main/res/drawable/abcd.gif -------------------------------------------------------------------------------- /app/src/main/res/drawable/bitmap.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/blue_s.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gycold/EasyAndroid/9cb415afabedaa80014e99bf2e98972b417223c6/app/src/main/res/drawable/blue_s.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/custom_shape_toast.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/keyboard_delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gycold/EasyAndroid/9cb415afabedaa80014e99bf2e98972b417223c6/app/src/main/res/drawable/keyboard_delete.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/keyboard_key.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/keyboard_shift.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gycold/EasyAndroid/9cb415afabedaa80014e99bf2e98972b417223c6/app/src/main/res/drawable/keyboard_shift.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/transparency_n.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gycold/EasyAndroid/9cb415afabedaa80014e99bf2e98972b417223c6/app/src/main/res/drawable/transparency_n.9.png -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 14 | 15 | 19 | 20 | 24 | 25 | 29 | 30 | 34 | 35 | 39 | 40 | 44 | 45 |