first commit 1.1(2)
18
.gitignore
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
*.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
|
||||
.idea/
|
||||
.safedk/
|
||||
app/debug/
|
||||
1
app/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
/build
|
||||
178
app/build.gradle.kts
Normal file
@ -0,0 +1,178 @@
|
||||
|
||||
import java.util.Date
|
||||
import java.text.SimpleDateFormat
|
||||
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("org.jetbrains.kotlin.android")
|
||||
kotlin("kapt")
|
||||
id ("kotlin-android")
|
||||
id("com.google.gms.google-services")
|
||||
id("com.google.firebase.crashlytics")
|
||||
}
|
||||
|
||||
val timestamp = SimpleDateFormat("MM_dd_HH_mm").format(Date())
|
||||
android {
|
||||
namespace = "com.app.input.inputaura"
|
||||
compileSdk = 36
|
||||
defaultConfig {
|
||||
applicationId = "com.app.input.inputaura"
|
||||
minSdk = 24
|
||||
targetSdk = 36
|
||||
versionCode = 2
|
||||
versionName = "1.1"
|
||||
setProperty(
|
||||
"archivesBaseName",
|
||||
"InputAura_V" + versionName + "(${versionCode})_$timestamp"
|
||||
)
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
isMinifyEnabled = true
|
||||
proguardFiles(
|
||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||
"proguard-rules.pro"
|
||||
)
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = "17"
|
||||
}
|
||||
buildFeatures {
|
||||
buildConfig = true
|
||||
viewBinding = true
|
||||
dataBinding = true
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
implementation("androidx.core:core-ktx:1.15.0")
|
||||
implementation("androidx.appcompat:appcompat:1.7.1")
|
||||
implementation("com.google.android.material:material:1.13.0")
|
||||
implementation("androidx.constraintlayout:constraintlayout:2.2.1")
|
||||
implementation("androidx.activity:activity:1.12.1")
|
||||
testImplementation("junit:junit:4.13.2")
|
||||
androidTestImplementation("androidx.test.ext:junit:1.3.0")
|
||||
androidTestImplementation("androidx.test.espresso:espresso-core:3.7.0")
|
||||
|
||||
|
||||
implementation("com.squareup.okhttp3:okhttp:5.3.2")
|
||||
implementation("com.github.bumptech.glide:glide:5.0.5")
|
||||
implementation ("jp.wasabeef:glide-transformations:4.3.0")
|
||||
//Glide支持webp动图的库
|
||||
implementation("com.github.zjupure:webpdecoder:2.7.4.16.0")
|
||||
implementation("com.github.omicronapps:7-Zip-JBinding-4Android:Release-16.02-2.03")
|
||||
|
||||
val room_version = "2.8.4"
|
||||
implementation ("androidx.room:room-runtime:$room_version")
|
||||
kapt("androidx.room:room-compiler:$room_version")
|
||||
implementation ("androidx.room:room-ktx:$room_version")
|
||||
implementation ("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2")
|
||||
implementation ("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2")
|
||||
|
||||
implementation("com.google.android.material:material:1.8.0")
|
||||
|
||||
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.2")
|
||||
implementation("com.google.android.gms:play-services-ads-identifier:18.0.1")
|
||||
implementation("com.google.android.gms:play-services-location:21.0.1")
|
||||
implementation("com.google.android.gms:play-services-appset:16.0.1")
|
||||
// Import the Firebase BoM
|
||||
implementation(platform("com.google.firebase:firebase-bom:34.6.0"))
|
||||
implementation("com.google.firebase:firebase-crashlytics-ndk")
|
||||
implementation("com.google.firebase:firebase-analytics")
|
||||
// okhttp
|
||||
implementation("com.squareup.okhttp3:okhttp:4.12.0")
|
||||
implementation("com.squareup.okhttp3:logging-interceptor:4.12.0")
|
||||
|
||||
implementation(files("libs/UpLoadLibrary_12_03_15_13-release.aar"))
|
||||
implementation(files("libs/TopOnLibrary_11_06_18_02-release.aar"))
|
||||
|
||||
//-----------------------------------------------TopOn(Mintegral、Pangle、UnitAds、Digital Turbine(Fyber)、Chartboost&Helium、Ironsource、Liftoff(Vungle)、Inmobi、Start.io、Bigo)
|
||||
//TU (Necessary)
|
||||
implementation("com.thinkup.sdk:core-tpn:6.5.36")
|
||||
implementation("com.thinkup.sdk:nativead-tpn:6.5.36")
|
||||
implementation("com.thinkup.sdk:banner-tpn:6.5.36")
|
||||
implementation("com.thinkup.sdk:interstitial-tpn:6.5.36")
|
||||
implementation("com.thinkup.sdk:rewardedvideo-tpn:6.5.36")
|
||||
implementation("com.thinkup.sdk:splash-tpn:6.5.36")
|
||||
|
||||
//Androidx (Necessary)
|
||||
implementation("androidx.appcompat:appcompat:1.6.1")
|
||||
implementation("androidx.browser:browser:1.4.0")
|
||||
|
||||
//StartApp
|
||||
implementation("com.thinkup.sdk:adapter-tpn-startapp:6.5.36")
|
||||
implementation("com.startapp:inapp-sdk:5.2.4")
|
||||
|
||||
//Vungle
|
||||
implementation("com.thinkup.sdk:adapter-tpn-vungle:6.5.36")
|
||||
implementation("com.vungle:vungle-ads:7.5.0")
|
||||
implementation("com.google.android.gms:play-services-basement:18.1.0")
|
||||
implementation("com.google.android.gms:play-services-ads-identifier:18.0.1")
|
||||
|
||||
//UnityAds
|
||||
implementation("com.thinkup.sdk:adapter-tpn-unityads:6.5.36")
|
||||
implementation("com.unity3d.ads:unity-ads:4.16.1")
|
||||
|
||||
//Ironsource
|
||||
implementation("com.thinkup.sdk:adapter-tpn-ironsource:6.5.36")
|
||||
implementation("com.ironsource.sdk:mediationsdk:8.10.0")
|
||||
implementation("com.google.android.gms:play-services-appset:16.0.2")
|
||||
implementation("com.google.android.gms:play-services-ads-identifier:18.0.1")
|
||||
implementation("com.google.android.gms:play-services-basement:18.1.0")
|
||||
|
||||
//Bigo
|
||||
implementation("com.thinkup.sdk:adapter-tpn-bigo:6.5.36")
|
||||
implementation("com.bigossp:bigo-ads:5.5.1")
|
||||
|
||||
//Pangle
|
||||
implementation("com.thinkup.sdk:adapter-tpn-pangle:6.5.36")
|
||||
implementation("com.pangle.global:pag-sdk:7.6.0.2")
|
||||
implementation("com.google.android.gms:play-services-ads-identifier:18.2.0")
|
||||
|
||||
//Inmobi
|
||||
implementation("com.thinkup.sdk:adapter-tpn-inmobi:6.5.36")
|
||||
implementation("com.inmobi.monetization:inmobi-ads-kotlin:10.8.7")
|
||||
|
||||
//TU Adx SDK(Necessary)
|
||||
implementation("com.thinkup.sdk:adapter-tpn-sdm:6.5.36.4")
|
||||
implementation("com.smartdigimkttech.sdk:smartdigimkttech-sdk:6.5.40")
|
||||
|
||||
//Mintegral
|
||||
implementation("com.thinkup.sdk:adapter-tpn-mintegral:6.5.36")
|
||||
implementation("com.mbridge.msdk.oversea:mbridge_android_sdk:16.9.91")
|
||||
implementation("androidx.recyclerview:recyclerview:1.1.0")
|
||||
|
||||
//Chartboost
|
||||
implementation("com.thinkup.sdk:adapter-tpn-chartboost:6.5.36")
|
||||
implementation("com.chartboost:chartboost-sdk:9.8.3")
|
||||
implementation("com.chartboost:chartboost-mediation-sdk:4.9.2")
|
||||
implementation("com.chartboost:chartboost-mediation-adapter-chartboost:4.9.8.1.0")
|
||||
implementation("com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter:1.0.0")
|
||||
implementation("com.squareup.okhttp3:logging-interceptor:4.10.0")
|
||||
implementation("com.squareup.okhttp3:okhttp:4.10.0")
|
||||
implementation("com.squareup.retrofit2:converter-scalars:2.9.0")
|
||||
implementation("com.squareup.retrofit2:retrofit:2.9.0")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.1")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.1")
|
||||
|
||||
//Fyber
|
||||
implementation("com.thinkup.sdk:adapter-tpn-fyber:6.5.36")
|
||||
implementation("com.fyber:marketplace-sdk:8.3.7")
|
||||
implementation("com.google.android.gms:play-services-ads-identifier:18.0.1")
|
||||
|
||||
//Tramini
|
||||
implementation("com.thinkup.sdk:tramini-plugin-tpn:6.5.36")
|
||||
// Debugger UI Tools
|
||||
implementation("com.thinkup.sdk:debugger-ui:1.1.2")
|
||||
}
|
||||
29
app/google-services.json
Normal file
@ -0,0 +1,29 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "506545201018",
|
||||
"project_id": "inputaura",
|
||||
"storage_bucket": "inputaura.firebasestorage.app"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:506545201018:android:c0a605cb5532b180d400c3",
|
||||
"android_client_info": {
|
||||
"package_name": "com.app.input.inputaura"
|
||||
}
|
||||
},
|
||||
"oauth_client": [],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyBsNL7TMIWZ9FLc6Bk6ysF95lT9MTTM0aA"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": []
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
||||
BIN
app/inputaura.jks
Normal file
6
app/keystore.properties
Normal file
@ -0,0 +1,6 @@
|
||||
app_name=InputAura
|
||||
package_name=com.app.input.inputaura
|
||||
keystoreFile=app/inputaura.jks
|
||||
key_alias=key0
|
||||
key_store_password=121212
|
||||
key_password=121212
|
||||
BIN
app/libs/TopOnLibrary_11_06_18_02-release.aar
Normal file
BIN
app/libs/UpLoadLibrary_12_03_15_13-release.aar
Normal file
173
app/proguard-rules.pro
vendored
Normal file
@ -0,0 +1,173 @@
|
||||
# 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 的核心类不被混淆
|
||||
-keep class androidx.room.** { *; }
|
||||
-keep class androidx.sqlite.db.** { *; }
|
||||
|
||||
# 保持 Room 数据库类的基本结构
|
||||
-keep class * extends androidx.room.RoomDatabase { *; }
|
||||
|
||||
# 保持 Room DAO 接口
|
||||
-keep @androidx.room.Dao interface * { *; }
|
||||
-keep @androidx.room.Dao class * { *; }
|
||||
|
||||
# 保持 Room 实体类
|
||||
-keep @androidx.room.Entity class * { *; }
|
||||
|
||||
# 保持 Room 的注解类
|
||||
-keep @androidx.room.Database class * { *; }
|
||||
|
||||
|
||||
|
||||
-keep class com.omicronapplications.** { *; }
|
||||
-keep class net.sf.sevenzipjbinding.** { *; }
|
||||
|
||||
|
||||
-keep class com.startapp.** {
|
||||
*;
|
||||
}
|
||||
|
||||
-keep class com.truenet.** {
|
||||
*;
|
||||
}
|
||||
|
||||
-keepattributes Exceptions, InnerClasses, Signature, Deprecated, SourceFile,
|
||||
LineNumberTable, *Annotation*, EnclosingMethod
|
||||
-dontwarn android.webkit.JavascriptInterface
|
||||
-dontwarn com.startapp.**
|
||||
|
||||
-dontwarn org.jetbrains.annotations.**
|
||||
# Vungle
|
||||
-dontwarn com.vungle.ads.**
|
||||
-keepclassmembers class com.vungle.ads.** {
|
||||
*;
|
||||
}
|
||||
-keep class com.vungle.ads.**
|
||||
|
||||
|
||||
|
||||
# Google
|
||||
-keep class com.google.android.gms.** { *; }
|
||||
-dontwarn com.google.android.gms.**
|
||||
|
||||
|
||||
|
||||
|
||||
# START OkHttp + Okio
|
||||
# JSR 305 annotations are for embedding nullability information.
|
||||
-dontwarn javax.annotation.**
|
||||
|
||||
|
||||
# A resource is loaded with a relative path so the package of this class must be preserved.
|
||||
-adaptresourcefilenames okhttp3/internal/publicsuffix/PublicSuffixDatabase.gz
|
||||
|
||||
|
||||
# Animal Sniffer compileOnly dependency to ensure APIs are compatible with older versions of Java.
|
||||
-dontwarn org.codehaus.mojo.animal_sniffer.*
|
||||
|
||||
|
||||
# OkHttp platform used only on JVM and when Conscrypt and other security providers are available.
|
||||
-dontwarn okhttp3.internal.platform.**
|
||||
-dontwarn org.conscrypt.**
|
||||
-dontwarn org.bouncycastle.**
|
||||
-dontwarn org.openjsse.**
|
||||
|
||||
|
||||
# Animal Sniffer compileOnly dependency to ensure APIs are compatible with older versions of Java.
|
||||
-dontwarn org.codehaus.mojo.animal_sniffer.*
|
||||
|
||||
|
||||
# END OkHttp + Okio
|
||||
|
||||
|
||||
# START Protobuf
|
||||
-dontwarn com.google.protobuf.**
|
||||
-keepclassmembers class com.google.protobuf.** {
|
||||
*;
|
||||
}
|
||||
-keep class * extends com.google.protobuf.GeneratedMessageLite { *; }
|
||||
|
||||
|
||||
# END Protobuf
|
||||
-keepclassmembers class com.ironsource.sdk.controller.IronSourceWebView$JSInterface {
|
||||
public *;
|
||||
}
|
||||
-keepclassmembers class * implements android.os.Parcelable {
|
||||
public static final android.os.Parcelable$Creator *;
|
||||
}
|
||||
-keep public class com.google.android.gms.ads.** {
|
||||
public *;
|
||||
}
|
||||
-keep class com.ironsource.adapters.** { *;
|
||||
}
|
||||
-dontwarn com.ironsource.mediationsdk.**
|
||||
-dontwarn com.ironsource.adapters.**
|
||||
-keepattributes JavascriptInterface
|
||||
-keepclassmembers class * {
|
||||
@android.webkit.JavascriptInterface <methods>;
|
||||
}
|
||||
-keep class com.bytedance.sdk.** { *; }
|
||||
-keep class com.inmobi.** { *; }
|
||||
-keep public class com.google.android.gms.**
|
||||
-dontwarn com.google.android.gms.**
|
||||
-dontwarn com.squareup.picasso.**
|
||||
-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient{
|
||||
public *;
|
||||
}
|
||||
-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient$Info{
|
||||
public *;
|
||||
}
|
||||
# skip the Picasso library classes
|
||||
-keep class com.squareup.picasso.** {*;}
|
||||
-dontwarn com.squareup.okhttp.**
|
||||
# skip Moat classes
|
||||
-keep class com.moat.** {*;}
|
||||
-dontwarn com.moat.**
|
||||
# skip IAB classes
|
||||
-keep class com.iab.** {*;}
|
||||
-dontwarn com.iab.**
|
||||
-keepattributes Signature
|
||||
-keepattributes *Annotation*
|
||||
-keep class com.mbridge.** {*; }
|
||||
-keep interface com.mbridge.** {*; }
|
||||
-dontwarn com.mbridge.**
|
||||
-keepclassmembers class **.R$* { public static final int mbridge*; }
|
||||
|
||||
-keep public class com.mbridge.* extends androidx.** { *; }
|
||||
-keep public class androidx.viewpager.widget.PagerAdapter{*;}
|
||||
-keep public class androidx.viewpager.widget.ViewPager.OnPageChangeListener{*;}
|
||||
-keep interface androidx.annotation.IntDef{*;}
|
||||
-keep interface androidx.annotation.Nullable{*;}
|
||||
-keep interface androidx.annotation.CheckResult{*;}
|
||||
-keep interface androidx.annotation.NonNull{*;}
|
||||
-keep public class androidx.fragment.app.Fragment{*;}
|
||||
-keep public class androidx.core.content.FileProvider{*;}
|
||||
-keep public class androidx.core.app.NotificationCompat{*;}
|
||||
-keep public class androidx.appcompat.widget.AppCompatImageView {*;}
|
||||
-keep public class androidx.recyclerview.*{*;}
|
||||
-keep class com.mbridge.msdk.foundation.tools.FastKV{*;}
|
||||
-keep class com.mbridge.msdk.foundation.tools.FastKV$Builder{*;}
|
||||
-keep class com.chartboost.** { *; }
|
||||
|
||||
|
||||
@ -0,0 +1,25 @@
|
||||
package com.keyboard.skinning.cool
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
|
||||
import org.junit.Assert.*
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* See [testing documentation](http://d.android.com/tools/testing).
|
||||
*/
|
||||
@RunWith(AndroidJUnit4::class)
|
||||
class ExampleInstrumentedTest {
|
||||
@Test
|
||||
fun useAppContext() {
|
||||
// Context of the app under test.
|
||||
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
|
||||
assertEquals("com.ba.ali.apps.keyboard", appContext.packageName)
|
||||
|
||||
}
|
||||
}
|
||||
71
app/src/main/AndroidManifest.xml
Normal file
@ -0,0 +1,71 @@
|
||||
<?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.INTERNET" />
|
||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.AD_ID" />
|
||||
<application
|
||||
android:name="com.app.input.inputaura.InputAura"
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher_foreground"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_foreground"
|
||||
android:networkSecurityConfig="@xml/net"
|
||||
tools:replace="networkSecurityConfig"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/MyKeyBoard"
|
||||
tools:targetApi="31">
|
||||
<uses-library android:name="org.apache.http.legacy" android:required="false"/>
|
||||
<!--start.io-->
|
||||
<meta-data
|
||||
android:name="com.startapp.sdk.SPLASH_ENABLED"
|
||||
android:value="false" />
|
||||
|
||||
<!--start.io-->
|
||||
<meta-data
|
||||
android:name="com.startapp.sdk.RETURN_ADS_ENABLED"
|
||||
android:value="false" />
|
||||
<activity
|
||||
android:name="com.app.input.inputaura.lmyfvfs.YhkFgv"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name="com.app.input.inputaura.lmyfvfs.HinDng"
|
||||
android:exported="true"
|
||||
android:screenOrientation="portrait">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name="com.app.input.inputaura.lmyfvfs.ViyVyg"
|
||||
android:exported="false"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.app.input.inputaura.lmyfvfs.HfyTbg"
|
||||
android:exported="false"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.app.input.inputaura.lmyfvfs.HiyFg"
|
||||
android:exported="true"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<service
|
||||
android:name="com.app.input.inputaura.nggfsdfds.PyvTbu"
|
||||
android:exported="true"
|
||||
android:permission="android.permission.BIND_INPUT_METHOD">
|
||||
<intent-filter>
|
||||
<action android:name="android.view.InputMethod" />
|
||||
</intent-filter>
|
||||
|
||||
<meta-data
|
||||
android:name="android.view.im"
|
||||
android:resource="@xml/keyborad_xml" />
|
||||
</service>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
BIN
app/src/main/assets/my_font.ttf
Normal file
21607
app/src/main/assets/res.json
Normal file
BIN
app/src/main/ic_launcher-playstore.png
Normal file
|
After Width: | Height: | Size: 553 KiB |
129
app/src/main/java/com/app/input/inputaura/InputAura.kt
Normal file
@ -0,0 +1,129 @@
|
||||
package com.app.input.inputaura
|
||||
|
||||
import android.app.Application
|
||||
import android.graphics.Typeface
|
||||
import com.ad.toponlibrary.AdManager
|
||||
import com.app.input.inputaura.dasda.Shikamaru
|
||||
import com.app.input.inputaura.dasda.Inhj
|
||||
import com.up.uploadlibrary.UpLoadManager
|
||||
//import com.pretty.keyboard.theme.keyboard.helper.ObjectBox
|
||||
import org.json.JSONArray
|
||||
import java.io.BufferedReader
|
||||
import java.io.IOException
|
||||
import java.io.InputStream
|
||||
import java.io.InputStreamReader
|
||||
import java.io.StringWriter
|
||||
|
||||
class InputAura : Application() {
|
||||
companion object {
|
||||
lateinit var inputAuraInstance: InputAura
|
||||
|
||||
lateinit var list: MutableList<Inhj>
|
||||
|
||||
const val TAG = "-----------------"
|
||||
var defaultFont: Typeface? = null
|
||||
const val DB_VERSION = 2
|
||||
const val DB_NAME = "db_name"
|
||||
}
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
inputAuraInstance = this
|
||||
defaultFont = Typeface.createFromAsset(assets, "my_font.ttf")
|
||||
dealFile()
|
||||
|
||||
UpLoadManager.init(this,"ocean") { _, _ -> }
|
||||
AdManager.init("ocean",this,"h69646a7448f89","ae3a442492a7590301acbf6889dee47d4",
|
||||
"25e138876a3743aa9037e82dff40dcb657df7a6d",
|
||||
"n69646a9f39616",
|
||||
"n69646a9eeaebc",
|
||||
"n69646a9eb74b9",false)
|
||||
}
|
||||
private fun dealFile() {
|
||||
val openFile = inputAuraInstance.assets.open("res.json")
|
||||
val jsonString = getJsonString(openFile)
|
||||
if (jsonString != null) {
|
||||
resolveJsonString(jsonString)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private fun resolveJsonString(string: String) {
|
||||
val jsonData = JSONArray(string)
|
||||
var dataList: MutableList<Inhj> = mutableListOf()
|
||||
for (i in 0 until jsonData.length()) {
|
||||
jsonData.getJSONObject(i).run {
|
||||
val pName = getString("parent_name")
|
||||
val listArray = getJSONArray("keyboard_list")
|
||||
var shikamaruList: MutableList<Shikamaru> = mutableListOf()
|
||||
for (listIndex in 0 until listArray.length()) {
|
||||
listArray.getJSONObject(listIndex).also {
|
||||
val title = it.getString("title")
|
||||
val thUrl = it.getString("thumbUrl")
|
||||
val thGif = it.getString("thumbUrlGif")
|
||||
var zipPath = ""
|
||||
var imgPath = ""
|
||||
var imgGif = ""
|
||||
var imgPreviewGif = ""
|
||||
if (it.has("detail")) {
|
||||
val contentObject =
|
||||
it.getJSONObject("detail").getJSONObject("themeContent")
|
||||
zipPath = contentObject.getString("androidRawZipUrl")
|
||||
imgPath = contentObject.getString("img")
|
||||
imgGif = contentObject.getString("imgGif")
|
||||
imgPreviewGif = contentObject.getString("imgPreviewGif")
|
||||
} else {
|
||||
|
||||
}
|
||||
shikamaruList.add(
|
||||
Shikamaru().apply {
|
||||
setImgPath(imgPath)
|
||||
setZipPath(zipPath)
|
||||
setTitleName(title)
|
||||
setImgGif(imgGif)
|
||||
thumbUrl = thUrl
|
||||
thumbGif = thGif
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
val shuffled = shikamaruList.shuffled()
|
||||
val dataInhj = Inhj()
|
||||
.apply {
|
||||
parentName = pName
|
||||
keyboardList = shuffled
|
||||
}
|
||||
dataList.add(dataInhj)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
updateDataList(dataList)
|
||||
|
||||
}
|
||||
|
||||
private fun updateDataList(mainList: MutableList<Inhj>) {
|
||||
list = mainList
|
||||
|
||||
}
|
||||
private fun getJsonString(fileInputStream: InputStream): String? {
|
||||
return try {
|
||||
// FileInputStream fileInputStream = new FileInputStream(path);
|
||||
val charArray = CharArray(fileInputStream.available())
|
||||
var readCount = 0
|
||||
val streamReader = InputStreamReader(fileInputStream)
|
||||
val bufferedReader = BufferedReader(streamReader)
|
||||
val stringWriter = StringWriter()
|
||||
while (bufferedReader.read(charArray).also { readCount = it } != -1) {
|
||||
stringWriter.write(charArray, 0, readCount)
|
||||
}
|
||||
stringWriter.toString()
|
||||
} catch (e: IOException) {
|
||||
""
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
8
app/src/main/java/com/app/input/inputaura/bgtng/OnuIg.kt
Normal file
@ -0,0 +1,8 @@
|
||||
package com.app.input.inputaura.bgtng
|
||||
|
||||
import com.app.input.inputaura.dasda.Shikamaru
|
||||
|
||||
interface OnuIg {
|
||||
|
||||
fun OnRemoveLike(data: Shikamaru)
|
||||
}
|
||||
8
app/src/main/java/com/app/input/inputaura/bgtng/PunTu.kt
Normal file
@ -0,0 +1,8 @@
|
||||
package com.app.input.inputaura.bgtng
|
||||
|
||||
import java.io.File
|
||||
|
||||
interface PunTu {
|
||||
|
||||
fun OnApplySkinListener(fileList: List<File?>?)
|
||||
}
|
||||
@ -0,0 +1,6 @@
|
||||
package com.app.input.inputaura.bgtng
|
||||
|
||||
interface TngOui {
|
||||
|
||||
fun OnClickSeeAll(name: String)
|
||||
}
|
||||
6
app/src/main/java/com/app/input/inputaura/bgtng/UngIn.kt
Normal file
@ -0,0 +1,6 @@
|
||||
package com.app.input.inputaura.bgtng
|
||||
|
||||
interface UngIn {
|
||||
|
||||
fun OnItemClickListener( )
|
||||
}
|
||||
27
app/src/main/java/com/app/input/inputaura/dasda/Inhj.java
Normal file
@ -0,0 +1,27 @@
|
||||
package com.app.input.inputaura.dasda;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class Inhj {
|
||||
private String parentName;
|
||||
|
||||
private List<Shikamaru> keyboardList;
|
||||
|
||||
public String getParentName() {
|
||||
|
||||
return parentName;
|
||||
}
|
||||
|
||||
public List<Shikamaru> getKeyboardList() {
|
||||
|
||||
return keyboardList;
|
||||
}
|
||||
|
||||
public void setParentName(String name) {
|
||||
this.parentName = name;
|
||||
}
|
||||
|
||||
public void setKeyboardList(List<Shikamaru> keyboardList) {
|
||||
this.keyboardList = keyboardList;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,87 @@
|
||||
package com.app.input.inputaura.dasda;
|
||||
|
||||
import androidx.room.Entity;
|
||||
import androidx.room.PrimaryKey;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Entity
|
||||
public class Shikamaru implements Serializable {
|
||||
|
||||
@PrimaryKey(autoGenerate = true)
|
||||
private long id;
|
||||
private String titleName;
|
||||
|
||||
private String thumbUrl;
|
||||
|
||||
private String thumbGif;
|
||||
|
||||
private String zipPath;
|
||||
|
||||
private String imgPath;
|
||||
private String imgGif;
|
||||
|
||||
|
||||
|
||||
public void setImgGif(String imgGif) {
|
||||
this.imgGif = imgGif;
|
||||
}
|
||||
|
||||
public String getTitleName() {
|
||||
|
||||
return titleName;
|
||||
}
|
||||
|
||||
public String getThumbUrl() {
|
||||
|
||||
return thumbUrl;
|
||||
}
|
||||
|
||||
public String getThumbGif() {
|
||||
|
||||
return thumbGif;
|
||||
}
|
||||
|
||||
public String getZipPath() {
|
||||
|
||||
return zipPath;
|
||||
}
|
||||
|
||||
public String getImgPath() {
|
||||
|
||||
return imgPath;
|
||||
}
|
||||
|
||||
public void setTitleName(String name) {
|
||||
this.titleName = name;
|
||||
}
|
||||
|
||||
public void setThumbUrl(String thumbUrl) {
|
||||
this.thumbUrl = thumbUrl;
|
||||
}
|
||||
|
||||
public void setThumbGif(String thumbGif) {
|
||||
this.thumbGif = thumbGif;
|
||||
}
|
||||
|
||||
public void setZipPath(String path) {
|
||||
this.zipPath = path;
|
||||
}
|
||||
|
||||
public void setImgPath(String imgPath) {
|
||||
this.imgPath = imgPath;
|
||||
}
|
||||
|
||||
public String getImgGif() {
|
||||
return imgGif;
|
||||
}
|
||||
|
||||
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
||||
106
app/src/main/java/com/app/input/inputaura/kfsdfbsd/EbgYih.java
Normal file
@ -0,0 +1,106 @@
|
||||
package com.app.input.inputaura.kfsdfbsd;
|
||||
|
||||
import com.app.input.inputaura.nggfsdfds.UnyOin;
|
||||
import com.app.input.inputaura.nggfsdfds.PinRuh;
|
||||
import com.app.input.inputaura.nggfsdfds.GobYiu;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class EbgYih {
|
||||
|
||||
public static PinRuh initConfig(String path) {
|
||||
String filePath = "keyboard.conf"; // 文件路径
|
||||
PinRuh config = parseConfig(path);
|
||||
return config;
|
||||
}
|
||||
|
||||
public static PinRuh parseConfig(String filePath) {
|
||||
// InputStream open = App.appInstance.getAssets().open(filePath);
|
||||
PinRuh config = new PinRuh();
|
||||
try (BufferedReader br = new BufferedReader(new FileReader(filePath))) {
|
||||
String line;
|
||||
GobYiu currentLayout = null;
|
||||
while ((line = br.readLine()) != null) {
|
||||
line = line.trim();
|
||||
if (line.isEmpty()) {
|
||||
continue; // 跳过空行
|
||||
}
|
||||
if (line.startsWith("Version:")) {
|
||||
config.setVersion(line.split(":")[1].trim());
|
||||
} else if (line.startsWith("SupportLayouts:")) {
|
||||
config.setSupportLayouts(line.split(":")[1].trim());
|
||||
} else if (line.startsWith("HideHint:")) {
|
||||
config.setHideHint(Integer.parseInt(line.split(":")[1].trim()));
|
||||
} else if (line.startsWith("LayoutStyle:")) {
|
||||
config.setLayoutStyle(line.split(":")[1].trim());
|
||||
} else if (line.equals("KeyDefault") || line.equals("KeyMarkDefault") || line.equals("KeyFuncDefault")) {
|
||||
LinkedHashMap<String, String> maps = config.getMaps();
|
||||
maps.put(line, "");
|
||||
} else if (line.contains(":") && currentLayout == null) {
|
||||
String[] parts = line.split(":");
|
||||
String keyName = parts[0].trim();
|
||||
String keyValue = parts[1].trim();
|
||||
|
||||
String latestKey = null;
|
||||
LinkedHashMap<String, String> maps = config.getMaps();
|
||||
for (Map.Entry<String, String> entry : maps.entrySet()) {
|
||||
latestKey = entry.getKey();
|
||||
}
|
||||
if (latestKey != null) {
|
||||
maps.put(latestKey, keyValue);
|
||||
}
|
||||
} else if (line.startsWith("Row")) {
|
||||
currentLayout = new GobYiu(line.split(":")[0].trim());
|
||||
config.addLayout(currentLayout);
|
||||
} else if (currentLayout != null) {
|
||||
if (line.equals("Key")) {
|
||||
String[] parts = line.split(":");
|
||||
String keyName = parts[0].trim();
|
||||
UnyOin unyOin = new UnyOin(keyName);
|
||||
currentLayout.addKey(unyOin);
|
||||
} else if (line.contains(":") && currentLayout.getLastKey().getBackground() == null) {
|
||||
// 解析按键的其他属性(如 Label)
|
||||
String[] parts = line.split(":");
|
||||
String keyName = parts[0].trim();
|
||||
String keyValue = parts[1].trim();
|
||||
UnyOin unyOin = currentLayout.getLastKey();
|
||||
if (keyName.equals("Label")) {
|
||||
unyOin.setLabel(keyValue);
|
||||
}
|
||||
if (keyName.equals("Background")) {
|
||||
unyOin.setBackground(keyValue);
|
||||
}
|
||||
} else {
|
||||
if (line.equals("KeyShift") || line.equals("KeyDelete") || line.equals("KeyAlphaSymbol") || line.equals("KeyEmoji")
|
||||
|| line.equals("KeyMark")
|
||||
|| line.equals("KeySpace")
|
||||
|| line.equals("KeyEnter")) {
|
||||
UnyOin funcationUnyOin = new UnyOin(line);
|
||||
config.addKey(funcationUnyOin);
|
||||
} else if (line.contains(":")) {
|
||||
String[] parts = line.split(":");
|
||||
String keyName = parts[0].trim();
|
||||
String keyValue = parts[1].trim();
|
||||
UnyOin lastUnyOin = config.getLastKeyList();
|
||||
if (keyName.equals("Label")) {
|
||||
lastUnyOin.setLabel(keyValue);
|
||||
}
|
||||
if (keyName.equals("Background")) {
|
||||
lastUnyOin.setBackground(keyValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return config;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
181
app/src/main/java/com/app/input/inputaura/kfsdfbsd/FjgvUv.kt
Normal file
@ -0,0 +1,181 @@
|
||||
package com.app.input.inputaura.kfsdfbsd
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.BitmapFactory
|
||||
import android.graphics.Color
|
||||
import android.graphics.drawable.BitmapDrawable
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.graphics.drawable.StateListDrawable
|
||||
import android.util.Xml
|
||||
import androidx.core.content.ContextCompat
|
||||
import com.app.input.inputaura.InputAura
|
||||
import com.app.input.inputaura.nggfsdfds.PinRuh
|
||||
import com.app.input.inputaura.R
|
||||
import org.xmlpull.v1.XmlPullParser
|
||||
import java.io.File
|
||||
import java.io.StringReader
|
||||
import kotlin.collections.iterator
|
||||
|
||||
class FjgvUv(var context: Context) {
|
||||
|
||||
|
||||
private var textSize = 13f
|
||||
|
||||
var functionDraw: Drawable =
|
||||
getDefaultDrawList(R.drawable.gjghjgj, R.drawable.minhjv)
|
||||
var generalDraw: Drawable =
|
||||
getDefaultDrawList(R.drawable.gjghjgj, R.drawable.minhjv)
|
||||
|
||||
var toDraw: Drawable = getDefaultDrawList(R.drawable.gjghjgj, R.drawable.minhjv)
|
||||
var spaceDraw: Drawable = getDefaultDrawList(R.drawable.gjghjgj, R.drawable.minhjv)
|
||||
|
||||
var switchDraw: Drawable? = null
|
||||
var deleteDraw: Drawable? = null
|
||||
var backDraw: Drawable? = null
|
||||
var searchDraw: Drawable? = null
|
||||
|
||||
var shiftDraw: Drawable? = null
|
||||
var shiftLockDraw: Drawable? = null
|
||||
|
||||
var keyTextColor: Int = ContextCompat.getColor(context, R.color.black)
|
||||
var keyTextColorFunction: Int = ContextCompat.getColor(context, R.color.black)
|
||||
|
||||
|
||||
|
||||
|
||||
fun getConfig(): PinRuh? {
|
||||
val skinPath = UbgKff.getSkinPath()
|
||||
val configFilePath = skinPath + "assets/keyboard.conf"
|
||||
val file = File(configFilePath)
|
||||
return if (file.exists()) {
|
||||
EbgYih.initConfig(configFilePath)
|
||||
} else {
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
fun getConfigBg(name: String): Drawable? {
|
||||
UbgKff.getSkinPath()?.let { resPath ->
|
||||
val pPath = "${resPath}res/drawable-xhdpi-v4/"
|
||||
|
||||
return getDrawList(
|
||||
pPath + name,
|
||||
pPath + name
|
||||
)
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
fun updateSkinConfig() {
|
||||
UbgKff.getSkinPath()?.let { resPath ->
|
||||
val pPath = "${resPath}res/drawable-xhdpi-v4/"
|
||||
pPath.let {
|
||||
readColors(resPath) {
|
||||
for ((name, value) in it) {
|
||||
if (name == GdfhNtf.keyTextColorName) {
|
||||
keyTextColor = value
|
||||
}
|
||||
if (name == GdfhNtf.keyTextColorFunctionName) {
|
||||
keyTextColorFunction = value
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
functionDraw = getDrawList(
|
||||
it + GdfhNtf.functionNormalName,
|
||||
it + GdfhNtf.functionPressName
|
||||
)
|
||||
generalDraw = getDrawList(it + GdfhNtf.normalName, it + GdfhNtf.pressName)
|
||||
toDraw = getDrawList(it + GdfhNtf.toNormalName, it + GdfhNtf.toPressName)
|
||||
spaceDraw =
|
||||
getDrawList(it + GdfhNtf.spaceNormalName, it + GdfhNtf.spacePressName)
|
||||
switchDraw =
|
||||
getDrawList(it + GdfhNtf.imeSwitchName, it + GdfhNtf.imeSwitchName)
|
||||
deleteDraw = getDrawList(
|
||||
it + GdfhNtf.deleteNormalName,
|
||||
it + GdfhNtf.deletePressName
|
||||
)
|
||||
backDraw = getDrawList(it + GdfhNtf.backName, it + GdfhNtf.backName)
|
||||
searchDraw = getDrawList(it + GdfhNtf.searchName, it + GdfhNtf.searchName)
|
||||
shiftDraw = getDrawList(
|
||||
it + GdfhNtf.shiftNormalName,
|
||||
it + GdfhNtf.shiftNormalName
|
||||
)
|
||||
shiftLockDraw =
|
||||
getDrawList(it + GdfhNtf.shiftLockName, it + GdfhNtf.shiftLockName)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private fun getDefaultDrawList(normalDrawId: Int, pressDrawId: Int): StateListDrawable {
|
||||
val normalDraw = ContextCompat.getDrawable(InputAura.Companion.inputAuraInstance, normalDrawId)
|
||||
val pressDraw = ContextCompat.getDrawable(InputAura.Companion.inputAuraInstance, pressDrawId)
|
||||
val stateListDrawable = StateListDrawable().apply {
|
||||
addState(
|
||||
intArrayOf(android.R.attr.state_pressed),
|
||||
pressDraw
|
||||
)
|
||||
addState(intArrayOf(), normalDraw)
|
||||
}
|
||||
|
||||
return stateListDrawable
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
private fun getDrawList(normalPath: String, pressPath: String): StateListDrawable {
|
||||
val pressDraw = BitmapFactory.decodeFile(pressPath)
|
||||
val normalDraw = BitmapFactory.decodeFile(normalPath)
|
||||
val stateListDrawable = StateListDrawable().apply {
|
||||
addState(
|
||||
intArrayOf(android.R.attr.state_pressed),
|
||||
BitmapDrawable(context.resources, pressDraw)
|
||||
)
|
||||
addState(intArrayOf(), BitmapDrawable(context.resources, normalDraw))
|
||||
}
|
||||
|
||||
return stateListDrawable
|
||||
|
||||
|
||||
}
|
||||
|
||||
private fun readColors(resPath: String, callBack: (Map<String, Int>) -> Unit) {
|
||||
val resMaps = mutableMapOf<String, Int>()
|
||||
|
||||
val pPath = "${resPath}res/colors.xml"
|
||||
val file = File(pPath)
|
||||
if (file.exists()) {
|
||||
val xmlPullParser = Xml.newPullParser().apply {
|
||||
setInput(StringReader(file.readText()))
|
||||
setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, false)
|
||||
|
||||
}
|
||||
var curType = xmlPullParser.eventType
|
||||
while (curType != XmlPullParser.END_DOCUMENT) {
|
||||
val b = curType == XmlPullParser.START_TAG
|
||||
val b1 = xmlPullParser.name == "color"
|
||||
val b2 = xmlPullParser.name == "item"
|
||||
if (b && (b1 || b2)) {
|
||||
val attributeName = xmlPullParser.getAttributeValue(null, "name")
|
||||
val nextTextValue = xmlPullParser.nextText()
|
||||
val b3 = attributeName == GdfhNtf.keyTextColorName
|
||||
val b4 = attributeName == GdfhNtf.keyTextColorFunctionName
|
||||
if (b3 || b4) {
|
||||
resMaps[attributeName] = Color.parseColor(nextTextValue)
|
||||
}
|
||||
}
|
||||
curType = xmlPullParser.next()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
callBack.invoke(resMaps)
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,60 @@
|
||||
package com.app.input.inputaura.kfsdfbsd
|
||||
|
||||
object GdfhNtf {
|
||||
|
||||
|
||||
|
||||
const val KEY_CODE_DELETE = -5
|
||||
|
||||
|
||||
//同一个按键
|
||||
const val KEY_CODE_SHIFT = -1
|
||||
const val KEY_CODE_NUMBER_SHIFT = -103
|
||||
const val KEY_CODE_SYMBOL_SHIFT = -101
|
||||
|
||||
//同一个按键
|
||||
const val KEY_CODE_CHANGE_NUMBER = -2
|
||||
const val KEY_CODE_BACK = -102
|
||||
|
||||
|
||||
const val KEY_CODE_COMPLETE = -4
|
||||
const val KEY_CODE_CANCEL = -3
|
||||
|
||||
const val KEY_CODE_SPACE = 32
|
||||
|
||||
|
||||
const val functionNormalName = "btn_keyboard_key_functional_normal.9.png"
|
||||
const val functionPressName = "btn_keyboard_key_functional_pressed.9.png"
|
||||
|
||||
const val normalName = "btn_keyboard_key_normal_normal.9.png"
|
||||
const val pressName = "btn_keyboard_key_normal_pressed.9.png"
|
||||
|
||||
const val toNormalName="btn_keyboard_key_toggle_normal_on.9.png"
|
||||
const val toPressName="btn_keyboard_key_toggle_pressed_on.9.png"
|
||||
|
||||
const val spaceNormalName = "btn_keyboard_spacekey_normal_normal.9.png"
|
||||
const val spacePressName = "btn_keyboard_spacekey_normal_pressed.9.png"
|
||||
|
||||
const val imeSwitchName ="ic_ime_switcher.png"
|
||||
|
||||
const val deleteNormalName = "sym_keyboard_delete_normal.png"
|
||||
const val deletePressName = "sym_keyboard_delete_pressed.png"
|
||||
|
||||
const val backName ="sym_keyboard_return_normal.png"
|
||||
|
||||
const val searchName ="sym_keyboard_search.png"
|
||||
|
||||
const val shiftNormalName ="sym_keyboard_shift.png"
|
||||
const val shiftLockName ="sym_keyboard_shift_locked.png"
|
||||
|
||||
const val keyTextColorName ="key_text_color_normal"
|
||||
const val keyTextColorFunctionName ="key_text_color_functional"
|
||||
|
||||
const val videoName ="keyboard_background_video.mp4"
|
||||
const val bgName ="keyboard_background.jpg"
|
||||
const val bgName_png ="keyboard_background.png"
|
||||
|
||||
const val previewBg="keyboard_preview_screenshot.jpg"
|
||||
|
||||
const val video ="keyboard_background_video.gif"
|
||||
}
|
||||
115
app/src/main/java/com/app/input/inputaura/kfsdfbsd/IutFhfg.kt
Normal file
@ -0,0 +1,115 @@
|
||||
package com.app.input.inputaura.kfsdfbsd
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.graphics.BitmapFactory
|
||||
import android.graphics.drawable.BitmapDrawable
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.provider.Settings
|
||||
import android.view.View
|
||||
import android.view.WindowManager
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import android.view.inputmethod.InputMethodManager
|
||||
import android.widget.ImageView
|
||||
import com.app.input.inputaura.InputAura
|
||||
import com.bumptech.glide.Glide
|
||||
import com.bumptech.glide.integration.webp.decoder.WebpDrawable
|
||||
import com.bumptech.glide.load.DataSource
|
||||
import com.bumptech.glide.load.engine.GlideException
|
||||
import com.bumptech.glide.load.resource.bitmap.CenterCrop
|
||||
import com.bumptech.glide.load.resource.bitmap.RoundedCorners
|
||||
import com.bumptech.glide.request.RequestListener
|
||||
import com.bumptech.glide.request.RequestOptions
|
||||
import com.bumptech.glide.request.target.Target
|
||||
import java.io.File
|
||||
|
||||
object IutFhfg {
|
||||
|
||||
val transform = RequestOptions().transform(CenterCrop(), RoundedCorners(dpToPx(8f)))
|
||||
fun initFullScreen(activity: Activity, dark: Boolean? = true) {
|
||||
val window = activity.window
|
||||
val decorView = window.decorView
|
||||
val rootView = decorView.rootView
|
||||
//
|
||||
if (dark == null) return
|
||||
|
||||
if (dark) {
|
||||
decorView.setSystemUiVisibility(
|
||||
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
||||
or View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
|
||||
)
|
||||
} else {
|
||||
decorView.setSystemUiVisibility(
|
||||
(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
||||
or View.SYSTEM_UI_FLAG_LAYOUT_STABLE)
|
||||
)
|
||||
}
|
||||
window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS)
|
||||
}
|
||||
|
||||
|
||||
fun loadWepJif(mContext: Context, webpGifUrl: String, view: ImageView) {
|
||||
Glide.with(mContext)
|
||||
.load(webpGifUrl)
|
||||
// .apply(transform)
|
||||
.addListener(object : RequestListener<Drawable> {
|
||||
override fun onLoadFailed(
|
||||
e: GlideException?,
|
||||
model: Any?,
|
||||
target: Target<Drawable>,
|
||||
isFirstResource: Boolean
|
||||
): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun onResourceReady(
|
||||
resource: Drawable,
|
||||
model: Any,
|
||||
target: Target<Drawable>,
|
||||
dataSource: DataSource,
|
||||
isFirstResource: Boolean
|
||||
): Boolean {
|
||||
if (resource is WebpDrawable) {
|
||||
resource.loopCount = WebpDrawable.LOOP_FOREVER
|
||||
}
|
||||
return false
|
||||
}
|
||||
}).into(view)
|
||||
}
|
||||
|
||||
|
||||
fun getBgDrawable(con: Context, filePath: String): Drawable? {
|
||||
if (!File(filePath).exists()) {
|
||||
return null
|
||||
}
|
||||
return BitmapDrawable(con.resources, BitmapFactory.decodeFile(filePath))
|
||||
}
|
||||
|
||||
|
||||
private val systemService =
|
||||
InputAura.Companion.inputAuraInstance.getSystemService(Context.INPUT_METHOD_SERVICE)
|
||||
private val inputMethodManager = systemService as InputMethodManager
|
||||
fun checkSetDefault(con: Context): Boolean {
|
||||
val defaultId =
|
||||
Settings.Secure.getString(con.contentResolver, Settings.Secure.DEFAULT_INPUT_METHOD)
|
||||
return defaultId != null && defaultId.startsWith(con.packageName)
|
||||
}
|
||||
|
||||
fun checkEnable(con: Context): Boolean {
|
||||
for (methodInfo in inputMethodManager.enabledInputMethodList) {
|
||||
if (methodInfo.id.startsWith(con.packageName)) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
fun getTextForImeAction(imeOptions: Int): Int {
|
||||
return imeOptions and EditorInfo.IME_MASK_ACTION
|
||||
}
|
||||
|
||||
fun dpToPx(dpValue: Float): Int {
|
||||
val scale = InputAura.Companion.inputAuraInstance.resources.displayMetrics.density
|
||||
return (dpValue * scale + 0.5f).toInt()
|
||||
}
|
||||
}
|
||||
238
app/src/main/java/com/app/input/inputaura/kfsdfbsd/OunRgf.java
Normal file
@ -0,0 +1,238 @@
|
||||
package com.app.input.inputaura.kfsdfbsd;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.util.Log;
|
||||
|
||||
import com.app.input.inputaura.InputAura;
|
||||
import com.app.input.inputaura.bgtng.PunTu;
|
||||
|
||||
import net.sf.sevenzipjbinding.ArchiveFormat;
|
||||
import net.sf.sevenzipjbinding.IArchiveOpenCallback;
|
||||
import net.sf.sevenzipjbinding.IInArchive;
|
||||
import net.sf.sevenzipjbinding.SevenZip;
|
||||
import net.sf.sevenzipjbinding.SevenZipException;
|
||||
import net.sf.sevenzipjbinding.impl.RandomAccessFileInStream;
|
||||
import net.sf.sevenzipjbinding.impl.RandomAccessFileOutStream;
|
||||
import net.sf.sevenzipjbinding.simple.ISimpleInArchive;
|
||||
import net.sf.sevenzipjbinding.simple.ISimpleInArchiveItem;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.RandomAccessFile;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import okhttp3.Call;
|
||||
import okhttp3.Callback;
|
||||
import okhttp3.MediaType;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
|
||||
public class OunRgf {
|
||||
|
||||
public static void startDownloadZip(String zipPath, PunTu callback) {
|
||||
OkHttpClient clientZip = new OkHttpClient().newBuilder().
|
||||
connectTimeout(20, TimeUnit.SECONDS)
|
||||
.writeTimeout(10, TimeUnit.SECONDS)
|
||||
.readTimeout(10, TimeUnit.SECONDS).build();
|
||||
Request.Builder builder = new Request.Builder();
|
||||
Request request = builder.get().url(zipPath).build();
|
||||
|
||||
clientZip.newCall(request).enqueue(new Callback() {
|
||||
@Override
|
||||
public void onFailure(Call call, IOException e) {
|
||||
callback.OnApplySkinListener(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResponse(Call call, Response response) {
|
||||
|
||||
InputStream inputStream = response.body().byteStream();
|
||||
long l = response.body().contentLength();
|
||||
MediaType mediaType = response.body().contentType();
|
||||
|
||||
saveZipFile(inputStream, getServiceZipName(zipPath), callback);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public static String getServiceZipName(String zipPath) {
|
||||
String pointStr = "/";
|
||||
int lastIndexOf = zipPath.lastIndexOf(pointStr);
|
||||
String zipName = zipPath.substring(lastIndexOf + pointStr.length());
|
||||
|
||||
|
||||
return zipName;
|
||||
}
|
||||
|
||||
private static String getunZipFolderName(String zipPath) {
|
||||
String pointStr = ".";
|
||||
int lastIndexOf = zipPath.lastIndexOf(pointStr);
|
||||
String zipName = zipPath.substring(0, lastIndexOf);
|
||||
|
||||
|
||||
return zipName;
|
||||
}
|
||||
|
||||
private static void saveZipFile(InputStream inputStream, String zipFileName, PunTu callback) {
|
||||
File zipfFile = new File(InputAura.inputAuraInstance.getFilesDir(), zipFileName);
|
||||
|
||||
Log.d("-------------------","-------zipFileName="+zipFileName);
|
||||
byte[] bytes = new byte[4096];
|
||||
int readLength = 0;
|
||||
InputStream is = inputStream;
|
||||
FileOutputStream fileOs = null;
|
||||
try {
|
||||
fileOs = new FileOutputStream(zipfFile);
|
||||
|
||||
while ((readLength = is.read(bytes)) != -1) {
|
||||
fileOs.write(bytes, 0, readLength);
|
||||
}
|
||||
fileOs.flush();
|
||||
|
||||
} catch (Exception exception) {
|
||||
|
||||
} finally {
|
||||
try {
|
||||
if (is != null) {
|
||||
is.close();
|
||||
}
|
||||
if (fileOs != null) {
|
||||
fileOs.close();
|
||||
}
|
||||
} catch (IOException ioException) {
|
||||
|
||||
}
|
||||
un7ZZipFile(zipfFile, callback);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static String getUnzipPath(String zipName){
|
||||
String folderName = getunZipFolderName(zipName);
|
||||
String replace = folderName.replace(".", "");
|
||||
return InputAura.inputAuraInstance.getFilesDir().getPath() + "/" + replace;
|
||||
}
|
||||
|
||||
private static void un7ZZipFile(File saveZipFile, PunTu callback) {
|
||||
List<File> fileList = new ArrayList<>();
|
||||
|
||||
String unzipFolderPath = getUnzipPath(saveZipFile.getName());
|
||||
|
||||
try {
|
||||
RandomAccessFileInStream inStream = new RandomAccessFileInStream(new RandomAccessFile(saveZipFile, "r"));
|
||||
IInArchive open = SevenZip.openInArchive(ArchiveFormat.SEVEN_ZIP, inStream, new IArchiveOpenCallback() {
|
||||
@Override
|
||||
public void setTotal(Long files, Long bytes) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCompleted(Long files, Long bytes) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
ISimpleInArchive simple = open.getSimpleInterface();
|
||||
for (ISimpleInArchiveItem archiveItem : simple.getArchiveItems()) {
|
||||
RandomAccessFileOutStream outStream = null;
|
||||
try {
|
||||
File itemFile;
|
||||
if (archiveItem.isFolder()) {
|
||||
File itemFolder = new File(unzipFolderPath, archiveItem.getPath());
|
||||
boolean mkdirs = itemFolder.mkdirs();
|
||||
continue;
|
||||
} else {
|
||||
itemFile = new File(unzipFolderPath, archiveItem.getPath());
|
||||
if (!itemFile.getParentFile().exists()) {
|
||||
boolean mkdirs = itemFile.getParentFile().mkdirs();
|
||||
}
|
||||
}
|
||||
outStream = new RandomAccessFileOutStream(new RandomAccessFile(itemFile, "rw"));
|
||||
archiveItem.extractSlow(outStream);
|
||||
fileList.add(itemFile);
|
||||
} finally {
|
||||
if (outStream != null) {
|
||||
outStream.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
inStream.close();
|
||||
open.close();
|
||||
|
||||
} catch (FileNotFoundException | SevenZipException exception) {
|
||||
|
||||
} catch (IOException ioException) {
|
||||
|
||||
} finally {
|
||||
if (saveZipFile.exists()) {
|
||||
|
||||
saveZipFile.delete();
|
||||
|
||||
}
|
||||
callback.OnApplySkinListener(fileList);
|
||||
}
|
||||
}
|
||||
|
||||
public static File findFirstDirectory(File dir) {
|
||||
if (dir.isDirectory()) {
|
||||
File[] files = dir.listFiles();
|
||||
if (files != null) {
|
||||
for (File file : files) {
|
||||
if (file.isDirectory()) {
|
||||
return file; // 返回第一个文件目录
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null; // 如果没有找到文件目录,则返回null
|
||||
}
|
||||
|
||||
|
||||
private static Bitmap drawableToBitmap(Drawable drawable) {
|
||||
if (drawable instanceof BitmapDrawable) {
|
||||
return ((BitmapDrawable) drawable).getBitmap();
|
||||
}
|
||||
|
||||
// 如果不是 BitmapDrawable,则创建一个空的 Bitmap 对象
|
||||
Bitmap bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(),
|
||||
drawable.getIntrinsicHeight(),
|
||||
Bitmap.Config.ARGB_8888);
|
||||
Canvas canvas = new Canvas(bitmap);
|
||||
drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
|
||||
drawable.draw(canvas);
|
||||
return bitmap;
|
||||
}
|
||||
|
||||
// 将 Bitmap 保存到文件
|
||||
private static void saveBitmapToFile(Bitmap bitmap, File file) throws IOException {
|
||||
if(!file.exists()){
|
||||
file.createNewFile();
|
||||
}
|
||||
FileOutputStream out = new FileOutputStream(file);
|
||||
bitmap.compress(Bitmap.CompressFormat.PNG, 100, out); // 保存为 PNG 格式
|
||||
out.flush();
|
||||
out.close();
|
||||
}
|
||||
|
||||
// 示例:将 Drawable 写入文件
|
||||
public static void saveDrawableToFile(Drawable drawable, File file) throws IOException {
|
||||
Bitmap bitmap = drawableToBitmap(drawable);
|
||||
saveBitmapToFile(bitmap, file);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,76 @@
|
||||
package com.app.input.inputaura.kfsdfbsd;
|
||||
|
||||
import android.graphics.Rect;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.recyclerview.widget.StaggeredGridLayoutManager;
|
||||
|
||||
import com.app.input.inputaura.InputAura;
|
||||
|
||||
|
||||
public class PumnFnb extends RecyclerView.ItemDecoration {
|
||||
|
||||
private int v, h, ex;
|
||||
|
||||
public PumnFnb(int v, int h, int ex) {
|
||||
this.v = Math.round(dpToPx(v));
|
||||
this.h = Math.round(dpToPx(h));
|
||||
this.ex = Math.round(dpToPx(ex));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getItemOffsets(@NonNull Rect outRect, @NonNull View view, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
|
||||
super.getItemOffsets(outRect, view, parent, state);
|
||||
int spanCount = 1;
|
||||
int spanSize = 1;
|
||||
int spanIndex = 0;
|
||||
|
||||
int childAdapterPosition = parent.getChildAdapterPosition(view);
|
||||
RecyclerView.LayoutManager layoutManager = parent.getLayoutManager();
|
||||
if (layoutManager instanceof StaggeredGridLayoutManager) {
|
||||
StaggeredGridLayoutManager staggeredGridLayoutManager = (StaggeredGridLayoutManager) layoutManager;
|
||||
StaggeredGridLayoutManager.LayoutParams layoutParams = (StaggeredGridLayoutManager.LayoutParams) view.getLayoutParams();
|
||||
spanCount = staggeredGridLayoutManager.getSpanCount();
|
||||
if (layoutParams.isFullSpan()) {
|
||||
spanSize = spanCount;
|
||||
}
|
||||
spanIndex = layoutParams.getSpanIndex();
|
||||
} else if (layoutManager instanceof GridLayoutManager) {
|
||||
GridLayoutManager gridLayoutManager = (GridLayoutManager) layoutManager;
|
||||
GridLayoutManager.LayoutParams layoutParams = (GridLayoutManager.LayoutParams) view.getLayoutParams();
|
||||
spanCount = gridLayoutManager.getSpanCount();
|
||||
spanSize = gridLayoutManager.getSpanSizeLookup().getSpanSize(childAdapterPosition);
|
||||
spanIndex = layoutParams.getSpanIndex();
|
||||
} else if (layoutManager instanceof LinearLayoutManager) {
|
||||
outRect.left = v;
|
||||
outRect.right = v;
|
||||
outRect.bottom = h;
|
||||
}
|
||||
|
||||
if (spanSize == spanCount) {
|
||||
outRect.left = v + ex;
|
||||
outRect.right = v + ex;
|
||||
outRect.bottom = h;
|
||||
|
||||
} else {
|
||||
int itemAllSpacing = (v * (spanCount + 1) + ex * 2) / spanCount;
|
||||
int left = v * (spanIndex + 1) - itemAllSpacing * spanIndex + ex;
|
||||
int right = itemAllSpacing - left;
|
||||
outRect.left = left;
|
||||
outRect.right = right;
|
||||
outRect.bottom = h;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static float dpToPx(float dpValue) {
|
||||
float density = InputAura.inputAuraInstance.getResources().getDisplayMetrics().density;
|
||||
return density * dpValue + 0.5f;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
package com.app.input.inputaura.kfsdfbsd;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.util.AttributeSet;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.app.input.inputaura.InputAura;
|
||||
import com.app.input.inputaura.R;
|
||||
|
||||
|
||||
public class TiuGju extends androidx.appcompat.widget.AppCompatTextView {
|
||||
|
||||
|
||||
public TiuGju(Context context, @Nullable AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
initAttrs(context,attrs);
|
||||
}
|
||||
|
||||
|
||||
private void initAttrs(Context context, AttributeSet attrs){
|
||||
TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.MyTV);
|
||||
boolean aBoolean = typedArray.getBoolean(R.styleable.MyTV_apply_font,false);
|
||||
if(aBoolean){
|
||||
initFont(this);
|
||||
}
|
||||
|
||||
typedArray.recycle();
|
||||
}
|
||||
|
||||
public static void initFont(TextView tv) {
|
||||
tv.setTypeface(InputAura.Companion.getDefaultFont());
|
||||
}
|
||||
|
||||
}
|
||||
19
app/src/main/java/com/app/input/inputaura/kfsdfbsd/UbgKff.kt
Normal file
@ -0,0 +1,19 @@
|
||||
package com.app.input.inputaura.kfsdfbsd
|
||||
|
||||
import android.content.Context
|
||||
import com.app.input.inputaura.InputAura
|
||||
|
||||
object UbgKff {
|
||||
|
||||
val SP_NAME = "keyboard_skin"
|
||||
val SKIN_PATH = "skin_path"
|
||||
val spSkin = InputAura.Companion.inputAuraInstance.getSharedPreferences(SP_NAME,Context.MODE_PRIVATE)
|
||||
|
||||
fun updateSkinPath(skinPath:String){
|
||||
spSkin.edit().putString(SKIN_PATH,skinPath).apply()
|
||||
}
|
||||
|
||||
fun getSkinPath( ):String?{
|
||||
return spSkin.getString(SKIN_PATH,null)
|
||||
}
|
||||
}
|
||||
75
app/src/main/java/com/app/input/inputaura/kmnhffs/OfhTff.kt
Normal file
@ -0,0 +1,75 @@
|
||||
package com.app.input.inputaura.kmnhffs
|
||||
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import com.app.input.inputaura.InputAura
|
||||
import com.app.input.inputaura.dasda.Shikamaru
|
||||
import com.app.input.inputaura.bgtng.OnuIg
|
||||
import com.app.input.inputaura.databinding.RwtsbfBinding
|
||||
import com.app.input.inputaura.ohbnf.DaBase
|
||||
import com.app.input.inputaura.ohbnf.OpnYty
|
||||
import com.app.input.inputaura.onjfsgvfsf.OvfYfd
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
class OfhTff : Fragment() {
|
||||
private lateinit var vb: RwtsbfBinding
|
||||
companion object {
|
||||
|
||||
@JvmStatic
|
||||
fun newInstance() =
|
||||
OfhTff()
|
||||
}
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater, container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? {
|
||||
vb = RwtsbfBinding.inflate(layoutInflater)
|
||||
|
||||
init()
|
||||
|
||||
return vb.root
|
||||
}
|
||||
|
||||
|
||||
private fun init() {
|
||||
val mainAdapter = OvfYfd(
|
||||
requireContext()
|
||||
).apply {
|
||||
setRemoveLike(object : OnuIg {
|
||||
override fun OnRemoveLike(data: Shikamaru) {
|
||||
lifecycleScope.launch {
|
||||
OpnYty.removeLike(data)
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
vb.likeRecycler.run {
|
||||
adapter = mainAdapter
|
||||
layoutManager = GridLayoutManager(requireContext(), 2)
|
||||
}
|
||||
|
||||
DaBase.Companion.daBase.ThemesDao().queryAllLike().observe(requireActivity()) {
|
||||
Log.d(InputAura.Companion.TAG, "---------it=${it?.size}")
|
||||
if(it.isNullOrEmpty()){
|
||||
vb.likeRecycler.isVisible = false
|
||||
vb.emptyTitle.isVisible = true
|
||||
}else{
|
||||
vb.likeRecycler.isVisible = true
|
||||
vb.emptyTitle.isVisible = false
|
||||
mainAdapter.setForYouList(it)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
371
app/src/main/java/com/app/input/inputaura/kmnhffs/UfjTvbd.kt
Normal file
@ -0,0 +1,371 @@
|
||||
package com.app.input.inputaura.kmnhffs
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.graphics.drawable.ColorDrawable
|
||||
import android.os.Bundle
|
||||
import android.view.Gravity
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.PopupWindow
|
||||
import android.widget.TextView
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import androidx.viewpager2.adapter.FragmentStateAdapter
|
||||
import androidx.viewpager2.widget.ViewPager2
|
||||
import com.app.input.inputaura.InputAura
|
||||
import com.app.input.inputaura.R
|
||||
import com.app.input.inputaura.dasda.Shikamaru
|
||||
import com.app.input.inputaura.databinding.HgiusBinding
|
||||
import com.app.input.inputaura.onjfsgvfsf.DubTbf
|
||||
import com.google.android.material.tabs.TabLayoutMediator
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
|
||||
class FragmentHome : Fragment() {
|
||||
|
||||
private lateinit var vb: HgiusBinding
|
||||
private lateinit var categoryViewPagerAdapter: CategoryViewPagerAdapter
|
||||
private lateinit var categoryNames: List<String>
|
||||
private var popupWindow: PopupWindow? = null
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun newInstance() = FragmentHome()
|
||||
}
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater, container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View {
|
||||
vb = HgiusBinding.inflate(inflater, container, false)
|
||||
return vb.root
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
// 获取所有分类名称
|
||||
categoryNames = InputAura.Companion.list.map { it.parentName }
|
||||
initCategoryViewPager()
|
||||
setupSeeAllDropdown()
|
||||
}
|
||||
|
||||
private fun initCategoryViewPager() {
|
||||
// 创建ViewPager适配器
|
||||
categoryViewPagerAdapter = CategoryViewPagerAdapter(this, categoryNames)
|
||||
vb.categoryViewPager.adapter = categoryViewPagerAdapter
|
||||
|
||||
// 设置TabLayout和ViewPager的联动
|
||||
TabLayoutMediator(vb.categoryTabLayout, vb.categoryViewPager) { tab, position ->
|
||||
tab.text = categoryNames[position]
|
||||
}.attach()
|
||||
|
||||
// 设置ViewPager预加载数量
|
||||
vb.categoryViewPager.offscreenPageLimit = 1
|
||||
|
||||
// 监听页面变化
|
||||
vb.categoryViewPager.registerOnPageChangeCallback(object : ViewPager2.OnPageChangeCallback() {
|
||||
override fun onPageSelected(position: Int) {
|
||||
super.onPageSelected(position)
|
||||
// 可以在这里添加页面切换时的逻辑
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
private fun setupSeeAllDropdown() {
|
||||
vb.seeAllButton.setOnClickListener { view ->
|
||||
// 如果已经显示,则关闭
|
||||
if (popupWindow?.isShowing == true) {
|
||||
popupWindow?.dismiss()
|
||||
} else {
|
||||
showDropdownPopup(view)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun showDropdownPopup(anchorView: View) {
|
||||
// 创建弹出窗口的内容视图
|
||||
val inflater = requireContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater
|
||||
val popupView = inflater.inflate(R.layout.litdg, null)
|
||||
|
||||
// 获取当前选中的位置
|
||||
val currentPosition = vb.categoryViewPager.currentItem
|
||||
|
||||
// 计算文本宽度,找到最长的文本
|
||||
val paint = TextView(requireContext()).paint
|
||||
paint.textSize = resources.getDimension(R.dimen.text_size_14sp)
|
||||
|
||||
var maxTextWidth = 0
|
||||
for (category in categoryNames) {
|
||||
val width = paint.measureText(category).toInt()
|
||||
if (width > maxTextWidth) {
|
||||
maxTextWidth = width
|
||||
}
|
||||
}
|
||||
|
||||
// 添加内边距(左右各16dp)
|
||||
val horizontalPadding = resources.getDimensionPixelSize(R.dimen.dropdown_item_padding) * 2
|
||||
val calculatedWidth = (maxTextWidth + horizontalPadding).coerceIn(
|
||||
resources.getDimensionPixelSize(R.dimen.dropdown_min_width),
|
||||
resources.getDimensionPixelSize(R.dimen.dropdown_max_width)
|
||||
)
|
||||
|
||||
// 设置RecyclerView
|
||||
val recyclerView = popupView.findViewById<RecyclerView>(R.id.dropdown_recycler_view)
|
||||
recyclerView.layoutManager = LinearLayoutManager(requireContext())
|
||||
|
||||
// 设置适配器
|
||||
recyclerView.adapter = CategoryDropdownAdapter(categoryNames, currentPosition) { position ->
|
||||
vb.categoryViewPager.currentItem = position
|
||||
vb.categoryTabLayout.getTabAt(position)?.select()
|
||||
popupWindow?.dismiss()
|
||||
}
|
||||
|
||||
// 设置收起按钮点击事件
|
||||
popupView.findViewById<View>(R.id.collapse_container).setOnClickListener {
|
||||
popupWindow?.dismiss()
|
||||
}
|
||||
|
||||
// 创建PopupWindow
|
||||
popupWindow = PopupWindow(
|
||||
popupView,
|
||||
calculatedWidth, // 使用计算出的宽度
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT,
|
||||
true
|
||||
)
|
||||
|
||||
// 设置弹出窗口的背景和动画
|
||||
popupWindow?.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
|
||||
popupWindow?.elevation = 8f
|
||||
|
||||
// 显示在按钮下方
|
||||
popupWindow?.showAsDropDown(anchorView, 0, 0, Gravity.NO_GRAVITY)
|
||||
|
||||
// 设置外部点击关闭
|
||||
popupWindow?.setOutsideTouchable(true)
|
||||
|
||||
// 设置关闭监听
|
||||
popupWindow?.setOnDismissListener {
|
||||
popupWindow = null
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
popupWindow?.dismiss()
|
||||
popupWindow = null
|
||||
}
|
||||
}
|
||||
|
||||
// 下拉列表适配器
|
||||
// 下拉列表适配器
|
||||
class CategoryDropdownAdapter(
|
||||
private val categories: List<String>,
|
||||
private val selectedPosition: Int,
|
||||
private val onItemClick: (Int) -> Unit
|
||||
) : RecyclerView.Adapter<CategoryDropdownAdapter.ViewHolder>() {
|
||||
|
||||
class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
|
||||
val textView: TextView = view.findViewById(R.id.category_text)
|
||||
val container: ViewGroup = view.findViewById(R.id.item_container) // 确保使用正确的ID
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
|
||||
val view = LayoutInflater.from(parent.context)
|
||||
.inflate(R.layout.posd, parent, false)
|
||||
return ViewHolder(view)
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
|
||||
holder.textView.text = categories[position]
|
||||
|
||||
// 设置选中状态
|
||||
if (position == selectedPosition) {
|
||||
holder.container.setBackgroundResource(R.drawable.bnfnbfgh)
|
||||
} else {
|
||||
holder.container.setBackgroundResource(android.R.color.transparent)
|
||||
}
|
||||
|
||||
holder.itemView.setOnClickListener {
|
||||
onItemClick(position)
|
||||
}
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int = categories.size
|
||||
}
|
||||
|
||||
// ViewPager适配器
|
||||
class CategoryViewPagerAdapter(
|
||||
fragment: Fragment,
|
||||
private val categoryNames: List<String>
|
||||
) : FragmentStateAdapter(fragment) {
|
||||
|
||||
override fun getItemCount(): Int = categoryNames.size
|
||||
|
||||
override fun createFragment(position: Int): Fragment {
|
||||
return CategoryFragment.newInstance(categoryNames[position])
|
||||
}
|
||||
}
|
||||
|
||||
// CategoryFragment类
|
||||
class CategoryFragment : Fragment() {
|
||||
|
||||
private lateinit var binding: com.app.input.inputaura.databinding.ZudgBinding
|
||||
private var categoryName: String? = null
|
||||
|
||||
// 懒加载标记
|
||||
private var isViewCreated = false
|
||||
private var isDataLoaded = false
|
||||
|
||||
companion object {
|
||||
private const val ARG_CATEGORY_NAME = "category_name"
|
||||
|
||||
@JvmStatic
|
||||
fun newInstance(categoryName: String): CategoryFragment {
|
||||
return CategoryFragment().apply {
|
||||
arguments = Bundle().apply {
|
||||
putString(ARG_CATEGORY_NAME, categoryName)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
// 在onCreate中获取参数,避免在onViewCreated中重复获取
|
||||
categoryName = arguments?.getString(ARG_CATEGORY_NAME)
|
||||
}
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View {
|
||||
binding = com.app.input.inputaura.databinding.ZudgBinding.inflate(inflater, container, false)
|
||||
isViewCreated = true
|
||||
return binding.root
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
// 初始化RecyclerView配置
|
||||
setupRecyclerViewConfig()
|
||||
|
||||
// 尝试加载数据
|
||||
tryLoadDataIfNeeded()
|
||||
}
|
||||
|
||||
private fun setupRecyclerViewConfig() {
|
||||
// 设置网格布局管理器
|
||||
val layoutManager = GridLayoutManager(requireContext(), 2)
|
||||
binding.recyclerView.layoutManager = layoutManager
|
||||
|
||||
// 启用固定大小优化
|
||||
// binding.recyclerView.setHasFixedSize(true)
|
||||
|
||||
// 启用item缓存
|
||||
binding.recyclerView.setItemViewCacheSize(20)
|
||||
}
|
||||
|
||||
private fun tryLoadDataIfNeeded() {
|
||||
if (isViewCreated && userVisibleHint && !isDataLoaded) {
|
||||
loadData()
|
||||
}
|
||||
}
|
||||
|
||||
private fun loadData() {
|
||||
lifecycleScope.launch {
|
||||
// 在IO线程查找对应分类的数据
|
||||
val keyboardList = withContext(Dispatchers.IO) {
|
||||
InputAura.Companion.list.find { it.parentName == categoryName }?.keyboardList ?: emptyList()
|
||||
}
|
||||
|
||||
// 回到主线程更新UI
|
||||
if (keyboardList.isNotEmpty()) {
|
||||
setupAdapter(keyboardList)
|
||||
} else {
|
||||
showEmptyView()
|
||||
}
|
||||
|
||||
isDataLoaded = true
|
||||
}
|
||||
}
|
||||
|
||||
private fun setupAdapter(keyboardList: List<Shikamaru>) {
|
||||
// 创建适配器
|
||||
val adapter = object : DubTbf(requireContext(), keyboardList) {
|
||||
// 使用自定义的适配器
|
||||
}
|
||||
|
||||
binding.recyclerView.adapter = adapter
|
||||
|
||||
// 添加间距装饰器
|
||||
val spacing = resources.getDimensionPixelSize(com.app.input.inputaura.R.dimen.grid_spacing)
|
||||
binding.recyclerView.addItemDecoration(
|
||||
GridSpacingItemDecoration(2, spacing, false)
|
||||
)
|
||||
}
|
||||
|
||||
private fun showEmptyView() {
|
||||
// 显示空状态视图
|
||||
binding.recyclerView.visibility = View.GONE
|
||||
}
|
||||
|
||||
override fun setUserVisibleHint(isVisibleToUser: Boolean) {
|
||||
super.setUserVisibleHint(isVisibleToUser)
|
||||
if (isVisibleToUser && isViewCreated && !isDataLoaded) {
|
||||
loadData()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
// 清理资源
|
||||
binding.recyclerView.adapter = null
|
||||
isViewCreated = false
|
||||
isDataLoaded = false
|
||||
}
|
||||
|
||||
// 网格间距装饰器
|
||||
class GridSpacingItemDecoration(
|
||||
private val spanCount: Int,
|
||||
private val spacing: Int,
|
||||
private val includeEdge: Boolean
|
||||
) : androidx.recyclerview.widget.RecyclerView.ItemDecoration() {
|
||||
|
||||
override fun getItemOffsets(
|
||||
outRect: android.graphics.Rect,
|
||||
view: View,
|
||||
parent: androidx.recyclerview.widget.RecyclerView,
|
||||
state: androidx.recyclerview.widget.RecyclerView.State
|
||||
) {
|
||||
val position = parent.getChildAdapterPosition(view)
|
||||
if (position < 0) return
|
||||
|
||||
val column = position % spanCount
|
||||
|
||||
if (includeEdge) {
|
||||
outRect.left = spacing - column * spacing / spanCount
|
||||
outRect.right = (column + 1) * spacing / spanCount
|
||||
|
||||
if (position < spanCount) {
|
||||
outRect.top = spacing
|
||||
}
|
||||
outRect.bottom = spacing
|
||||
} else {
|
||||
outRect.left = column * spacing / spanCount
|
||||
outRect.right = spacing - (column + 1) * spacing / spanCount
|
||||
|
||||
if (position >= spanCount) {
|
||||
outRect.top = spacing
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
180
app/src/main/java/com/app/input/inputaura/kmnhffs/YinFjh.kt
Normal file
@ -0,0 +1,180 @@
|
||||
package com.app.input.inputaura.kmnhffs
|
||||
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.IntentFilter
|
||||
import android.graphics.Color
|
||||
import android.graphics.drawable.ColorDrawable
|
||||
import android.os.Bundle
|
||||
import android.provider.Settings
|
||||
import android.view.Gravity
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.WindowManager
|
||||
import android.view.inputmethod.InputMethodManager
|
||||
import android.widget.ImageView
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.TextView
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.fragment.app.DialogFragment
|
||||
import com.app.input.inputaura.InputAura
|
||||
import com.app.input.inputaura.kfsdfbsd.IutFhfg
|
||||
import com.app.input.inputaura.R
|
||||
import com.app.input.inputaura.databinding.PuoiouBinding
|
||||
|
||||
|
||||
class YinFjh : DialogFragment() {
|
||||
|
||||
private lateinit var vb: PuoiouBinding
|
||||
|
||||
private lateinit var layoutStepOne: LinearLayout
|
||||
private lateinit var layoutStepTwo: LinearLayout
|
||||
private lateinit var imgStepOkOne: ImageView
|
||||
private lateinit var imgStepOkTwo: ImageView
|
||||
private lateinit var intentFilter: IntentFilter
|
||||
private var myreceiver: BroadcastReceiver? = null
|
||||
|
||||
private lateinit var stepOne: TextView
|
||||
private lateinit var stepTwo: TextView
|
||||
|
||||
private lateinit var context: Context
|
||||
|
||||
private var clickAction: (() -> Unit )? = null
|
||||
|
||||
|
||||
|
||||
companion object {
|
||||
fun newInstance(): YinFjh {
|
||||
val fragment = YinFjh()
|
||||
return fragment
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fun setClickListener(action:() -> Unit){
|
||||
clickAction = action
|
||||
}
|
||||
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View {
|
||||
vb = PuoiouBinding.inflate(layoutInflater)
|
||||
context = InputAura.Companion.inputAuraInstance
|
||||
|
||||
|
||||
findViewId()
|
||||
onViewStep()
|
||||
getReceiver()
|
||||
return vb.root
|
||||
}
|
||||
|
||||
override fun onStart() {
|
||||
super.onStart()
|
||||
dialog?.run {
|
||||
setCanceledOnTouchOutside(true)
|
||||
window?.run {
|
||||
setGravity(Gravity.BOTTOM)
|
||||
setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
|
||||
|
||||
attributes = attributes.apply {
|
||||
width = WindowManager.LayoutParams.MATCH_PARENT
|
||||
height = WindowManager.LayoutParams.WRAP_CONTENT
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private fun findViewId() {
|
||||
|
||||
layoutStepOne = vb.linearStepOne
|
||||
layoutStepTwo = vb.linearStepTwo
|
||||
imgStepOkOne = vb.okOne
|
||||
imgStepOkTwo = vb.okTwo
|
||||
stepOne = vb.textStepOne
|
||||
stepTwo = vb.textStepTwo
|
||||
}
|
||||
|
||||
private fun onViewStep() {
|
||||
|
||||
layoutStepOne.setOnClickListener {
|
||||
startActivity(Intent(Settings.ACTION_INPUT_METHOD_SETTINGS))
|
||||
}
|
||||
layoutStepTwo.setOnClickListener {
|
||||
val inputMethodManager =
|
||||
context.getSystemService(AppCompatActivity.INPUT_METHOD_SERVICE) as InputMethodManager
|
||||
inputMethodManager.showInputMethodPicker()
|
||||
}
|
||||
vb.imClose.setOnClickListener {
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
updateUI()
|
||||
}
|
||||
|
||||
private fun getReceiver() {
|
||||
myreceiver = object : BroadcastReceiver() {
|
||||
override fun onReceive(context: Context?, intent: Intent?) {
|
||||
updateUI()
|
||||
}
|
||||
}
|
||||
intentFilter = IntentFilter(Intent.ACTION_INPUT_METHOD_CHANGED)
|
||||
|
||||
context.registerReceiver(myreceiver, intentFilter)
|
||||
}
|
||||
|
||||
private fun updateUI() {
|
||||
|
||||
val checkEnable = IutFhfg.checkEnable(InputAura.Companion.inputAuraInstance)
|
||||
val checkSetDefault = IutFhfg.checkSetDefault(InputAura.Companion.inputAuraInstance)
|
||||
if (checkEnable && checkSetDefault) {
|
||||
clickAction?.invoke()
|
||||
dismiss()
|
||||
return
|
||||
}
|
||||
if (checkEnable) {
|
||||
layoutStepOne.isEnabled = false
|
||||
layoutStepOne.isSelected = true
|
||||
imgStepOkOne.isVisible = true
|
||||
stepOne.setTextColor(context.getColor(R.color.step_true))
|
||||
} else {
|
||||
layoutStepOne.isEnabled = true
|
||||
layoutStepOne.isSelected = false
|
||||
imgStepOkOne.isVisible = false
|
||||
stepOne.setTextColor(context.getColor(R.color.white))
|
||||
}
|
||||
|
||||
if (checkSetDefault) {
|
||||
layoutStepTwo.isEnabled = false
|
||||
layoutStepTwo.isSelected = true
|
||||
imgStepOkTwo.isVisible = true
|
||||
stepTwo.setTextColor(context.getColor(R.color.step_true))
|
||||
} else {
|
||||
layoutStepTwo.isEnabled = true
|
||||
layoutStepTwo.isSelected = false
|
||||
imgStepOkTwo.isVisible = false
|
||||
stepTwo.setTextColor(context.getColor(R.color.white))
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
if (myreceiver != null) {
|
||||
context.unregisterReceiver(myreceiver)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,36 @@
|
||||
package com.app.input.inputaura.lmyfvfs
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.activity.OnBackPressedCallback
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
|
||||
open class BaseActivity: AppCompatActivity() {
|
||||
protected var backPressedCallback: OnBackPressedCallback? = null
|
||||
/** 子类是否需要拦截返回 */
|
||||
protected open fun shouldInterceptBackPress(): Boolean = false
|
||||
|
||||
/** 子类定义拦截后的操作(例如弹窗) */
|
||||
protected open fun onInterceptBackPressed() {}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setupBackPressedCallback()//初始化back事件
|
||||
}
|
||||
private fun setupBackPressedCallback() {
|
||||
backPressedCallback = object : OnBackPressedCallback(true) {
|
||||
override fun handleOnBackPressed() {
|
||||
if (shouldInterceptBackPress()) {
|
||||
// 由子类处理拦截动作
|
||||
onInterceptBackPressed()
|
||||
} else {
|
||||
// 不拦截:关闭自己
|
||||
isEnabled = false
|
||||
onBackPressedDispatcher.onBackPressed()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onBackPressedDispatcher.addCallback(this, backPressedCallback!!)
|
||||
|
||||
}
|
||||
}
|
||||
150
app/src/main/java/com/app/input/inputaura/lmyfvfs/HfyTbg.java
Normal file
@ -0,0 +1,150 @@
|
||||
package com.app.input.inputaura.lmyfvfs;
|
||||
|
||||
import static com.bumptech.glide.request.RequestOptions.bitmapTransform;
|
||||
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.ViewTreeObserver;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import androidx.activity.EdgeToEdge;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.graphics.Insets;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.core.view.WindowInsetsCompat;
|
||||
|
||||
import com.ad.toponlibrary.AdManager;
|
||||
import com.app.input.inputaura.R;
|
||||
import com.app.input.inputaura.databinding.PunngdBinding;
|
||||
import com.app.input.inputaura.kfsdfbsd.GdfhNtf;
|
||||
import com.app.input.inputaura.kfsdfbsd.IutFhfg;
|
||||
import com.app.input.inputaura.kfsdfbsd.UbgKff;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.load.DataSource;
|
||||
import com.bumptech.glide.load.engine.GlideException;
|
||||
import com.bumptech.glide.request.RequestListener;
|
||||
import com.bumptech.glide.request.target.Target;
|
||||
|
||||
import java.util.BitSet;
|
||||
|
||||
import jp.wasabeef.glide.transformations.BlurTransformation;
|
||||
import kotlin.Unit;
|
||||
import kotlin.jvm.functions.Function0;
|
||||
|
||||
|
||||
public class HfyTbg extends BaseActivity {
|
||||
private PunngdBinding vb;
|
||||
public static String key_name = "key_name";
|
||||
private int mPreviousKeyboardHeight = -1;
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
vb = PunngdBinding.inflate(getLayoutInflater());
|
||||
EdgeToEdge.enable(this);
|
||||
setContentView(vb.getRoot());
|
||||
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
|
||||
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
|
||||
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
|
||||
return insets;
|
||||
});
|
||||
|
||||
onInit();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public void onInit() {
|
||||
|
||||
String stringExtra = getIntent().getStringExtra(key_name);
|
||||
vb.title.setText(stringExtra);
|
||||
|
||||
String curPath = UbgKff.INSTANCE.getSkinPath();
|
||||
|
||||
vb.idBack.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
onInterceptBackPressed();
|
||||
}
|
||||
});
|
||||
if (curPath == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
String bgPath = curPath+"res/drawable-xxhdpi-v4/"+ GdfhNtf.previewBg;
|
||||
|
||||
Drawable bgDraw = IutFhfg.INSTANCE.getBgDrawable(this, bgPath);
|
||||
if (bgDraw != null) {
|
||||
|
||||
Glide.with(this)
|
||||
.load(bgDraw)
|
||||
.apply(bitmapTransform(new BlurTransformation(15, 3))) // 设置模糊半径和模糊采样
|
||||
.listener(new RequestListener<Drawable>() {
|
||||
@Override
|
||||
public boolean onLoadFailed(@Nullable GlideException e, @Nullable Object model, @NonNull Target<Drawable> target, boolean isFirstResource) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onResourceReady(@NonNull Drawable resource, @NonNull Object model, Target<Drawable> target, @NonNull DataSource dataSource, boolean isFirstResource) {
|
||||
vb.main.setBackground(resource);
|
||||
|
||||
return false;
|
||||
}
|
||||
})
|
||||
.preload();
|
||||
|
||||
}
|
||||
keyboardheight();
|
||||
vb.et.requestFocus();
|
||||
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void keyboardheight() {
|
||||
final View rootView = getWindow().getDecorView();
|
||||
rootView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
|
||||
|
||||
|
||||
@Override
|
||||
public void onGlobalLayout() {
|
||||
Rect r = new Rect();
|
||||
rootView.getWindowVisibleDisplayFrame(r);
|
||||
int screenHeight = rootView.getRootView().getHeight();
|
||||
int keypadHeight = screenHeight - r.bottom;
|
||||
|
||||
if (keypadHeight != mPreviousKeyboardHeight) {
|
||||
if (mPreviousKeyboardHeight < keypadHeight) {
|
||||
mPreviousKeyboardHeight = keypadHeight;
|
||||
ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) vb.et.getLayoutParams();
|
||||
params.bottomMargin = mPreviousKeyboardHeight;
|
||||
vb.et.setLayoutParams(params);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean shouldInterceptBackPress() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onInterceptBackPressed() {
|
||||
AdManager.showTopOn(this, () -> {});
|
||||
if (getBackPressedCallback() != null) {
|
||||
getBackPressedCallback().setEnabled(false);
|
||||
}
|
||||
getOnBackPressedDispatcher().onBackPressed();
|
||||
}
|
||||
}
|
||||
58
app/src/main/java/com/app/input/inputaura/lmyfvfs/HinDng.kt
Normal file
@ -0,0 +1,58 @@
|
||||
package com.app.input.inputaura.lmyfvfs
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.os.CountDownTimer
|
||||
import android.widget.ProgressBar
|
||||
import com.ad.toponlibrary.AdManager
|
||||
import com.app.input.inputaura.kfsdfbsd.IutFhfg
|
||||
import com.app.input.inputaura.R
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
|
||||
/**
|
||||
* 不要修改启动页继承Activity这点
|
||||
*/
|
||||
class HinDng : Activity() {
|
||||
|
||||
private lateinit var progressBar: ProgressBar
|
||||
private var countTime = 15000L
|
||||
private lateinit var timer: CountDownTimer
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.mgihd)
|
||||
IutFhfg.initFullScreen(this, true)
|
||||
progressBar = findViewById<ProgressBar>(R.id.nova_progress)
|
||||
|
||||
init()
|
||||
|
||||
}
|
||||
|
||||
private fun init() {
|
||||
timer = AdManager.showWelcomeAd(this, countTime,
|
||||
countAction = { millisUntilFinished ->
|
||||
val percentage: Float = 100 - millisUntilFinished.toFloat() / countTime * 100
|
||||
val round = percentage.roundToInt()
|
||||
progressBar.progress = round
|
||||
},
|
||||
goMain = {
|
||||
progressBar.progress = 100
|
||||
toHome()
|
||||
})
|
||||
timer.start()
|
||||
}
|
||||
|
||||
private fun toHome() {
|
||||
startActivity(Intent(this, HiyFg::class.java))
|
||||
finish()
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
timer.cancel()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
127
app/src/main/java/com/app/input/inputaura/lmyfvfs/HiyFg.java
Normal file
@ -0,0 +1,127 @@
|
||||
package com.app.input.inputaura.lmyfvfs;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.activity.EdgeToEdge;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.graphics.Insets;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.core.view.WindowInsetsCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.viewpager2.adapter.FragmentStateAdapter;
|
||||
import androidx.viewpager2.widget.ViewPager2;
|
||||
|
||||
import com.ad.toponlibrary.AdManager;
|
||||
import com.app.input.inputaura.R;
|
||||
import com.app.input.inputaura.databinding.OgjggBinding;
|
||||
import com.app.input.inputaura.kfsdfbsd.TiuGju;
|
||||
import com.app.input.inputaura.kmnhffs.OfhTff;
|
||||
import com.app.input.inputaura.kmnhffs.FragmentHome;
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public class HiyFg extends AppCompatActivity {
|
||||
|
||||
private OgjggBinding vb;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
vb = OgjggBinding.inflate(getLayoutInflater());
|
||||
EdgeToEdge.enable(this);
|
||||
setContentView(vb.getRoot());
|
||||
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
|
||||
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
|
||||
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
|
||||
return insets;
|
||||
});
|
||||
|
||||
init();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
AdManager.loadAllAd();
|
||||
}
|
||||
|
||||
private void init() {
|
||||
List<Fragment> listFragment = new ArrayList<>();
|
||||
listFragment.add(FragmentHome.newInstance());
|
||||
listFragment.add(OfhTff.newInstance());
|
||||
|
||||
for (int i = 0; i < listFragment.size(); i++) {
|
||||
TabLayout.Tab tab = vb.tabLayout.newTab();
|
||||
|
||||
View inflate = LayoutInflater.from(this).inflate(R.layout.dajiobu, null, false);
|
||||
ImageView icon = inflate.findViewById(R.id.im_icon);
|
||||
TiuGju textView = inflate.findViewById(R.id.textView);
|
||||
if (i == 0) {
|
||||
textView.setSelected(true);
|
||||
textView.setText(getString(R.string.tab_home));
|
||||
icon.setImageDrawable(ContextCompat.getDrawable(this, R.drawable.bfgfhn));
|
||||
} else if(i ==1){
|
||||
textView.setSelected(false);
|
||||
textView.setText(getString(R.string.tab_favorite));
|
||||
icon.setImageDrawable(ContextCompat.getDrawable(this, R.drawable.bdbdfg));
|
||||
}
|
||||
tab.setCustomView(inflate);
|
||||
vb.tabLayout.addTab(tab);
|
||||
}
|
||||
|
||||
|
||||
vb.viewpager.setUserInputEnabled(false);
|
||||
vb.viewpager.setAdapter(new FragmentStateAdapter(this) {
|
||||
@NonNull
|
||||
@Override
|
||||
public Fragment createFragment(int position) {
|
||||
return listFragment.get(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return listFragment.size();
|
||||
}
|
||||
});
|
||||
bing();
|
||||
}
|
||||
|
||||
|
||||
private void bing() {
|
||||
vb.tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
|
||||
@Override
|
||||
public void onTabSelected(TabLayout.Tab tab) {
|
||||
ImageView icon = Objects.requireNonNull(tab.getCustomView()).findViewById(R.id.im_icon);
|
||||
icon.setSelected(true);
|
||||
vb.viewpager.setCurrentItem(tab.getPosition());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTabUnselected(TabLayout.Tab tab) {
|
||||
ImageView icon = Objects.requireNonNull(tab.getCustomView()).findViewById(R.id.im_icon);
|
||||
icon.setSelected(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTabReselected(TabLayout.Tab tab) {
|
||||
|
||||
}
|
||||
});
|
||||
vb.viewpager.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() {
|
||||
@Override
|
||||
public void onPageSelected(int position) {
|
||||
super.onPageSelected(position);
|
||||
Objects.requireNonNull(vb.tabLayout.getTabAt(position)).select();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
344
app/src/main/java/com/app/input/inputaura/lmyfvfs/ViyVyg.kt
Normal file
@ -0,0 +1,344 @@
|
||||
package com.app.input.inputaura.lmyfvfs
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Intent
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.View
|
||||
import android.widget.FrameLayout
|
||||
import android.widget.ImageView
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.TextView
|
||||
import android.widget.Toast
|
||||
import androidx.activity.enableEdgeToEdge
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.view.OnApplyWindowInsetsListener
|
||||
import androidx.core.view.ViewCompat
|
||||
import androidx.core.view.WindowInsetsCompat
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.ad.toponlibrary.AdManager
|
||||
import com.app.input.inputaura.InputAura
|
||||
import com.app.input.inputaura.dasda.Shikamaru
|
||||
import com.app.input.inputaura.bgtng.UngIn
|
||||
import com.app.input.inputaura.bgtng.PunTu
|
||||
import com.app.input.inputaura.ohbnf.OpnYty
|
||||
import com.app.input.inputaura.onjfsgvfsf.DhgUb
|
||||
import com.app.input.inputaura.kmnhffs.YinFjh
|
||||
import com.app.input.inputaura.kfsdfbsd.IutFhfg
|
||||
import com.app.input.inputaura.kfsdfbsd.OunRgf
|
||||
import com.app.input.inputaura.kfsdfbsd.UbgKff
|
||||
import com.app.input.inputaura.R
|
||||
import com.bumptech.glide.Glide
|
||||
import com.bumptech.glide.integration.webp.decoder.WebpDrawable
|
||||
import com.bumptech.glide.load.DataSource
|
||||
import com.bumptech.glide.load.engine.GlideException
|
||||
import com.bumptech.glide.request.RequestListener
|
||||
import com.bumptech.glide.request.target.Target
|
||||
import kotlinx.coroutines.launch
|
||||
import java.io.File
|
||||
|
||||
|
||||
class ViyVyg : AppCompatActivity() {
|
||||
companion object {
|
||||
@JvmField
|
||||
var DISPLAY_URL_KEY: String = "display_url_key"
|
||||
|
||||
@JvmField
|
||||
val ZIP_URL_KEY = "zip_url_key"
|
||||
|
||||
|
||||
@JvmField
|
||||
val NAME_KEY = "name_key"
|
||||
|
||||
@JvmField
|
||||
val GIF_KEY = "gif_key"
|
||||
|
||||
@JvmField
|
||||
val THUMB_KEY = "thumb_key"
|
||||
|
||||
@JvmField
|
||||
val SOURCE_KEY = "data_key"
|
||||
}
|
||||
|
||||
private var dialog: YinFjh? = null
|
||||
private lateinit var displayUrl: String
|
||||
private lateinit var gifUrl: String
|
||||
private lateinit var zipUrl: String
|
||||
private lateinit var name: String
|
||||
private lateinit var applyBtn: LinearLayout
|
||||
private lateinit var imgData: ImageView
|
||||
private lateinit var imgBack: ImageView
|
||||
private lateinit var textName: TextView
|
||||
|
||||
private lateinit var recommendedRecycler: RecyclerView
|
||||
// private lateinit var viewAllLayout: LinearLayout
|
||||
|
||||
private lateinit var loadingLayout: FrameLayout
|
||||
|
||||
private lateinit var unzipPath: String
|
||||
|
||||
private lateinit var tvDownload: TextView
|
||||
private lateinit var imDownload: ImageView
|
||||
|
||||
private lateinit var thumb: String
|
||||
|
||||
private lateinit var imgLike: ImageView
|
||||
|
||||
private lateinit var data: Shikamaru
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.fongng)
|
||||
this.enableEdgeToEdge()
|
||||
ViewCompat.setOnApplyWindowInsetsListener(
|
||||
findViewById<View?>(R.id.main),
|
||||
OnApplyWindowInsetsListener { v: View?, insets: WindowInsetsCompat? ->
|
||||
val systemBars = insets!!.getInsets(WindowInsetsCompat.Type.systemBars())
|
||||
v!!.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
|
||||
insets
|
||||
})
|
||||
AdManager.showTopOn(this) {}
|
||||
findViewId()
|
||||
getExtraData()
|
||||
displayData()
|
||||
setApply()
|
||||
onClick()
|
||||
|
||||
AdManager.loadAllAd()
|
||||
}
|
||||
|
||||
|
||||
private fun getExtraData() {
|
||||
data = intent.getSerializableExtra(SOURCE_KEY) as Shikamaru
|
||||
|
||||
displayUrl = intent.getStringExtra(DISPLAY_URL_KEY).toString()
|
||||
zipUrl = intent.getStringExtra(ZIP_URL_KEY).toString()
|
||||
name = intent.getStringExtra(NAME_KEY).toString()
|
||||
gifUrl = intent.getStringExtra(GIF_KEY).toString()
|
||||
thumb = intent.getStringExtra(THUMB_KEY).toString()
|
||||
|
||||
val serviceZipName = OunRgf.getServiceZipName(zipUrl)
|
||||
unzipPath = OunRgf.getUnzipPath(serviceZipName)
|
||||
|
||||
Log.d("-------------------", "-------unzipPath=" + unzipPath)
|
||||
lifecycleScope.launch {
|
||||
OpnYty.getIsLike(name) {
|
||||
imgLike.isSelected = it
|
||||
}
|
||||
}
|
||||
|
||||
if (File(unzipPath).exists()) {
|
||||
imDownload.isVisible = false
|
||||
tvDownload.text = getString(R.string.apply)
|
||||
} else {
|
||||
imDownload.isVisible = true
|
||||
tvDownload.text = getString(R.string.download_apply)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun findViewId() {
|
||||
applyBtn = findViewById(R.id.layoutDownloadApply)
|
||||
imgData = findViewById(R.id.image_data)
|
||||
imgBack = findViewById(R.id.back)
|
||||
textName = findViewById(R.id.textview_data_name)
|
||||
recommendedRecycler = findViewById(R.id.recommended_recycler)
|
||||
// viewAllLayout = findViewById(R.id.layout_view_all)
|
||||
|
||||
imgLike = findViewById(R.id.im_like)
|
||||
loadingLayout = findViewById(R.id.loading)
|
||||
imDownload = findViewById(R.id.im_download)
|
||||
tvDownload = findViewById(R.id.tv_download)
|
||||
}
|
||||
|
||||
private fun displayData() {
|
||||
textName.text = name
|
||||
if (gifUrl.isNotEmpty()) {
|
||||
loadImgGif()
|
||||
} else {
|
||||
Glide.with(this)
|
||||
.load(displayUrl)
|
||||
.thumbnail(Glide.with(this).load(thumb))
|
||||
.into(imgData)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private fun onClick() {
|
||||
imgBack.setOnClickListener {
|
||||
finish()
|
||||
}
|
||||
|
||||
imgLike.setOnClickListener {
|
||||
imgLike.isSelected = !imgLike.isSelected
|
||||
|
||||
lifecycleScope.launch {
|
||||
if (imgLike.isSelected) {
|
||||
OpnYty.addLike(data)
|
||||
} else {
|
||||
OpnYty.removeLike(data)
|
||||
}
|
||||
}
|
||||
}
|
||||
val forYouList = InputAura.Companion.list.filter {
|
||||
it.parentName == getString(R.string.recommend_name)
|
||||
|
||||
}
|
||||
|
||||
recommendedRecycler.run {
|
||||
adapter = DhgUb(
|
||||
this@ViyVyg
|
||||
).apply {
|
||||
val shuffled = forYouList[0].keyboardList.shuffled()
|
||||
setForYouList(shuffled)
|
||||
}.apply {
|
||||
setClickAction(object : UngIn {
|
||||
override fun OnItemClickListener() {
|
||||
finish()
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
layoutManager = GridLayoutManager(this@ViyVyg, 2)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
private fun loadImgGif() {
|
||||
Glide.with(this)
|
||||
.load(gifUrl)
|
||||
.thumbnail(Glide.with(this).load(thumb))
|
||||
.addListener(object : RequestListener<Drawable> {
|
||||
override fun onLoadFailed(
|
||||
e: GlideException?,
|
||||
model: Any?,
|
||||
target: Target<Drawable>,
|
||||
isFirstResource: Boolean
|
||||
): Boolean {
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
override fun onResourceReady(
|
||||
resource: Drawable,
|
||||
model: Any,
|
||||
target: Target<Drawable>?,
|
||||
dataSource: DataSource,
|
||||
isFirstResource: Boolean
|
||||
): Boolean {
|
||||
if (resource is WebpDrawable) {
|
||||
resource.loopCount = WebpDrawable.LOOP_FOREVER
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
}).into(imgData)
|
||||
}
|
||||
|
||||
private fun setApply() {
|
||||
applyBtn.setOnClickListener {
|
||||
val checkEnable = IutFhfg.checkEnable(this)
|
||||
val checkSetDefault = IutFhfg.checkSetDefault(this)
|
||||
if (!checkEnable || !checkSetDefault) {
|
||||
showDialog()
|
||||
return@setOnClickListener
|
||||
}
|
||||
startDown()
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private fun showDialog() {
|
||||
dialog = dialog ?: YinFjh.Companion.newInstance() .apply{
|
||||
|
||||
|
||||
}
|
||||
dialog?.setClickListener {
|
||||
startDown()
|
||||
}
|
||||
dialog?.show(supportFragmentManager, "")
|
||||
}
|
||||
|
||||
private fun startDown() {
|
||||
loadingLayout.isVisible = true
|
||||
applyBtn.isEnabled = false
|
||||
|
||||
val file = File(unzipPath)
|
||||
if (file.exists()) {
|
||||
val findFirstDirectory = OunRgf.findFirstDirectory(file)
|
||||
|
||||
apply("${findFirstDirectory}/")
|
||||
applyBtn.isEnabled = true
|
||||
loadingLayout.isVisible = false
|
||||
} else {
|
||||
OunRgf.startDownloadZip(zipUrl, object :
|
||||
PunTu {
|
||||
override fun OnApplySkinListener(fileList: List<File?>?) {
|
||||
runOnUiThread {
|
||||
applyBtn.isEnabled = true
|
||||
loadingLayout.isVisible = false
|
||||
}
|
||||
if (fileList.isNullOrEmpty()) {
|
||||
runOnUiThread {
|
||||
Toast.makeText(
|
||||
this@ViyVyg,
|
||||
getString(R.string.download_fail),
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
}
|
||||
} else {
|
||||
// lifecycleScope.launch {
|
||||
// DbFunction.addDownload(data)
|
||||
// }
|
||||
if (file.exists()) {
|
||||
val findFirstDirectory = OunRgf.findFirstDirectory(file)
|
||||
Log.d(
|
||||
InputAura.Companion.TAG,
|
||||
"----apply------------it=$findFirstDirectory"
|
||||
)
|
||||
runOnUiThread {
|
||||
apply("${findFirstDirectory}/")
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun apply(path: String) {
|
||||
var skinParentPath = path
|
||||
if (path.contains("res")) {
|
||||
skinParentPath = path.substringBeforeLast("res")
|
||||
}
|
||||
|
||||
|
||||
UbgKff.updateSkinPath(skinParentPath)
|
||||
Toast.makeText(
|
||||
this@ViyVyg,
|
||||
getString(R.string.theme_application_successful),
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
startActivity(Intent(this, HfyTbg::class.java).apply {
|
||||
putExtra(HfyTbg.key_name, name)
|
||||
})
|
||||
finish()
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
135
app/src/main/java/com/app/input/inputaura/lmyfvfs/YhkFgv.java
Normal file
@ -0,0 +1,135 @@
|
||||
package com.app.input.inputaura.lmyfvfs;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.activity.EdgeToEdge;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.graphics.Insets;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.core.view.WindowInsetsCompat;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.ad.toponlibrary.AdManager;
|
||||
import com.app.input.inputaura.InputAura;
|
||||
import com.app.input.inputaura.R;
|
||||
import com.app.input.inputaura.dasda.Shikamaru;
|
||||
import com.app.input.inputaura.dasda.Inhj;
|
||||
import com.app.input.inputaura.databinding.AdiasdnadBinding;
|
||||
import com.app.input.inputaura.onjfsgvfsf.DubTbf;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class YhkFgv extends BaseActivity {
|
||||
private AdiasdnadBinding vb;
|
||||
public static final String KEY_NAME = "class_name";
|
||||
private String name;
|
||||
private List<Shikamaru> data = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
vb = AdiasdnadBinding.inflate(getLayoutInflater());
|
||||
EdgeToEdge.enable(this);
|
||||
setContentView(vb.getRoot());
|
||||
|
||||
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
|
||||
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
|
||||
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
|
||||
return insets;
|
||||
});
|
||||
|
||||
name = getIntent().getStringExtra(KEY_NAME);
|
||||
initData();
|
||||
initClick();
|
||||
}
|
||||
|
||||
private void initData() {
|
||||
vb.className.setText(name);
|
||||
|
||||
// 查找对应分类的数据
|
||||
for (Inhj inhj : InputAura.list) {
|
||||
if (inhj.getParentName().equals(name)) {
|
||||
data = inhj.getKeyboardList();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 使用新的适配器
|
||||
DubTbf adapterMain = new DubTbf(this, data);
|
||||
|
||||
// 设置两列网格布局
|
||||
GridLayoutManager layoutManager = new GridLayoutManager(YhkFgv.this, 2);
|
||||
vb.recycler.setLayoutManager(layoutManager);
|
||||
vb.recycler.setAdapter(adapterMain);
|
||||
|
||||
// 添加间距装饰器 - 修正:设置为false,因为我们已经在适配器中考虑了间距
|
||||
int spacing = getResources().getDimensionPixelSize(R.dimen.grid_spacing);
|
||||
vb.recycler.addItemDecoration(new GridSpacingItemDecoration(2, spacing, false));
|
||||
}
|
||||
|
||||
private void initClick() {
|
||||
vb.back.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
onInterceptBackPressed();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 网格间距装饰器
|
||||
public static class GridSpacingItemDecoration extends RecyclerView.ItemDecoration {
|
||||
private int spanCount;
|
||||
private int spacing;
|
||||
private boolean includeEdge;
|
||||
|
||||
public GridSpacingItemDecoration(int spanCount, int spacing, boolean includeEdge) {
|
||||
this.spanCount = spanCount;
|
||||
this.spacing = spacing;
|
||||
this.includeEdge = includeEdge;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getItemOffsets(android.graphics.Rect outRect, View view,
|
||||
RecyclerView parent, RecyclerView.State state) {
|
||||
int position = parent.getChildAdapterPosition(view);
|
||||
int column = position % spanCount;
|
||||
|
||||
if (includeEdge) {
|
||||
outRect.left = spacing - column * spacing / spanCount;
|
||||
outRect.right = (column + 1) * spacing / spanCount;
|
||||
|
||||
if (position < spanCount) {
|
||||
outRect.top = spacing;
|
||||
}
|
||||
outRect.bottom = spacing;
|
||||
} else {
|
||||
// 修正:只添加列间距,不添加边缘间距
|
||||
outRect.left = column * spacing / spanCount;
|
||||
outRect.right = spacing - (column + 1) * spacing / spanCount;
|
||||
|
||||
// 添加顶部间距(除第一行外)
|
||||
if (position >= spanCount) {
|
||||
outRect.top = spacing;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected boolean shouldInterceptBackPress() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onInterceptBackPressed() {
|
||||
AdManager.showTopOn(this, () -> {});
|
||||
if (getBackPressedCallback() != null) {
|
||||
getBackPressedCallback().setEnabled(false);
|
||||
}
|
||||
getOnBackPressedDispatcher().onBackPressed();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
package com.app.input.inputaura.nggfsdfds;
|
||||
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class GobYiu {
|
||||
private String name;
|
||||
private List<UnyOin> unyOins = new ArrayList<>();
|
||||
|
||||
|
||||
public GobYiu(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
// Getters and Setters
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public List<UnyOin> getKeys() {
|
||||
return unyOins;
|
||||
}
|
||||
|
||||
public void addKey(UnyOin unyOin) {
|
||||
this.unyOins.add(unyOin);
|
||||
}
|
||||
|
||||
public UnyOin getLastKey() {
|
||||
return unyOins.isEmpty() ? null : unyOins.get(unyOins.size() - 1);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
168
app/src/main/java/com/app/input/inputaura/nggfsdfds/PinRuh.java
Normal file
@ -0,0 +1,168 @@
|
||||
package com.app.input.inputaura.nggfsdfds;
|
||||
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
|
||||
public class PinRuh {
|
||||
private String version;
|
||||
private String supportLayouts;
|
||||
private int hideHint;
|
||||
private String layoutStyle;
|
||||
private List<GobYiu> layouts = new ArrayList<>();
|
||||
private List<UnyOin> unyOinList = new ArrayList<>();
|
||||
private LinkedHashMap<String, String> maps = new LinkedHashMap<>();
|
||||
private String KeyDefault;
|
||||
private String KeyMarkDefault;
|
||||
private String KeyFuncDefault;
|
||||
private String KeyShift;
|
||||
private String KeyDelete;
|
||||
private String KeyAlphaSymbol;
|
||||
private String KeyEmoji;
|
||||
private String KeyMark;
|
||||
private String KeySpace;
|
||||
private String KeyEnter;
|
||||
|
||||
// Getters and Setters
|
||||
public String getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(String version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public String getSupportLayouts() {
|
||||
return supportLayouts;
|
||||
}
|
||||
|
||||
public void setSupportLayouts(String supportLayouts) {
|
||||
this.supportLayouts = supportLayouts;
|
||||
}
|
||||
|
||||
public int getHideHint() {
|
||||
return hideHint;
|
||||
}
|
||||
|
||||
public void setHideHint(int hideHint) {
|
||||
this.hideHint = hideHint;
|
||||
}
|
||||
|
||||
public String getLayoutStyle() {
|
||||
return layoutStyle;
|
||||
}
|
||||
|
||||
public void setLayoutStyle(String layoutStyle) {
|
||||
this.layoutStyle = layoutStyle;
|
||||
}
|
||||
|
||||
public List<GobYiu> getLayouts() {
|
||||
return layouts;
|
||||
}
|
||||
|
||||
public void addLayout(GobYiu layout) {
|
||||
this.layouts.add(layout);
|
||||
}
|
||||
|
||||
public List<UnyOin> getKeyList() {
|
||||
return unyOinList;
|
||||
}
|
||||
|
||||
public UnyOin getLastKeyList() {
|
||||
return unyOinList.isEmpty() ? null : unyOinList.get(unyOinList.size() - 1);
|
||||
}
|
||||
|
||||
public void addKey(UnyOin unyOin) {
|
||||
this.unyOinList.add(unyOin);
|
||||
}
|
||||
|
||||
public LinkedHashMap<String, String> getMaps() {
|
||||
return maps;
|
||||
}
|
||||
|
||||
public void setMaps(LinkedHashMap<String, String> maps) {
|
||||
this.maps = maps;
|
||||
}
|
||||
|
||||
public String getKeyDefault() {
|
||||
return KeyDefault;
|
||||
}
|
||||
|
||||
public void setKeyDefault(String keyDefault) {
|
||||
KeyDefault = keyDefault;
|
||||
}
|
||||
|
||||
public String getKeyMarkDefault() {
|
||||
return KeyMarkDefault;
|
||||
}
|
||||
|
||||
public void setKeyMarkDefault(String keyMarkDefault) {
|
||||
KeyMarkDefault = keyMarkDefault;
|
||||
}
|
||||
|
||||
public String getKeyFuncDefault() {
|
||||
return KeyFuncDefault;
|
||||
}
|
||||
|
||||
public void setKeyFuncDefault(String keyFuncDefault) {
|
||||
KeyFuncDefault = keyFuncDefault;
|
||||
}
|
||||
|
||||
public String getKeyShift() {
|
||||
return KeyShift;
|
||||
}
|
||||
|
||||
public void setKeyShift(String keyShift) {
|
||||
KeyShift = keyShift;
|
||||
}
|
||||
|
||||
public String getKeyDelete() {
|
||||
return KeyDelete;
|
||||
}
|
||||
|
||||
public void setKeyDelete(String keyDelete) {
|
||||
KeyDelete = keyDelete;
|
||||
}
|
||||
|
||||
public String getKeyAlphaSymbol() {
|
||||
return KeyAlphaSymbol;
|
||||
}
|
||||
|
||||
public void setKeyAlphaSymbol(String keyAlphaSymbol) {
|
||||
KeyAlphaSymbol = keyAlphaSymbol;
|
||||
}
|
||||
|
||||
public String getKeyEmoji() {
|
||||
return KeyEmoji;
|
||||
}
|
||||
|
||||
public void setKeyEmoji(String keyEmoji) {
|
||||
KeyEmoji = keyEmoji;
|
||||
}
|
||||
|
||||
public String getKeyMark() {
|
||||
return KeyMark;
|
||||
}
|
||||
|
||||
public void setKeyMark(String keyMark) {
|
||||
KeyMark = keyMark;
|
||||
}
|
||||
|
||||
public String getKeySpace() {
|
||||
return KeySpace;
|
||||
}
|
||||
|
||||
public void setKeySpace(String keySpace) {
|
||||
KeySpace = keySpace;
|
||||
}
|
||||
|
||||
public String getKeyEnter() {
|
||||
return KeyEnter;
|
||||
}
|
||||
|
||||
public void setKeyEnter(String keyEnter) {
|
||||
KeyEnter = keyEnter;
|
||||
}
|
||||
}
|
||||
288
app/src/main/java/com/app/input/inputaura/nggfsdfds/PyvTbu.java
Normal file
@ -0,0 +1,288 @@
|
||||
package com.app.input.inputaura.nggfsdfds;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.inputmethodservice.InputMethodService;
|
||||
|
||||
import android.media.MediaPlayer;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.view.inputmethod.InputConnection;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.VideoView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.integration.webp.decoder.WebpDrawable;
|
||||
import com.bumptech.glide.load.DataSource;
|
||||
import com.bumptech.glide.load.engine.GlideException;
|
||||
import com.bumptech.glide.request.RequestListener;
|
||||
import com.bumptech.glide.request.target.Target;
|
||||
import com.app.input.inputaura.InputAura;
|
||||
import com.app.input.inputaura.R;
|
||||
import com.app.input.inputaura.kfsdfbsd.GdfhNtf;
|
||||
import com.app.input.inputaura.kfsdfbsd.IutFhfg;
|
||||
import com.app.input.inputaura.kfsdfbsd.UbgKff;
|
||||
import com.app.input.inputaura.onhvtgfs.VuhTg;
|
||||
import com.app.input.inputaura.onhvtgfs.HiyFhg;
|
||||
|
||||
|
||||
import kotlin.Unit;
|
||||
import kotlin.jvm.functions.Function2;
|
||||
|
||||
public class PyvTbu extends InputMethodService implements HiyFhg.OnKeyboardActionListener {
|
||||
|
||||
|
||||
private RvyIub rvyIub;
|
||||
private VuhTg mKeyBoard;
|
||||
private View parentView;
|
||||
|
||||
|
||||
private ImageView imBG;
|
||||
private VideoView videoView;
|
||||
|
||||
private int a = R.xml.xml_one;
|
||||
private int b = R.xml.xml_two;
|
||||
private int c = R.xml.xml_three;
|
||||
|
||||
private int curImeAction = EditorInfo.IME_ACTION_UNSPECIFIED;
|
||||
|
||||
@SuppressLint("InflateParams")
|
||||
@Override
|
||||
public View onCreateInputView() {
|
||||
parentView = getLayoutInflater().inflate(R.layout.uususs, null);
|
||||
findView();
|
||||
return parentView;
|
||||
}
|
||||
|
||||
private void findView() {
|
||||
|
||||
imBG = parentView.findViewById(R.id.gif_bg);
|
||||
videoView = parentView.findViewById(R.id.video_view);
|
||||
mKeyBoard = new VuhTg(this, a);
|
||||
rvyIub = parentView.findViewById(R.id.custom_input_view);
|
||||
rvyIub.setEnabled(true);
|
||||
rvyIub.setPreviewEnabled(false);
|
||||
rvyIub.setKeyboard(mKeyBoard);
|
||||
rvyIub.setOnKeyboardActionListener(this);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onWindowHidden() {
|
||||
super.onWindowHidden();
|
||||
if (videoView.isPlaying()) {
|
||||
videoView.pause();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWindowShown() {
|
||||
super.onWindowShown();
|
||||
EditorInfo currentInputEditorInfo = getCurrentInputEditorInfo();
|
||||
curImeAction = IutFhfg.INSTANCE.getTextForImeAction(currentInputEditorInfo.imeOptions);
|
||||
String skinPath = UbgKff.INSTANCE.getSkinPath();
|
||||
|
||||
if (skinPath == null || skinPath.isEmpty()) {
|
||||
Log.d(InputAura.TAG, "---------skinPath= bull");
|
||||
rvyIub.updateUi(curImeAction);
|
||||
} else {
|
||||
Log.d(InputAura.TAG, "---------skinPath= 1111");
|
||||
QunSg.INSTANCE.readBgOrVideo(this, new Function2<String, Drawable, Unit>() {
|
||||
@Override
|
||||
public Unit invoke(String s, Drawable drawable) {
|
||||
Log.d(InputAura.TAG, "---------s= " + s + "---------drawable=" + drawable);
|
||||
if (s != null) {
|
||||
rvyIub.setBackground(null);
|
||||
if (s.endsWith(".gif")) {
|
||||
imBG.setVisibility(View.VISIBLE);
|
||||
videoView.setVisibility(View.GONE);
|
||||
Glide.with(PyvTbu.this)
|
||||
.load(s)
|
||||
.addListener(new RequestListener<Drawable>() {
|
||||
@Override
|
||||
public boolean onLoadFailed(@Nullable GlideException e, @Nullable Object model, @NonNull Target<Drawable> target, boolean isFirstResource) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onResourceReady(@NonNull Drawable resource, @NonNull Object model, Target<Drawable> target, @NonNull DataSource dataSource, boolean isFirstResource) {
|
||||
if (resource instanceof WebpDrawable) {
|
||||
((WebpDrawable) resource).setLoopCount(WebpDrawable.LOOP_FOREVER);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}).into(imBG);
|
||||
} else if (s.endsWith(".mp4")) {
|
||||
imBG.setVisibility(View.GONE);
|
||||
videoView.setVisibility(View.VISIBLE);
|
||||
videoView.setVideoPath(s);
|
||||
videoView.start();
|
||||
videoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
|
||||
@Override
|
||||
public void onPrepared(MediaPlayer mp) {
|
||||
mp.setLooping(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
} else {
|
||||
rvyIub.setBackground(drawable);
|
||||
}
|
||||
rvyIub.updateUi(curImeAction);
|
||||
return null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (videoView != null) {
|
||||
videoView.stopPlayback();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPress(int primaryCode) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRelease(int primaryCode) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onKey(int primaryCode, int[] keyCodes) {
|
||||
|
||||
InputConnection curInputConnect = getCurrentInputConnection();
|
||||
switch (primaryCode) {
|
||||
case GdfhNtf.KEY_CODE_DELETE:
|
||||
curInputConnect.deleteSurroundingText(1, 0);
|
||||
break;
|
||||
case GdfhNtf.KEY_CODE_SHIFT:
|
||||
switchShift();
|
||||
break;
|
||||
case GdfhNtf.KEY_CODE_NUMBER_SHIFT:
|
||||
case GdfhNtf.KEY_CODE_SYMBOL_SHIFT:
|
||||
switchMoreOrNumber();
|
||||
break;
|
||||
case GdfhNtf.KEY_CODE_CHANGE_NUMBER:
|
||||
case GdfhNtf.KEY_CODE_BACK:
|
||||
switchNormalOrNumber();
|
||||
break;
|
||||
|
||||
case GdfhNtf.KEY_CODE_COMPLETE:
|
||||
case GdfhNtf.KEY_CODE_CANCEL:
|
||||
curInputConnect.performEditorAction(curImeAction);
|
||||
// curInputConnect.performEditorAction(EditorInfo.IME_ACTION_DONE);
|
||||
break;
|
||||
default:
|
||||
String codeToChar = QunSg.INSTANCE.primaryCodeToChar(primaryCode);
|
||||
curInputConnect.commitText(codeToChar, 1);
|
||||
if (rvyIub.isLowerCase() == 1) {
|
||||
//自动转小写
|
||||
rvyIub.setLowerCase(0);
|
||||
QunSg.INSTANCE.keyToLowerCase(mKeyBoard);
|
||||
rvyIub.setKeyboard(mKeyBoard);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void switchMoreOrNumber() {
|
||||
int mode = rvyIub.getMode();
|
||||
switch (mode) {
|
||||
case 1:
|
||||
mKeyBoard = new VuhTg(this, c);
|
||||
rvyIub.setMode(2);
|
||||
rvyIub.setKeyboard(mKeyBoard);
|
||||
break;
|
||||
case 2:
|
||||
mKeyBoard = new VuhTg(this, b);
|
||||
rvyIub.setMode(1);
|
||||
rvyIub.setKeyboard(mKeyBoard);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void switchNormalOrNumber() {
|
||||
int mode = rvyIub.getMode();
|
||||
switch (mode) {
|
||||
case 0:
|
||||
mKeyBoard = new VuhTg(this, b);
|
||||
rvyIub.setMode(1);
|
||||
rvyIub.setKeyboard(mKeyBoard);
|
||||
break;
|
||||
case 1:
|
||||
case 2:
|
||||
mKeyBoard = new VuhTg(this, a);
|
||||
rvyIub.setMode(0);
|
||||
rvyIub.setKeyboard(mKeyBoard);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void switchShift() {
|
||||
int lowerCase = rvyIub.isLowerCase();
|
||||
switch (lowerCase) {
|
||||
case 0:
|
||||
//当前小写转大写
|
||||
rvyIub.setLowerCase(1);
|
||||
QunSg.INSTANCE.keyToUpper(mKeyBoard);
|
||||
rvyIub.setKeyboard(mKeyBoard);
|
||||
break;
|
||||
case 1:
|
||||
//当前大写转锁定大写
|
||||
rvyIub.setLowerCase(2);
|
||||
break;
|
||||
case 2:
|
||||
//当前锁定大写转小写
|
||||
rvyIub.setLowerCase(0);
|
||||
QunSg.INSTANCE.keyToLowerCase(mKeyBoard);
|
||||
rvyIub.setKeyboard(mKeyBoard);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onText(CharSequence text) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void swipeLeft() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void swipeRight() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void swipeDown() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void swipeUp() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
100
app/src/main/java/com/app/input/inputaura/nggfsdfds/QunSg.kt
Normal file
@ -0,0 +1,100 @@
|
||||
package com.app.input.inputaura.nggfsdfds
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.graphics.BitmapFactory
|
||||
import android.graphics.drawable.BitmapDrawable
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.util.Log
|
||||
import com.app.input.inputaura.InputAura
|
||||
import com.app.input.inputaura.onhvtgfs.VuhTg
|
||||
import com.app.input.inputaura.kfsdfbsd.GdfhNtf
|
||||
import com.app.input.inputaura.kfsdfbsd.UbgKff
|
||||
import java.io.File
|
||||
|
||||
object QunSg {
|
||||
fun keyToUpper(mKeyBoard: VuhTg) {
|
||||
for (key in mKeyBoard.keys) {
|
||||
if (key.label != null) {
|
||||
if (key.label.length == 1) {
|
||||
val charLabel = key.label.toString()[0]
|
||||
val toUpperCase = charLabel.uppercaseChar()
|
||||
key.codes[0] = toUpperCase.toInt()
|
||||
key.label = toUpperCase.toString()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
fun keyToLowerCase(mKeyBoard: VuhTg) {
|
||||
for (key in mKeyBoard.keys) {
|
||||
if (key.label != null) {
|
||||
if (key.label.length == 1) {
|
||||
val charLabel = key.label.toString()[0]
|
||||
val toLowerCase = charLabel.lowercaseChar()
|
||||
key.codes[0] = toLowerCase.toInt()
|
||||
key.label = toLowerCase.toString()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun primaryCodeToChar(primCode: Int): String {
|
||||
val toString = primCode.toChar().toString()
|
||||
|
||||
return toString
|
||||
}
|
||||
|
||||
@SuppressLint("SuspiciousIndentation")
|
||||
fun readBgOrVideo(
|
||||
context: Context,
|
||||
playAction: (gif: String?, bgDraw: Drawable?) -> Unit
|
||||
) {
|
||||
|
||||
UbgKff.getSkinPath()?.let { resPath ->
|
||||
val videoPath = "${resPath}res/raw/${GdfhNtf.videoName}"
|
||||
val videoPath2 = "${resPath}res/raw/${GdfhNtf.video}"
|
||||
val backgroundPath = "${resPath}res/drawable-xxhdpi-v4/${GdfhNtf.bgName}"
|
||||
val backgroundPath_png = "${resPath}res/drawable-xxhdpi-v4/${GdfhNtf.bgName_png}"
|
||||
val file = File(videoPath)
|
||||
val file2 = File(videoPath2)
|
||||
val file3 = File(backgroundPath)
|
||||
val file4 = File(backgroundPath_png)
|
||||
if (file.exists() || file2.exists()) {
|
||||
Log.d(InputAura.Companion.TAG, "--------11111111= resPath=${resPath}")
|
||||
val path: String = if (file.exists()) {
|
||||
videoPath
|
||||
} else {
|
||||
videoPath2
|
||||
}
|
||||
val bitmapDrawable =
|
||||
BitmapDrawable(context.resources, BitmapFactory.decodeFile(path))
|
||||
|
||||
playAction.invoke(path, null)
|
||||
|
||||
// playAction.invoke(mediaPlayer,null);
|
||||
} else {
|
||||
Log.d(
|
||||
InputAura.Companion.TAG,
|
||||
"--------11111111= file3.exists()" + file3.exists() + "---resPath=" + resPath
|
||||
)
|
||||
if (file3.exists()) {
|
||||
val bitmapDrawable =
|
||||
BitmapDrawable(context.resources, BitmapFactory.decodeFile(backgroundPath))
|
||||
playAction.invoke(null, bitmapDrawable)
|
||||
} else if (file4.exists()) {
|
||||
val bitmapDrawable =
|
||||
BitmapDrawable(context.resources, BitmapFactory.decodeFile(backgroundPath_png))
|
||||
playAction.invoke(null, bitmapDrawable)
|
||||
} else {
|
||||
playAction.invoke(null, null)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
324
app/src/main/java/com/app/input/inputaura/nggfsdfds/RvyIub.java
Normal file
@ -0,0 +1,324 @@
|
||||
package com.app.input.inputaura.nggfsdfds;
|
||||
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
|
||||
import androidx.core.graphics.drawable.DrawableCompat;
|
||||
|
||||
import com.app.input.inputaura.InputAura;
|
||||
import com.app.input.inputaura.R;
|
||||
import com.app.input.inputaura.onhvtgfs.VuhTg;
|
||||
import com.app.input.inputaura.onhvtgfs.HiyFhg;
|
||||
import com.app.input.inputaura.kfsdfbsd.GdfhNtf;
|
||||
import com.app.input.inputaura.kfsdfbsd.FjgvUv;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class RvyIub extends HiyFhg {
|
||||
|
||||
private Paint mPaint;
|
||||
private Context mContext;
|
||||
|
||||
private float mRation = 0.5f;
|
||||
|
||||
|
||||
//0 小写 1 大写 2 大写锁定
|
||||
private int isLowerCase = 0;
|
||||
//0 默认键盘 1 字母键盘 2 符号键盘
|
||||
private int mMode = 0;
|
||||
|
||||
private FjgvUv fjgvUv;
|
||||
private int curImeAction = EditorInfo.IME_ACTION_UNSPECIFIED;
|
||||
|
||||
public RvyIub(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
mContext = context;
|
||||
setAttribute(attrs, context);
|
||||
}
|
||||
|
||||
public RvyIub(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
mContext = context;
|
||||
setAttribute(attrs, context);
|
||||
}
|
||||
|
||||
public RvyIub(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
mContext = context;
|
||||
setAttribute(attrs, context);
|
||||
}
|
||||
|
||||
|
||||
public void setMode(int mType) {
|
||||
this.mMode = mType;
|
||||
}
|
||||
|
||||
public int getMode() {
|
||||
return mMode;
|
||||
}
|
||||
|
||||
public int isLowerCase() {
|
||||
return isLowerCase;
|
||||
}
|
||||
|
||||
public void setLowerCase(int lowerCase) {
|
||||
isLowerCase = lowerCase;
|
||||
}
|
||||
|
||||
public void updateUi(int ime) {
|
||||
Log.d(InputAura.TAG, "----------ime=" + ime);
|
||||
curImeAction = ime;
|
||||
fjgvUv.updateSkinConfig();
|
||||
invalidate();
|
||||
}
|
||||
|
||||
private void initPaint() {
|
||||
mPaint = new Paint();
|
||||
mPaint.setAntiAlias(true);
|
||||
mPaint.setTextAlign(Paint.Align.CENTER);
|
||||
|
||||
}
|
||||
|
||||
private void setAttribute(AttributeSet attrs, Context con) {
|
||||
fjgvUv = new FjgvUv(con);
|
||||
initPaint();
|
||||
TypedArray mTypedArray = con.obtainStyledAttributes(attrs, R.styleable.CustomInputView);
|
||||
|
||||
// int color = mTypedArray.getColor(R.styleable.CustomInputView_text_color_done, 1);
|
||||
//
|
||||
// Drawable drawable = mTypedArray.getDrawable(R.styleable.CustomInputView_drawable_cancel);
|
||||
//
|
||||
// int textSize = mTypedArray.getInt(R.styleable.CustomInputView_text_size_key, 12);
|
||||
|
||||
mTypedArray.recycle();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDraw(Canvas canvas) {
|
||||
super.onDraw(canvas);
|
||||
|
||||
|
||||
PinRuh config = fjgvUv.getConfig();
|
||||
List<UnyOin> unyOins = new ArrayList<>();
|
||||
int i = 0;
|
||||
|
||||
for (VuhTg.Key curKey : getKeyboard().getKeys()) {
|
||||
int code = curKey.codes[0];
|
||||
if (config != null&& !config.getLayouts().isEmpty()) {
|
||||
if (code == 113 ||code == 81 || code == 49||code == 91) {
|
||||
i = 0;
|
||||
GobYiu gobYiu = config.getLayouts().get(0);
|
||||
unyOins = gobYiu.getKeys();
|
||||
} else if (code == 97||code == 65 || code == 33||code == 126) {
|
||||
i = 0;
|
||||
GobYiu gobYiu = config.getLayouts().get(1);
|
||||
unyOins = gobYiu.getKeys();
|
||||
}else if (code == -1 || code == -103||code==-101) {
|
||||
i = 0;
|
||||
GobYiu gobYiu = config.getLayouts().get(2);
|
||||
unyOins = gobYiu.getKeys();
|
||||
}else if (code == -2 || code == -102) {
|
||||
i = 0;
|
||||
GobYiu gobYiu = config.getLayouts().get(3);
|
||||
unyOins = gobYiu.getKeys();
|
||||
}
|
||||
String background = unyOins.get(i).getBackground()+".9.png";
|
||||
i++;
|
||||
Drawable configBg = fjgvUv.getConfigBg(background);
|
||||
realNewDraw(configBg, curKey, canvas, code);
|
||||
|
||||
} else {
|
||||
realDraw(curKey, canvas, code);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void realNewDraw(Drawable configBg, VuhTg.Key curKey, Canvas canvas, int code) {
|
||||
switch (code) {
|
||||
case GdfhNtf.KEY_CODE_SHIFT:
|
||||
// drawAllShift(curKey, canvas);
|
||||
onDrawCurKey(curKey, canvas, "Shift", configBg, null);
|
||||
break;
|
||||
case GdfhNtf.KEY_CODE_NUMBER_SHIFT:
|
||||
onDrawCurKey(curKey, canvas, "More", configBg, null);
|
||||
break;
|
||||
case GdfhNtf.KEY_CODE_DELETE:
|
||||
onDrawCurKey(curKey, canvas, "Delete", configBg, null);
|
||||
break;
|
||||
case GdfhNtf.KEY_CODE_SYMBOL_SHIFT:
|
||||
onDrawCurKey(curKey, canvas, "123", configBg, null);
|
||||
break;
|
||||
case GdfhNtf.KEY_CODE_CHANGE_NUMBER:
|
||||
onDrawCurKey(curKey, canvas, null, configBg, null);
|
||||
break;
|
||||
case GdfhNtf.KEY_CODE_BACK:
|
||||
onDrawCurKey(curKey, canvas, "Back", configBg, null);
|
||||
break;
|
||||
case GdfhNtf.KEY_CODE_SPACE:
|
||||
onDrawCurKey(curKey, canvas, null, configBg, null);
|
||||
break;
|
||||
case GdfhNtf.KEY_CODE_COMPLETE, GdfhNtf.KEY_CODE_CANCEL:
|
||||
Log.d(InputAura.TAG, "-11111111111---------curImeAction=" + curImeAction);
|
||||
if (curImeAction == EditorInfo.IME_ACTION_SEARCH) {
|
||||
onDrawCurKey(curKey, canvas, "Search", configBg, null);
|
||||
} else {
|
||||
onDrawCurKey(curKey, canvas, "Done", configBg, null);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
||||
onDrawCurKey(curKey, canvas, null, configBg, null);
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void realDraw(VuhTg.Key curKey, Canvas canvas, int code) {
|
||||
switch (code) {
|
||||
case GdfhNtf.KEY_CODE_SHIFT:
|
||||
drawAllShift(curKey, canvas);
|
||||
break;
|
||||
case GdfhNtf.KEY_CODE_NUMBER_SHIFT:
|
||||
onDrawCurKey(curKey, canvas, "More", fjgvUv.getFunctionDraw(), null);
|
||||
break;
|
||||
case GdfhNtf.KEY_CODE_DELETE:
|
||||
onDrawCurKey(curKey, canvas, "Delete", fjgvUv.getFunctionDraw(), null);
|
||||
break;
|
||||
case GdfhNtf.KEY_CODE_SYMBOL_SHIFT:
|
||||
onDrawCurKey(curKey, canvas, "123", fjgvUv.getFunctionDraw(), null);
|
||||
break;
|
||||
case GdfhNtf.KEY_CODE_CHANGE_NUMBER:
|
||||
onDrawCurKey(curKey, canvas, null, fjgvUv.getToDraw(), null);
|
||||
break;
|
||||
case GdfhNtf.KEY_CODE_BACK:
|
||||
onDrawCurKey(curKey, canvas, "Back", fjgvUv.getToDraw(), null);
|
||||
break;
|
||||
case GdfhNtf.KEY_CODE_SPACE:
|
||||
onDrawCurKey(curKey, canvas, null, fjgvUv.getSpaceDraw(), null);
|
||||
break;
|
||||
case GdfhNtf.KEY_CODE_COMPLETE, GdfhNtf.KEY_CODE_CANCEL:
|
||||
Log.d(InputAura.TAG, "-11111111111---------curImeAction=" + curImeAction);
|
||||
if (curImeAction == EditorInfo.IME_ACTION_SEARCH) {
|
||||
onDrawCurKey(curKey, canvas, "Search", fjgvUv.getFunctionDraw(), null);
|
||||
} else {
|
||||
onDrawCurKey(curKey, canvas, "Done", fjgvUv.getFunctionDraw(), null);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
||||
onDrawCurKey(curKey, canvas, null, fjgvUv.getGeneralDraw(), null);
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void drawAllShift(VuhTg.Key curKey, Canvas canvas) {
|
||||
if (isLowerCase == 0) {
|
||||
onDrawCurKey(curKey, canvas, "Shift", fjgvUv.getFunctionDraw(), null);
|
||||
} else if (isLowerCase == 1) {
|
||||
onDrawCurKey(curKey, canvas, "Shift", fjgvUv.getFunctionDraw(), null);
|
||||
} else if (isLowerCase == 2) {
|
||||
onDrawCurKey(curKey, canvas, "Shift", fjgvUv.getFunctionDraw(), null);
|
||||
}
|
||||
}
|
||||
|
||||
private void onDrawCurKey(VuhTg.Key curKey, Canvas curCanvas, String label, Drawable bgDrawable, Drawable iconDraw) {
|
||||
|
||||
if (bgDrawable != null) {
|
||||
onDrawKeyBackground(curKey, curCanvas, bgDrawable);
|
||||
}
|
||||
if (iconDraw != null) {
|
||||
onDrawKeyIcon(curKey, curCanvas, iconDraw);
|
||||
}
|
||||
onDrawKeyText(curKey, curCanvas, label);
|
||||
}
|
||||
|
||||
private void onDrawKeyText(VuhTg.Key curKey, Canvas curCanvas, String label) {
|
||||
mPaint.setColor(fjgvUv.getKeyTextColor());
|
||||
mPaint.setTextSize(mContext.getResources().getDimension(R.dimen.text_size));
|
||||
float v = curKey.width / 2f;
|
||||
float v1 = curKey.height / 2f;
|
||||
float v2 = (mPaint.getTextSize() - mPaint.descent()) / 2f;
|
||||
|
||||
|
||||
if (curKey.label != null) {
|
||||
curCanvas.drawText((String) curKey.label, curKey.x + getPaddingLeft() + v, curKey.y + getPaddingRight() + v1 + v2, mPaint);
|
||||
} else if (label != null) {
|
||||
curCanvas.drawText(label, curKey.x + getPaddingLeft() + v, curKey.y + getPaddingRight() + v1 + v2, mPaint);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void onDrawKeyBackground(VuhTg.Key curKey, Canvas curCanvas, Drawable curDrawable) {
|
||||
if (curKey.codes[0] != 0) {
|
||||
curDrawable.setState(curKey.getCurrentDrawableState());
|
||||
}
|
||||
Rect rect = new Rect((curKey.x + this.getPaddingLeft()), (curKey.y + this.getPaddingTop()), (curKey.x + this.getPaddingLeft() + curKey.width), (curKey.y + this.getPaddingTop() + curKey.height));
|
||||
curDrawable.setBounds(rect);
|
||||
|
||||
curDrawable.draw(curCanvas);
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void onDrawKeyIcon(VuhTg.Key curKey, Canvas curCanvas, Drawable curDrawable) {
|
||||
|
||||
Drawable wrap = DrawableCompat.wrap(curDrawable);
|
||||
|
||||
curKey.icon = curDrawable;
|
||||
float iconW = (float) curKey.icon.getIntrinsicWidth();
|
||||
float iconH = (float) curKey.icon.getIntrinsicHeight();
|
||||
|
||||
float wDivRation = iconW / curKey.width;
|
||||
float hDivRation = iconH / curKey.height;
|
||||
|
||||
curKey.icon.draw(curCanvas);
|
||||
|
||||
if (wDivRation > hDivRation) {
|
||||
float minRatio = 0;
|
||||
if (wDivRation <= mRation) {
|
||||
minRatio = wDivRation;
|
||||
} else {
|
||||
minRatio = mRation;
|
||||
}
|
||||
iconH = (iconH / wDivRation) * minRatio;
|
||||
iconW = (iconW / wDivRation) * minRatio;
|
||||
} else {
|
||||
float minRatio = 0;
|
||||
if (hDivRation <= mRation) {
|
||||
minRatio = hDivRation;
|
||||
} else {
|
||||
minRatio = mRation;
|
||||
}
|
||||
iconH = (iconH / hDivRation) * minRatio;
|
||||
iconW = (iconW / hDivRation) * minRatio;
|
||||
}
|
||||
float subW = (curKey.width - iconW) / 2f;
|
||||
float subH = (curKey.height - iconH) / 2f;
|
||||
int xLeft = (int) (curKey.x + getPaddingLeft() + subW);
|
||||
int yTop = (int) (curKey.y + getPaddingTop() + subH);
|
||||
int xRight = (int) (xLeft + iconW);
|
||||
int yBottom = (int) (yTop + iconH);
|
||||
curKey.icon.setBounds(xLeft, yTop, xRight, yBottom);
|
||||
curKey.icon.draw(curCanvas);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
package com.app.input.inputaura.nggfsdfds;
|
||||
|
||||
// 按键对象模型
|
||||
public class UnyOin {
|
||||
private String name;
|
||||
private String background;
|
||||
private String label;
|
||||
|
||||
public UnyOin(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
// Getters and Setters
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
public void setBackground(String background) {
|
||||
this.background = background;
|
||||
}
|
||||
|
||||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
|
||||
public void setLabel(String label) {
|
||||
this.label = label;
|
||||
}
|
||||
}
|
||||
31
app/src/main/java/com/app/input/inputaura/ohbnf/BinYuTb.kt
Normal file
@ -0,0 +1,31 @@
|
||||
package com.app.input.inputaura.ohbnf
|
||||
|
||||
import androidx.lifecycle.LiveData
|
||||
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.app.input.inputaura.dasda.Shikamaru
|
||||
|
||||
@Dao
|
||||
interface BinYuTb {
|
||||
@Insert(onConflict = OnConflictStrategy.Companion.IGNORE)
|
||||
suspend fun insertData(data: Shikamaru): Long
|
||||
|
||||
@Query("select * from Shikamaru ")
|
||||
fun queryAllLike(): LiveData<List<Shikamaru?>?>
|
||||
|
||||
|
||||
|
||||
@Query("select * from Shikamaru where titleName = :title ")
|
||||
suspend fun queryIsLike(title: String ): Shikamaru?
|
||||
|
||||
|
||||
@Delete
|
||||
suspend fun delete(data: Shikamaru)
|
||||
|
||||
@Update
|
||||
suspend fun updateLike(data: Shikamaru)
|
||||
}
|
||||
31
app/src/main/java/com/app/input/inputaura/ohbnf/DaBase.kt
Normal file
@ -0,0 +1,31 @@
|
||||
package com.app.input.inputaura.ohbnf
|
||||
|
||||
import androidx.room.Database
|
||||
import androidx.room.Room
|
||||
import androidx.room.RoomDatabase
|
||||
import com.app.input.inputaura.InputAura
|
||||
import com.app.input.inputaura.dasda.Shikamaru
|
||||
|
||||
|
||||
@Database(
|
||||
entities = [Shikamaru::class],
|
||||
version = InputAura.Companion.DB_VERSION,
|
||||
exportSchema = false
|
||||
)
|
||||
abstract class DaBase : RoomDatabase() {
|
||||
|
||||
abstract fun ThemesDao(): BinYuTb
|
||||
|
||||
|
||||
|
||||
companion object {
|
||||
val daBase: DaBase by lazy {
|
||||
Room.databaseBuilder(
|
||||
InputAura.Companion.inputAuraInstance, DaBase::class.java,
|
||||
InputAura.Companion.DB_NAME
|
||||
) .fallbackToDestructiveMigration()
|
||||
.build()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
34
app/src/main/java/com/app/input/inputaura/ohbnf/OpnYty.kt
Normal file
@ -0,0 +1,34 @@
|
||||
package com.app.input.inputaura.ohbnf
|
||||
|
||||
import com.app.input.inputaura.dasda.Shikamaru
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.withContext
|
||||
|
||||
object OpnYty {
|
||||
|
||||
|
||||
suspend fun addLike(data: Shikamaru) {
|
||||
withContext(Dispatchers.IO) {
|
||||
DaBase.daBase.ThemesDao().insertData(data)
|
||||
}
|
||||
|
||||
}
|
||||
suspend fun removeLike(data: Shikamaru) {
|
||||
withContext(Dispatchers.IO) {
|
||||
val queryIsLike = DaBase.daBase.ThemesDao().queryIsLike(data.titleName)
|
||||
if (queryIsLike != null) {
|
||||
DaBase.daBase.ThemesDao().delete(queryIsLike)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
suspend fun getIsLike(name: String, action: (isLike: Boolean) -> Unit) {
|
||||
withContext(Dispatchers.IO) {
|
||||
val query = DaBase.daBase.ThemesDao().queryIsLike(name)
|
||||
withContext(Dispatchers.Main) {
|
||||
action.invoke(query != null)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
1386
app/src/main/java/com/app/input/inputaura/onhvtgfs/HiyFhg.java
Normal file
858
app/src/main/java/com/app/input/inputaura/onhvtgfs/VuhTg.java
Normal file
@ -0,0 +1,858 @@
|
||||
package com.app.input.inputaura.onhvtgfs;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.content.res.TypedArray;
|
||||
import android.content.res.XmlResourceParser;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.text.TextUtils;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.util.TypedValue;
|
||||
import android.util.Xml;
|
||||
|
||||
import androidx.annotation.XmlRes;
|
||||
|
||||
import org.xmlpull.v1.XmlPullParserException;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
|
||||
import com.app.input.inputaura.R;
|
||||
|
||||
public class VuhTg {
|
||||
|
||||
static final String TAG = "------------Keyboard-----------";
|
||||
|
||||
// Keyboard XML Tags
|
||||
private static final String TAG_KEYBOARD = "Keyboard";
|
||||
private static final String TAG_ROW = "Row";
|
||||
private static final String TAG_KEY = "Key";
|
||||
|
||||
public static final int EDGE_LEFT = 0x01;
|
||||
public static final int EDGE_RIGHT = 0x02;
|
||||
public static final int EDGE_TOP = 0x04;
|
||||
public static final int EDGE_BOTTOM = 0x08;
|
||||
|
||||
public static final int KEYCODE_SHIFT = -1;
|
||||
public static final int KEYCODE_MODE_CHANGE = -2;
|
||||
public static final int KEYCODE_CANCEL = -3;
|
||||
public static final int KEYCODE_DONE = -4;
|
||||
public static final int KEYCODE_DELETE = -5;
|
||||
public static final int KEYCODE_ALT = -6;
|
||||
|
||||
/** Keyboard label **/
|
||||
private CharSequence mLabel;
|
||||
|
||||
/** Horizontal gap default for all rows */
|
||||
private int mDefaultHorizontalGap;
|
||||
|
||||
/** Default key width */
|
||||
private int mDefaultWidth;
|
||||
|
||||
/** Default key height */
|
||||
private int mDefaultHeight;
|
||||
|
||||
/** Default gap between rows */
|
||||
private int mDefaultVerticalGap;
|
||||
|
||||
/** Is the keyboard in the shifted state */
|
||||
private boolean mShifted;
|
||||
|
||||
/** Key instance for the shift key, if present */
|
||||
private VuhTg.Key[] mShiftKeys = { null, null };
|
||||
|
||||
/** Key index for the shift key, if present */
|
||||
private int[] mShiftKeyIndices = {-1, -1};
|
||||
|
||||
/** Current key width, while loading the keyboard */
|
||||
private int mKeyWidth;
|
||||
|
||||
/** Current key height, while loading the keyboard */
|
||||
private int mKeyHeight;
|
||||
|
||||
/** Total height of the keyboard, including the padding and keys */
|
||||
private int mTotalHeight;
|
||||
|
||||
/**
|
||||
* Total width of the keyboard, including left side gaps and keys, but not any gaps on the
|
||||
* right side.
|
||||
*/
|
||||
private int mTotalWidth;
|
||||
|
||||
/** List of keys in this keyboard */
|
||||
private List<VuhTg.Key> mKeys;
|
||||
|
||||
/** List of modifier keys such as Shift & Alt, if any */
|
||||
private List<VuhTg.Key> mModifierKeys;
|
||||
|
||||
/** Width of the screen available to fit the keyboard */
|
||||
private int mDisplayWidth;
|
||||
|
||||
/** Height of the screen */
|
||||
private int mDisplayHeight;
|
||||
|
||||
/** Keyboard mode, or zero, if none. */
|
||||
private int mKeyboardMode;
|
||||
|
||||
// Variables for pre-computing nearest keys.
|
||||
|
||||
private static final int GRID_WIDTH = 10;
|
||||
private static final int GRID_HEIGHT = 5;
|
||||
private static final int GRID_SIZE = GRID_WIDTH * GRID_HEIGHT;
|
||||
private int mCellWidth;
|
||||
private int mCellHeight;
|
||||
private int[][] mGridNeighbors;
|
||||
private int mProximityThreshold;
|
||||
/** Number of key widths from current touch point to search for nearest keys. */
|
||||
private static float SEARCH_DISTANCE = 1.8f;
|
||||
|
||||
private ArrayList<VuhTg.Row> rows = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Container for keys in the keyboard. All keys in a row are at the same Y-coordinate.
|
||||
* Some of the key size defaults can be overridden per row from what the {@link VuhTg}
|
||||
* defines.
|
||||
* @attr ref android.R.styleable#King_Keyboard_keyWidth
|
||||
* @attr ref android.R.styleable#King_Keyboard_keyHeight
|
||||
* @attr ref android.R.styleable#King_Keyboard_horizontalGap
|
||||
* @attr ref android.R.styleable#King_Keyboard_verticalGap
|
||||
* @attr ref android.R.styleable#King_Keyboard_Row_rowEdgeFlags
|
||||
* @attr ref android.R.styleable#King_Keyboard_Row_keyboardMode
|
||||
*/
|
||||
public static class Row {
|
||||
/** Default width of a key in this row. */
|
||||
public int defaultWidth;
|
||||
/** Default height of a key in this row. */
|
||||
public int defaultHeight;
|
||||
/** Default horizontal gap between keys in this row. */
|
||||
public int defaultHorizontalGap;
|
||||
/** Vertical gap following this row. */
|
||||
public int verticalGap;
|
||||
|
||||
ArrayList<VuhTg.Key> mKeys = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Edge flags for this row of keys. Possible values that can be assigned are
|
||||
* {@link VuhTg#EDGE_TOP EDGE_TOP} and {@link VuhTg#EDGE_BOTTOM EDGE_BOTTOM}
|
||||
*/
|
||||
public int rowEdgeFlags;
|
||||
|
||||
/** The keyboard mode for this row */
|
||||
public int mode;
|
||||
|
||||
private VuhTg parent;
|
||||
|
||||
public Row(VuhTg parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public Row(Resources res, VuhTg parent, XmlResourceParser parser) {
|
||||
this.parent = parent;
|
||||
TypedArray a = res.obtainAttributes(Xml.asAttributeSet(parser),
|
||||
R.styleable.My_Keyboard_view);
|
||||
defaultWidth = getDimensionOrFraction(a,
|
||||
R.styleable.My_Keyboard_view_android_keyWidth,
|
||||
parent.mDisplayWidth, parent.mDefaultWidth);
|
||||
defaultHeight = getDimensionOrFraction(a,
|
||||
R.styleable.My_Keyboard_view_android_keyHeight,
|
||||
parent.mDisplayHeight, parent.mDefaultHeight);
|
||||
defaultHorizontalGap = getDimensionOrFraction(a,
|
||||
R.styleable.My_Keyboard_view_android_horizontalGap,
|
||||
parent.mDisplayWidth, parent.mDefaultHorizontalGap);
|
||||
verticalGap = getDimensionOrFraction(a,
|
||||
R.styleable.My_Keyboard_view_android_verticalGap,
|
||||
parent.mDisplayHeight, parent.mDefaultVerticalGap);
|
||||
a.recycle();
|
||||
a = res.obtainAttributes(Xml.asAttributeSet(parser),
|
||||
R.styleable.Kil_Keyboard_Row);
|
||||
rowEdgeFlags = a.getInt(R.styleable.Kil_Keyboard_Row_android_rowEdgeFlags, 0);
|
||||
mode = a.getResourceId(R.styleable.Kil_Keyboard_Row_android_keyboardMode,
|
||||
0);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Class for describing the position and characteristics of a single key in the keyboard.
|
||||
*
|
||||
* @attr ref android.R.styleable#King_Keyboard_keyWidth
|
||||
* @attr ref android.R.styleable#King_Keyboard_keyHeight
|
||||
* @attr ref android.R.styleable#King_Keyboard_horizontalGap
|
||||
* @attr ref android.R.styleable#King_Keyboard_Key_codes
|
||||
* @attr ref android.R.styleable#King_Keyboard_Key_keyIcon
|
||||
* @attr ref android.R.styleable#King_Keyboard_Key_keyLabel
|
||||
* @attr ref android.R.styleable#King_Keyboard_Key_iconPreview
|
||||
* @attr ref android.R.styleable#King_Keyboard_Key_isSticky
|
||||
* @attr ref android.R.styleable#King_Keyboard_Key_isRepeatable
|
||||
* @attr ref android.R.styleable#King_Keyboard_Key_isModifier
|
||||
* @attr ref android.R.styleable#King_Keyboard_Key_popupKeyboard
|
||||
* @attr ref android.R.styleable#King_Keyboard_Key_popupCharacters
|
||||
* @attr ref android.R.styleable#King_Keyboard_Key_keyOutputText
|
||||
* @attr ref android.R.styleable#King_Keyboard_Key_keyEdgeFlags
|
||||
*/
|
||||
public static class Key {
|
||||
/**
|
||||
* All the key codes (unicode or custom code) that this key could generate, zero'th
|
||||
* being the most important.
|
||||
*/
|
||||
public int[] codes;
|
||||
|
||||
/** Label to display */
|
||||
public CharSequence label;
|
||||
|
||||
/** Icon to display instead of a label. Icon takes precedence over a label */
|
||||
public Drawable icon;
|
||||
/** Preview version of the icon, for the preview popup */
|
||||
public Drawable iconPreview;
|
||||
/** Width of the key, not including the gap */
|
||||
public int width;
|
||||
/** Height of the key, not including the gap */
|
||||
public int height;
|
||||
/** The horizontal gap before this key */
|
||||
public int gap;
|
||||
/** Whether this key is sticky, i.e., a toggle key */
|
||||
public boolean sticky;
|
||||
/** X coordinate of the key in the keyboard layout */
|
||||
public int x;
|
||||
/** Y coordinate of the key in the keyboard layout */
|
||||
public int y;
|
||||
/** The current pressed state of this key */
|
||||
public boolean pressed;
|
||||
/** If this is a sticky key, is it on? */
|
||||
public boolean on;
|
||||
/** Text to output when pressed. This can be multiple characters, like ".com" */
|
||||
public CharSequence text;
|
||||
/** Popup characters */
|
||||
public CharSequence popupCharacters;
|
||||
|
||||
/**
|
||||
* Flags that specify the anchoring to edges of the keyboard for detecting touch events
|
||||
* that are just out of the boundary of the key. This is a bit mask of
|
||||
* {@link VuhTg#EDGE_LEFT}, {@link VuhTg#EDGE_RIGHT}, {@link VuhTg#EDGE_TOP} and
|
||||
* {@link VuhTg#EDGE_BOTTOM}.
|
||||
*/
|
||||
public int edgeFlags;
|
||||
/** Whether this is a modifier key, such as Shift or Alt */
|
||||
public boolean modifier;
|
||||
/** The keyboard that this key belongs to */
|
||||
private VuhTg keyboard;
|
||||
/**
|
||||
* If this key pops up a mini keyboard, this is the resource id for the XML layout for that
|
||||
* keyboard.
|
||||
*/
|
||||
public int popupResId;
|
||||
/** Whether this key repeats itself when held down */
|
||||
public boolean repeatable;
|
||||
|
||||
|
||||
private final static int[] KEY_STATE_NORMAL_ON = {
|
||||
android.R.attr.state_checkable,
|
||||
android.R.attr.state_checked
|
||||
};
|
||||
|
||||
private final static int[] KEY_STATE_PRESSED_ON = {
|
||||
android.R.attr.state_pressed,
|
||||
android.R.attr.state_checkable,
|
||||
android.R.attr.state_checked
|
||||
};
|
||||
|
||||
private final static int[] KEY_STATE_NORMAL_OFF = {
|
||||
android.R.attr.state_checkable
|
||||
};
|
||||
|
||||
private final static int[] KEY_STATE_PRESSED_OFF = {
|
||||
android.R.attr.state_pressed,
|
||||
android.R.attr.state_checkable
|
||||
};
|
||||
|
||||
private final static int[] KEY_STATE_NORMAL = {
|
||||
};
|
||||
|
||||
private final static int[] KEY_STATE_PRESSED = {
|
||||
android.R.attr.state_pressed
|
||||
};
|
||||
|
||||
/** Create an empty key with no attributes. */
|
||||
public Key(VuhTg.Row parent) {
|
||||
keyboard = parent.parent;
|
||||
height = parent.defaultHeight;
|
||||
width = parent.defaultWidth;
|
||||
gap = parent.defaultHorizontalGap;
|
||||
edgeFlags = parent.rowEdgeFlags;
|
||||
}
|
||||
|
||||
/** Create a key with the given top-left coordinate and extract its attributes from
|
||||
* the XML parser.
|
||||
* @param res resources associated with the caller's context
|
||||
* @param parent the row that this key belongs to. The row must already be attached to
|
||||
* a {@link VuhTg}.
|
||||
* @param x the x coordinate of the top-left
|
||||
* @param y the y coordinate of the top-left
|
||||
* @param parser the XML parser containing the attributes for this key
|
||||
*/
|
||||
public Key(Resources res, VuhTg.Row parent, int x, int y, XmlResourceParser parser) {
|
||||
this(parent);
|
||||
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
|
||||
TypedArray a = res.obtainAttributes(Xml.asAttributeSet(parser),
|
||||
R.styleable.My_Keyboard_view);
|
||||
|
||||
width = getDimensionOrFraction(a,
|
||||
R.styleable.My_Keyboard_view_android_keyWidth,
|
||||
keyboard.mDisplayWidth, parent.defaultWidth);
|
||||
height = getDimensionOrFraction(a,
|
||||
R.styleable.My_Keyboard_view_android_keyHeight,
|
||||
keyboard.mDisplayHeight, parent.defaultHeight);
|
||||
gap = getDimensionOrFraction(a,
|
||||
R.styleable.My_Keyboard_view_android_horizontalGap,
|
||||
keyboard.mDisplayWidth, parent.defaultHorizontalGap);
|
||||
a.recycle();
|
||||
a = res.obtainAttributes(Xml.asAttributeSet(parser),
|
||||
R.styleable.K_Keyboard_Key);
|
||||
this.x += gap;
|
||||
TypedValue codesValue = new TypedValue();
|
||||
a.getValue(R.styleable.K_Keyboard_Key_android_codes,
|
||||
codesValue);
|
||||
if (codesValue.type == TypedValue.TYPE_INT_DEC
|
||||
|| codesValue.type == TypedValue.TYPE_INT_HEX) {
|
||||
codes = new int[] { codesValue.data };
|
||||
} else if (codesValue.type == TypedValue.TYPE_STRING) {
|
||||
codes = parseCSV(codesValue.string.toString());
|
||||
}
|
||||
|
||||
iconPreview = a.getDrawable(R.styleable.K_Keyboard_Key_android_iconPreview);
|
||||
if (iconPreview != null) {
|
||||
iconPreview.setBounds(0, 0, iconPreview.getIntrinsicWidth(),
|
||||
iconPreview.getIntrinsicHeight());
|
||||
}
|
||||
popupCharacters = a.getText(
|
||||
R.styleable.K_Keyboard_Key_android_popupCharacters);
|
||||
popupResId = a.getResourceId(
|
||||
R.styleable.K_Keyboard_Key_android_popupKeyboard, 0);
|
||||
repeatable = a.getBoolean(
|
||||
R.styleable.K_Keyboard_Key_android_isRepeatable, false);
|
||||
modifier = a.getBoolean(
|
||||
R.styleable.K_Keyboard_Key_android_isModifier, false);
|
||||
sticky = a.getBoolean(
|
||||
R.styleable.K_Keyboard_Key_android_isSticky, false);
|
||||
edgeFlags = a.getInt(R.styleable.K_Keyboard_Key_android_keyEdgeFlags, 0);
|
||||
edgeFlags |= parent.rowEdgeFlags;
|
||||
|
||||
icon = a.getDrawable(
|
||||
R.styleable.K_Keyboard_Key_android_keyIcon);
|
||||
if (icon != null) {
|
||||
icon.setBounds(0, 0, icon.getIntrinsicWidth(), icon.getIntrinsicHeight());
|
||||
}
|
||||
label = a.getText(R.styleable.K_Keyboard_Key_android_keyLabel);
|
||||
text = a.getText(R.styleable.K_Keyboard_Key_android_keyOutputText);
|
||||
|
||||
if (codes == null && !TextUtils.isEmpty(label)) {
|
||||
codes = new int[] { label.charAt(0) };
|
||||
}
|
||||
a.recycle();
|
||||
}
|
||||
|
||||
/**
|
||||
* Informs the key that it has been pressed, in case it needs to change its appearance or
|
||||
* state.
|
||||
* @see #onReleased(boolean)
|
||||
*/
|
||||
public void onPressed() {
|
||||
pressed = !pressed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Changes the pressed state of the key.
|
||||
*
|
||||
* <p>Toggled state of the key will be flipped when all the following conditions are
|
||||
* fulfilled:</p>
|
||||
*
|
||||
* <ul>
|
||||
* <li>This is a sticky key, that is, {@link #sticky} is {@code true}.
|
||||
* <li>The parameter {@code inside} is {@code true}.
|
||||
* <li>{@link android.os.Build.VERSION#SDK_INT} is greater than
|
||||
* {@link android.os.Build.VERSION_CODES#LOLLIPOP_MR1}.
|
||||
* </ul>
|
||||
*
|
||||
* @param inside whether the finger was released inside the key. Works only on Android M and
|
||||
* later. See the method document for details.
|
||||
* @see #onPressed()
|
||||
*/
|
||||
public void onReleased(boolean inside) {
|
||||
pressed = !pressed;
|
||||
if (sticky && inside) {
|
||||
on = !on;
|
||||
}
|
||||
}
|
||||
|
||||
int[] parseCSV(String value) {
|
||||
int count = 0;
|
||||
int lastIndex = 0;
|
||||
if (value.length() > 0) {
|
||||
count++;
|
||||
while ((lastIndex = value.indexOf(",", lastIndex + 1)) > 0) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
int[] values = new int[count];
|
||||
count = 0;
|
||||
StringTokenizer st = new StringTokenizer(value, ",");
|
||||
while (st.hasMoreTokens()) {
|
||||
try {
|
||||
values[count++] = Integer.parseInt(st.nextToken());
|
||||
} catch (NumberFormatException nfe) {
|
||||
|
||||
}
|
||||
}
|
||||
return values;
|
||||
}
|
||||
|
||||
/**
|
||||
* Detects if a point falls inside this key.
|
||||
* @param x the x-coordinate of the point
|
||||
* @param y the y-coordinate of the point
|
||||
* @return whether or not the point falls inside the key. If the key is attached to an edge,
|
||||
* it will assume that all points between the key and the edge are considered to be inside
|
||||
* the key.
|
||||
*/
|
||||
public boolean isInside(int x, int y) {
|
||||
boolean leftEdge = (edgeFlags & EDGE_LEFT) > 0;
|
||||
boolean rightEdge = (edgeFlags & EDGE_RIGHT) > 0;
|
||||
boolean topEdge = (edgeFlags & EDGE_TOP) > 0;
|
||||
boolean bottomEdge = (edgeFlags & EDGE_BOTTOM) > 0;
|
||||
if ((x >= this.x || (leftEdge && x <= this.x + this.width))
|
||||
&& (x < this.x + this.width || (rightEdge && x >= this.x))
|
||||
&& (y >= this.y || (topEdge && y <= this.y + this.height))
|
||||
&& (y < this.y + this.height || (bottomEdge && y >= this.y))) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the square of the distance between the center of the key and the given point.
|
||||
* @param x the x-coordinate of the point
|
||||
* @param y the y-coordinate of the point
|
||||
* @return the square of the distance of the point from the center of the key
|
||||
*/
|
||||
public int squaredDistanceFrom(int x, int y) {
|
||||
int xDist = this.x + width / 2 - x;
|
||||
int yDist = this.y + height / 2 - y;
|
||||
return xDist * xDist + yDist * yDist;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the drawable state for the key, based on the current state and type of the key.
|
||||
* @return the drawable state of the key.
|
||||
* @see android.graphics.drawable.StateListDrawable#setState(int[])
|
||||
*/
|
||||
public int[] getCurrentDrawableState() {
|
||||
int[] states = KEY_STATE_NORMAL;
|
||||
|
||||
if (on) {
|
||||
if (pressed) {
|
||||
states = KEY_STATE_PRESSED_ON;
|
||||
} else {
|
||||
states = KEY_STATE_NORMAL_ON;
|
||||
}
|
||||
} else {
|
||||
if (sticky) {
|
||||
if (pressed) {
|
||||
states = KEY_STATE_PRESSED_OFF;
|
||||
} else {
|
||||
states = KEY_STATE_NORMAL_OFF;
|
||||
}
|
||||
} else {
|
||||
if (pressed) {
|
||||
states = KEY_STATE_PRESSED;
|
||||
}
|
||||
}
|
||||
}
|
||||
return states;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a keyboard from the given xml key layout file.
|
||||
* @param context the application or service context
|
||||
* @param xmlLayoutResId the resource file that contains the keyboard layout and keys.
|
||||
*/
|
||||
public VuhTg(Context context, int xmlLayoutResId) {
|
||||
this(context, xmlLayoutResId, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a keyboard from the given xml key layout file. Weeds out rows
|
||||
* that have a keyboard mode defined but don't match the specified mode.
|
||||
* @param context the application or service context
|
||||
* @param xmlLayoutResId the resource file that contains the keyboard layout and keys.
|
||||
* @param modeId keyboard mode identifier
|
||||
* @param width sets width of keyboard
|
||||
* @param height sets height of keyboard
|
||||
*/
|
||||
public VuhTg(Context context, @XmlRes int xmlLayoutResId, int modeId, int width,
|
||||
int height) {
|
||||
mDisplayWidth = width;
|
||||
mDisplayHeight = height;
|
||||
|
||||
mDefaultHorizontalGap = 0;
|
||||
mDefaultWidth = mDisplayWidth / 10;
|
||||
mDefaultVerticalGap = 0;
|
||||
mDefaultHeight = mDefaultWidth;
|
||||
mKeys = new ArrayList<>();
|
||||
mModifierKeys = new ArrayList<>();
|
||||
mKeyboardMode = modeId;
|
||||
loadKeyboard(context, context.getResources().getXml(xmlLayoutResId));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a keyboard from the given xml key layout file. Weeds out rows
|
||||
* that have a keyboard mode defined but don't match the specified mode.
|
||||
* @param context the application or service context
|
||||
* @param xmlLayoutResId the resource file that contains the keyboard layout and keys.
|
||||
* @param modeId keyboard mode identifier
|
||||
*/
|
||||
public VuhTg(Context context, @XmlRes int xmlLayoutResId, int modeId) {
|
||||
DisplayMetrics dm = context.getResources().getDisplayMetrics();
|
||||
mDisplayWidth = dm.widthPixels;
|
||||
mDisplayHeight = dm.heightPixels;
|
||||
//Log.v(TAG, "keyboard's display metrics:" + dm);
|
||||
|
||||
mDefaultHorizontalGap = 0;
|
||||
mDefaultWidth = mDisplayWidth / 10;
|
||||
mDefaultVerticalGap = 0;
|
||||
mDefaultHeight = mDefaultWidth;
|
||||
mKeys = new ArrayList<>();
|
||||
mModifierKeys = new ArrayList<>();
|
||||
mKeyboardMode = modeId;
|
||||
loadKeyboard(context, context.getResources().getXml(xmlLayoutResId));
|
||||
}
|
||||
|
||||
public VuhTg(Context context, int layoutTemplateResId,
|
||||
CharSequence characters, int columns, int horizontalPadding) {
|
||||
this(context, layoutTemplateResId);
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
int column = 0;
|
||||
mTotalWidth = 0;
|
||||
|
||||
VuhTg.Row row = new VuhTg.Row(this);
|
||||
row.defaultHeight = mDefaultHeight;
|
||||
row.defaultWidth = mDefaultWidth;
|
||||
row.defaultHorizontalGap = mDefaultHorizontalGap;
|
||||
row.verticalGap = mDefaultVerticalGap;
|
||||
row.rowEdgeFlags = EDGE_TOP | EDGE_BOTTOM;
|
||||
final int maxColumns = columns == -1 ? Integer.MAX_VALUE : columns;
|
||||
for (int i = 0; i < characters.length(); i++) {
|
||||
char c = characters.charAt(i);
|
||||
if (column >= maxColumns
|
||||
|| x + mDefaultWidth + horizontalPadding > mDisplayWidth) {
|
||||
x = 0;
|
||||
y += mDefaultVerticalGap + mDefaultHeight;
|
||||
column = 0;
|
||||
}
|
||||
final VuhTg.Key key = new VuhTg.Key(row);
|
||||
key.x = x;
|
||||
key.y = y;
|
||||
key.label = String.valueOf(c);
|
||||
key.codes = new int[] { c };
|
||||
column++;
|
||||
x += key.width + key.gap;
|
||||
mKeys.add(key);
|
||||
row.mKeys.add(key);
|
||||
if (x > mTotalWidth) {
|
||||
mTotalWidth = x;
|
||||
}
|
||||
}
|
||||
mTotalHeight = y + mDefaultHeight;
|
||||
rows.add(row);
|
||||
}
|
||||
|
||||
final void resize(int newWidth, int newHeight) {
|
||||
int numRows = rows.size();
|
||||
for (int rowIndex = 0; rowIndex < numRows; ++rowIndex) {
|
||||
VuhTg.Row row = rows.get(rowIndex);
|
||||
int numKeys = row.mKeys.size();
|
||||
int totalGap = 0;
|
||||
int totalWidth = 0;
|
||||
for (int keyIndex = 0; keyIndex < numKeys; ++keyIndex) {
|
||||
VuhTg.Key key = row.mKeys.get(keyIndex);
|
||||
if (keyIndex > 0) {
|
||||
totalGap += key.gap;
|
||||
}
|
||||
totalWidth += key.width;
|
||||
}
|
||||
if (totalGap + totalWidth > newWidth) {
|
||||
int x = 0;
|
||||
float scaleFactor = (float)(newWidth - totalGap) / totalWidth;
|
||||
for (int keyIndex = 0; keyIndex < numKeys; ++keyIndex) {
|
||||
VuhTg.Key key = row.mKeys.get(keyIndex);
|
||||
key.width *= scaleFactor;
|
||||
key.x = x;
|
||||
x += key.width + key.gap;
|
||||
}
|
||||
}
|
||||
}
|
||||
mTotalWidth = newWidth;
|
||||
// TODO: This does not adjust the vertical placement according to the new size.
|
||||
// The main problem in the previous code was horizontal placement/size, but we should
|
||||
// also recalculate the vertical sizes/positions when we get this resize call.
|
||||
}
|
||||
|
||||
public List<VuhTg.Key> getKeys() {
|
||||
return mKeys;
|
||||
}
|
||||
|
||||
public List<VuhTg.Key> getModifierKeys() {
|
||||
return mModifierKeys;
|
||||
}
|
||||
|
||||
protected int getHorizontalGap() {
|
||||
return mDefaultHorizontalGap;
|
||||
}
|
||||
|
||||
protected void setHorizontalGap(int gap) {
|
||||
mDefaultHorizontalGap = gap;
|
||||
}
|
||||
|
||||
protected int getVerticalGap() {
|
||||
return mDefaultVerticalGap;
|
||||
}
|
||||
|
||||
protected void setVerticalGap(int gap) {
|
||||
mDefaultVerticalGap = gap;
|
||||
}
|
||||
|
||||
protected int getKeyHeight() {
|
||||
return mDefaultHeight;
|
||||
}
|
||||
|
||||
protected void setKeyHeight(int height) {
|
||||
mDefaultHeight = height;
|
||||
}
|
||||
|
||||
protected int getKeyWidth() {
|
||||
return mDefaultWidth;
|
||||
}
|
||||
|
||||
protected void setKeyWidth(int width) {
|
||||
mDefaultWidth = width;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the total height of the keyboard
|
||||
* @return the total height of the keyboard
|
||||
*/
|
||||
public int getHeight() {
|
||||
return mTotalHeight;
|
||||
}
|
||||
|
||||
public int getMinWidth() {
|
||||
return mTotalWidth;
|
||||
}
|
||||
|
||||
public boolean setShifted(boolean shiftState) {
|
||||
for (VuhTg.Key shiftKey : mShiftKeys) {
|
||||
if (shiftKey != null) {
|
||||
shiftKey.on = shiftState;
|
||||
}
|
||||
}
|
||||
if (mShifted != shiftState) {
|
||||
mShifted = shiftState;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isShifted() {
|
||||
return mShifted;
|
||||
}
|
||||
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
public int[] getShiftKeyIndices() {
|
||||
return mShiftKeyIndices;
|
||||
}
|
||||
|
||||
public int getShiftKeyIndex() {
|
||||
return mShiftKeyIndices[0];
|
||||
}
|
||||
|
||||
private void computeNearestNeighbors() {
|
||||
// Round-up so we don't have any pixels outside the grid
|
||||
mCellWidth = (getMinWidth() + GRID_WIDTH - 1) / GRID_WIDTH;
|
||||
mCellHeight = (getHeight() + GRID_HEIGHT - 1) / GRID_HEIGHT;
|
||||
mGridNeighbors = new int[GRID_SIZE][];
|
||||
int[] indices = new int[mKeys.size()];
|
||||
final int gridWidth = GRID_WIDTH * mCellWidth;
|
||||
final int gridHeight = GRID_HEIGHT * mCellHeight;
|
||||
for (int x = 0; x < gridWidth; x += mCellWidth) {
|
||||
for (int y = 0; y < gridHeight; y += mCellHeight) {
|
||||
int count = 0;
|
||||
for (int i = 0; i < mKeys.size(); i++) {
|
||||
final VuhTg.Key key = mKeys.get(i);
|
||||
if (key.squaredDistanceFrom(x, y) < mProximityThreshold ||
|
||||
key.squaredDistanceFrom(x + mCellWidth - 1, y) < mProximityThreshold ||
|
||||
key.squaredDistanceFrom(x + mCellWidth - 1, y + mCellHeight - 1)
|
||||
< mProximityThreshold ||
|
||||
key.squaredDistanceFrom(x, y + mCellHeight - 1) < mProximityThreshold) {
|
||||
indices[count++] = i;
|
||||
}
|
||||
}
|
||||
int [] cell = new int[count];
|
||||
System.arraycopy(indices, 0, cell, 0, count);
|
||||
mGridNeighbors[(y / mCellHeight) * GRID_WIDTH + (x / mCellWidth)] = cell;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the indices of the keys that are closest to the given point.
|
||||
* @param x the x-coordinate of the point
|
||||
* @param y the y-coordinate of the point
|
||||
* @return the array of integer indices for the nearest keys to the given point. If the given
|
||||
* point is out of range, then an array of size zero is returned.
|
||||
*/
|
||||
public int[] getNearestKeys(int x, int y) {
|
||||
if (mGridNeighbors == null) computeNearestNeighbors();
|
||||
if (x >= 0 && x < getMinWidth() && y >= 0 && y < getHeight()) {
|
||||
int index = (y / mCellHeight) * GRID_WIDTH + (x / mCellWidth);
|
||||
if (index < GRID_SIZE) {
|
||||
return mGridNeighbors[index];
|
||||
}
|
||||
}
|
||||
return new int[0];
|
||||
}
|
||||
|
||||
protected VuhTg.Row createRowFromXml(Resources res, XmlResourceParser parser) {
|
||||
return new VuhTg.Row(res, this, parser);
|
||||
}
|
||||
|
||||
protected VuhTg.Key createKeyFromXml(Resources res, VuhTg.Row parent, int x, int y,
|
||||
XmlResourceParser parser) {
|
||||
return new VuhTg.Key(res, parent, x, y, parser);
|
||||
}
|
||||
|
||||
private void loadKeyboard(Context context, XmlResourceParser parser) {
|
||||
boolean inKey = false;
|
||||
boolean inRow = false;
|
||||
boolean leftMostKey = false;
|
||||
int row = 0;
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
VuhTg.Key key = null;
|
||||
VuhTg.Row currentRow = null;
|
||||
Resources res = context.getResources();
|
||||
boolean skipRow = false;
|
||||
|
||||
try {
|
||||
int event;
|
||||
while ((event = parser.next()) != XmlResourceParser.END_DOCUMENT) {
|
||||
if (event == XmlResourceParser.START_TAG) {
|
||||
String tag = parser.getName();
|
||||
if (TAG_ROW.equals(tag)) {
|
||||
inRow = true;
|
||||
x = 0;
|
||||
currentRow = createRowFromXml(res, parser);
|
||||
rows.add(currentRow);
|
||||
skipRow = currentRow.mode != 0 && currentRow.mode != mKeyboardMode;
|
||||
if (skipRow) {
|
||||
skipToEndOfRow(parser);
|
||||
inRow = false;
|
||||
}
|
||||
} else if (TAG_KEY.equals(tag)) {
|
||||
inKey = true;
|
||||
key = createKeyFromXml(res, currentRow, x, y, parser);
|
||||
mKeys.add(key);
|
||||
if (key.codes[0] == KEYCODE_SHIFT) {
|
||||
// Find available shift key slot and put this shift key in it
|
||||
for (int i = 0; i < mShiftKeys.length; i++) {
|
||||
if (mShiftKeys[i] == null) {
|
||||
mShiftKeys[i] = key;
|
||||
mShiftKeyIndices[i] = mKeys.size()-1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
mModifierKeys.add(key);
|
||||
} else if (key.codes[0] == KEYCODE_ALT) {
|
||||
mModifierKeys.add(key);
|
||||
}
|
||||
currentRow.mKeys.add(key);
|
||||
} else if (TAG_KEYBOARD.equals(tag)) {
|
||||
parseKeyboardAttributes(res, parser);
|
||||
}
|
||||
} else if (event == XmlResourceParser.END_TAG) {
|
||||
if (inKey) {
|
||||
inKey = false;
|
||||
x += key.gap + key.width;
|
||||
if (x > mTotalWidth) {
|
||||
mTotalWidth = x;
|
||||
}
|
||||
} else if (inRow) {
|
||||
inRow = false;
|
||||
y += currentRow.verticalGap;
|
||||
y += currentRow.defaultHeight;
|
||||
row++;
|
||||
} else {
|
||||
// TODO: error or extend?
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
||||
e.printStackTrace();
|
||||
}
|
||||
mTotalHeight = y - mDefaultVerticalGap;
|
||||
}
|
||||
|
||||
private void skipToEndOfRow(XmlResourceParser parser)
|
||||
throws XmlPullParserException, IOException {
|
||||
int event;
|
||||
while ((event = parser.next()) != XmlResourceParser.END_DOCUMENT) {
|
||||
if (event == XmlResourceParser.END_TAG
|
||||
&& parser.getName().equals(TAG_ROW)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void parseKeyboardAttributes(Resources res, XmlResourceParser parser) {
|
||||
TypedArray a = res.obtainAttributes(Xml.asAttributeSet(parser),
|
||||
R.styleable.My_Keyboard_view);
|
||||
|
||||
mDefaultWidth = getDimensionOrFraction(a,
|
||||
R.styleable.My_Keyboard_view_android_keyWidth,
|
||||
mDisplayWidth, mDisplayWidth / 10);
|
||||
mDefaultHeight = getDimensionOrFraction(a,
|
||||
R.styleable.My_Keyboard_view_android_keyHeight,
|
||||
mDisplayHeight, 50);
|
||||
mDefaultHorizontalGap = getDimensionOrFraction(a,
|
||||
R.styleable.My_Keyboard_view_android_horizontalGap,
|
||||
mDisplayWidth, 0);
|
||||
mDefaultVerticalGap = getDimensionOrFraction(a,
|
||||
R.styleable.My_Keyboard_view_android_verticalGap,
|
||||
mDisplayHeight, 0);
|
||||
mProximityThreshold = (int) (mDefaultWidth * SEARCH_DISTANCE);
|
||||
mProximityThreshold = mProximityThreshold * mProximityThreshold; // Square it for comparison
|
||||
a.recycle();
|
||||
}
|
||||
|
||||
static int getDimensionOrFraction(TypedArray a, int index, int base, int defValue) {
|
||||
TypedValue value = a.peekValue(index);
|
||||
if (value == null) return defValue;
|
||||
if (value.type == TypedValue.TYPE_DIMENSION) {
|
||||
return a.getDimensionPixelOffset(index, defValue);
|
||||
} else if (value.type == TypedValue.TYPE_FRACTION) {
|
||||
// Round it to avoid values like 47.9999 from getting truncated
|
||||
return Math.round(a.getFraction(index, base, base, defValue));
|
||||
}
|
||||
return defValue;
|
||||
}
|
||||
}
|
||||
|
||||
127
app/src/main/java/com/app/input/inputaura/onjfsgvfsf/DhgUb.java
Normal file
@ -0,0 +1,127 @@
|
||||
package com.app.input.inputaura.onjfsgvfsf;
|
||||
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.cardview.widget.CardView;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.app.input.inputaura.R;
|
||||
import com.app.input.inputaura.dasda.Shikamaru;
|
||||
import com.app.input.inputaura.bgtng.UngIn;
|
||||
import com.app.input.inputaura.lmyfvfs.ViyVyg;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.app.input.inputaura.kfsdfbsd.IutFhfg;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class DhgUb extends RecyclerView.Adapter<DhgUb.ForYouViewHolder> {
|
||||
|
||||
private Context mContext;
|
||||
private List<Shikamaru> mList = new ArrayList<>();
|
||||
|
||||
private UngIn mCallBack;
|
||||
|
||||
public DhgUb(Context context) {
|
||||
mContext = context;
|
||||
}
|
||||
|
||||
public void setForYouList(List<Shikamaru> list) {
|
||||
this.mList = list;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
public void setClickAction(UngIn callback) {
|
||||
mCallBack = callback;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ForYouViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
|
||||
View view = LayoutInflater.from(mContext).inflate(R.layout.xusyt, parent, false);
|
||||
return new ForYouViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ForYouViewHolder holder, int position) {
|
||||
Shikamaru shikamaru = mList.get(position);
|
||||
String thumbGif = shikamaru.getThumbGif();
|
||||
String thumb = shikamaru.getThumbUrl();
|
||||
if (!thumbGif.isEmpty()) {
|
||||
IutFhfg.INSTANCE.loadWepJif(mContext, thumbGif, holder.itemImg);
|
||||
} else {
|
||||
Glide.with(mContext).load(thumb).into(holder.itemImg);
|
||||
}
|
||||
|
||||
holder.cardView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Intent intentApply = new Intent(mContext, ViyVyg.class);
|
||||
intentApply.putExtra(ViyVyg.SOURCE_KEY, shikamaru);
|
||||
intentApply.putExtra(ViyVyg.DISPLAY_URL_KEY, shikamaru.getImgPath());
|
||||
intentApply.putExtra(ViyVyg.ZIP_URL_KEY, shikamaru.getZipPath());
|
||||
intentApply.putExtra(ViyVyg.NAME_KEY, shikamaru.getTitleName());
|
||||
intentApply.putExtra(ViyVyg.GIF_KEY, shikamaru.getImgGif());
|
||||
String intent_thumb;
|
||||
if (!thumbGif.isEmpty()) {
|
||||
intent_thumb = thumbGif;
|
||||
} else {
|
||||
intent_thumb = thumb;
|
||||
}
|
||||
intentApply.putExtra(ViyVyg.THUMB_KEY, intent_thumb);
|
||||
mContext.startActivity(intentApply);
|
||||
if (mCallBack != null) {
|
||||
mCallBack.OnItemClickListener();
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mList.size();
|
||||
}
|
||||
|
||||
public static class ForYouViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
private CardView cardView;
|
||||
private ImageView itemImg;
|
||||
|
||||
public ForYouViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
cardView = itemView.findViewById(R.id.card_view);
|
||||
itemImg = itemView.findViewById(R.id.imPreview);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// private void loadWepJif(String webpGifUrl,ImageView view){
|
||||
// Glide.with(mContext).load(webpGifUrl).addListener(new RequestListener<Drawable>() {
|
||||
// @Override
|
||||
// public boolean onLoadFailed(@Nullable GlideException e, @Nullable Object model, @NonNull Target<Drawable> target, boolean isFirstResource) {
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean onResourceReady(@NonNull Drawable resource, @NonNull Object model, Target<Drawable> target, @NonNull DataSource dataSource, boolean isFirstResource) {
|
||||
// if(resource instanceof WebpDrawable){
|
||||
// WebpDrawable webpDrawable = (WebpDrawable) resource;
|
||||
// webpDrawable.setLoopCount(LOOP_FOREVER);
|
||||
// }
|
||||
//
|
||||
// return false;
|
||||
// }
|
||||
// }).into(view);
|
||||
// }
|
||||
}
|
||||
124
app/src/main/java/com/app/input/inputaura/onjfsgvfsf/DubTbf.java
Normal file
@ -0,0 +1,124 @@
|
||||
package com.app.input.inputaura.onjfsgvfsf;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.app.input.inputaura.R;
|
||||
import com.app.input.inputaura.dasda.Shikamaru;
|
||||
import com.app.input.inputaura.databinding.TibsgdgBinding;
|
||||
import com.app.input.inputaura.lmyfvfs.ViyVyg;
|
||||
import com.app.input.inputaura.kfsdfbsd.IutFhfg;
|
||||
import com.bumptech.glide.Glide;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class DubTbf extends RecyclerView.Adapter<DubTbf.CategoryViewHolder> {
|
||||
|
||||
private Context mContext;
|
||||
private List<Shikamaru> mList = new ArrayList<>();
|
||||
private int screenWidth;
|
||||
private int gridSpacing;
|
||||
private int recyclerPadding; // 存储RecyclerView的左右padding
|
||||
|
||||
public DubTbf(Context context, List<Shikamaru> list) {
|
||||
mContext = context;
|
||||
this.mList = list;
|
||||
|
||||
// 获取屏幕宽度、间距和padding
|
||||
screenWidth = context.getResources().getDisplayMetrics().widthPixels;
|
||||
gridSpacing = context.getResources().getDimensionPixelSize(R.dimen.grid_spacing);
|
||||
// 从dimens.xml获取RecyclerView的padding,如果没有定义则默认为10dp
|
||||
recyclerPadding = context.getResources().getDimensionPixelSize(R.dimen.recycler_padding);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public CategoryViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
TibsgdgBinding binding = TibsgdgBinding.inflate(
|
||||
LayoutInflater.from(parent.getContext()),
|
||||
parent,
|
||||
false
|
||||
);
|
||||
return new CategoryViewHolder(binding);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull CategoryViewHolder holder, int position) {
|
||||
// 动态设置卡片高度为4:3比例
|
||||
int columnCount = 2; // 网格列数
|
||||
|
||||
// 修正:可用宽度 = 屏幕宽度 - (左右padding × 2) - (列间距 × (列数 + 1))
|
||||
// 10dp(左padding) + 10dp(右padding) + 间距
|
||||
int availableWidth = screenWidth - (recyclerPadding * 2) - (gridSpacing * (columnCount + 1));
|
||||
int itemWidth = availableWidth / columnCount;
|
||||
int itemHeight = (int) (itemWidth * 0.75); // 4:3比例,高度 = 宽度 × 3/4
|
||||
|
||||
// 设置卡片布局参数
|
||||
ViewGroup.LayoutParams layoutParams = holder.itemView.getLayoutParams();
|
||||
layoutParams.width = itemWidth;
|
||||
layoutParams.height = itemHeight;
|
||||
holder.itemView.setLayoutParams(layoutParams);
|
||||
|
||||
// 加载数据
|
||||
Shikamaru shikamaru = mList.get(position);
|
||||
|
||||
// 加载图片
|
||||
String thumbGif = shikamaru.getThumbGif();
|
||||
String thumb = shikamaru.getThumbUrl();
|
||||
|
||||
if (thumbGif != null && !thumbGif.isEmpty()) {
|
||||
IutFhfg.INSTANCE.loadWepJif(mContext, thumbGif, holder.binding.imageView);
|
||||
} else {
|
||||
Glide.with(mContext)
|
||||
.load(thumb)
|
||||
.error(R.drawable.hffghfgh)
|
||||
.placeholder(R.drawable.hffghfgh)
|
||||
.centerCrop()
|
||||
.into(holder.binding.imageView);
|
||||
}
|
||||
|
||||
// 点击事件
|
||||
holder.itemView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Intent intentApply = new Intent(mContext, ViyVyg.class);
|
||||
intentApply.putExtra(ViyVyg.SOURCE_KEY, shikamaru);
|
||||
intentApply.putExtra(ViyVyg.DISPLAY_URL_KEY, shikamaru.getImgPath());
|
||||
intentApply.putExtra(ViyVyg.ZIP_URL_KEY, shikamaru.getZipPath());
|
||||
intentApply.putExtra(ViyVyg.NAME_KEY, shikamaru.getTitleName());
|
||||
intentApply.putExtra(ViyVyg.GIF_KEY, shikamaru.getImgGif());
|
||||
|
||||
String intent_thumb;
|
||||
if (thumbGif != null && !thumbGif.isEmpty()) {
|
||||
intent_thumb = thumbGif;
|
||||
} else {
|
||||
intent_thumb = thumb;
|
||||
}
|
||||
intentApply.putExtra(ViyVyg.THUMB_KEY, intent_thumb);
|
||||
|
||||
mContext.startActivity(intentApply);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mList.size();
|
||||
}
|
||||
|
||||
public static class CategoryViewHolder extends RecyclerView.ViewHolder {
|
||||
private TibsgdgBinding binding;
|
||||
|
||||
public CategoryViewHolder(@NonNull TibsgdgBinding itemView) {
|
||||
super(itemView.getRoot());
|
||||
binding = itemView;
|
||||
}
|
||||
}
|
||||
}
|
||||
125
app/src/main/java/com/app/input/inputaura/onjfsgvfsf/EubDnb.java
Normal file
@ -0,0 +1,125 @@
|
||||
package com.app.input.inputaura.onjfsgvfsf;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Rect;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.app.input.inputaura.R;
|
||||
import com.app.input.inputaura.dasda.Inhj;
|
||||
import com.app.input.inputaura.dasda.Shikamaru;
|
||||
import com.app.input.inputaura.bgtng.TngOui;
|
||||
import com.app.input.inputaura.databinding.RsadasdasBinding;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class EubDnb extends RecyclerView.Adapter<EubDnb.MainViewHolder> {
|
||||
private Context mContext;
|
||||
private List<Inhj> mList = new ArrayList<>();
|
||||
private TngOui mCallBack;
|
||||
|
||||
public EubDnb(Context context, List<Inhj> list) {
|
||||
mContext = context;
|
||||
this.mList = list;
|
||||
}
|
||||
|
||||
public void setClickAction(TngOui callback) {
|
||||
mCallBack = callback;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public MainViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
RsadasdasBinding inflate = RsadasdasBinding.inflate(LayoutInflater.from(parent.getContext()));
|
||||
return new MainViewHolder(inflate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull MainViewHolder holder, int position) {
|
||||
Inhj inhj = mList.get(position);
|
||||
String parentName = inhj.getParentName();
|
||||
holder.binding.className.setText(parentName);
|
||||
|
||||
// 获取前6个数据
|
||||
List<Shikamaru> displayList = inhj.getKeyboardList();
|
||||
int displayCount = Math.min(displayList.size(), 6);
|
||||
List<Shikamaru> subList = displayList.subList(0, displayCount);
|
||||
|
||||
// 设置横向布局管理器
|
||||
LinearLayoutManager layoutManager = new LinearLayoutManager(
|
||||
mContext,
|
||||
LinearLayoutManager.HORIZONTAL,
|
||||
false
|
||||
);
|
||||
|
||||
// 创建适配器
|
||||
UegYf uegYf = new UegYf(mContext, subList);
|
||||
|
||||
// 移除旧的装饰器
|
||||
if (holder.binding.childRecycler.getItemDecorationCount() > 0) {
|
||||
holder.binding.childRecycler.removeItemDecorationAt(0);
|
||||
}
|
||||
|
||||
// 添加新的间距装饰器
|
||||
int spacing = mContext.getResources().getDimensionPixelSize(R.dimen.item_spacing_small);
|
||||
holder.binding.childRecycler.addItemDecoration(new HorizontalItemDecoration(spacing));
|
||||
|
||||
// 设置适配器和布局管理器
|
||||
holder.binding.childRecycler.setLayoutManager(layoutManager);
|
||||
holder.binding.childRecycler.setAdapter(uegYf);
|
||||
|
||||
// 禁用滑动监听(去掉提示图标)
|
||||
// holder.binding.childRecycler.clearOnScrollListeners();
|
||||
|
||||
// 查看全部按钮点击事件
|
||||
holder.binding.tvAll.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (mCallBack != null) {
|
||||
mCallBack.OnClickSeeAll(parentName);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mList.size();
|
||||
}
|
||||
|
||||
public static class MainViewHolder extends RecyclerView.ViewHolder {
|
||||
private RsadasdasBinding binding;
|
||||
public MainViewHolder(@NonNull RsadasdasBinding itemView) {
|
||||
super(itemView.getRoot());
|
||||
binding = itemView;
|
||||
}
|
||||
}
|
||||
|
||||
// 自定义横向间距装饰器(只设置右间距)
|
||||
public static class HorizontalItemDecoration extends RecyclerView.ItemDecoration {
|
||||
private final int spacing;
|
||||
|
||||
public HorizontalItemDecoration(int spacing) {
|
||||
this.spacing = spacing;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
|
||||
int position = parent.getChildAdapterPosition(view);
|
||||
int itemCount = parent.getAdapter().getItemCount();
|
||||
|
||||
// 每个item都设置右间距,最后一个除外
|
||||
if (position < itemCount - 1) {
|
||||
outRect.right = spacing;
|
||||
} else {
|
||||
outRect.right = 0; // 最后一个item不要右边距
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
126
app/src/main/java/com/app/input/inputaura/onjfsgvfsf/OvfYfd.java
Normal file
@ -0,0 +1,126 @@
|
||||
package com.app.input.inputaura.onjfsgvfsf;
|
||||
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.cardview.widget.CardView;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.app.input.inputaura.dasda.Shikamaru;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.app.input.inputaura.R;
|
||||
import com.app.input.inputaura.kfsdfbsd.IutFhfg;
|
||||
import com.app.input.inputaura.bgtng.OnuIg;
|
||||
import com.app.input.inputaura.lmyfvfs.ViyVyg;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class OvfYfd extends RecyclerView.Adapter<OvfYfd.ForYouViewHolder> {
|
||||
|
||||
private Context mContext;
|
||||
private List<Shikamaru> mList = new ArrayList<>();
|
||||
|
||||
private OnuIg mCallBack;
|
||||
|
||||
public OvfYfd(Context context) {
|
||||
mContext = context;
|
||||
}
|
||||
|
||||
public void setForYouList(List<Shikamaru> list) {
|
||||
this.mList = list;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
|
||||
public void setRemoveLike(OnuIg callback) {
|
||||
mCallBack = callback;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ForYouViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
|
||||
View view = LayoutInflater.from(mContext).inflate(R.layout.ynsygd, parent, false);
|
||||
return new ForYouViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ForYouViewHolder holder, int position) {
|
||||
Shikamaru shikamaru = mList.get(position);
|
||||
String thumbGif = shikamaru.getThumbGif();
|
||||
String thumb = shikamaru.getThumbUrl();
|
||||
if (!thumbGif.isEmpty()) {
|
||||
IutFhfg.INSTANCE.loadWepJif(mContext, thumbGif, holder.itemImg);
|
||||
} else {
|
||||
Glide.with(mContext)
|
||||
.load(thumb).error(R.drawable.hffghfgh)
|
||||
.placeholder(R.drawable.hffghfgh).into(holder.itemImg);
|
||||
}
|
||||
holder.itemFavorite.setSelected(true);
|
||||
holder.layoutFavorite.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
holder.itemFavorite.setSelected(false);
|
||||
int adapterPosition = holder.getAdapterPosition();
|
||||
notifyItemRemoved(adapterPosition);
|
||||
if (mCallBack != null) {
|
||||
mCallBack.OnRemoveLike(shikamaru);
|
||||
}
|
||||
}
|
||||
});
|
||||
holder.cardView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Intent intentApply = new Intent(mContext, ViyVyg.class);
|
||||
intentApply.putExtra(ViyVyg.SOURCE_KEY, shikamaru);
|
||||
intentApply.putExtra(ViyVyg.DISPLAY_URL_KEY, shikamaru.getImgPath());
|
||||
intentApply.putExtra(ViyVyg.ZIP_URL_KEY, shikamaru.getZipPath());
|
||||
intentApply.putExtra(ViyVyg.NAME_KEY, shikamaru.getTitleName());
|
||||
intentApply.putExtra(ViyVyg.GIF_KEY, shikamaru.getImgGif());
|
||||
String intent_thumb;
|
||||
if (!thumbGif.isEmpty()) {
|
||||
intent_thumb = thumbGif;
|
||||
} else {
|
||||
intent_thumb = thumb;
|
||||
}
|
||||
intentApply.putExtra(ViyVyg.THUMB_KEY, intent_thumb);
|
||||
mContext.startActivity(intentApply);
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mList.size();
|
||||
}
|
||||
|
||||
public static class ForYouViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
private CardView cardView;
|
||||
private FrameLayout layoutFavorite;
|
||||
private ImageView itemImg, itemFavorite;
|
||||
|
||||
public ForYouViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
cardView = itemView.findViewById(R.id.card_view);
|
||||
layoutFavorite = itemView.findViewById(R.id.layout_favorite);
|
||||
itemImg = itemView.findViewById(R.id.im);
|
||||
itemFavorite = itemView.findViewById(R.id.im_favorite);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
100
app/src/main/java/com/app/input/inputaura/onjfsgvfsf/UegYf.java
Normal file
@ -0,0 +1,100 @@
|
||||
package com.app.input.inputaura.onjfsgvfsf;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.app.input.inputaura.R;
|
||||
import com.app.input.inputaura.dasda.Shikamaru;
|
||||
import com.app.input.inputaura.databinding.CuysnBinding;
|
||||
import com.app.input.inputaura.lmyfvfs.ViyVyg;
|
||||
import com.app.input.inputaura.kfsdfbsd.IutFhfg;
|
||||
import com.bumptech.glide.Glide;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class UegYf extends RecyclerView.Adapter<UegYf.ChildViewHolder> {
|
||||
|
||||
private Context mContext;
|
||||
private List<Shikamaru> mList = new ArrayList<>();
|
||||
|
||||
public UegYf(Context context, List<Shikamaru> list) {
|
||||
mContext = context;
|
||||
this.mList = list;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ChildViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
CuysnBinding inflate = CuysnBinding.inflate(
|
||||
LayoutInflater.from(parent.getContext()),
|
||||
parent,
|
||||
false
|
||||
);
|
||||
return new ChildViewHolder(inflate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ChildViewHolder holder, int position) {
|
||||
Shikamaru shikamaru = mList.get(position);
|
||||
|
||||
String thumbGif = shikamaru.getThumbGif();
|
||||
String thumb = shikamaru.getThumbUrl();
|
||||
|
||||
// 加载图片
|
||||
if (thumbGif != null && !thumbGif.isEmpty()) {
|
||||
IutFhfg.INSTANCE.loadWepJif(mContext, thumbGif, holder.binding.imageView);
|
||||
} else {
|
||||
Glide.with(mContext)
|
||||
.load(thumb)
|
||||
.error(R.drawable.hffghfgh)
|
||||
.placeholder(R.drawable.hffghfgh)
|
||||
.centerCrop()
|
||||
.into(holder.binding.imageView);
|
||||
}
|
||||
|
||||
// 设置点击事件
|
||||
holder.itemView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// 直接跳转,不加动画
|
||||
Intent intentApply = new Intent(mContext, ViyVyg.class);
|
||||
intentApply.putExtra(ViyVyg.SOURCE_KEY, shikamaru);
|
||||
intentApply.putExtra(ViyVyg.DISPLAY_URL_KEY, shikamaru.getImgPath());
|
||||
intentApply.putExtra(ViyVyg.ZIP_URL_KEY, shikamaru.getZipPath());
|
||||
intentApply.putExtra(ViyVyg.NAME_KEY, shikamaru.getTitleName());
|
||||
intentApply.putExtra(ViyVyg.GIF_KEY, shikamaru.getImgGif());
|
||||
|
||||
String intent_thumb;
|
||||
if (thumbGif != null && !thumbGif.isEmpty()) {
|
||||
intent_thumb = thumbGif;
|
||||
} else {
|
||||
intent_thumb = thumb;
|
||||
}
|
||||
intentApply.putExtra(ViyVyg.THUMB_KEY, intent_thumb);
|
||||
|
||||
mContext.startActivity(intentApply);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mList.size();
|
||||
}
|
||||
|
||||
public static class ChildViewHolder extends RecyclerView.ViewHolder {
|
||||
private CuysnBinding binding;
|
||||
|
||||
public ChildViewHolder(@NonNull CuysnBinding itemView) {
|
||||
super(itemView.getRoot());
|
||||
binding = itemView;
|
||||
}
|
||||
}
|
||||
}
|
||||
6
app/src/main/res/color/selector_color_tab.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/white" android:state_selected="true"/>
|
||||
<item android:color="@color/color_gray" android:state_selected="false"/>
|
||||
|
||||
</selector>
|
||||
BIN
app/src/main/res/drawable/adasda.png
Normal file
|
After Width: | Height: | Size: 341 B |
6
app/src/main/res/drawable/bdbdfg.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:drawable="@drawable/hvtfvnm" android:state_selected="false"/>
|
||||
<item android:drawable="@drawable/knybgh" android:state_selected="true" />
|
||||
|
||||
</selector>
|
||||
9
app/src/main/res/drawable/bfbdfgbd.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="M716.8,60.2c-81.3,0 -153.6,36.1 -204.8,96.4 -51.2,-60.2 -123.5,-96.4 -204.8,-96.4C153.6,60.2 30.1,192.8 30.1,358.4c0,45.2 6,87.3 21.1,126.5 0,0 12,36.1 21.1,57.2C189.7,798.1 512,963.8 512,963.8s322.3,-165.6 439.7,-424.7c0,0 15.1,-33.1 21.1,-57.2 12,-39.2 21.1,-81.3 21.1,-126.5C993.9,192.8 870.4,60.2 716.8,60.2zM915.6,466.8c-6,15.1 -15.1,42.2 -18.1,48.2 -87.3,192.8 -307.2,334.3 -385.5,379.5 -78.3,-45.2 -298.2,-186.7 -385.5,-379.5 -6,-15.1 -15.1,-36.1 -18.1,-51.2 -12,-33.1 -18.1,-72.3 -18.1,-105.4C90.4,225.9 189.7,120.5 307.2,120.5c60.2,0 117.5,27.1 159.6,75.3L512,247l45.2,-51.2C599.3,147.6 656.6,120.5 716.8,120.5c120.5,0 216.8,105.4 216.8,234.9 0,36.1 -6,72.3 -18.1,111.4z"
|
||||
android:fillColor="@color/white"/>
|
||||
</vector>
|
||||
6
app/src/main/res/drawable/bfgfhn.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:drawable="@drawable/lmjn" android:state_selected="false"/>
|
||||
<item android:drawable="@drawable/lkunjb" android:state_selected="true" />
|
||||
|
||||
</selector>
|
||||
5
app/src/main/res/drawable/bnfnbfgh.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/list" />
|
||||
<corners android:radius="4dp" />
|
||||
</shape>
|
||||
BIN
app/src/main/res/drawable/fadfdaf.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
9
app/src/main/res/drawable/fggfg.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="16dp"
|
||||
android:height="16dp"
|
||||
android:viewportWidth="16"
|
||||
android:viewportHeight="16">
|
||||
<path
|
||||
android:pathData="M8.72,8L14.21,2.51C14.412,2.307 14.412,1.992 14.21,1.79C14.007,1.587 13.692,1.587 13.49,1.79L8,7.28L2.51,1.79C2.307,1.587 1.992,1.587 1.79,1.79C1.587,1.992 1.587,2.307 1.79,2.51L7.28,8L1.79,13.49C1.587,13.692 1.587,14.007 1.79,14.21C1.88,14.3 2.015,14.367 2.15,14.367C2.285,14.367 2.42,14.322 2.51,14.21L8,8.72L13.49,14.21C13.58,14.3 13.715,14.367 13.85,14.367C13.985,14.367 14.12,14.322 14.21,14.21C14.412,14.007 14.412,13.692 14.21,13.49L8.72,8Z"
|
||||
android:fillColor="#000000"/>
|
||||
</vector>
|
||||
15
app/src/main/res/drawable/gdfgdfgfdg.xml
Normal file
@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="false">
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="4dp"/>
|
||||
<solid android:color="@color/white"/>
|
||||
</shape>
|
||||
</item>
|
||||
<item android:state_pressed="true">
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="4dp"/>
|
||||
<solid android:color="@color/key_bg_press"/>
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
BIN
app/src/main/res/drawable/gjghjgj.png
Normal file
|
After Width: | Height: | Size: 481 B |
27
app/src/main/res/drawable/hbgdfg.xml
Normal file
@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 进度条背景 -->
|
||||
<item android:id="@android:id/background">
|
||||
<shape>
|
||||
<solid android:color="#E0E0E0" /> <!-- 灰色背景 -->
|
||||
<corners android:radius="2.5dp" /> <!-- 匹配进度条高度5dp的圆角 -->
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<!-- 进度条填充(三段渐变模拟彩虹) -->
|
||||
<item android:id="@android:id/progress">
|
||||
<clip> <!-- 必须保留:随进度裁切渐变 -->
|
||||
<shape>
|
||||
<corners android:radius="2.5dp" />
|
||||
<gradient
|
||||
android:type="linear"
|
||||
android:angle="0"
|
||||
android:startColor="@color/tab"
|
||||
android:centerColor="@color/tab"
|
||||
android:endColor="@color/tab"
|
||||
android:centerX="0.5"
|
||||
android:useLevel="true" />
|
||||
</shape>
|
||||
</clip>
|
||||
</item>
|
||||
</layer-list>
|
||||
BIN
app/src/main/res/drawable/hffghfgh.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
app/src/main/res/drawable/hvtfvnm.png
Normal file
|
After Width: | Height: | Size: 7.7 KiB |
6
app/src/main/res/drawable/jhgjghj.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:drawable="@drawable/nghnghjg" android:state_selected="false" />
|
||||
<item android:drawable="@drawable/kjugb" />
|
||||
</selector>
|
||||
7
app/src/main/res/drawable/kjugb.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/apply_step_false" />
|
||||
<corners android:radius="12dp" />
|
||||
|
||||
</shape>
|
||||
BIN
app/src/main/res/drawable/knybgh.png
Normal file
|
After Width: | Height: | Size: 8.0 KiB |
6
app/src/main/res/drawable/likmjg.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/white"/>
|
||||
<corners android:radius="12dp"/>
|
||||
<stroke android:width="1dp" android:color="@color/light_gray"/>
|
||||
</shape>
|
||||
BIN
app/src/main/res/drawable/lkunjb.png
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
app/src/main/res/drawable/lmjn.png
Normal file
|
After Width: | Height: | Size: 6.5 KiB |
BIN
app/src/main/res/drawable/minhjv.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
7
app/src/main/res/drawable/nghnghjg.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/tab" />
|
||||
<corners android:radius="12dp" />
|
||||
|
||||
</shape>
|
||||
7
app/src/main/res/drawable/oadiandad.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/white"/>
|
||||
|
||||
</shape>
|
||||
9
app/src/main/res/drawable/oikmjbn.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="@android:color/black"
|
||||
android:pathData="M7,10l5,5,5,-5z"/>
|
||||
</vector>
|
||||
9
app/src/main/res/drawable/ojuninjin.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="256dp"
|
||||
android:height="256dp"
|
||||
android:viewportWidth="1024"
|
||||
android:viewportHeight="1024">
|
||||
<path
|
||||
android:pathData="M608,736c-6.4,0 -19.2,0 -25.6,-6.4l-192,-192C384,524.8 384,499.2 390.4,486.4l192,-192c12.8,-12.8 32,-12.8 44.8,0s12.8,32 0,44.8L460.8,512l166.4,166.4c12.8,12.8 12.8,32 0,44.8C627.2,736 614.4,736 608,736z"
|
||||
android:fillColor="@color/main_text_color"/>
|
||||
</vector>
|
||||
6
app/src/main/res/drawable/ounjgy.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?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>
|
||||
6
app/src/main/res/drawable/piubn.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@android:color/transparent"/>
|
||||
<stroke android:width="1dp" android:color="@color/light_gray"/>
|
||||
<corners android:radius="16dp"/>
|
||||
</shape>
|
||||
10
app/src/main/res/drawable/pkyhbnv.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/white"/>
|
||||
<corners
|
||||
android:topLeftRadius="40dp"
|
||||
android:topRightRadius="40dp" />
|
||||
|
||||
|
||||
</shape>
|
||||
BIN
app/src/main/res/drawable/rtgbgf.png
Normal file
|
After Width: | Height: | Size: 9.5 KiB |
6
app/src/main/res/drawable/vddsf.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:drawable="@drawable/bfbdfgbd" android:state_selected="false"/>
|
||||
<item android:drawable="@drawable/knybgh" android:state_selected="true" />
|
||||
|
||||
</selector>
|
||||
9
app/src/main/res/drawable/zsj.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="@android:color/black"
|
||||
android:pathData="M7,15 L17,15 L12,10 Z"/>
|
||||
</vector>
|
||||
44
app/src/main/res/layout/adiasdnad.xml
Normal file
@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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:id="@+id/main"
|
||||
android:background="@color/bg_color"
|
||||
tools:context="com.app.input.inputaura.lmyfvfs.YhkFgv">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/back"
|
||||
android:layout_width="44dp"
|
||||
android:layout_height="44dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:paddingVertical="7dp"
|
||||
android:paddingStart="5dp"
|
||||
android:src="@drawable/ojuninjin"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.app.input.inputaura.kfsdfbsd.TiuGju
|
||||
android:id="@+id/class_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/app_name"
|
||||
android:textColor="@color/main_text_color"
|
||||
android:textSize="18sp"
|
||||
app:apply_font="true"
|
||||
app:layout_constraintBottom_toBottomOf="@id/back"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/back" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:paddingStart="@dimen/recycler_padding"
|
||||
android:paddingEnd="@dimen/recycler_padding"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/back" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
19
app/src/main/res/layout/cuysn.xml
Normal file
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/fragme"
|
||||
android:layout_width="160dp"
|
||||
android:layout_height="100dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
app:cardCornerRadius="8dp"
|
||||
app:cardElevation="2dp"
|
||||
app:cardBackgroundColor="@android:color/white">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/image_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
android:background="@android:color/transparent" />
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
25
app/src/main/res/layout/dajiobu.xml
Normal file
@ -0,0 +1,25 @@
|
||||
<?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"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/im_icon"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp" />
|
||||
|
||||
<com.app.input.inputaura.kfsdfbsd.TiuGju
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/app_name"
|
||||
android:id="@+id/textView"
|
||||
app:apply_font="true"
|
||||
android:textColor="@color/selector_color_tab"
|
||||
android:layout_marginTop="5dp"
|
||||
android:textSize="12sp" />
|
||||
|
||||
</LinearLayout>
|
||||
137
app/src/main/res/layout/fongng.xml
Normal file
@ -0,0 +1,137 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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:id="@+id/main"
|
||||
android:background="@color/bg_color">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/back"
|
||||
android:layout_width="44dp"
|
||||
android:layout_height="44dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:paddingStart="5dp"
|
||||
android:paddingVertical="7dp"
|
||||
android:src="@drawable/ojuninjin"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.app.input.inputaura.kfsdfbsd.TiuGju
|
||||
android:id="@+id/textview_data_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/app_name"
|
||||
android:textColor="@color/main_text_color"
|
||||
android:textSize="18sp"
|
||||
app:apply_font="true"
|
||||
app:layout_constraintBottom_toBottomOf="@id/back"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/back" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/im_like"
|
||||
android:layout_width="44dp"
|
||||
android:layout_height="44dp"
|
||||
android:layout_marginEnd="30dp"
|
||||
android:padding="9dp"
|
||||
android:src="@drawable/vddsf"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/back" />
|
||||
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/card_viewData"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="204dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
app:cardBackgroundColor="@color/transparent"
|
||||
app:cardCornerRadius="12dp"
|
||||
app:cardElevation="0dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/back">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/image_data"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="fitXY" />
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layoutDownloadApply"
|
||||
android:layout_width="260dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="28dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:background="@drawable/nghnghjg"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/card_viewData">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/im_download"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:src="@drawable/rtgbgf" />
|
||||
|
||||
<com.app.input.inputaura.kfsdfbsd.TiuGju
|
||||
android:id="@+id/tv_download"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:text="@string/download_apply"
|
||||
app:apply_font="true"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<com.app.input.inputaura.kfsdfbsd.TiuGju
|
||||
android:id="@+id/text_for_you"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="25dp"
|
||||
android:text="@string/recommended"
|
||||
android:textColor="@color/main_text_color"
|
||||
android:textSize="16sp"
|
||||
app:apply_font="true"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/layoutDownloadApply" />
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recommended_recycler"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="17dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/text_for_you" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/loading"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/bg_loading"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:visibility="gone">
|
||||
|
||||
<ProgressBar
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:indeterminateTint="@color/white" />
|
||||
</FrameLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
87
app/src/main/res/layout/hgius.xml
Normal file
@ -0,0 +1,87 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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/bg_color">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/topContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent">
|
||||
|
||||
<!-- 使用 CardView 包裹 TabLayout 以添加阴影 -->
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
app:cardElevation="4dp"
|
||||
app:cardCornerRadius="20dp"
|
||||
app:cardUseCompatPadding="true"
|
||||
app:cardBackgroundColor="@color/bg_color">
|
||||
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/categoryTabLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="30dp"
|
||||
android:background="@color/bg_color"
|
||||
app:tabIndicatorHeight="0dp"
|
||||
app:tabMode="scrollable" />
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<!-- See All 按钮固定宽度 -->
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/seeAllButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:background="@drawable/piubn">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvSeeAll"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/See_All"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@color/black"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/oikmjbn"
|
||||
android:layout_marginStart="4dp"
|
||||
app:layout_constraintStart_toEndOf="@id/tvSeeAll"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 分类内容 ViewPager2 -->
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
android:id="@+id/categoryViewPager"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:paddingStart="@dimen/recycler_padding"
|
||||
android:paddingEnd="@dimen/recycler_padding"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/topContainer" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
41
app/src/main/res/layout/litdg.xml
Normal file
@ -0,0 +1,41 @@
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/dropdown_container"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:minWidth="120dp"
|
||||
android:maxWidth="200dp"
|
||||
android:orientation="vertical"
|
||||
android:background="@drawable/likmjg"
|
||||
android:paddingVertical="8dp"
|
||||
android:elevation="8dp"
|
||||
android:outlineProvider="background"
|
||||
android:clipToOutline="true">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/dropdown_recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="8dp"
|
||||
android:maxHeight="300dp"
|
||||
android:overScrollMode="never"
|
||||
android:scrollbars="vertical"
|
||||
android:layout_gravity="center"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/collapse_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:padding="12dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/collapse_icon"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:src="@drawable/zsj"
|
||||
app:tint="@color/black" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
46
app/src/main/res/layout/mgihd.xml
Normal file
@ -0,0 +1,46 @@
|
||||
<?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:id="@+id/main"
|
||||
android:background="@color/bg_color">
|
||||
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/nova_progress"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_width="240dp"
|
||||
android:layout_height="5dp"
|
||||
android:layout_below="@id/tv"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginStart="33dp"
|
||||
android:layout_marginTop="28dp"
|
||||
android:layout_marginEnd="33dp"
|
||||
android:layout_marginBottom="40dp"
|
||||
android:progress="1"
|
||||
android:progressDrawable="@drawable/hbgdfg" />
|
||||
|
||||
<androidx.constraintlayout.utils.widget.ImageFilterView
|
||||
android:id="@+id/image"
|
||||
android:layout_width="106dp"
|
||||
android:layout_height="106dp"
|
||||
app:roundPercent="0.2"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="260dp"
|
||||
android:src="@mipmap/ic_launcher_foreground" />
|
||||
|
||||
<com.app.input.inputaura.kfsdfbsd.TiuGju
|
||||
android:id="@+id/tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/image"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="@string/app_name"
|
||||
android:textColor="@color/main_text_color"
|
||||
android:textSize="18sp"
|
||||
app:apply_font="true" />
|
||||
|
||||
</RelativeLayout>
|
||||
27
app/src/main/res/layout/ogjgg.xml
Normal file
@ -0,0 +1,27 @@
|
||||
<?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:id="@+id/main"
|
||||
android:background="@color/bg_color"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
android:id="@+id/viewpager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_above="@id/tab_layout" />
|
||||
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/tab_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="55dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
app:tabIndicatorHeight="0dp"
|
||||
android:background="@color/tab"/>
|
||||
|
||||
</RelativeLayout>
|
||||
21
app/src/main/res/layout/posd.xml
Normal file
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/item_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
android:background="?android:attr/selectableItemBackground">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/category_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="none"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp"
|
||||
android:gravity="center" />
|
||||
|
||||
</LinearLayout>
|
||||
67
app/src/main/res/layout/punngd.xml
Normal file
@ -0,0 +1,67 @@
|
||||
<?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:id="@+id/main"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/relayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/bg_loading" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginTop="50dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:background="@drawable/oadiandad"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true"
|
||||
android:hint="@string/et_hint"
|
||||
android:paddingStart="15dp"
|
||||
android:textColor="@color/black"
|
||||
android:textColorHint="@color/apply_step_false"
|
||||
android:textCursorDrawable="@color/color_74CBFF" />
|
||||
</RelativeLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/id_back"
|
||||
android:layout_width="44dp"
|
||||
android:layout_height="44dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:paddingStart="5dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:src="@drawable/adasda" />
|
||||
|
||||
<com.app.input.inputaura.kfsdfbsd.TiuGju
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignTop="@id/id_back"
|
||||
android:layout_alignBottom="@id/id_back"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:paddingStart="5dp"
|
||||
android:paddingEnd="5dp"
|
||||
android:text="@string/app_name"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="18sp"
|
||||
app:apply_font="true" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
103
app/src/main/res/layout/puoiou.xml
Normal file
@ -0,0 +1,103 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout 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="wrap_content"
|
||||
>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:background="@drawable/pkyhbnv"
|
||||
android:paddingBottom="20dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:backgroundTint="@color/bg_color">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="55dp"
|
||||
android:layout_height="45dp"
|
||||
android:padding="12dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:id="@+id/im_close"
|
||||
android:layout_marginTop="10dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:src="@drawable/fggfg"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
/>
|
||||
|
||||
<com.app.input.inputaura.kfsdfbsd.TiuGju
|
||||
android:id="@+id/text_open"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="50dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="50dp"
|
||||
android:gravity="center"
|
||||
app:apply_font="true"
|
||||
android:text="@string/open_str"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintTop_toBottomOf="@id/im_close" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linear_step_one"
|
||||
android:layout_width="280dp"
|
||||
android:layout_height="52dp"
|
||||
android:layout_marginTop="32dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:background="@drawable/jhgjghj"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintTop_toBottomOf="@id/text_open">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ok_one"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:src="@drawable/fadfdaf"
|
||||
android:visibility="gone" />
|
||||
|
||||
<com.app.input.inputaura.kfsdfbsd.TiuGju
|
||||
android:id="@+id/text_step_one"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/step_1"
|
||||
app:apply_font="true"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="15sp" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linear_step_two"
|
||||
android:layout_width="280dp"
|
||||
android:layout_height="52dp"
|
||||
android:layout_marginTop="20dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:background="@drawable/jhgjghj"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintTop_toBottomOf="@id/linear_step_one">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ok_two"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:src="@drawable/fadfdaf"
|
||||
android:visibility="gone" />
|
||||
|
||||
<com.app.input.inputaura.kfsdfbsd.TiuGju
|
||||
android:id="@+id/text_step_two"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/step_2"
|
||||
app:apply_font="true"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="15sp" />
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</FrameLayout>
|
||||
43
app/src/main/res/layout/rsadasdas.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="wrap_content"
|
||||
android:paddingBottom="12dp">
|
||||
|
||||
<com.app.input.inputaura.kfsdfbsd.TiuGju
|
||||
android:id="@+id/class_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="46dp"
|
||||
android:layout_marginStart="6dp"
|
||||
android:gravity="center_vertical"
|
||||
android:text="@string/app_name"
|
||||
android:textColor="@color/main_text_color"
|
||||
android:textSize="16sp"
|
||||
app:apply_font="true" />
|
||||
|
||||
<com.app.input.inputaura.kfsdfbsd.TiuGju
|
||||
android:id="@+id/tv_all"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignTop="@id/class_name"
|
||||
android:layout_alignBottom="@id/class_name"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingStart="12dp"
|
||||
android:text="@string/see_all"
|
||||
android:textColor="@color/main_text_color"
|
||||
android:textSize="14sp"
|
||||
app:apply_font="true" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/child_recycler"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="110dp"
|
||||
android:layout_below="@id/class_name"
|
||||
android:paddingStart="6dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:clipToPadding="false" />
|
||||
|
||||
</RelativeLayout>
|
||||
34
app/src/main/res/layout/rwtsbf.xml
Normal file
@ -0,0 +1,34 @@
|
||||
<?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">
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/like_recycler"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="15dp" />
|
||||
|
||||
|
||||
<com.app.input.inputaura.kfsdfbsd.TiuGju
|
||||
android:id="@+id/empty_title"
|
||||
android:layout_width="260dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_marginStart="25dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginEnd="25dp"
|
||||
android:gravity="center"
|
||||
android:lineSpacingExtra="2dp"
|
||||
android:text="@string/no_like"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp"
|
||||
android:visibility="gone"
|
||||
app:apply_font="true" />
|
||||
|
||||
</RelativeLayout>
|
||||
18
app/src/main/res/layout/tibsgdg.xml
Normal file
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.cardview.widget.CardView 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="wrap_content"
|
||||
app:cardCornerRadius="10dp"
|
||||
app:cardElevation="2dp"
|
||||
app:cardUseCompatPadding="true">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/image_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:background="@android:color/darker_gray" />
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
41
app/src/main/res/layout/uususs.xml
Normal file
@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/rl_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/gif_bg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_alignTop="@id/custom_input_view"
|
||||
android:layout_alignBottom="@id/custom_input_view" />
|
||||
|
||||
<VideoView
|
||||
android:id="@+id/video_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_alignTop="@id/custom_input_view"
|
||||
android:layout_alignBottom="@id/custom_input_view" />
|
||||
|
||||
|
||||
<com.app.input.inputaura.nggfsdfds.RvyIub
|
||||
android:id="@+id/custom_input_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:animateLayoutChanges="true"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true"
|
||||
android:keyBackground="@drawable/gdfgdfgfdg"
|
||||
android:keyTextColor="@color/white"
|
||||
android:keyTextSize="0sp"
|
||||
android:labelTextSize="12sp"
|
||||
android:paddingStart="5dp"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingEnd="5dp"
|
||||
android:paddingBottom="5dp" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
21
app/src/main/res/layout/xusyt.xml
Normal file
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout 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="wrap_content">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/card_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="120dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:cardCornerRadius="12dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imPreview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="fitXY" />
|
||||
</androidx.cardview.widget.CardView>
|
||||
</FrameLayout>
|
||||