V1.0.3(4) 功能优化,集成topon广告
This commit is contained in:
parent
a63186484f
commit
7318bf8736
@ -1,6 +1,6 @@
|
||||
|
||||
import java.util.Date
|
||||
import java.text.SimpleDateFormat
|
||||
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("org.jetbrains.kotlin.android")
|
||||
@ -14,23 +14,20 @@ android {
|
||||
compileSdk = 34
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "com.nova.keyboard"
|
||||
//com.nova.keyboard
|
||||
applicationId = "com.nova.keyboard.test11"
|
||||
minSdk = 23
|
||||
targetSdk = 34
|
||||
versionCode = 4
|
||||
versionName = "1.0.3"
|
||||
setProperty("archivesBaseName", "Nova keyboard_V" + versionName + "(${versionCode})_$timestamp")
|
||||
setProperty(
|
||||
"archivesBaseName",
|
||||
"Nova keyboard_V" + versionName + "(${versionCode})_$timestamp"
|
||||
)
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
debug {
|
||||
isMinifyEnabled = true
|
||||
proguardFiles(
|
||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||
"proguard-rules.pro"
|
||||
)
|
||||
}
|
||||
release {
|
||||
isMinifyEnabled = true
|
||||
proguardFiles(
|
||||
@ -43,9 +40,16 @@ android {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = "1.8"
|
||||
}
|
||||
buildFeatures {
|
||||
buildConfig = true
|
||||
viewBinding = true
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
dependencies {
|
||||
@ -65,11 +69,73 @@ dependencies {
|
||||
implementation("com.github.zjupure:webpdecoder:2.0.4.12.0")
|
||||
implementation("com.github.omicronapps:7-Zip-JBinding-4Android:Release-16.02-2.02")
|
||||
|
||||
implementation(platform("com.google.firebase:firebase-bom:32.3.1"))
|
||||
implementation("com.google.firebase:firebase-analytics-ktx")
|
||||
implementation("com.google.firebase:firebase-crashlytics-ktx")
|
||||
// implementation(platform("com.google.firebase:firebase-bom:32.3.1"))
|
||||
// implementation("com.google.firebase:firebase-analytics-ktx")
|
||||
// implementation("com.google.firebase:firebase-crashlytics-ktx")
|
||||
|
||||
implementation(platform("com.google.firebase:firebase-bom:33.1.1"))
|
||||
implementation("com.google.firebase:firebase-crashlytics")
|
||||
implementation("com.google.firebase:firebase-analytics")
|
||||
implementation("com.google.firebase:firebase-config")
|
||||
|
||||
|
||||
//-----------------------------------------------TopOn(pangle、IronSource、mintegral、unityads、liftoff(vungle)、Bigo)
|
||||
//Anythink (Necessary)
|
||||
implementation("com.anythink.sdk:core-tpn:6.3.68")
|
||||
implementation("com.anythink.sdk:nativead-tpn:6.3.68")
|
||||
implementation("com.anythink.sdk:banner-tpn:6.3.68")
|
||||
implementation("com.anythink.sdk:interstitial-tpn:6.3.68")
|
||||
implementation("com.anythink.sdk:rewardedvideo-tpn:6.3.68")
|
||||
implementation("com.anythink.sdk:splash-tpn:6.3.68")
|
||||
|
||||
//Androidx (Necessary)
|
||||
implementation("androidx.appcompat:appcompat:1.1.0")
|
||||
implementation("androidx.browser:browser:1.4.0")
|
||||
|
||||
//Vungle
|
||||
implementation("com.anythink.sdk:adapter-tpn-vungle:6.3.68")
|
||||
implementation("com.vungle:vungle-ads:7.3.2")
|
||||
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.anythink.sdk:adapter-tpn-unityads:6.3.68")
|
||||
implementation("com.unity3d.ads:unity-ads:4.9.3")
|
||||
|
||||
//Ironsource
|
||||
implementation("com.anythink.sdk:adapter-tpn-ironsource:6.3.68")
|
||||
implementation("com.ironsource.sdk:mediationsdk:8.1.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.anythink.sdk:adapter-tpn-bigo:6.3.68")
|
||||
implementation("com.bigossp:bigo-ads:4.7.4")
|
||||
|
||||
//Pangle
|
||||
implementation("com.anythink.sdk:adapter-tpn-pangle-nonchina:6.3.68.1")
|
||||
implementation( "com.pangle.global:ads-sdk:6.0.0.3")
|
||||
implementation( "com.google.android.gms:play-services-ads-identifier:18.0.1")
|
||||
|
||||
//Mintegral
|
||||
implementation("com.anythink.sdk:adapter-tpn-mintegral-nonchina:6.3.68")
|
||||
implementation("com.mbridge.msdk.oversea:reward:16.7.51")
|
||||
implementation("com.mbridge.msdk.oversea:newinterstitial:16.7.51")
|
||||
implementation("com.mbridge.msdk.oversea:mbnative:16.7.51")
|
||||
implementation("com.mbridge.msdk.oversea:mbnativeadvanced:16.7.51")
|
||||
implementation("com.mbridge.msdk.oversea:mbsplash:16.7.51")
|
||||
implementation("com.mbridge.msdk.oversea:mbbanner:16.7.51")
|
||||
implementation("com.mbridge.msdk.oversea:mbbid:16.7.51")
|
||||
implementation("androidx.recyclerview:recyclerview:1.1.0")
|
||||
|
||||
//Tramini
|
||||
implementation("com.anythink.sdk:tramini-plugin-tpn:6.3.68")
|
||||
|
||||
// Debugger UI Tools
|
||||
implementation ("com.anythink.sdk:debugger-ui:1.0.7")
|
||||
|
||||
//----------------------------------------------TopOn
|
||||
|
||||
|
||||
}
|
||||
@ -9,7 +9,7 @@
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:326384418328:android:fe2196479b76d028c1cd6d",
|
||||
"android_client_info": {
|
||||
"package_name": "com.nova.keyboard"
|
||||
"package_name": "com.nova.keyboard.test11"
|
||||
}
|
||||
},
|
||||
"oauth_client": [],
|
||||
|
||||
Binary file not shown.
@ -15,6 +15,7 @@
|
||||
tools:targetApi="31">
|
||||
<activity
|
||||
android:name=".viewUi.NovaActivity"
|
||||
android:theme="@style/Theme.NovaActivity"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
Binary file not shown.
22461
app/src/main/assets/source_keyboard.json
Normal file
22461
app/src/main/assets/source_keyboard.json
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,9 @@
|
||||
package com.input.board.appskey.keyboard
|
||||
|
||||
import android.app.Application
|
||||
import android.util.Log
|
||||
import com.anythink.core.api.ATSDK
|
||||
import com.anythink.core.api.NetTrafficeCallback
|
||||
import com.input.board.appskey.keyboard.fileTools.DesFile
|
||||
import com.input.board.appskey.keyboard.fileTools.DesFile.deFile
|
||||
import com.input.board.appskey.keyboard.jsonBean.ChildBean
|
||||
@ -13,20 +16,24 @@ class KeyBoardApp : Application() {
|
||||
|
||||
lateinit var list: MutableList<MainBean>
|
||||
|
||||
}
|
||||
const val TAG = "+++++++++++++++++++++"
|
||||
|
||||
}
|
||||
private val APPId = "h66b1d37c22a77"
|
||||
private val AppKey = "a3f5e17582cca6e43dcbb0732c125dec8"
|
||||
|
||||
private val debug_Key = "63db2183733f4027ed5333d9ea59e1540d46b1a6"
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
appInstance = this
|
||||
|
||||
initUNity()
|
||||
initTopOnSDK()
|
||||
dealFile()
|
||||
}
|
||||
|
||||
private fun dealFile() {
|
||||
val openFile = appInstance.assets.open("encrypt_keyboard.json")
|
||||
val deFilePath = deFile(openFile)
|
||||
val jsonString = DesFile.getJsonString(deFilePath)
|
||||
val openFile = appInstance.assets.open("source_keyboard.json")
|
||||
val jsonString = DesFile.getJsonString(openFile)
|
||||
resolveJsonString(jsonString)
|
||||
}
|
||||
|
||||
@ -89,8 +96,24 @@ class KeyBoardApp : Application() {
|
||||
|
||||
}
|
||||
|
||||
private fun initUNity() {
|
||||
private fun initTopOnSDK() {
|
||||
ATSDK.checkIsEuTraffic(this, object : NetTrafficeCallback {
|
||||
override fun onResultCallback(isEU: Boolean) {
|
||||
Log.e(TAG, "onResultCallback:$isEU")
|
||||
if (isEU && ATSDK.getGDPRDataLevel(this@KeyBoardApp) == ATSDK.UNKNOWN) {
|
||||
ATSDK.showGdprAuth(this@KeyBoardApp)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onErrorCallback(errorMsg: String) {
|
||||
Log.e(TAG, "onErrorCallback:$errorMsg")
|
||||
}
|
||||
})
|
||||
ATSDK.init(this, APPId, AppKey)
|
||||
// AdManager.loadAllAd()
|
||||
//测试工具
|
||||
// ATDebuggerUITest.showDebuggerUI(this, debug_Key)
|
||||
// ATSDK.setNetworkLogDebug(true)
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,166 @@
|
||||
package com.input.board.appskey.keyboard.dialog
|
||||
|
||||
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.input.board.appskey.keyboard.KeyBoardApp
|
||||
import com.input.board.appskey.keyboard.R
|
||||
import com.input.board.appskey.keyboard.databinding.DialogStepBinding
|
||||
import com.input.board.appskey.keyboard.fileTools.InputMethodCom
|
||||
|
||||
|
||||
class RecommentDialog(private var clickAction: (clickPos: Int) -> Unit) : DialogFragment() {
|
||||
|
||||
private lateinit var vb: DialogStepBinding
|
||||
|
||||
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
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View {
|
||||
vb = DialogStepBinding.inflate(layoutInflater)
|
||||
context = KeyBoardApp.appInstance
|
||||
|
||||
|
||||
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 = InputMethodCom.checkEnable(KeyBoardApp.appInstance)
|
||||
val checkSetDefault = InputMethodCom.checkSetDefault(KeyBoardApp.appInstance)
|
||||
if (checkEnable && checkSetDefault) {
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val clickType_home = 0
|
||||
const val clickType_lock = 1
|
||||
const val clickType_both = 2
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,166 @@
|
||||
package com.input.board.appskey.keyboard.dialog
|
||||
|
||||
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.input.board.appskey.keyboard.KeyBoardApp
|
||||
import com.input.board.appskey.keyboard.R
|
||||
import com.input.board.appskey.keyboard.databinding.DialogStepBinding
|
||||
import com.input.board.appskey.keyboard.fileTools.InputMethodCom
|
||||
|
||||
|
||||
class StepDialog(private var clickAction: (clickPos: Int) -> Unit) : DialogFragment() {
|
||||
|
||||
private lateinit var vb: DialogStepBinding
|
||||
|
||||
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
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View {
|
||||
vb = DialogStepBinding.inflate(layoutInflater)
|
||||
context = KeyBoardApp.appInstance
|
||||
|
||||
|
||||
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 = InputMethodCom.checkEnable(KeyBoardApp.appInstance)
|
||||
val checkSetDefault = InputMethodCom.checkSetDefault(KeyBoardApp.appInstance)
|
||||
if (checkEnable && checkSetDefault) {
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val clickType_home = 0
|
||||
const val clickType_lock = 1
|
||||
const val clickType_both = 2
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -93,9 +93,9 @@ public class DesFile {
|
||||
}
|
||||
}
|
||||
|
||||
public static String getJsonString(String path) {
|
||||
public static String getJsonString(InputStream fileInputStream) {
|
||||
try {
|
||||
FileInputStream fileInputStream = new FileInputStream(path);
|
||||
// FileInputStream fileInputStream = new FileInputStream(path);
|
||||
char[] charArray = new char[fileInputStream.available()];
|
||||
int readCount = 0;
|
||||
InputStreamReader streamReader = new InputStreamReader(fileInputStream);
|
||||
|
||||
@ -0,0 +1,9 @@
|
||||
package com.input.board.appskey.keyboard.firebase
|
||||
|
||||
object RemoteConfigKey {
|
||||
|
||||
//配置在firebase中的key,通过它取出自己配置的json
|
||||
const val KEY_AD_SHOW_INTERVAL = "key_ad_show_interval"
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,137 @@
|
||||
package com.input.board.appskey.keyboard.firebase
|
||||
|
||||
import android.app.Application
|
||||
import android.content.Context
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.os.Message
|
||||
import android.text.TextUtils
|
||||
import android.util.Log
|
||||
import com.google.firebase.remoteconfig.ConfigUpdate
|
||||
import com.google.firebase.remoteconfig.ConfigUpdateListener
|
||||
import com.google.firebase.remoteconfig.FirebaseRemoteConfig
|
||||
import com.google.firebase.remoteconfig.FirebaseRemoteConfigException
|
||||
import com.google.firebase.remoteconfig.FirebaseRemoteConfigSettings
|
||||
import com.google.firebase.remoteconfig.FirebaseRemoteConfigValue
|
||||
import com.input.board.appskey.keyboard.BuildConfig
|
||||
import com.input.board.appskey.keyboard.KeyBoardApp
|
||||
import java.lang.ref.WeakReference
|
||||
|
||||
class RemoteConfigNew {
|
||||
private var ctx: Context? = null
|
||||
private var mFirebaseRemoteConfig: FirebaseRemoteConfig? = null
|
||||
|
||||
//配置是否初始化成功
|
||||
private var isInit = false
|
||||
|
||||
//上次获取数据的时间
|
||||
private var lastFetchTime: Long = 0
|
||||
private val handler = MHandler(this)
|
||||
|
||||
|
||||
companion object {
|
||||
const val MSG_REFRESH_CONFIG = 1
|
||||
val instance: RemoteConfigNew by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) {
|
||||
RemoteConfigNew()
|
||||
}
|
||||
}
|
||||
|
||||
fun init(ctx: Application) {
|
||||
this.ctx = ctx
|
||||
initConfig()
|
||||
fetchConfig()
|
||||
onConfigUpdate()
|
||||
}
|
||||
|
||||
private fun initConfig() {
|
||||
var intervalTime = (60 * 10).toLong()
|
||||
//如果是开发状态,则将提取时间缩短
|
||||
if (BuildConfig.DEBUG) {
|
||||
intervalTime = (60 * 5).toLong()
|
||||
}
|
||||
mFirebaseRemoteConfig = FirebaseRemoteConfig.getInstance()
|
||||
val configSettings =
|
||||
FirebaseRemoteConfigSettings.Builder() //默认值12小时的最短提取间隔,如果在间隔内取值,则优先取上次的结果
|
||||
.setMinimumFetchIntervalInSeconds(intervalTime).build()
|
||||
mFirebaseRemoteConfig!!.setConfigSettingsAsync(configSettings)
|
||||
}
|
||||
|
||||
private fun onConfigUpdate() {
|
||||
mFirebaseRemoteConfig!!.addOnConfigUpdateListener(object : ConfigUpdateListener {
|
||||
override fun onUpdate(configUpdate: ConfigUpdate) {
|
||||
Log.d(KeyBoardApp.TAG, "Updated keys: " + configUpdate.updatedKeys)
|
||||
try {
|
||||
mFirebaseRemoteConfig!!.activate().addOnCompleteListener { task ->
|
||||
if (task.isSuccessful) {
|
||||
updateData("onConfigUpdate", mFirebaseRemoteConfig!!.all)
|
||||
}
|
||||
}
|
||||
} catch (ignore: Exception) {
|
||||
}
|
||||
}
|
||||
|
||||
override fun onError(error: FirebaseRemoteConfigException) {
|
||||
Log.d(KeyBoardApp.TAG, "Config update error with code: " + error.code)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
private fun fetchConfig() {
|
||||
//这里可能会抛出异常 FirebaseRemoteConfigFetchThrottledException
|
||||
try {
|
||||
mFirebaseRemoteConfig!!.fetchAndActivate().addOnCompleteListener { task ->
|
||||
if (task.isSuccessful) {
|
||||
isInit = true
|
||||
lastFetchTime = System.currentTimeMillis()
|
||||
updateData("fetchAndActivate", mFirebaseRemoteConfig!!.all)
|
||||
//24小时后,重新再去获取
|
||||
handler.removeMessages(MSG_REFRESH_CONFIG)
|
||||
handler.sendEmptyMessageDelayed(
|
||||
MSG_REFRESH_CONFIG, (1000 * 60 * 60 * 24).toLong()
|
||||
)
|
||||
} else {
|
||||
//15分钟后重新再去获取
|
||||
handler.removeMessages(MSG_REFRESH_CONFIG)
|
||||
handler.sendEmptyMessageDelayed(MSG_REFRESH_CONFIG, (1000 * 60 * 15).toLong())
|
||||
}
|
||||
}
|
||||
} catch (ignore: Exception) {
|
||||
}
|
||||
}
|
||||
|
||||
private fun updateData(from: String, all: Map<String, FirebaseRemoteConfigValue>) {
|
||||
for ((key, value) in all) {
|
||||
try {
|
||||
Log.d(
|
||||
KeyBoardApp.TAG, "from = " + from + "Key = " + key + " Value = " + value.asString()
|
||||
)
|
||||
if (TextUtils.equals(RemoteConfigKey.KEY_AD_SHOW_INTERVAL, key)) {
|
||||
Sp.getInstance(KeyBoardApp.appInstance)
|
||||
.putLong(RemoteConfigKey.KEY_AD_SHOW_INTERVAL, value.asLong()).commit()
|
||||
}
|
||||
|
||||
} catch (ignore: Exception) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class MHandler(remoteConfig: RemoteConfigNew) : Handler(Looper.getMainLooper()) {
|
||||
private val weakReference: WeakReference<RemoteConfigNew>
|
||||
|
||||
init {
|
||||
weakReference = WeakReference(remoteConfig)
|
||||
}
|
||||
|
||||
override fun handleMessage(msg: Message) {
|
||||
super.handleMessage(msg)
|
||||
val remoteConfig = weakReference.get()
|
||||
if (remoteConfig?.ctx != null) {
|
||||
if (msg.what == MSG_REFRESH_CONFIG) {
|
||||
remoteConfig.fetchConfig()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
package com.input.board.appskey.keyboard.firebase;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
|
||||
|
||||
public class Sp {
|
||||
private static String spName = "AD_SHOW";
|
||||
private static Sp instance;
|
||||
//默认的广告展示间隔时间20s
|
||||
private static final long DEFAULT_SHOW_INTERVAL = 1000 * 30L;
|
||||
private SharedPreferences.Editor editor;
|
||||
|
||||
private SharedPreferences preferences;
|
||||
|
||||
private Sp(Application context) {
|
||||
preferences = context.getSharedPreferences(spName, Context.MODE_PRIVATE);
|
||||
editor = preferences.edit();
|
||||
}
|
||||
|
||||
|
||||
public static Sp getInstance(Application context) {
|
||||
if (instance == null) {
|
||||
instance = new Sp(context);
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
public Sp putLong(String key, long value) {
|
||||
editor.putLong(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean commit() {
|
||||
return editor.commit();
|
||||
}
|
||||
|
||||
public long getLongValue(String key) {
|
||||
return preferences.getLong(key, DEFAULT_SHOW_INTERVAL);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
package com.input.board.appskey.keyboard.topon
|
||||
|
||||
interface AdListener {
|
||||
|
||||
fun loadFail(placeId: String)
|
||||
fun showSuccess()
|
||||
|
||||
fun showFail()
|
||||
|
||||
fun showClose()
|
||||
}
|
||||
@ -0,0 +1,242 @@
|
||||
package com.input.board.appskey.keyboard.topon
|
||||
|
||||
import android.app.Activity
|
||||
import android.os.CountDownTimer
|
||||
import android.util.Log
|
||||
import com.anythink.core.api.ATAdInfo
|
||||
import com.anythink.core.api.AdError
|
||||
import com.anythink.interstitial.api.ATInterstitial
|
||||
import com.anythink.interstitial.api.ATInterstitialListener
|
||||
import com.input.board.appskey.keyboard.KeyBoardApp
|
||||
import com.input.board.appskey.keyboard.firebase.RemoteConfigKey
|
||||
import com.input.board.appskey.keyboard.firebase.Sp
|
||||
|
||||
|
||||
object AdManager {
|
||||
|
||||
|
||||
|
||||
//上次广告展示时刻
|
||||
var LAST_AD_SHOW = 0L
|
||||
|
||||
const val type_no_cache = 0
|
||||
const val type_has_cache = 1
|
||||
const val type_show_success = 2
|
||||
const val type_show_close = 3
|
||||
const val type_show_fail = 4
|
||||
|
||||
/**
|
||||
n66b1d3d019590
|
||||
n66b1d3cfebd3c
|
||||
n66b1d3cfc4f3b
|
||||
*/
|
||||
|
||||
const val place1Id = "n66b1d3d019590"
|
||||
const val place2Id = "n66b1d3cfebd3c"
|
||||
const val place3Id = "n66b1d3cfc4f3b"
|
||||
|
||||
|
||||
var place1LoadFail = false
|
||||
var place2LoadFail = false
|
||||
var place3LoadFail = false
|
||||
|
||||
val list = mutableListOf<ATInterstitial>()
|
||||
|
||||
|
||||
@JvmStatic
|
||||
fun loadAllAd() {
|
||||
if (list.size <= 0) {
|
||||
val mInterstitialAd1 = ATInterstitial(KeyBoardApp.appInstance, place1Id)
|
||||
val mInterstitialAd2 = ATInterstitial(KeyBoardApp.appInstance, place2Id)
|
||||
val mInterstitialAd3 = ATInterstitial(KeyBoardApp.appInstance, place3Id)
|
||||
list.add(mInterstitialAd1)
|
||||
list.add(mInterstitialAd2)
|
||||
list.add(mInterstitialAd3)
|
||||
}
|
||||
for (ad in list) {
|
||||
if (!ad.isAdReady) {
|
||||
setCallBack(ad, object : AdListener {
|
||||
override fun loadFail(placeId: String) {
|
||||
if (placeId == place1Id) {
|
||||
place1LoadFail = true
|
||||
}
|
||||
if (placeId == place2Id) {
|
||||
place2LoadFail = true
|
||||
}
|
||||
if (placeId == place3Id) {
|
||||
place3LoadFail = true
|
||||
}
|
||||
}
|
||||
|
||||
override fun showSuccess() {
|
||||
|
||||
}
|
||||
|
||||
override fun showFail() {
|
||||
|
||||
}
|
||||
|
||||
override fun showClose() {
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
ad.load()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun getReadyAd(): ATInterstitial? {
|
||||
|
||||
if (LAST_AD_SHOW > 0L) {
|
||||
val adInterval =
|
||||
Sp.getInstance(KeyBoardApp.appInstance).getLongValue(RemoteConfigKey.KEY_AD_SHOW_INTERVAL)
|
||||
val curInterval = System.currentTimeMillis() - LAST_AD_SHOW
|
||||
|
||||
Log.d(
|
||||
KeyBoardApp.TAG,
|
||||
"-广告判断------------LAST_AD_SHOW=$LAST_AD_SHOW curInterval=${curInterval} adInterval=${adInterval}"
|
||||
)
|
||||
if (curInterval < adInterval) {
|
||||
Log.d(
|
||||
KeyBoardApp.TAG,
|
||||
"-没有广告--------"
|
||||
)
|
||||
return null
|
||||
}
|
||||
}
|
||||
list.shuffle()
|
||||
for (ad in list) {
|
||||
if (ad.isAdReady) {
|
||||
Log.d(KeyBoardApp.TAG, "-有广告------------")
|
||||
return ad
|
||||
}
|
||||
}
|
||||
Log.d(KeyBoardApp.TAG, "-没有广告------------")
|
||||
return null
|
||||
}
|
||||
|
||||
|
||||
@JvmStatic
|
||||
fun showWelcomeAd(
|
||||
activity: Activity,
|
||||
totalTim: Long,
|
||||
countAction: (millisUntilFinished: Long) -> Unit,
|
||||
goMain: () -> Unit
|
||||
): CountDownTimer {
|
||||
var alreadyShow = false
|
||||
var timer = object : CountDownTimer(totalTim, 100) {
|
||||
override fun onTick(millisUntilFinished: Long) {
|
||||
countAction.invoke(millisUntilFinished)
|
||||
if (!alreadyShow) {
|
||||
showAD(activity) {
|
||||
if (it == type_has_cache) {
|
||||
alreadyShow = true
|
||||
}
|
||||
if (it == type_show_close || it == type_show_fail) {
|
||||
goMain.invoke()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun onFinish() {
|
||||
if (!alreadyShow) {
|
||||
showAD(activity) {
|
||||
if (it == type_show_close || it == type_show_fail || it == type_no_cache) {
|
||||
goMain.invoke()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return timer
|
||||
}
|
||||
|
||||
private fun setCallBack(ad: ATInterstitial, listener: AdListener) {
|
||||
ad.setAdListener(object : ATInterstitialListener {
|
||||
override fun onInterstitialAdLoaded() {
|
||||
Log.d(KeyBoardApp.TAG, "LoadLoaded ${ad.mPlacementId}")
|
||||
}
|
||||
|
||||
override fun onInterstitialAdLoadFail(p0: AdError?) {
|
||||
Log.d(KeyBoardApp.TAG, "LoadFail:${p0?.code} ${p0?.desc}")
|
||||
}
|
||||
|
||||
override fun onInterstitialAdClicked(p0: ATAdInfo?) {
|
||||
|
||||
}
|
||||
|
||||
override fun onInterstitialAdShow(p0: ATAdInfo?) {
|
||||
Log.d(KeyBoardApp.TAG, "AdShow ${p0?.showId} ")
|
||||
listener.showSuccess()
|
||||
ad.load()
|
||||
}
|
||||
|
||||
override fun onInterstitialAdClose(p0: ATAdInfo?) {
|
||||
listener.showClose()
|
||||
}
|
||||
|
||||
override fun onInterstitialAdVideoStart(p0: ATAdInfo?) {
|
||||
|
||||
}
|
||||
|
||||
override fun onInterstitialAdVideoEnd(p0: ATAdInfo?) {
|
||||
|
||||
}
|
||||
|
||||
override fun onInterstitialAdVideoError(p0: AdError?) {
|
||||
listener.showFail()
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@JvmStatic
|
||||
private fun showAD(activity: Activity, action: (type: Int) -> Unit) {
|
||||
val readyAd = getReadyAd()
|
||||
if (readyAd != null) {
|
||||
Log.d(KeyBoardApp.TAG, "readyAd ${readyAd.mPlacementId} ")
|
||||
action.invoke(type_has_cache)
|
||||
setCallBack(readyAd, object : AdListener {
|
||||
override fun loadFail(placeId: String) {
|
||||
|
||||
}
|
||||
|
||||
override fun showSuccess() {
|
||||
action.invoke(type_show_success)
|
||||
LAST_AD_SHOW = System.currentTimeMillis()
|
||||
}
|
||||
|
||||
override fun showFail() {
|
||||
action.invoke(type_show_fail)
|
||||
}
|
||||
|
||||
override fun showClose() {
|
||||
action.invoke(type_show_close)
|
||||
}
|
||||
|
||||
})
|
||||
readyAd.show(activity)
|
||||
} else {
|
||||
action.invoke(type_no_cache)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun showTopOn(activity: Activity, listener: onActionListener) {
|
||||
showAD(activity) { type ->
|
||||
if (type == type_no_cache || type == type_show_close || type == type_show_fail) {
|
||||
listener.onAction()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,6 @@
|
||||
package com.input.board.appskey.keyboard.topon;
|
||||
|
||||
public interface onActionListener {
|
||||
|
||||
void onAction();
|
||||
}
|
||||
@ -14,6 +14,8 @@ import androidx.recyclerview.widget.GridLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.input.board.appskey.keyboard.KeyBoardApp
|
||||
import com.input.board.appskey.keyboard.R
|
||||
import com.input.board.appskey.keyboard.dialog.StepDialog
|
||||
import com.input.board.appskey.keyboard.fileTools.InputMethodCom
|
||||
import com.input.board.appskey.keyboard.recyAdapter.ForYouAdapter
|
||||
|
||||
class HomeActivity : AppCompatActivity() {
|
||||
@ -30,11 +32,14 @@ class HomeActivity : AppCompatActivity() {
|
||||
|
||||
private lateinit var cardView:CardView
|
||||
|
||||
private var dialog: StepDialog?= null
|
||||
|
||||
@SuppressLint("MissingInflatedId")
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_home)
|
||||
findViewId()
|
||||
initDialog()
|
||||
setForYouData()
|
||||
onClick()
|
||||
}
|
||||
@ -51,6 +56,18 @@ class HomeActivity : AppCompatActivity() {
|
||||
}
|
||||
|
||||
|
||||
private fun initDialog(){
|
||||
val checkEnable = InputMethodCom.checkEnable(KeyBoardApp.appInstance)
|
||||
val checkSetDefault = InputMethodCom.checkSetDefault(KeyBoardApp.appInstance)
|
||||
if(!checkEnable||!checkSetDefault){
|
||||
dialog = dialog?: StepDialog {
|
||||
|
||||
}
|
||||
dialog?.show(supportFragmentManager,"")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun onClick() {
|
||||
cardView.setOnClickListener {
|
||||
startActivity(Intent(this, ViewAllActivity::class.java))
|
||||
|
||||
@ -30,7 +30,7 @@ class KeyBoardSettingActivity : AppCompatActivity() {
|
||||
private lateinit var stepTwo:TextView
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_key_board_setting)
|
||||
setContentView(R.layout.dialog_step)
|
||||
findViewId()
|
||||
onViewStep()
|
||||
getReceiver()
|
||||
|
||||
@ -7,15 +7,14 @@ import android.widget.ImageView
|
||||
import android.widget.ProgressBar
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import com.input.board.appskey.keyboard.R
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
class NovaActivity : AppCompatActivity() {
|
||||
|
||||
private lateinit var progressBar: ProgressBar
|
||||
private lateinit var novaIm: ImageView
|
||||
private var countTime = 11000L
|
||||
private var countTime = 1000L
|
||||
private lateinit var timer: CountDownTimer
|
||||
private var needShow = true
|
||||
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
@ -28,14 +27,18 @@ class NovaActivity : AppCompatActivity() {
|
||||
|
||||
timer = object : CountDownTimer(countTime, 100) {
|
||||
override fun onTick(millisUntilFinished: Long) {
|
||||
|
||||
val percentage: Float = 100 - millisUntilFinished.toFloat() / countTime * 100
|
||||
val round = percentage.roundToInt()
|
||||
progressBar.progress = round
|
||||
}
|
||||
|
||||
override fun onFinish() {
|
||||
progressBar.progress = 100
|
||||
toHome()
|
||||
}
|
||||
|
||||
}
|
||||
timer.start()
|
||||
|
||||
}
|
||||
|
||||
|
||||
7
app/src/main/res/drawable/apply_btn_bg_enable.xml
Normal file
7
app/src/main/res/drawable/apply_btn_bg_enable.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>
|
||||
13
app/src/main/res/drawable/bg_step_dialog.xml
Normal file
13
app/src/main/res/drawable/bg_step_dialog.xml
Normal file
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<gradient android:angle="270"
|
||||
android:startColor="@color/dialog_start"
|
||||
android:centerColor="@color/dialog_center"
|
||||
android:endColor="@color/dialog_end"/>
|
||||
<corners
|
||||
android:topLeftRadius="40dp"
|
||||
android:topRightRadius="40dp" />
|
||||
|
||||
|
||||
</shape>
|
||||
9
app/src/main/res/drawable/close.xml
Normal file
9
app/src/main/res/drawable/close.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="#ffffff"/>
|
||||
</vector>
|
||||
14
app/src/main/res/drawable/dialog_close.xml
Normal file
14
app/src/main/res/drawable/dialog_close.xml
Normal file
@ -0,0 +1,14 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M12,0.45L12,0.45A11.55,11.55 0,0 1,23.55 12L23.55,12A11.55,11.55 0,0 1,12 23.55L12,23.55A11.55,11.55 0,0 1,0.45 12L0.45,12A11.55,11.55 0,0 1,12 0.45z"
|
||||
android:strokeWidth="0.9"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#ffffff"/>
|
||||
<path
|
||||
android:pathData="M12.72,12L18.21,6.51C18.412,6.307 18.412,5.992 18.21,5.79C18.007,5.587 17.692,5.587 17.49,5.79L12,11.28L6.51,5.79C6.307,5.587 5.992,5.587 5.79,5.79C5.587,5.992 5.587,6.307 5.79,6.51L11.28,12L5.79,17.49C5.587,17.692 5.587,18.007 5.79,18.21C5.88,18.3 6.015,18.367 6.15,18.367C6.285,18.367 6.42,18.322 6.51,18.21L12,12.72L17.49,18.21C17.58,18.3 17.715,18.367 17.85,18.367C17.985,18.367 18.12,18.322 18.21,18.21C18.412,18.007 18.412,17.692 18.21,17.49L12.72,12Z"
|
||||
android:fillColor="#ffffff"/>
|
||||
</vector>
|
||||
26
app/src/main/res/drawable/progressbar.xml
Normal file
26
app/src/main/res/drawable/progressbar.xml
Normal file
@ -0,0 +1,26 @@
|
||||
<?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>
|
||||
<corners android:radius="10dp" />
|
||||
<solid android:color="@color/pb_bg" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:id="@android:id/progress">
|
||||
<clip>
|
||||
<shape>
|
||||
<corners android:radius="10dp" />
|
||||
<gradient
|
||||
android:angle="0"
|
||||
android:endColor="@color/pb_end_color"
|
||||
android:startColor="@color/pb_start_color" />
|
||||
</shape>
|
||||
</clip>
|
||||
</item>
|
||||
</layer-list>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -2,5 +2,5 @@
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:drawable="@drawable/apply_btn_bg" android:state_selected="false" />
|
||||
<item android:drawable="@color/apply_step_false" />
|
||||
<item android:drawable="@drawable/apply_btn_bg_enable" />
|
||||
</selector>
|
||||
@ -1,105 +0,0 @@
|
||||
<?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="@mipmap/main_prink_bg"
|
||||
tools:context=".viewUi.KeyBoardSettingActivity">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/back"
|
||||
android:layout_width="44dp"
|
||||
android:layout_height="44dp"
|
||||
android:paddingStart="5dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:src="@mipmap/direction_back"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:text="@string/Keyboard_set"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/back"
|
||||
app:layout_constraintLeft_toRightOf="@id/back"
|
||||
app:layout_constraintTop_toTopOf="@id/back" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_open"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="50dp"
|
||||
android:layout_marginTop="220dp"
|
||||
android:layout_marginEnd="50dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/open_str"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintTop_toBottomOf="@id/name" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linear_step_one"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="52dp"
|
||||
android:layout_marginStart="40dp"
|
||||
android:layout_marginTop="32dp"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:background="@drawable/settings_step_selector"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintTop_toBottomOf="@id/text_open">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ok_one"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:visibility="gone"
|
||||
android:src="@mipmap/status_ok" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="14sp"
|
||||
android:id="@+id/text_step_one"
|
||||
android:textColor="@color/white"
|
||||
android:text="@string/step_1" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linear_step_two"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="52dp"
|
||||
android:layout_marginStart="40dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:background="@drawable/settings_step_selector"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintTop_toBottomOf="@id/linear_step_one">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ok_two"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:visibility="gone"
|
||||
android:src="@mipmap/status_ok" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="14sp"
|
||||
android:id="@+id/text_step_two"
|
||||
android:textColor="@color/white"
|
||||
android:text="@string/step_2" />
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@ -7,14 +7,20 @@
|
||||
android:background="@mipmap/nova_bg"
|
||||
tools:context=".viewUi.NovaActivity">
|
||||
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/nova_progress"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/nova_picture"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="10dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="60dp"
|
||||
android:indeterminateTint="@color/main_start" />
|
||||
android:layout_marginStart="33dp"
|
||||
android:layout_marginEnd="33dp"
|
||||
android:layout_marginBottom="40dp"
|
||||
android:progress="10"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:progressDrawable="@drawable/progressbar" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/nova_picture"
|
||||
|
||||
33
app/src/main/res/layout/dialog_recommend.xml
Normal file
33
app/src/main/res/layout/dialog_recommend.xml
Normal file
@ -0,0 +1,33 @@
|
||||
<?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"
|
||||
tools:context=".viewUi.KeyBoardSettingActivity">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/im_close"
|
||||
android:layout_width="55dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:padding="12dp"
|
||||
android:src="@drawable/dialog_close"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
98
app/src/main/res/layout/dialog_step.xml
Normal file
98
app/src/main/res/layout/dialog_step.xml
Normal file
@ -0,0 +1,98 @@
|
||||
<?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"
|
||||
tools:context=".viewUi.KeyBoardSettingActivity">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:background="@drawable/bg_step_dialog"
|
||||
android:paddingBottom="20dp"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<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/close"
|
||||
app:layout_constraintRight_toRightOf="parent" />
|
||||
|
||||
<TextView
|
||||
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"
|
||||
android:text="@string/open_str"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp"
|
||||
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/settings_step_selector"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintTop_toBottomOf="@id/text_open">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ok_one"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:src="@mipmap/status_ok"
|
||||
android:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_step_one"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/step_1"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp" />
|
||||
</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/settings_step_selector"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintTop_toBottomOf="@id/linear_step_one">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ok_two"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:src="@mipmap/status_ok"
|
||||
android:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_step_two"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/step_2"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</FrameLayout>
|
||||
BIN
app/src/main/res/mipmap-xxxhdpi/recommen_bottom_bg.png
Normal file
BIN
app/src/main/res/mipmap-xxxhdpi/recommen_bottom_bg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 155 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/recommen_top_bg.png
Normal file
BIN
app/src/main/res/mipmap-xxxhdpi/recommen_top_bg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 108 KiB |
@ -17,4 +17,11 @@
|
||||
<color name="step_true">#666666</color>
|
||||
<color name="status_bar">#FA93A8</color>
|
||||
<color name="status_bar1">#F1A5D2</color>
|
||||
<color name="pb_bg">#898989</color>
|
||||
<color name="pb_start_color">#86FB5BAF</color>
|
||||
<color name="pb_end_color">#FB5BAF</color>
|
||||
|
||||
<color name="dialog_start">#fa7691</color>
|
||||
<color name="dialog_center">#f19dc7</color>
|
||||
<color name="dialog_end">#f6e5f5</color>
|
||||
</resources>
|
||||
@ -8,7 +8,7 @@
|
||||
<string name="app_privacy_path">https://marielathama.bitbucket.io/privacy.html</string>
|
||||
<string name="recommended">Recommended Themes</string>
|
||||
<string name="Keyboard_set">Keyboard settings</string>
|
||||
<string name="open_str">Activate PassionCool Keyboard to enable MORE functions!</string>
|
||||
<string name="open_str">Activate Nova keyboard to enable MORE functions!</string>
|
||||
<string name="step_1">Step 1:Select</string>
|
||||
<string name="step_2">Step 2:Enable</string>
|
||||
<string name="theme_application_successful">Theme application successful</string>
|
||||
|
||||
@ -32,4 +32,9 @@
|
||||
<attr format="reference" name="drawable_done"/>
|
||||
<attr format="reference" name="drawable_none"/>
|
||||
</declare-styleable>
|
||||
|
||||
<style name="Theme.NovaActivity" parent="Theme.MyKeyBoard">
|
||||
<item name="android:windowBackground">@mipmap/nova_bg</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
6
keystore.properties
Normal file
6
keystore.properties
Normal file
@ -0,0 +1,6 @@
|
||||
app_name=Nova keyboard
|
||||
package_name=com.nova.keyboard
|
||||
keystoreFile=app/novakeynewboard.jks
|
||||
key_alias=novakeynewboardkey0
|
||||
key_store_password=novakeynewboard
|
||||
key_password=novakeynewboard
|
||||
@ -13,7 +13,17 @@ dependencyResolutionManagement {
|
||||
mavenCentral()
|
||||
maven("https://jitpack.io")
|
||||
|
||||
//Anythink(Core)
|
||||
maven("https://jfrog.anythinktech.com/artifactory/overseas_sdk")
|
||||
//Ironsource
|
||||
maven("https://android-sdk.is.com/")
|
||||
//Mintegral
|
||||
maven("https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea")
|
||||
//Pangle
|
||||
maven ( "https://artifact.bytedance.com/repository/pangle")
|
||||
|
||||
//TopOn集成测试工具
|
||||
maven ( "https://jfrog.anythinktech.com/artifactory/debugger")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user