diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 2f66b2f..3e32832 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -15,11 +15,11 @@ android { defaultConfig { //com.sunny.tools.app.soft - applicationId = "com.sunny.tools.app.soft.test" + applicationId = "com.sunny.tools.app.soft" minSdk = 23 targetSdk = 34 - versionCode = 5 - versionName = "1.0.4" + versionCode = 6 + versionName = "1.0.5" setProperty("archivesBaseName", "Custom Keyboard_V" + versionName + "(${versionCode})_$timestamp") testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } @@ -58,7 +58,7 @@ dependencies { implementation("com.geyifeng.immersionbar:immersionbar:3.2.2") implementation("com.geyifeng.immersionbar:immersionbar-ktx:3.2.2") - implementation ("com.google.code.gson:gson:2.10.1") + implementation ("com.github.bumptech.glide:glide:4.16.0") annotationProcessor ("com.github.bumptech.glide:compiler:4.16.0") @@ -112,12 +112,12 @@ dependencies { implementation("androidx.recyclerview:recyclerview:1.1.0") //Tramini - implementation("com.anythink.sdk:tramini-plugin-tpn:6.3.68") +// implementation("com.anythink.sdk:tramini-plugin-tpn:6.3.68") //-----------------------------TopOn 聚合 // Debugger UI Tools - implementation ("com.anythink.sdk:debugger-ui:1.0.7") +// implementation ("com.anythink.sdk:debugger-ui:1.0.7") diff --git a/app/google-services.json b/app/google-services.json index 7f3f9d3..6b54dbe 100644 --- a/app/google-services.json +++ b/app/google-services.json @@ -9,7 +9,7 @@ "client_info": { "mobilesdk_app_id": "1:894189375933:android:0409bb4d16339f3a5082d4", "android_client_info": { - "package_name": "com.sunny.tools.app.soft.test" + "package_name": "com.sunny.tools.app.soft" } }, "oauth_client": [], diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index e1adecf..b48e144 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -23,6 +23,24 @@ -keep class com.sunny.app.soft.timberkeyboardnew.data.entity.BackgroundEntity { *; } +# 保持 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 * { *; } + + #---------------------------------TopOn 聚合 # Vungle -dontwarn com.vungle.ads.** diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 15cefa2..4b00ca0 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -15,7 +15,9 @@ android:supportsRtl="true" android:theme="@style/Theme.TimberKeyboardNew" tools:targetApi="31"> - + @@ -25,14 +27,14 @@ - - - + android:windowSoftInputMode="stateVisible" /> + + - \ No newline at end of file diff --git a/app/src/main/assets/CustomKeyboard_PrivacyPolicy.html b/app/src/main/assets/CustomKeyboard_PrivacyPolicy.html new file mode 100644 index 0000000..297569d --- /dev/null +++ b/app/src/main/assets/CustomKeyboard_PrivacyPolicy.html @@ -0,0 +1,71 @@ + + + + + Privacy Policy + + + +

Privacy Policy

+ +

We provides this Privacy Policy to help you understand how we collect, use and disclose information, including what you may provide to us or that we obtain from our products and services. We treat your privacy very seriously. Your privacy is important to us.

+ +

Information Collection and Use

+ +

For a better experience, while using our Service, We may require you to provide us with certain personally identifiable information add whatever else you collect here, e.g. users name, address, location, pictures. The information that We request will be retained on your device and is not collected by us in any way retained by us and used as described in this privacy policy.

+ +

The app does use third-party services that may collect information used to identify you.

+ +

Please refer to the privacy policy of the third-party service provider used by the application:

+
    +
  • Google Play Services
  • +
  • Google Analytics for Firebase
  • +
  • Firebase Crashlytics
  • +
  • Unity
  • +
  • AppLovin
  • +
  • Vungle
  • +
+ +

Log Data

+ +

We want to inform you that whenever you use our Service, in a case of an error in the app We collect data and information (through third-party products) on your phone called Log Data. This Log Data may include information such as your device Internet Protocol (“IP”) address, device name, operating system version, the configuration of the app when utilizing our Service, the time and date of your use of the Service, and other statistics.

+ +

Cookies

+ +

Cookies are files with a small amount of data that are commonly used as anonymous unique identifiers. These are sent to your browser from the websites that you visit and are stored on your device's internal memory. +This Service does not use these “cookies” explicitly. However, the app may use third-party code and libraries that use “cookies” to collect information and improve their services. You have the option to either accept or refuse these cookies and know when a cookie is being sent to your device. If you choose to refuse our cookies, you may not be able to use some portions of this Service.

+ +

Service Providers

+ +

We may employ third-party companies and individuals due to the following reasons:

+ +

To facilitate our Service; +To provide the Service on our behalf;To perform Service-related services; orTo assist us in analyzing how our Service is used. +We want to inform users of this Service that these third parties have access to their Personal Information. The reason is to perform the tasks assigned to them on our behalf. However, they are obligated not to disclose or use the information for any other purpose.

+ +

Security

+ +

We value your trust in providing us your Personal Information, thus we are striving to use commercially acceptable means of protecting it. But remember that no method of transmission over the internet, or method of electronic storage is 100% secure and reliable, and We cannot guarantee its absolute security.

+ +

Links to Other Sites

+ +

This Service may contain links to other sites. If you click on a third-party link, you will be directed to that site. Note that these external sites are not operated by us. Therefore, We strongly advise you to review the Privacy Policy of these websites. We have no control over and assume no responsibility for the content, privacy policies, or practices of any third-party sites or services.

+ +

Children’s Privacy

+ +

These Services do not address anyone under the age of 13. We do not knowingly collect personally identifiable information from children under 13 years of age. In the case We discover that a child under 13 has provided us with personal information, We immediately delete this from our servers. If you are a parent or guardian and you are aware that your child has provided us with personal information, please contact us so that We will be able to do the necessary actions.

+ +

Changes to This Privacy Policy

+ +

We may update our Privacy Policy from time to time. Thus, you are advised to review this page periodically for any changes. We will notify you of any changes by posting the new Privacy Policy on this page.

+ +

PRIVACY QUESTIONS

+ +

We may update Privacy Policy from time to time. When we change the policy in a material way, a notice will be posted on our website along with the updated Privacy Policy.

+ +

If you have any questions or concerns about our Privacy Policy or data processing, please contact us: arbabulfb@gmail.com + + + +.

+ \ No newline at end of file diff --git a/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/App.kt b/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/App.kt index 4226ac7..0657cc1 100644 --- a/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/App.kt +++ b/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/App.kt @@ -5,10 +5,8 @@ import android.content.Context import android.util.Log import com.anythink.core.api.ATSDK import com.anythink.core.api.NetTrafficeCallback -import com.anythink.debug.api.ATDebuggerUITest import com.sunny.app.soft.timberkeyboardnew.data.DataManager import com.sunny.app.soft.timberkeyboardnew.room.MyDatabase - import com.sunny.app.soft.timberkeyboardnew.topon.AdManager import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers @@ -72,6 +70,6 @@ class App : Application() { AdManager.loadAllAd() //测试工具 - //ATDebuggerUITest.showDebuggerUI(this,debugKey) +// ATDebuggerUITest.showDebuggerUI(this,debugKey) } } \ No newline at end of file diff --git a/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/data/DataManager.kt b/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/data/DataManager.kt index 8f2a93d..996b9fd 100644 --- a/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/data/DataManager.kt +++ b/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/data/DataManager.kt @@ -1,7 +1,7 @@ package com.sunny.app.soft.timberkeyboardnew.data import android.util.Log -import com.google.gson.Gson + import com.sunny.app.soft.timberkeyboardnew.App import com.sunny.app.soft.timberkeyboardnew.data.entity.BackgroundEntity import com.sunny.app.soft.timberkeyboardnew.data.entity.CategoryEntity diff --git a/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/tools/DialogRecommend.kt b/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/tools/DialogRecommend.kt index 25b5942..72ab0e3 100644 --- a/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/tools/DialogRecommend.kt +++ b/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/tools/DialogRecommend.kt @@ -1,14 +1,9 @@ package com.sunny.app.soft.timberkeyboardnew.tools import android.app.Activity -import android.content.BroadcastReceiver -import android.content.Context import android.content.DialogInterface import android.content.Intent -import android.content.IntentFilter import android.os.Bundle -import android.provider.Settings -import android.util.Log import android.view.Gravity import android.view.LayoutInflater import android.view.View @@ -16,19 +11,15 @@ import android.view.ViewGroup import android.view.Window import android.view.WindowManager import android.view.inputmethod.InputMethodManager -import androidx.appcompat.app.AppCompatActivity -import androidx.core.view.isVisible import androidx.fragment.app.DialogFragment -import com.anythink.debug.util.a import com.bumptech.glide.Glide import com.bumptech.glide.load.engine.DiskCacheStrategy import com.sunny.app.soft.timberkeyboardnew.App import com.sunny.app.soft.timberkeyboardnew.R import com.sunny.app.soft.timberkeyboardnew.data.entity.BackgroundEntity import com.sunny.app.soft.timberkeyboardnew.databinding.DialogRecommendBinding - -import com.sunny.app.soft.timberkeyboardnew.databinding.DialogStepBinding import com.sunny.app.soft.timberkeyboardnew.room.MyDatabase +import com.sunny.app.soft.timberkeyboardnew.topon.AdManager import com.sunny.app.soft.timberkeyboardnew.ui.activity.DownloadActivity import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers @@ -73,9 +64,7 @@ class DialogRecommend(var activity: Activity, var onClose: () -> Unit) : DialogF dismiss() } - dialogVb.imageview.setOnClickListener { - } CoroutineScope(Dispatchers.IO).launch { data = MyDatabase.myDatabase.BackgroundEntityDao().queryRandomItem() @@ -89,10 +78,13 @@ class DialogRecommend(var activity: Activity, var onClose: () -> Unit) : DialogF .into(dialogVb.imageview) dialogVb.tvApply.setOnClickListener { - val intent = Intent(activity, DownloadActivity::class.java) - intent.putExtra(AppConstant.KEY_EXTRA, backEntity) - startActivity(intent) - dismiss() + AdManager.showTopOn(activity){ + val intent = Intent(activity, DownloadActivity::class.java) + intent.putExtra(AppConstant.KEY_EXTRA, backEntity) + startActivity(intent) + dismiss() + } + } } diff --git a/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/topon/AdManager.kt b/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/topon/AdManager.kt index 6c3d5de..6a9178b 100644 --- a/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/topon/AdManager.kt +++ b/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/topon/AdManager.kt @@ -74,7 +74,7 @@ object AdManager { } }) -// ad.load() + ad.load() } } diff --git a/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/ui/activity/BaseActivity.kt b/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/ui/activity/BaseActivity.kt index 2db5b8a..0f60f8f 100644 --- a/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/ui/activity/BaseActivity.kt +++ b/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/ui/activity/BaseActivity.kt @@ -11,19 +11,17 @@ abstract class BaseActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(setRootView()) - initView() + initStatusBar() if (loadAd()) { AdManager.loadAllAd() } + onUI() } + abstract fun onUI() abstract fun loadAd(): Boolean abstract fun setRootView(): View - open fun initView() { - initStatusBar() - } - private fun initStatusBar() { ImmersionBar.with(this).statusBarDarkFont(true).init() } diff --git a/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/ui/activity/DisplayActivity.kt b/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/ui/activity/DisplayActivity.kt index 238c771..6b0cd8e 100644 --- a/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/ui/activity/DisplayActivity.kt +++ b/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/ui/activity/DisplayActivity.kt @@ -7,6 +7,10 @@ import com.sunny.app.soft.timberkeyboardnew.databinding.ActivityDisplayBinding class DisplayActivity : BaseActivity() { private lateinit var binding: ActivityDisplayBinding + override fun onUI() { + init() + } + override fun loadAd(): Boolean = true private var inputMethod: InputMethodManager? = null @@ -15,7 +19,7 @@ class DisplayActivity : BaseActivity() { override fun setRootView(): View { binding = ActivityDisplayBinding.inflate(layoutInflater) - init() + return binding.root } diff --git a/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/ui/activity/DownloadActivity.kt b/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/ui/activity/DownloadActivity.kt index b59d2ca..671d68d 100644 --- a/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/ui/activity/DownloadActivity.kt +++ b/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/ui/activity/DownloadActivity.kt @@ -56,14 +56,7 @@ class DownloadActivity : private var appliedSkinStyle: Int = -1 private var defaultStyle = 0 - override fun loadAd(): Boolean = true - override fun setRootView(): View { - binding = ActivityDownloadBinding.inflate(layoutInflater) - return binding.root - } - - override fun initView() { - super.initView() + override fun onUI() { binding.downloadProgress.visibility = View.VISIBLE backgroundEntity = intent.getSerializableExtra(AppConstant.KEY_EXTRA) as BackgroundEntity sp = getSharedPreferences(AppConstant.SHARE_NAME, Context.MODE_PRIVATE) @@ -80,6 +73,14 @@ class DownloadActivity : initTitle() } + override fun loadAd(): Boolean = true + override fun setRootView(): View { + binding = ActivityDownloadBinding.inflate(layoutInflater) + return binding.root + } + + + private fun initTitle() { binding.bgName.text = "Keyboard background" } @@ -124,14 +125,7 @@ class DownloadActivity : } } - private fun onShowAd() { - AdManager.showTopOn(this) { - startSetSkin() - } - - - } private fun initButton() { binding.downloadBack.setOnClickListener(this) @@ -181,11 +175,22 @@ class DownloadActivity : when (v) { binding.downloadBack -> finish() binding.btnDownload -> { - applySkin() + AdManager.showTopOn(this) { + applySkin() + } + } binding.imLike -> { - binding.imLike.isSelected = !binding.imLike.isSelected + AdManager.showTopOn(this@DownloadActivity){ + binding.imLike.isSelected = !binding.imLike.isSelected + if(binding.imLike.isSelected){ + Toast.makeText(this@DownloadActivity,getString(R.string.add_success),Toast.LENGTH_SHORT).show() + }else{ + Toast.makeText(this@DownloadActivity,getString(R.string.cancel_success),Toast.LENGTH_SHORT).show() + } + } + } } } @@ -205,14 +210,14 @@ class DownloadActivity : if (stepDialog == null) { stepDialog = DialogStep.newInstance(this@DownloadActivity) { if (KeyboardManager.isChoose() && KeyboardManager.isEnable()) { - onShowAd() + startSetSkin() } } } stepDialog?.show(supportFragmentManager, "") return } - onShowAd() + startSetSkin() } private fun startSetSkin() { diff --git a/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/ui/activity/ListActivity.kt b/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/ui/activity/ListActivity.kt index 1d759ef..cedb70f 100644 --- a/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/ui/activity/ListActivity.kt +++ b/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/ui/activity/ListActivity.kt @@ -22,13 +22,7 @@ class ListActivity : BaseActivity(), View.OnClickListener { return binding.root } - override fun initView() { - super.initView() - categoryEntity = intent.getSerializableExtra(AppConstant.KEY_EXTRA) as CategoryEntity - initButton() - initTitle() - initRecyclerView() - } + private fun initRecyclerView() { val selectAdapter = @@ -51,6 +45,14 @@ class ListActivity : BaseActivity(), View.OnClickListener { adapter = selectAdapter } } + + override fun onUI() { + categoryEntity = intent.getSerializableExtra(AppConstant.KEY_EXTRA) as CategoryEntity + initButton() + initTitle() + initRecyclerView() + } + override fun loadAd(): Boolean = true private fun initTitle() { binding.selectTitle.text = categoryEntity.name diff --git a/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/ui/activity/LoadingActivity.kt b/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/ui/activity/LoadingActivity.kt index 7d896e2..8bb14d5 100644 --- a/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/ui/activity/LoadingActivity.kt +++ b/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/ui/activity/LoadingActivity.kt @@ -13,22 +13,8 @@ class LoadingActivity : BaseActivity() { private var countDownTimer: CountDownTimer?= null - private val time = 1000L - - override fun loadAd(): Boolean = false - override fun setRootView(): View { - binding = ActivityLoadingBinding.inflate(layoutInflater) - return binding.root - } - - override fun onDestroy() { - super.onDestroy() - countDownTimer?.cancel() - } - - override fun initView() { - super.initView() - + private val time = 12000L + override fun onUI() { countDownTimer = AdManager.showWelcomeAd(this@LoadingActivity, time, { millisUntilFinished -> val percentage: Float = 100 - millisUntilFinished.toFloat() / time * 100 val round = percentage.roundToInt() @@ -43,6 +29,19 @@ class LoadingActivity : BaseActivity() { countDownTimer?.start() } + override fun loadAd(): Boolean = false + override fun setRootView(): View { + binding = ActivityLoadingBinding.inflate(layoutInflater) + return binding.root + } + + override fun onDestroy() { + super.onDestroy() + countDownTimer?.cancel() + } + + + private fun intoMainActivity() { val intent = Intent(this, MainActivity::class.java) diff --git a/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/ui/activity/MainActivity.kt b/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/ui/activity/MainActivity.kt index c78a5ff..aff553c 100644 --- a/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/ui/activity/MainActivity.kt +++ b/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/ui/activity/MainActivity.kt @@ -29,6 +29,12 @@ class MainActivity : private var stepDialog: DialogStep? = null private var recommendDialog: DialogRecommend? = null + override fun onUI() { + initViewPager() + initTabButton() + checkStep() + } + override fun loadAd(): Boolean = true override fun setRootView(): View { @@ -36,12 +42,7 @@ class MainActivity : return binding.root } - override fun initView() { - super.initView() - initViewPager() - initTabButton() - checkStep() - } + private fun initTabButton() { binding.mainTabHome.setOnClickListener(this) diff --git a/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/ui/activity/PrivacyActivity.kt b/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/ui/activity/PrivacyActivity.kt new file mode 100644 index 0000000..a5bed1f --- /dev/null +++ b/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/ui/activity/PrivacyActivity.kt @@ -0,0 +1,22 @@ +package com.sunny.app.soft.timberkeyboardnew.ui.activity + +import android.view.View +import com.sunny.app.soft.timberkeyboardnew.databinding.ActivityPrivacyBinding + +class PrivacyActivity : BaseActivity() { + override fun onUI() { + binding.webView.loadUrl("file:///android_asset/CustomKeyboard_PrivacyPolicy.html") + binding.back.setOnClickListener { + finish() + } + } + + override fun loadAd(): Boolean = true + private lateinit var binding: ActivityPrivacyBinding + override fun setRootView(): View { + binding = ActivityPrivacyBinding.inflate(layoutInflater) + return binding.root + } + + +} \ No newline at end of file diff --git a/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/ui/activity/SetKeyboardActivity.kt b/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/ui/activity/SetKeyboardActivity.kt deleted file mode 100644 index bf9de63..0000000 --- a/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/ui/activity/SetKeyboardActivity.kt +++ /dev/null @@ -1,106 +0,0 @@ -package com.sunny.app.soft.timberkeyboardnew.ui.activity - -import android.app.AlertDialog -import android.content.BroadcastReceiver -import android.content.Context -import android.content.Intent -import android.content.IntentFilter -import android.provider.Settings -import android.view.View -import android.view.inputmethod.InputMethodManager -import com.sunny.app.soft.timberkeyboardnew.R -import com.sunny.app.soft.timberkeyboardnew.databinding.ActivityEnableBinding -import com.sunny.app.soft.timberkeyboardnew.tools.KeyboardManager - -class SetKeyboardActivity : - BaseActivity(), - View.OnClickListener { - - private lateinit var binding: ActivityEnableBinding - private lateinit var inputManager: InputMethodManager - private lateinit var broadcastReceiver: BroadcastReceiver - - override fun setRootView(): View { - binding = ActivityEnableBinding.inflate(layoutInflater) - return binding.root - } - - override fun initView() { - super.initView() - inputManager = getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager - broadcastReceiver = StepperReceiver() - updateUi() - register() - initButton() - } - override fun loadAd(): Boolean = true - private fun initButton() { - binding.setKeyboardBack.setOnClickListener(this) - binding.setKeyboardSteps1.setOnClickListener(this) - binding.setKeyboardSteps2.setOnClickListener(this) - } - - private fun register() { - registerReceiver(broadcastReceiver, IntentFilter(Intent.ACTION_INPUT_METHOD_CHANGED)) - } - - inner class StepperReceiver : BroadcastReceiver() { - override fun onReceive(context: Context?, intent: Intent?) { - updateUi() - } - - } - - private fun updateUi() { -// if (KeyboardManager.isEnable()) { -// binding.setKeyboardSteps1.setBackgroundResource(R.drawable.shape_r24_grey) -// } else { -// binding.setKeyboardSteps1.setBackgroundResource(R.drawable.shape_r24_orange) -// } -// if (KeyboardManager.isChoose()) { -// binding.setKeyboardSteps2.setBackgroundResource(R.drawable.shape_r24_grey) -// } else { -// binding.setKeyboardSteps2.setBackgroundResource(R.drawable.shape_r24_orange) -// } -// if (KeyboardManager.isChoose() && KeyboardManager.isEnable()) { -// showInfoDialog() -// } - - } - - private fun showInfoDialog() { - AlertDialog.Builder(this).apply { - title = "Settings" - setMessage("You have successfully activated the soft keyboard!") - setPositiveButton("OK") { _, _ -> finish() } - }.create().show() - } - - override fun onResume() { - super.onResume() - updateUi() - } - - override fun onDestroy() { - super.onDestroy() - unregisterReceiver(broadcastReceiver) - } - - override fun onClick(v: View?) { - when (v) { - binding.setKeyboardBack -> finish() - binding.setKeyboardSteps1 -> chooseKeyboard() - binding.setKeyboardSteps2 -> settingKeyboard() - } - } - - private fun settingKeyboard() { - inputManager.showInputMethodPicker() - } - - private fun chooseKeyboard() { - val intent = Intent(Settings.ACTION_INPUT_METHOD_SETTINGS) - startActivity(intent) - } - -} \ No newline at end of file diff --git a/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/ui/fragment/CollectFragment.kt b/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/ui/fragment/CollectFragment.kt index 456e2bd..e4d4498 100644 --- a/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/ui/fragment/CollectFragment.kt +++ b/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/ui/fragment/CollectFragment.kt @@ -37,9 +37,13 @@ class CollectFragment : private fun initViewPager() { val homeViewAdapter = SelectAdapter(requireContext(), object : OnBgItemClickListener { override fun onItemClick(position: Int, backgroundEntity: BackgroundEntity) { - val intent = Intent(requireActivity(), DownloadActivity::class.java) - intent.putExtra(AppConstant.KEY_EXTRA, backgroundEntity) - startActivity(intent) + AdManager.showTopOn(requireActivity()) { + val intent = Intent(requireActivity(), DownloadActivity::class.java) + intent.putExtra(AppConstant.KEY_EXTRA, backgroundEntity) + startActivity(intent) + + } + } }) @@ -71,14 +75,7 @@ class CollectFragment : } - fun onShowAd() { - AdManager.showTopOn(requireActivity()) { - enterList() - } - - - } } \ No newline at end of file diff --git a/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/ui/fragment/HomeFragment.kt b/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/ui/fragment/HomeFragment.kt index 31955e7..d6c6bf5 100644 --- a/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/ui/fragment/HomeFragment.kt +++ b/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/ui/fragment/HomeFragment.kt @@ -37,7 +37,9 @@ class HomeFragment : val homeViewAdapter = HomeViewAdapter(requireContext(), object : OnItemClickListener { override fun onItemClick(position: Int, categoryEntity: CategoryEntity) { data = categoryEntity - onShowAd() + AdManager.showTopOn(requireActivity()) { + enterList() + } } @@ -63,15 +65,7 @@ class HomeFragment : } - fun onShowAd() { - AdManager.showTopOn(requireActivity()) { - enterList() - - } - - - } private fun initTitle() { binding.homeTitle.text = App.appContext.getString(R.string.app_name) diff --git a/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/ui/fragment/SettingFragment.kt b/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/ui/fragment/SettingFragment.kt index 9664616..57cbdc6 100644 --- a/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/ui/fragment/SettingFragment.kt +++ b/app/src/main/java/com/sunny/app/soft/timberkeyboardnew/ui/fragment/SettingFragment.kt @@ -1,12 +1,14 @@ package com.sunny.app.soft.timberkeyboardnew.ui.fragment import android.content.Intent +import android.content.pm.PackageInfo +import android.content.pm.PackageManager import android.net.Uri import android.view.View import com.sunny.app.soft.timberkeyboardnew.App import com.sunny.app.soft.timberkeyboardnew.R import com.sunny.app.soft.timberkeyboardnew.databinding.FragmentSettingBinding -import com.sunny.app.soft.timberkeyboardnew.ui.activity.SetKeyboardActivity +import com.sunny.app.soft.timberkeyboardnew.ui.activity.PrivacyActivity class SettingFragment : BaseFragment(), View.OnClickListener { @@ -20,7 +22,15 @@ class SettingFragment : BaseFragment(), View.OnClickListener { super.initView() binding.settingLayoutRating.setOnClickListener(this) binding.settingLayoutShare.setOnClickListener(this) - binding.settingLayoutSetKeyboard.setOnClickListener(this) + binding.layoutPrivacy.setOnClickListener(this) + val appVersionName = getAppVersionName() + + appVersionName?.let { + binding.tvVersion.text = String.format(getString(R.string.version), it.versionName) + }.run { + binding.tvVersion.text = String.format(getString(R.string.version), "1.0.5") + } + } override fun onClick(v: View?) { @@ -40,9 +50,19 @@ class SettingFragment : BaseFragment(), View.OnClickListener { startActivity(intent) } - binding.settingLayoutSetKeyboard -> { - + binding.layoutPrivacy -> { + startActivity(Intent(requireActivity(), PrivacyActivity::class.java)) } + + + } + } + + private fun getAppVersionName(): PackageInfo? { + return try { + requireActivity().packageManager.getPackageInfo(requireActivity().packageName, 0) + } catch (exception: PackageManager.NameNotFoundException) { + null } } } \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_privacy.xml b/app/src/main/res/drawable/ic_privacy.xml new file mode 100644 index 0000000..3bcbc9b --- /dev/null +++ b/app/src/main/res/drawable/ic_privacy.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_version.xml b/app/src/main/res/drawable/ic_version.xml new file mode 100644 index 0000000..b2be8aa --- /dev/null +++ b/app/src/main/res/drawable/ic_version.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/svg_rating.xml b/app/src/main/res/drawable/svg_rating.xml index f2fc337..6597b69 100644 --- a/app/src/main/res/drawable/svg_rating.xml +++ b/app/src/main/res/drawable/svg_rating.xml @@ -5,5 +5,5 @@ android:viewportHeight="1024"> + android:fillColor="@color/set_ic_color"/> diff --git a/app/src/main/res/drawable/svg_share.xml b/app/src/main/res/drawable/svg_share.xml index 1cee7ab..9536121 100644 --- a/app/src/main/res/drawable/svg_share.xml +++ b/app/src/main/res/drawable/svg_share.xml @@ -5,5 +5,5 @@ android:viewportHeight="1024"> + android:fillColor="@color/set_ic_color"/> diff --git a/app/src/main/res/layout/activity_enable.xml b/app/src/main/res/layout/activity_enable.xml deleted file mode 100644 index 686cab5..0000000 --- a/app/src/main/res/layout/activity_enable.xml +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/activity_privacy.xml b/app/src/main/res/layout/activity_privacy.xml new file mode 100644 index 0000000..d713875 --- /dev/null +++ b/app/src/main/res/layout/activity_privacy.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_setting.xml b/app/src/main/res/layout/fragment_setting.xml index 0ceee7b..3360e9a 100644 --- a/app/src/main/res/layout/fragment_setting.xml +++ b/app/src/main/res/layout/fragment_setting.xml @@ -81,6 +81,37 @@ android:textSize="14sp" /> + + + + + + + + + + + android:src="@drawable/ic_version" /> diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index ba2b4e6..d22c1b6 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -17,4 +17,5 @@ #F7F9FC #FFF3E3 #F7931A + #2c2c2c \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 9684b6b..b35ec9f 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -23,6 +23,10 @@ Please select the following button background Display Enter text to see the effect + V %s + Privacy Policy + Added to favorites successfully + Successfully canceled the collection skin_%s_delete_emoji.png skin_%s_caps_enabled.png diff --git a/settings.gradle.kts b/settings.gradle.kts index 382d4d4..e7676d4 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -23,7 +23,7 @@ dependencyResolutionManagement { maven ("https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea") //TopOn集成测试工具 - maven ( "https://jfrog.anythinktech.com/artifactory/debugger") +// maven ( "https://jfrog.anythinktech.com/artifactory/debugger") } }