添加收藏,修改UI。
This commit is contained in:
parent
431b421791
commit
2a95df9e9a
6
.idea/compiler.xml
generated
Normal file
6
.idea/compiler.xml
generated
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<bytecodeTargetLevel target="17" />
|
||||
</component>
|
||||
</project>
|
||||
10
.idea/deploymentTargetSelector.xml
generated
Normal file
10
.idea/deploymentTargetSelector.xml
generated
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="deploymentTargetSelector">
|
||||
<selectionStates>
|
||||
<SelectionState runConfigName="app">
|
||||
<option name="selectionMode" value="DROPDOWN" />
|
||||
</SelectionState>
|
||||
</selectionStates>
|
||||
</component>
|
||||
</project>
|
||||
19
.idea/gradle.xml
generated
Normal file
19
.idea/gradle.xml
generated
Normal file
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GradleMigrationSettings" migrationVersion="1" />
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="gradleJvm" value="jbr-17" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
<option value="$PROJECT_DIR$/app" />
|
||||
</set>
|
||||
</option>
|
||||
<option name="resolveExternalAnnotations" value="false" />
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
5
.idea/misc.xml
generated
Normal file
5
.idea/misc.xml
generated
Normal file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK" />
|
||||
</project>
|
||||
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
@ -5,6 +5,7 @@ plugins {
|
||||
id 'org.jetbrains.kotlin.android'
|
||||
id 'com.google.gms.google-services'
|
||||
id 'com.google.firebase.crashlytics'
|
||||
id 'kotlin-kapt'
|
||||
}
|
||||
|
||||
String timestamp = new SimpleDateFormat("MM_dd_HH_mm").format(new Date())
|
||||
@ -17,8 +18,8 @@ android {
|
||||
applicationId "com.keyboards.journey"
|
||||
minSdk 23
|
||||
targetSdk 34
|
||||
versionCode 6
|
||||
versionName "1.0.6"
|
||||
versionCode 8
|
||||
versionName "1.0.8"
|
||||
setProperty("archivesBaseName", "Keyboard Journey_V" + versionName + "(${versionCode})_$timestamp")
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
@ -30,11 +31,11 @@ android {
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
sourceCompatibility JavaVersion.VERSION_17
|
||||
targetCompatibility JavaVersion.VERSION_17
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = '1.8'
|
||||
jvmTarget = '17'
|
||||
}
|
||||
buildFeatures {
|
||||
viewBinding true
|
||||
@ -71,8 +72,11 @@ dependencies {
|
||||
//7z
|
||||
implementation 'com.github.omicronapps:7-Zip-JBinding-4Android:Release-16.02-2.02'
|
||||
|
||||
|
||||
|
||||
implementation("com.github.lihangleo2:ShadowLayout:3.4.0")
|
||||
implementation("androidx.room:room-ktx:2.6.1")
|
||||
implementation("androidx.room:room-runtime:2.6.1")
|
||||
//noinspection KaptUsageInsteadOfKsp
|
||||
kapt("androidx.room:room-compiler:2.6.1")
|
||||
implementation(platform("com.google.firebase:firebase-bom:32.2.2"))
|
||||
implementation("com.google.firebase:firebase-analytics-ktx")
|
||||
implementation("com.google.firebase:firebase-crashlytics-ktx")
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
|
||||
|
||||
<activity
|
||||
android:name=".JourneyMActivity"
|
||||
android:name=".MainActivity"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
|
||||
@ -2,17 +2,12 @@ package com.keyboard.journey
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Intent
|
||||
import android.graphics.Color
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import android.provider.Settings
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.inputmethod.InputMethodManager
|
||||
import android.widget.Toast
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.view.GravityCompat
|
||||
import androidx.drawerlayout.widget.DrawerLayout
|
||||
import android.view.ViewGroup
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.gyf.immersionbar.ktx.immersionBar
|
||||
import com.keyboard.journey.adapter.BannerImgAdapter
|
||||
@ -23,9 +18,6 @@ import com.keyboard.journey.databinding.JourneyActivityMainBinding
|
||||
import com.keyboard.journey.util.NetworkCallback
|
||||
import com.keyboard.journey.util.NetworkUtil
|
||||
import com.keyboard.journey.util.getRandomInt
|
||||
import com.keyboard.journey.util.isMyInputMethodDefault
|
||||
import com.keyboard.journey.util.isMyInputMethodEnabled
|
||||
import com.keyboard.journey.util.shareAppInfo
|
||||
import com.youth.banner.listener.OnPageChangeListener
|
||||
import kotlinx.coroutines.DelicateCoroutinesApi
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
@ -39,21 +31,25 @@ import org.libpag.PAGFile
|
||||
import kotlin.coroutines.resume
|
||||
|
||||
|
||||
class JourneyMActivity : AppCompatActivity() {
|
||||
class HomeFragment : Fragment() {
|
||||
private lateinit var binding: JourneyActivityMainBinding
|
||||
private var imgList: MutableList<Int> = mutableListOf()
|
||||
private var dataList: MutableList<MainDataBean> = mutableListOf()
|
||||
private var mainAdapter: MainDataAdapter? = null
|
||||
private var backPressedOnce = false
|
||||
private var currentBannerType = 0
|
||||
|
||||
private lateinit var bannerStr0: String
|
||||
private lateinit var bannerStr1: String
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?
|
||||
): View {
|
||||
binding = JourneyActivityMainBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
return binding.root
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
bannerStr0 = getString(R.string.recommend)
|
||||
bannerStr1 = getString(R.string.cool)
|
||||
initBar()
|
||||
@ -61,6 +57,24 @@ class JourneyMActivity : AppCompatActivity() {
|
||||
initData()
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
initImmersionBar()
|
||||
}
|
||||
|
||||
override fun onHiddenChanged(hidden: Boolean) {
|
||||
super.onHiddenChanged(hidden)
|
||||
if (!hidden) {
|
||||
initImmersionBar()
|
||||
}
|
||||
}
|
||||
|
||||
private fun initImmersionBar() {
|
||||
immersionBar {
|
||||
statusBarDarkFont(true)
|
||||
statusBarView(binding.view)
|
||||
}
|
||||
}
|
||||
|
||||
private suspend fun getFetchCategory(
|
||||
key: String,
|
||||
@ -69,8 +83,7 @@ class JourneyMActivity : AppCompatActivity() {
|
||||
): CategoryDataBean? {
|
||||
return try {
|
||||
suspendCancellableCoroutine<CategoryDataBean> { continuation ->
|
||||
NetworkUtil().fetchCategory(
|
||||
key,
|
||||
NetworkUtil().fetchCategory(key,
|
||||
offset,
|
||||
pageSize,
|
||||
object : NetworkCallback<List<CategoryDataBean>> {
|
||||
@ -90,6 +103,7 @@ class JourneyMActivity : AppCompatActivity() {
|
||||
@OptIn(DelicateCoroutinesApi::class)
|
||||
private fun initData() {
|
||||
loadingPlay()
|
||||
binding.noDataLayout.visibility = View.GONE
|
||||
NetworkUtil().fetchData(object : NetworkCallback<List<MainDataBean>> {
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
override fun onSuccess(data: List<MainDataBean>) {
|
||||
@ -111,6 +125,11 @@ class JourneyMActivity : AppCompatActivity() {
|
||||
Log.d(JourneyApp.TAG, "--------------dataList=${dataList.size}")
|
||||
mainAdapter?.notifyDataSetChanged()
|
||||
loadingClose()
|
||||
if (dataList.size > 0) {
|
||||
binding.noDataLayout.visibility = View.GONE
|
||||
} else {
|
||||
binding.noDataLayout.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -118,6 +137,8 @@ class JourneyMActivity : AppCompatActivity() {
|
||||
|
||||
override fun onFailure(errorMessage: String) {
|
||||
LogUtil.logMsgD(errorMessage)
|
||||
binding.noDataLayout.visibility = View.VISIBLE
|
||||
loadingClose()
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -129,27 +150,9 @@ class JourneyMActivity : AppCompatActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
private fun setupDrawerListener() {
|
||||
binding.drawer.addDrawerListener(object : DrawerLayout.DrawerListener {
|
||||
override fun onDrawerSlide(drawerView: View, slideOffset: Float) {}
|
||||
|
||||
override fun onDrawerOpened(drawerView: View) {
|
||||
drawerView.isClickable = true
|
||||
}
|
||||
|
||||
override fun onDrawerClosed(drawerView: View) {}
|
||||
|
||||
override fun onDrawerStateChanged(newState: Int) {}
|
||||
})
|
||||
}
|
||||
|
||||
private fun initClick() {
|
||||
binding.menuBtn.setOnClickListener {
|
||||
if (binding.drawer.isDrawerOpen(GravityCompat.START)) {
|
||||
binding.drawer.closeDrawer(GravityCompat.START)
|
||||
} else {
|
||||
binding.drawer.openDrawer(GravityCompat.START)
|
||||
}
|
||||
binding.tryAgain.setOnClickListener {
|
||||
initData()
|
||||
}
|
||||
binding.bannerBtn.setOnClickListener {
|
||||
for (data in dataList) {
|
||||
@ -159,80 +162,31 @@ class JourneyMActivity : AppCompatActivity() {
|
||||
val cool = dataList.filter { it.title.contains(bannerStr1) }
|
||||
if (currentBannerType == 0) {
|
||||
Log.d(JourneyApp.TAG, "----------0 recommend.size=${recommend.size}")
|
||||
val intent = Intent(this, JourneyCategoryDetailsActivity::class.java)
|
||||
intent.putExtra(
|
||||
JourneyCategoryDetailsActivity.CATEGORY_DETAILS_BEAN_KEY,
|
||||
recommend[0]
|
||||
)
|
||||
startActivity(intent)
|
||||
if (recommend.isNotEmpty()) {
|
||||
val intent =
|
||||
Intent(requireActivity(), JourneyCategoryDetailsActivity::class.java)
|
||||
intent.putExtra(
|
||||
JourneyCategoryDetailsActivity.CATEGORY_DETAILS_BEAN_KEY, recommend[0]
|
||||
)
|
||||
startActivity(intent)
|
||||
}
|
||||
} else if (currentBannerType == 1) {
|
||||
Log.d(JourneyApp.TAG, "----------1 cool.size=${cool.size}")
|
||||
val intent = Intent(this, JourneyCategoryDetailsActivity::class.java)
|
||||
intent.putExtra(JourneyCategoryDetailsActivity.CATEGORY_DETAILS_BEAN_KEY, cool[0])
|
||||
startActivity(intent)
|
||||
if (cool.isNotEmpty()) {
|
||||
val intent =
|
||||
Intent(requireActivity(), JourneyCategoryDetailsActivity::class.java)
|
||||
intent.putExtra(
|
||||
JourneyCategoryDetailsActivity.CATEGORY_DETAILS_BEAN_KEY, cool[0]
|
||||
)
|
||||
startActivity(intent)
|
||||
}
|
||||
}
|
||||
}
|
||||
binding.applyKeyboardBtn.setOnClickListener {
|
||||
val enabled = isMyInputMethodEnabled(this)
|
||||
val default = isMyInputMethodDefault(this)
|
||||
if (enabled && default) {
|
||||
binding.dialogStepLayout.visibility = View.GONE
|
||||
|
||||
Toast.makeText(
|
||||
this,
|
||||
"The keyboard has been set up successfully!",
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
} else {
|
||||
binding.dialogStepLayout.visibility = View.VISIBLE
|
||||
updateSetMyInputMethod()
|
||||
}
|
||||
}
|
||||
binding.step1Btn.setOnClickListener {
|
||||
val intent = Intent(Settings.ACTION_INPUT_METHOD_SETTINGS)
|
||||
startActivity(intent)
|
||||
}
|
||||
|
||||
binding.step2Btn.setOnClickListener {
|
||||
val imeManager = getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager
|
||||
imeManager.showInputMethodPicker()
|
||||
}
|
||||
|
||||
binding.dialogStepLayout.setOnClickListener {
|
||||
binding.dialogStepLayout.visibility = View.GONE
|
||||
}
|
||||
|
||||
binding.privacyBtn.setOnClickListener {
|
||||
val privacyPolicyUrl = "https://sites.google.com/view/privacy-policy-html-app"
|
||||
val intent = Intent(Intent.ACTION_VIEW)
|
||||
intent.data = Uri.parse(privacyPolicyUrl)
|
||||
startActivity(intent)
|
||||
}
|
||||
binding.shareBtn.setOnClickListener {
|
||||
shareAppInfo(this)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onBackPressed() {
|
||||
if (binding.drawer.isDrawerOpen(GravityCompat.START)) {
|
||||
binding.drawer.closeDrawer(GravityCompat.START);
|
||||
} else {
|
||||
if (backPressedOnce) {
|
||||
super.onBackPressed()
|
||||
return
|
||||
}
|
||||
|
||||
backPressedOnce = true
|
||||
Toast.makeText(this, "Press again to exit!", Toast.LENGTH_SHORT).show()
|
||||
// 两秒钟内再次按返回键取消退出操作
|
||||
val handler = android.os.Handler()
|
||||
handler.postDelayed({ backPressedOnce = false }, 2000)
|
||||
}
|
||||
}
|
||||
|
||||
private fun initView() {
|
||||
binding.rv.layoutManager = LinearLayoutManager(this)
|
||||
mainAdapter = MainDataAdapter(this, dataList)
|
||||
binding.rv.layoutManager = LinearLayoutManager(requireActivity())
|
||||
mainAdapter = MainDataAdapter(requireActivity(), dataList)
|
||||
binding.rv.adapter = mainAdapter
|
||||
|
||||
imgList.add(R.mipmap.recommend_top_banner_img)
|
||||
@ -241,9 +195,7 @@ class JourneyMActivity : AppCompatActivity() {
|
||||
binding.banner.setAdapter(adapter).addBannerLifecycleObserver(this) //添加生命周期观察者
|
||||
binding.banner.addOnPageChangeListener(object : OnPageChangeListener {
|
||||
override fun onPageScrolled(
|
||||
position: Int,
|
||||
positionOffset: Float,
|
||||
positionOffsetPixels: Int
|
||||
position: Int, positionOffset: Float, positionOffsetPixels: Int
|
||||
) {
|
||||
|
||||
}
|
||||
@ -252,22 +204,22 @@ class JourneyMActivity : AppCompatActivity() {
|
||||
when (position) {
|
||||
0 -> {
|
||||
currentBannerType = 0
|
||||
binding.indicatorLayout.setBackgroundColor(getColor(R.color.banner_indicator_one_bg))
|
||||
binding.indicatorLayout.setBackgroundColor(requireActivity().getColor(R.color.banner_indicator_one_bg))
|
||||
binding.indicatorImg.setImageResource(R.mipmap.top_banner_one_img)
|
||||
binding.indicatorTxt.text = bannerStr0
|
||||
binding.indicatorGoBg.setCardBackgroundColor(getColor(R.color.banner_indicator_one_go_bg_color))
|
||||
binding.indicatorLineOneBg.setBackgroundColor(getColor(R.color.banner_indicator_one_go_bg_color))
|
||||
binding.indicatorLineTowBg.setBackgroundColor(getColor(R.color.black_10))
|
||||
binding.indicatorGoBg.background = requireActivity().getDrawable(R.drawable.draw_go_bg)
|
||||
binding.indicatorLineOneBg.setBackgroundColor(requireActivity().getColor(R.color.banner_indicator_one_go_bg_color))
|
||||
binding.indicatorLineTowBg.setBackgroundColor(requireActivity().getColor(R.color.black_10))
|
||||
}
|
||||
|
||||
1 -> {
|
||||
currentBannerType = 1
|
||||
binding.indicatorLayout.setBackgroundColor(getColor(R.color.banner_indicator_tow_bg))
|
||||
binding.indicatorLayout.setBackgroundColor(requireActivity().getColor(R.color.banner_indicator_tow_bg))
|
||||
binding.indicatorImg.setImageResource(R.mipmap.top_banner_tow_img)
|
||||
binding.indicatorTxt.text = bannerStr1
|
||||
binding.indicatorGoBg.setCardBackgroundColor(getColor(R.color.banner_indicator_tow_go_bg_color))
|
||||
binding.indicatorLineOneBg.setBackgroundColor(getColor(R.color.black_10))
|
||||
binding.indicatorLineTowBg.setBackgroundColor(getColor(R.color.banner_indicator_tow_go_bg_color))
|
||||
binding.indicatorGoBg.background = requireActivity().getDrawable(R.drawable.draw_go_2_bg)
|
||||
binding.indicatorLineOneBg.setBackgroundColor(requireActivity().getColor(R.color.black_10))
|
||||
binding.indicatorLineTowBg.setBackgroundColor(requireActivity().getColor(R.color.banner_indicator_tow_go_bg_color))
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -276,14 +228,13 @@ class JourneyMActivity : AppCompatActivity() {
|
||||
|
||||
}
|
||||
})
|
||||
setupDrawerListener()
|
||||
initClick()
|
||||
}
|
||||
|
||||
private fun loadingPlay() {
|
||||
binding.loadingLayout.visibility = View.VISIBLE
|
||||
binding.indicatorGoBg.visibility = View.GONE
|
||||
val pagFile = PAGFile.Load(assets, "loading.pag")
|
||||
val pagFile = PAGFile.Load(requireActivity().assets, "loading.pag")
|
||||
binding.pagView.composition = pagFile
|
||||
binding.pagView.setRepeatCount(0)
|
||||
binding.pagView.play()
|
||||
@ -296,28 +247,4 @@ class JourneyMActivity : AppCompatActivity() {
|
||||
binding.pagView.stop()
|
||||
}
|
||||
}
|
||||
|
||||
private fun updateSetMyInputMethod() {
|
||||
val enabled = isMyInputMethodEnabled(this)
|
||||
val default = isMyInputMethodDefault(this)
|
||||
if (enabled) {
|
||||
binding.step1Btn.background = getDrawable(R.drawable.drw_gray_select_bg)
|
||||
binding.step1Btn.text = "Step 1:Enabled"
|
||||
binding.step1Btn.setTextColor(Color.parseColor("#999999"))
|
||||
} else {
|
||||
binding.step1Btn.background = getDrawable(R.mipmap.activate_btn_bg)
|
||||
binding.step1Btn.text = "Step 1:Select"
|
||||
binding.step1Btn.setTextColor(Color.parseColor("#000000"))
|
||||
}
|
||||
if (default) {
|
||||
binding.step2Btn.background = getDrawable(R.drawable.drw_gray_select_bg)
|
||||
binding.step2Btn.text = "Step 2:Enabled"
|
||||
binding.step1Btn.setTextColor(Color.parseColor("#999999"))
|
||||
} else {
|
||||
binding.step2Btn.background = getDrawable(R.mipmap.activate_btn_bg)
|
||||
binding.step2Btn.text = "Step 2:Select"
|
||||
binding.step1Btn.setTextColor(Color.parseColor("#000000"))
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -4,6 +4,7 @@ import android.app.Application
|
||||
import android.util.Log
|
||||
import com.anythink.core.api.ATSDK
|
||||
import com.anythink.core.api.NetTrafficeCallback
|
||||
import com.keyboard.journey.db.DatabaseManager
|
||||
//import com.anythink.debug.api.ATDebuggerUITest
|
||||
import com.keyboard.journey.topon.AdManager
|
||||
|
||||
@ -11,6 +12,9 @@ class JourneyApp : Application() {
|
||||
companion object {
|
||||
lateinit var app: JourneyApp
|
||||
const val TAG = "----------"
|
||||
|
||||
lateinit var databaseManager: DatabaseManager
|
||||
private set
|
||||
}
|
||||
private val APPId="h6697811556e91"
|
||||
private val APPKey="44f890794fdaec43c4df6cc60e345eb2"
|
||||
@ -18,6 +22,7 @@ class JourneyApp : Application() {
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
app = this
|
||||
databaseManager = DatabaseManager.getInstance(this)
|
||||
initSDK()
|
||||
}
|
||||
|
||||
|
||||
@ -36,7 +36,7 @@ class JourneyCategoryDetailsActivity : AppCompatActivity() {
|
||||
super.onCreate(savedInstanceState)
|
||||
binding = JourneyCategoryDetailsActivityBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
AdManager.showAD(this@JourneyCategoryDetailsActivity){
|
||||
AdManager.showAD(this@JourneyCategoryDetailsActivity) {
|
||||
|
||||
}
|
||||
bean = intent.getSerializableExtra(CATEGORY_DETAILS_BEAN_KEY) as MainDataBean?
|
||||
@ -48,6 +48,7 @@ class JourneyCategoryDetailsActivity : AppCompatActivity() {
|
||||
initData()
|
||||
|
||||
|
||||
AdManager.loadAllAd()
|
||||
}
|
||||
|
||||
private fun initBar() {
|
||||
@ -65,7 +66,7 @@ class JourneyCategoryDetailsActivity : AppCompatActivity() {
|
||||
binding.refreshLayout.setOnLoadMoreListener {
|
||||
refreshData()
|
||||
}
|
||||
adapter = CategoryDetailsDataAdapter(this, contentBeans)
|
||||
adapter = CategoryDetailsDataAdapter(this, contentBeans, "category")
|
||||
binding.rv.layoutManager = GridLayoutManager(this, 2)
|
||||
binding.rv.adapter = adapter
|
||||
}
|
||||
@ -123,7 +124,7 @@ class JourneyCategoryDetailsActivity : AppCompatActivity() {
|
||||
})
|
||||
}
|
||||
|
||||
private fun loadingPlay(){
|
||||
private fun loadingPlay() {
|
||||
binding.loadingLayout.visibility = View.VISIBLE
|
||||
val pagFile = PAGFile.Load(assets, "loading.pag")
|
||||
binding.pagView.composition = pagFile
|
||||
@ -131,9 +132,9 @@ class JourneyCategoryDetailsActivity : AppCompatActivity() {
|
||||
binding.pagView.play()
|
||||
}
|
||||
|
||||
private fun loadingClose(){
|
||||
private fun loadingClose() {
|
||||
binding.loadingLayout.visibility = View.GONE
|
||||
if(binding.pagView.isPlaying){
|
||||
if (binding.pagView.isPlaying) {
|
||||
binding.pagView.stop()
|
||||
}
|
||||
}
|
||||
|
||||
@ -16,11 +16,14 @@ import com.keyboard.journey.util.OnDownloadListener
|
||||
import com.keyboard.journey.util.ResourceDownloadUtil
|
||||
import com.keyboard.journey.util.fileIsDownload
|
||||
import com.keyboard.journey.util.loadRoundedImage
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.coroutines.launch
|
||||
import org.libpag.PAGFile
|
||||
|
||||
class JourneyDetailsActivity : AppCompatActivity(), OnDownloadListener {
|
||||
companion object {
|
||||
const val KEY_JOURNEY_DETAILS_BEAN = "key_journey_details_bean"
|
||||
const val KEY_JOURNEY_FROM = "key_journey_from"
|
||||
}
|
||||
|
||||
private lateinit var binding: JourneyDetailsActivityBinding
|
||||
@ -33,6 +36,10 @@ class JourneyDetailsActivity : AppCompatActivity(), OnDownloadListener {
|
||||
binding = JourneyDetailsActivityBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
bean = intent.getSerializableExtra(KEY_JOURNEY_DETAILS_BEAN) as ItemDataBean?
|
||||
val from = intent.getStringExtra(KEY_JOURNEY_FROM)
|
||||
if (from == "like") {
|
||||
AdManager.showAD(this) {}
|
||||
}
|
||||
initBar()
|
||||
initView()
|
||||
initData()
|
||||
@ -47,6 +54,32 @@ class JourneyDetailsActivity : AppCompatActivity(), OnDownloadListener {
|
||||
}
|
||||
|
||||
private fun initView() {
|
||||
GlobalScope.launch {
|
||||
val current = JourneyApp.databaseManager.getItemDataBeanFileByPath(bean?.key!!)
|
||||
if (current?.isLiked == true) {
|
||||
binding.likeImg.setImageResource(R.drawable.like_select_icon)
|
||||
} else {
|
||||
binding.likeImg.setImageResource(R.drawable.like_unselect_icon)
|
||||
}
|
||||
bean?.isLiked = current?.isLiked == true
|
||||
}
|
||||
|
||||
binding.likeBtn.setOnClickListener {
|
||||
bean?.isLiked = bean?.isLiked != true
|
||||
if (bean?.isLiked == true) {
|
||||
binding.likeImg.setImageResource(R.drawable.like_select_icon)
|
||||
} else {
|
||||
binding.likeImg.setImageResource(R.drawable.like_unselect_icon)
|
||||
}
|
||||
GlobalScope.launch {
|
||||
if (bean?.isLiked == true) {
|
||||
JourneyApp.databaseManager.insertItemDataBeanFile(bean!!)
|
||||
} else {
|
||||
JourneyApp.databaseManager.deleteItemDataBeanFile(bean!!)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
binding.titleTv.text = bean?.title
|
||||
binding.backBtn.setOnClickListener { finish() }
|
||||
|
||||
@ -58,8 +91,8 @@ class JourneyDetailsActivity : AppCompatActivity(), OnDownloadListener {
|
||||
val imageUrl = it.themeContent.androidRawZipUrl
|
||||
val b = fileIsDownload(this, imageUrl)
|
||||
if (b) {
|
||||
AdManager.showAD(this@JourneyDetailsActivity){type->
|
||||
if (type == AdManager.type_show_close || type == AdManager.type_show_fail || type == AdManager.type_no_cache){
|
||||
AdManager.showAD(this@JourneyDetailsActivity) { type ->
|
||||
if (type == AdManager.type_show_close || type == AdManager.type_show_fail || type == AdManager.type_no_cache) {
|
||||
AppSharedPreferences(this).setCurrentlyThemeUrl(imageUrl)
|
||||
val intent = Intent(this, PreviewActivity::class.java)
|
||||
intent.putExtra(PreviewActivity.KEY_PREVIEW_URL, imageUrl)
|
||||
@ -152,5 +185,19 @@ class JourneyDetailsActivity : AppCompatActivity(), OnDownloadListener {
|
||||
binding.downIcon.visibility = View.GONE
|
||||
|
||||
updateUi(detailsBean!!)
|
||||
val imageUrl = detailsBean?.themeContent?.androidRawZipUrl
|
||||
val b = fileIsDownload(this, imageUrl!!)
|
||||
if (b) {
|
||||
AdManager.showAD(this@JourneyDetailsActivity) { type ->
|
||||
if (type == AdManager.type_show_close || type == AdManager.type_show_fail || type == AdManager.type_no_cache) {
|
||||
AppSharedPreferences(this).setCurrentlyThemeUrl(imageUrl)
|
||||
val intent = Intent(this, PreviewActivity::class.java)
|
||||
intent.putExtra(PreviewActivity.KEY_PREVIEW_URL, imageUrl)
|
||||
startActivity(intent)
|
||||
finish()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -38,7 +38,7 @@ class JourneyStartActivity : AppCompatActivity() {
|
||||
|
||||
|
||||
private fun startMain() {
|
||||
val intent = Intent(this, JourneyMActivity::class.java)
|
||||
val intent = Intent(this, MainActivity::class.java)
|
||||
startActivity(intent)
|
||||
finish()
|
||||
}
|
||||
|
||||
100
app/src/main/java/com/keyboard/journey/LikeFragment.kt
Normal file
100
app/src/main/java/com/keyboard/journey/LikeFragment.kt
Normal file
@ -0,0 +1,100 @@
|
||||
package com.keyboard.journey
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import com.gyf.immersionbar.ktx.immersionBar
|
||||
import com.keyboard.journey.adapter.CategoryDetailsDataAdapter
|
||||
import com.keyboard.journey.bean.ItemDataBean
|
||||
import com.keyboard.journey.databinding.FragmentLikeBinding
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import org.libpag.PAGFile
|
||||
|
||||
class LikeFragment : Fragment() {
|
||||
private lateinit var binding: FragmentLikeBinding
|
||||
private var adapter: CategoryDetailsDataAdapter? = null
|
||||
private var contentBeans: MutableList<ItemDataBean> = mutableListOf()
|
||||
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?
|
||||
): View {
|
||||
binding = FragmentLikeBinding.inflate(layoutInflater)
|
||||
return binding.root
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
initView()
|
||||
initData()
|
||||
}
|
||||
|
||||
private fun initImmersionBar() {
|
||||
immersionBar {
|
||||
statusBarDarkFont(true)
|
||||
statusBarView(binding.view)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
initImmersionBar()
|
||||
initData()
|
||||
}
|
||||
|
||||
override fun onHiddenChanged(hidden: Boolean) {
|
||||
super.onHiddenChanged(hidden)
|
||||
if (!hidden) {
|
||||
initImmersionBar()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private fun initView() {
|
||||
adapter = CategoryDetailsDataAdapter(requireActivity(), contentBeans, "like")
|
||||
binding.rv.layoutManager = GridLayoutManager(requireActivity(), 2)
|
||||
binding.rv.adapter = adapter
|
||||
}
|
||||
|
||||
private fun initData() {
|
||||
loadingPlay()
|
||||
binding.noDataLayout.visibility = View.GONE
|
||||
GlobalScope.launch {
|
||||
val beans = JourneyApp.databaseManager.getAllItemDataBeanFiles()
|
||||
if (beans.isNotEmpty()) {
|
||||
contentBeans.clear()
|
||||
contentBeans.addAll(beans)
|
||||
withContext(Dispatchers.Main) {
|
||||
loadingClose()
|
||||
binding.noDataLayout.visibility = View.GONE
|
||||
}
|
||||
} else {
|
||||
withContext(Dispatchers.Main) {
|
||||
loadingClose()
|
||||
binding.noDataLayout.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun loadingPlay() {
|
||||
binding.loadingLayout.visibility = View.VISIBLE
|
||||
val pagFile = PAGFile.Load(requireActivity().assets, "loading.pag")
|
||||
binding.pagView.composition = pagFile
|
||||
binding.pagView.setRepeatCount(0)
|
||||
binding.pagView.play()
|
||||
}
|
||||
|
||||
private fun loadingClose() {
|
||||
binding.loadingLayout.visibility = View.GONE
|
||||
if (binding.pagView.isPlaying) {
|
||||
binding.pagView.stop()
|
||||
}
|
||||
}
|
||||
}
|
||||
347
app/src/main/java/com/keyboard/journey/MainActivity.kt
Normal file
347
app/src/main/java/com/keyboard/journey/MainActivity.kt
Normal file
@ -0,0 +1,347 @@
|
||||
package com.keyboard.journey
|
||||
|
||||
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.net.Uri
|
||||
import android.os.Bundle
|
||||
import android.provider.Settings
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.inputmethod.InputMethodManager
|
||||
import android.widget.ImageView
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.TextView
|
||||
import android.widget.Toast
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.view.GravityCompat
|
||||
import androidx.drawerlayout.widget.DrawerLayout
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.FragmentTransaction
|
||||
import com.bumptech.glide.Glide
|
||||
import com.gyf.immersionbar.ktx.immersionBar
|
||||
import com.keyboard.journey.bean.ItemDataBean
|
||||
import com.keyboard.journey.databinding.ActivityMainBinding
|
||||
import com.keyboard.journey.topon.AdManager
|
||||
import com.keyboard.journey.util.isMyInputMethodDefault
|
||||
import com.keyboard.journey.util.isMyInputMethodEnabled
|
||||
import com.keyboard.journey.util.openGooglePlayForReview
|
||||
import com.keyboard.journey.util.shareAppInfo
|
||||
|
||||
|
||||
class MainActivity : AppCompatActivity() {
|
||||
private lateinit var binding: ActivityMainBinding
|
||||
private var backPressedOnce = false
|
||||
private lateinit var bannerStr0: String
|
||||
private lateinit var bannerStr1: String
|
||||
|
||||
private val mFragments: MutableList<Fragment> = ArrayList()
|
||||
private var currentIndex: Int = 0
|
||||
private var mCurrentFragment: Fragment? = null
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
binding = ActivityMainBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
bannerStr0 = getString(R.string.recommend)
|
||||
bannerStr1 = getString(R.string.cool)
|
||||
initBar()
|
||||
initView()
|
||||
registerReceiver()
|
||||
AdManager.loadAllAd()
|
||||
}
|
||||
|
||||
private fun initFragment() {
|
||||
mFragments.clear()
|
||||
mFragments.add(HomeFragment())
|
||||
mFragments.add(LikeFragment())
|
||||
changeFragment(0)
|
||||
updateBtnState(0)
|
||||
}
|
||||
|
||||
private fun changeFragment(index: Int) {
|
||||
currentIndex = index
|
||||
val ft: FragmentTransaction = supportFragmentManager.beginTransaction()
|
||||
if (null != mCurrentFragment) {
|
||||
ft.hide(mCurrentFragment!!)
|
||||
}
|
||||
var fragment = supportFragmentManager.findFragmentByTag(
|
||||
mFragments[currentIndex].javaClass.name
|
||||
)
|
||||
if (null == fragment) {
|
||||
fragment = mFragments[index]
|
||||
}
|
||||
mCurrentFragment = fragment
|
||||
|
||||
if (!fragment.isAdded) {
|
||||
ft.add(R.id.frame_layout, fragment, fragment.javaClass.name)
|
||||
} else {
|
||||
ft.show(fragment)
|
||||
}
|
||||
ft.commit()
|
||||
}
|
||||
|
||||
private fun updateBtnState(index: Int) {
|
||||
binding.apply {
|
||||
homeImg.setImageResource(
|
||||
when (index) {
|
||||
0 -> {
|
||||
binding.topLayout.visibility = View.VISIBLE
|
||||
R.drawable.kj_home_select_icon
|
||||
}
|
||||
|
||||
else -> R.drawable.kj_home_unselect_icon
|
||||
}
|
||||
)
|
||||
likeImg.setImageResource(
|
||||
when (index) {
|
||||
1 -> {
|
||||
binding.topLayout.visibility = View.GONE
|
||||
R.drawable.kj_like_select_icon
|
||||
}
|
||||
|
||||
else -> R.drawable.kj_like_unselect_icon
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private fun initBar() {
|
||||
immersionBar {
|
||||
statusBarDarkFont(true)
|
||||
statusBarView(binding.view)
|
||||
}
|
||||
}
|
||||
|
||||
private fun setupDrawerListener() {
|
||||
binding.drawer.addDrawerListener(object : DrawerLayout.DrawerListener {
|
||||
override fun onDrawerSlide(drawerView: View, slideOffset: Float) {}
|
||||
|
||||
override fun onDrawerOpened(drawerView: View) {
|
||||
drawerView.isClickable = true
|
||||
}
|
||||
|
||||
override fun onDrawerClosed(drawerView: View) {}
|
||||
|
||||
override fun onDrawerStateChanged(newState: Int) {}
|
||||
})
|
||||
}
|
||||
|
||||
private fun initClick() {
|
||||
binding.menuBtn.setOnClickListener {
|
||||
if (binding.drawer.isDrawerOpen(GravityCompat.START)) {
|
||||
binding.drawer.closeDrawer(GravityCompat.START)
|
||||
} else {
|
||||
binding.drawer.openDrawer(GravityCompat.START)
|
||||
}
|
||||
}
|
||||
|
||||
binding.homeBtn.setOnClickListener {
|
||||
changeFragment(0)
|
||||
updateBtnState(0)
|
||||
}
|
||||
binding.likeBtn.setOnClickListener {
|
||||
changeFragment(1)
|
||||
updateBtnState(1)
|
||||
}
|
||||
binding.applyKeyboardBtn.setOnClickListener {
|
||||
val enabled = isMyInputMethodEnabled(this)
|
||||
val default = isMyInputMethodDefault(this)
|
||||
if (enabled && default) {
|
||||
binding.dialogStepLayout.visibility = View.GONE
|
||||
|
||||
Toast.makeText(
|
||||
this, "The keyboard has been set up successfully!", Toast.LENGTH_SHORT
|
||||
).show()
|
||||
} else {
|
||||
binding.dialogStepLayout.visibility = View.VISIBLE
|
||||
updateSetMyInputMethod()
|
||||
}
|
||||
}
|
||||
binding.step1Btn.setOnClickListener {
|
||||
val intent = Intent(Settings.ACTION_INPUT_METHOD_SETTINGS)
|
||||
startActivity(intent)
|
||||
}
|
||||
|
||||
binding.step2Btn.setOnClickListener {
|
||||
val imeManager = getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager
|
||||
imeManager.showInputMethodPicker()
|
||||
}
|
||||
|
||||
binding.step1HomeBtn.setOnClickListener {
|
||||
val intent = Intent(Settings.ACTION_INPUT_METHOD_SETTINGS)
|
||||
startActivity(intent)
|
||||
}
|
||||
|
||||
binding.step2HomeBtn.setOnClickListener {
|
||||
val imeManager = getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager
|
||||
imeManager.showInputMethodPicker()
|
||||
}
|
||||
|
||||
binding.dialogStepLayout.setOnClickListener {
|
||||
binding.dialogStepLayout.visibility = View.GONE
|
||||
}
|
||||
|
||||
binding.dialogHomeStepLayout.setOnClickListener {
|
||||
binding.dialogHomeStepLayout.visibility = View.GONE
|
||||
}
|
||||
|
||||
binding.privacyBtn.setOnClickListener {
|
||||
val privacyPolicyUrl = "https://sites.google.com/view/privacy-policy-html-app"
|
||||
val intent = Intent(Intent.ACTION_VIEW)
|
||||
intent.data = Uri.parse(privacyPolicyUrl)
|
||||
startActivity(intent)
|
||||
}
|
||||
binding.shareBtn.setOnClickListener {
|
||||
shareAppInfo(this)
|
||||
}
|
||||
binding.rateBtn.setOnClickListener {
|
||||
openGooglePlayForReview(this)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onBackPressed() {
|
||||
if (binding.drawer.isDrawerOpen(GravityCompat.START)) {
|
||||
binding.drawer.closeDrawer(GravityCompat.START);
|
||||
} else {
|
||||
if (backPressedOnce) {
|
||||
super.onBackPressed()
|
||||
return
|
||||
}
|
||||
|
||||
backPressedOnce = true
|
||||
Toast.makeText(this, "Press again to exit!", Toast.LENGTH_SHORT).show()
|
||||
// 两秒钟内再次按返回键取消退出操作
|
||||
val handler = android.os.Handler()
|
||||
handler.postDelayed({ backPressedOnce = false }, 2000)
|
||||
}
|
||||
}
|
||||
|
||||
private fun initView() {
|
||||
val enabled = isMyInputMethodEnabled(this)
|
||||
val default = isMyInputMethodDefault(this)
|
||||
if (!enabled || !default) {
|
||||
binding.dialogHomeStepLayout.visibility = View.VISIBLE
|
||||
updateSetMyInputMethodHome()
|
||||
}
|
||||
|
||||
initFragment()
|
||||
setupDrawerListener()
|
||||
initClick()
|
||||
}
|
||||
|
||||
private fun updateSetMyInputMethod() {
|
||||
val enabled = isMyInputMethodEnabled(this)
|
||||
val default = isMyInputMethodDefault(this)
|
||||
if (enabled) {
|
||||
binding.step1Btn.background = getDrawable(R.drawable.drw_gray_select_bg)
|
||||
binding.step1Btn.text = "Step 1:Enabled"
|
||||
binding.step1Btn.setTextColor(Color.parseColor("#999999"))
|
||||
} else {
|
||||
binding.step1Btn.background = getDrawable(R.mipmap.activate_btn_bg)
|
||||
binding.step1Btn.text = "Step 1:Select"
|
||||
binding.step1Btn.setTextColor(Color.parseColor("#000000"))
|
||||
}
|
||||
if (default) {
|
||||
binding.step2Btn.background = getDrawable(R.drawable.drw_gray_select_bg)
|
||||
binding.step2Btn.text = "Step 2:Enabled"
|
||||
binding.step1Btn.setTextColor(Color.parseColor("#999999"))
|
||||
} else {
|
||||
binding.step2Btn.background = getDrawable(R.mipmap.activate_btn_bg)
|
||||
binding.step2Btn.text = "Step 2:Select"
|
||||
binding.step1Btn.setTextColor(Color.parseColor("#000000"))
|
||||
}
|
||||
}
|
||||
|
||||
private fun updateSetMyInputMethodHome() {
|
||||
val enabled = isMyInputMethodEnabled(this)
|
||||
val default = isMyInputMethodDefault(this)
|
||||
if (enabled) {
|
||||
binding.step1HomeBtn.background = getDrawable(R.drawable.drw_gray_select_bg)
|
||||
binding.step1HomeBtn.text = "Step 1:Enabled"
|
||||
binding.step1HomeBtn.setTextColor(Color.parseColor("#999999"))
|
||||
} else {
|
||||
binding.step1HomeBtn.background = getDrawable(R.mipmap.activate_btn_bg)
|
||||
binding.step1HomeBtn.text = "Step 1:Select"
|
||||
binding.step1HomeBtn.setTextColor(Color.parseColor("#000000"))
|
||||
}
|
||||
if (default) {
|
||||
binding.step2HomeBtn.background = getDrawable(R.drawable.drw_gray_select_bg)
|
||||
binding.step2HomeBtn.text = "Step 2:Enabled"
|
||||
binding.step1HomeBtn.setTextColor(Color.parseColor("#999999"))
|
||||
} else {
|
||||
binding.step2HomeBtn.background = getDrawable(R.mipmap.activate_btn_bg)
|
||||
binding.step2HomeBtn.text = "Step 2:Select"
|
||||
binding.step1HomeBtn.setTextColor(Color.parseColor("#000000"))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private fun showDialogRecommend() {
|
||||
val bean = ItemDataBean(
|
||||
isLiked = false,
|
||||
key = "225e68e251874193a884d7dd4b718586",
|
||||
title = "AIGC Pretty Heart Girl",
|
||||
type = 6,
|
||||
thumbUrl = "https://cdn.kikakeyboard.com/picture/wallpaper/1705373685197_keyboard_preview_604*444.jpg.webp",
|
||||
thumbUrlGif = ""
|
||||
)
|
||||
|
||||
val inflater = LayoutInflater.from(this)
|
||||
val dialogView = inflater.inflate(R.layout.dialog_recommend, null)
|
||||
val okBtn = dialogView.findViewById<ImageView>(R.id.go_btn)
|
||||
val cancelBtn = dialogView.findViewById<LinearLayout>(R.id.cha_btn)
|
||||
val img = dialogView.findViewById<ImageView>(R.id.img)
|
||||
Glide.with(this)
|
||||
.load(bean.thumbUrl)
|
||||
.into(img)
|
||||
val dialogBuilder = AlertDialog.Builder(this).setView(dialogView)
|
||||
val dialog = dialogBuilder.create()
|
||||
dialog.window?.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
|
||||
dialog.show()
|
||||
okBtn.setOnClickListener {
|
||||
dialog.dismiss()
|
||||
val intent = Intent(this, JourneyDetailsActivity::class.java)
|
||||
intent.putExtra(JourneyDetailsActivity.KEY_JOURNEY_DETAILS_BEAN, bean)
|
||||
startActivity(intent)
|
||||
}
|
||||
cancelBtn.setOnClickListener {
|
||||
dialog.dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
private var receiver: BroadcastReceiver? = null
|
||||
private fun registerReceiver() {
|
||||
val filter = IntentFilter(Intent.ACTION_INPUT_METHOD_CHANGED)
|
||||
receiver = object : BroadcastReceiver() {
|
||||
override fun onReceive(context: Context, intent: Intent) {
|
||||
updateSetMyInputMethodHome()
|
||||
val enabled = isMyInputMethodEnabled(this@MainActivity)
|
||||
val default = isMyInputMethodDefault(this@MainActivity)
|
||||
if (enabled && default) {
|
||||
binding.dialogHomeStepLayout.visibility = View.GONE
|
||||
showDialogRecommend()
|
||||
} else {
|
||||
binding.dialogHomeStepLayout.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
}
|
||||
registerReceiver(receiver, filter)
|
||||
}
|
||||
|
||||
private fun unregisterReceiver() {
|
||||
if (receiver != null) {
|
||||
unregisterReceiver(receiver)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
unregisterReceiver()
|
||||
}
|
||||
|
||||
}
|
||||
@ -14,6 +14,7 @@ import android.view.inputmethod.InputMethodManager
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import com.gyf.immersionbar.ktx.immersionBar
|
||||
import com.keyboard.journey.databinding.JourneyPreviewActivityBinding
|
||||
import com.keyboard.journey.topon.AdManager
|
||||
import com.keyboard.journey.util.currentlyThemeUFileString
|
||||
import com.keyboard.journey.util.getBitmapXXDrawable
|
||||
import com.keyboard.journey.util.isMyInputMethodDefault
|
||||
@ -159,6 +160,7 @@ class PreviewActivity : AppCompatActivity() {
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
unregisterReceiver()
|
||||
AdManager.loadAllAd()
|
||||
}
|
||||
|
||||
private fun showKeyboard(view: View) {
|
||||
|
||||
@ -15,8 +15,13 @@ import com.keyboard.journey.bean.ItemDataBean
|
||||
import com.keyboard.journey.bean.MainDataBean
|
||||
import com.keyboard.journey.databinding.AdapterCategoryDetailsItemBinding
|
||||
import com.keyboard.journey.databinding.MainRvItemBinding
|
||||
import com.keyboard.journey.topon.AdManager
|
||||
|
||||
class CategoryDetailsDataAdapter(private val context: Context, private val mainDataList: List<ItemDataBean>) :
|
||||
class CategoryDetailsDataAdapter(
|
||||
private val context: Context,
|
||||
private val mainDataList: List<ItemDataBean>,
|
||||
private val from: String
|
||||
) :
|
||||
RecyclerView.Adapter<CategoryDetailsDataAdapter.MainDataViewHolder>() {
|
||||
|
||||
inner class MainDataViewHolder(private val binding: AdapterCategoryDetailsItemBinding) :
|
||||
@ -49,7 +54,8 @@ class CategoryDetailsDataAdapter(private val context: Context, private val mainD
|
||||
holder.bind(currentItem)
|
||||
holder.itemView.setOnClickListener {
|
||||
val intent = Intent(context, JourneyDetailsActivity::class.java)
|
||||
intent.putExtra(JourneyDetailsActivity.KEY_JOURNEY_DETAILS_BEAN,currentItem)
|
||||
intent.putExtra(JourneyDetailsActivity.KEY_JOURNEY_DETAILS_BEAN, currentItem)
|
||||
intent.putExtra(JourneyDetailsActivity.KEY_JOURNEY_FROM, from)
|
||||
context.startActivity(intent)
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@ package com.keyboard.journey.adapter
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
@ -48,6 +49,7 @@ class CategoryItemDataAdapter(
|
||||
val currentItem = mainDataList[position]
|
||||
holder.bind(currentItem)
|
||||
holder.itemView.setOnClickListener {
|
||||
Log.d("ocean","currentItem ->$currentItem")
|
||||
val intent = Intent(context, JourneyDetailsActivity::class.java)
|
||||
intent.putExtra(KEY_JOURNEY_DETAILS_BEAN,currentItem)
|
||||
context.startActivity(intent)
|
||||
|
||||
@ -1,14 +1,22 @@
|
||||
package com.keyboard.journey.bean
|
||||
|
||||
import androidx.annotation.Keep
|
||||
import androidx.room.ColumnInfo
|
||||
import androidx.room.Entity
|
||||
import androidx.room.PrimaryKey
|
||||
import java.io.Serializable
|
||||
|
||||
@Keep
|
||||
@Entity
|
||||
data class ItemDataBean(
|
||||
val key: String,
|
||||
val title: String,
|
||||
val type: Int,
|
||||
val thumbUrl: String,
|
||||
val thumbUrlGif: String,
|
||||
val themeContentBean: ThemeContentBean,
|
||||
val lockBean: LockBean
|
||||
) : Serializable
|
||||
@ColumnInfo(name = "isLiked") var isLiked: Boolean,
|
||||
@ColumnInfo(name = "key") var key: String,
|
||||
@ColumnInfo(name = "title") var title: String,
|
||||
@ColumnInfo(name = "type") var type: Int,
|
||||
@ColumnInfo(name = "thumbUrl") var thumbUrl: String,
|
||||
@ColumnInfo(name = "thumbUrlGif") var thumbUrlGif: String,
|
||||
) : Serializable {
|
||||
@PrimaryKey(autoGenerate = true)
|
||||
var id: Long = 0
|
||||
}
|
||||
|
||||
|
||||
80
app/src/main/java/com/keyboard/journey/db/DatabaseManager.kt
Normal file
80
app/src/main/java/com/keyboard/journey/db/DatabaseManager.kt
Normal file
@ -0,0 +1,80 @@
|
||||
package com.keyboard.journey.db
|
||||
|
||||
import android.content.Context
|
||||
import androidx.room.Room
|
||||
import com.keyboard.journey.bean.ItemDataBean
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.withContext
|
||||
|
||||
class DatabaseManager private constructor(context: Context) {
|
||||
|
||||
private val database = Room.databaseBuilder(
|
||||
context.applicationContext,
|
||||
LikeDatabase::class.java, "local_kj_like_database"
|
||||
).build()
|
||||
|
||||
private val audioFileDao = database.localLikeDao()
|
||||
|
||||
suspend fun insertItemDataBeanFile(audio: ItemDataBean) {
|
||||
withContext(Dispatchers.IO) {
|
||||
val existingItemDataBeanFile = getItemDataBeanFileByPath(audio.key)
|
||||
if (existingItemDataBeanFile == null) {
|
||||
audioFileDao.insertItemDataBeanFile(audio)
|
||||
} else {
|
||||
audioFileDao.updateItemDataBeanFile(audio)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun insertItemDataBeanFiles(audios: List<ItemDataBean>) {
|
||||
withContext(Dispatchers.IO) {
|
||||
for (audio in audios) {
|
||||
val existingItemDataBeanFile = getItemDataBeanFileByPath(audio.key)
|
||||
if (existingItemDataBeanFile == null) {
|
||||
audioFileDao.insertItemDataBeanFile(audio)
|
||||
} else {
|
||||
audioFileDao.updateItemDataBeanFile(audio)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun getAllItemDataBeanFiles(): List<ItemDataBean> {
|
||||
return withContext(Dispatchers.IO) {
|
||||
audioFileDao.getAllItemDataBeanFile()
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun deleteItemDataBeanFile(audioFile: ItemDataBean) {
|
||||
withContext(Dispatchers.IO) {
|
||||
audioFileDao.deleteItemDataBeanFile(audioFile)
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun deleteAllItemDataBeanFiles() {
|
||||
withContext(Dispatchers.IO) {
|
||||
audioFileDao.deleteAllItemDataBeanFile()
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun updateItemDataBeanFiles(audioFile: ItemDataBean) {
|
||||
withContext(Dispatchers.IO) {
|
||||
audioFileDao.updateItemDataBeanFile(audioFile)
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun getItemDataBeanFileByPath(path: String): ItemDataBean? {
|
||||
return audioFileDao.getItemDataBeanFileByPath(path)
|
||||
}
|
||||
|
||||
companion object {
|
||||
@Volatile
|
||||
private var instance: DatabaseManager? = null
|
||||
|
||||
fun getInstance(context: Context): DatabaseManager {
|
||||
return instance ?: synchronized(this) {
|
||||
instance ?: DatabaseManager(context).also { instance = it }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
11
app/src/main/java/com/keyboard/journey/db/LikeDatabase.kt
Normal file
11
app/src/main/java/com/keyboard/journey/db/LikeDatabase.kt
Normal file
@ -0,0 +1,11 @@
|
||||
|
||||
package com.keyboard.journey.db
|
||||
|
||||
import androidx.room.Database
|
||||
import androidx.room.RoomDatabase
|
||||
import com.keyboard.journey.bean.ItemDataBean
|
||||
|
||||
@Database(entities = [ItemDataBean::class], version = 1, exportSchema = false)
|
||||
abstract class LikeDatabase : RoomDatabase() {
|
||||
abstract fun localLikeDao(): LocalLikeDao
|
||||
}
|
||||
31
app/src/main/java/com/keyboard/journey/db/LocalLikeDao.kt
Normal file
31
app/src/main/java/com/keyboard/journey/db/LocalLikeDao.kt
Normal file
@ -0,0 +1,31 @@
|
||||
|
||||
|
||||
package com.keyboard.journey.db
|
||||
|
||||
import androidx.room.*
|
||||
import com.keyboard.journey.bean.ItemDataBean
|
||||
|
||||
@Dao
|
||||
interface LocalLikeDao {
|
||||
|
||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
||||
suspend fun insertItemDataBeanFile(barcode: ItemDataBean)
|
||||
|
||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
||||
suspend fun insertItemDataBeanFiles(itemDataBeans: List<ItemDataBean>)
|
||||
|
||||
@Query("SELECT * FROM ItemDataBean")
|
||||
suspend fun getAllItemDataBeanFile(): List<ItemDataBean>
|
||||
|
||||
@Delete
|
||||
suspend fun deleteItemDataBeanFile(barcode: ItemDataBean)
|
||||
|
||||
@Query("DELETE FROM ItemDataBean")
|
||||
suspend fun deleteAllItemDataBeanFile()
|
||||
|
||||
@Update
|
||||
suspend fun updateItemDataBeanFile(itemDataBean: ItemDataBean)
|
||||
|
||||
@Query("SELECT * FROM ItemDataBean WHERE `key` = :path LIMIT 1")
|
||||
suspend fun getItemDataBeanFileByPath(path: String): ItemDataBean?
|
||||
}
|
||||
@ -232,3 +232,18 @@ fun shareAppInfo(context: Context) {
|
||||
context.startActivity(shareIntent)
|
||||
}
|
||||
}
|
||||
|
||||
fun openGooglePlayForReview(context: Context) {
|
||||
val packageName = context.packageName
|
||||
try {
|
||||
val intent = Intent(
|
||||
Intent.ACTION_VIEW,
|
||||
Uri.parse("https://play.google.com/store/apps/details?id=$packageName")
|
||||
)
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
context.startActivity(intent)
|
||||
} catch (e: Exception) {
|
||||
// 如果设备上没有安装 Google Play 商店应用,则使用浏览器打开
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.keyboard.journey.util
|
||||
|
||||
import com.keyboard.journey.JourneyApp
|
||||
import com.keyboard.journey.bean.Author
|
||||
import com.keyboard.journey.bean.CategoryDataBean
|
||||
import com.keyboard.journey.bean.Content
|
||||
@ -10,6 +11,8 @@ import com.keyboard.journey.bean.MainDataBean
|
||||
import com.keyboard.journey.bean.MainItemDataBean
|
||||
import com.keyboard.journey.bean.ThemeContentBean
|
||||
import com.keyboard.journey.bean.ThemeDetailsContent
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.coroutines.launch
|
||||
import okhttp3.Call
|
||||
import okhttp3.Callback
|
||||
import okhttp3.OkHttpClient
|
||||
@ -189,13 +192,12 @@ class NetworkUtil {
|
||||
val lock = LockBean(lockType)
|
||||
|
||||
val item = ItemDataBean(
|
||||
false,
|
||||
itemKey,
|
||||
itemTitle,
|
||||
itemType,
|
||||
thumbUrl,
|
||||
thumbUrlGif,
|
||||
themeContent,
|
||||
lock
|
||||
)
|
||||
itemsList.add(item)
|
||||
}
|
||||
|
||||
21
app/src/main/res/drawable/arrow_down_icon.xml
Normal file
21
app/src/main/res/drawable/arrow_down_icon.xml
Normal file
@ -0,0 +1,21 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="18dp"
|
||||
android:height="18dp"
|
||||
android:viewportWidth="18"
|
||||
android:viewportHeight="18">
|
||||
<group>
|
||||
<clip-path
|
||||
android:pathData="M0,0h18v18h-18z"/>
|
||||
<path
|
||||
android:pathData="M4.72,9.22C4.86,9.079 5.051,9 5.25,9C5.449,9 5.64,9.079 5.78,9.22L9,12.439L12.22,9.22C12.361,9.083 12.551,9.007 12.747,9.009C12.944,9.011 13.132,9.09 13.271,9.229C13.41,9.368 13.489,9.556 13.491,9.753C13.493,9.949 13.417,10.139 13.28,10.28L9.53,14.03C9.39,14.171 9.199,14.25 9,14.25C8.801,14.25 8.61,14.171 8.47,14.03L4.72,10.28C4.579,10.139 4.5,9.949 4.5,9.75C4.5,9.551 4.579,9.36 4.72,9.22Z"
|
||||
android:strokeAlpha="0.6"
|
||||
android:fillColor="#000000"
|
||||
android:fillType="evenOdd"
|
||||
android:fillAlpha="0.6"/>
|
||||
<path
|
||||
android:pathData="M5.25,4.502C5.051,4.502 4.86,4.581 4.72,4.721C4.579,4.862 4.5,5.053 4.5,5.251C4.5,5.45 4.579,5.641 4.72,5.782L8.47,9.532C8.61,9.672 8.801,9.751 9,9.751C9.199,9.751 9.39,9.672 9.53,9.532L13.28,5.782C13.352,5.712 13.409,5.63 13.448,5.538C13.488,5.447 13.508,5.348 13.509,5.249C13.51,5.149 13.491,5.05 13.453,4.958C13.416,4.866 13.36,4.782 13.29,4.712C13.219,4.641 13.135,4.586 13.043,4.548C12.951,4.51 12.852,4.491 12.753,4.492C12.653,4.493 12.555,4.514 12.463,4.553C12.372,4.592 12.289,4.65 12.22,4.721L9,7.941L5.78,4.721C5.64,4.581 5.449,4.502 5.25,4.502Z"
|
||||
android:strokeAlpha="0.3"
|
||||
android:fillColor="#000000"
|
||||
android:fillAlpha="0.3"/>
|
||||
</group>
|
||||
</vector>
|
||||
14
app/src/main/res/drawable/cha_icon.xml
Normal file
14
app/src/main/res/drawable/cha_icon.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:strokeWidth="1"
|
||||
android:pathData="M12,0.5L12,0.5A11.5,11.5 0,0 1,23.5 12L23.5,12A11.5,11.5 0,0 1,12 23.5L12,23.5A11.5,11.5 0,0 1,0.5 12L0.5,12A11.5,11.5 0,0 1,12 0.5z"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#ffffff"/>
|
||||
<path
|
||||
android:pathData="M16.496,8.511C16.774,8.233 16.774,7.782 16.496,7.504C16.218,7.225 15.767,7.225 15.489,7.504L12,10.993L8.511,7.504C8.233,7.225 7.782,7.225 7.504,7.504C7.225,7.782 7.225,8.233 7.504,8.511L10.993,12L7.504,15.489C7.225,15.767 7.225,16.218 7.504,16.496C7.782,16.774 8.233,16.774 8.511,16.496L12,13.007L15.489,16.496C15.767,16.774 16.218,16.774 16.496,16.496C16.774,16.218 16.774,15.767 16.496,15.489L13.007,12L16.496,8.511Z"
|
||||
android:fillColor="#ffffff"/>
|
||||
</vector>
|
||||
6
app/src/main/res/drawable/draw_go_2_bg.xml
Normal file
6
app/src/main/res/drawable/draw_go_2_bg.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="rectangle">
|
||||
<corners android:radius="80dp" />
|
||||
<solid android:color="@color/banner_indicator_tow_go_bg_color" />
|
||||
</shape>
|
||||
6
app/src/main/res/drawable/draw_go_bg.xml
Normal file
6
app/src/main/res/drawable/draw_go_bg.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="rectangle">
|
||||
<corners android:radius="80dp" />
|
||||
<solid android:color="@color/banner_indicator_one_go_bg_color" />
|
||||
</shape>
|
||||
7
app/src/main/res/drawable/draw_main_tab_bg.xml
Normal file
7
app/src/main/res/drawable/draw_main_tab_bg.xml
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:topLeftRadius="24dp"
|
||||
android:topRightRadius="24dp"/>
|
||||
<solid android:color="@color/white"/>
|
||||
</shape>
|
||||
14
app/src/main/res/drawable/kj_home_select_icon.xml
Normal file
14
app/src/main/res/drawable/kj_home_select_icon.xml
Normal file
@ -0,0 +1,14 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="32dp"
|
||||
android:height="32dp"
|
||||
android:viewportWidth="32"
|
||||
android:viewportHeight="32">
|
||||
<path
|
||||
android:pathData="M28.068,19.168L25.589,9.519C25.587,9.51 25.585,9.502 25.582,9.493C25.417,8.987 25.061,8.554 24.577,8.275C24.094,7.996 23.541,7.904 23.02,8.014C23.011,8.016 23.003,8.018 22.994,8.021L13.399,10.699C13.299,10.727 13.215,10.791 13.164,10.879L8.245,19.4C7.719,20.312 8.107,21.524 9.111,22.104L20.335,28.584C21.339,29.164 22.583,28.894 23.11,27.982L28.029,19.462C28.08,19.374 28.094,19.269 28.067,19.168L28.068,19.168Z"
|
||||
android:fillColor="#C98FFF"/>
|
||||
<path
|
||||
android:pathData="M23.604,13.002L13.954,3.15C13.946,3.141 13.937,3.133 13.928,3.124C13.38,2.631 12.653,2.359 11.881,2.359C11.108,2.359 10.381,2.631 9.833,3.124C9.824,3.132 9.815,3.141 9.806,3.15L0.157,13.002C0.056,13.105 0,13.241 0,13.381V27.002C0,28.458 1.306,29.643 2.909,29.643H20.852C22.456,29.643 23.761,28.458 23.761,27.001V13.381C23.761,13.241 23.705,13.105 23.604,13.002L23.604,13.002ZM8.531,21.443H15.223C15.934,21.443 16.51,22.02 16.51,22.73C16.51,23.441 15.934,24.017 15.223,24.017H8.531C7.82,24.017 7.244,23.441 7.244,22.73C7.244,22.02 7.82,21.443 8.531,21.443Z"
|
||||
android:strokeAlpha="0.9"
|
||||
android:fillColor="#E2C8FA"
|
||||
android:fillAlpha="0.9"/>
|
||||
</vector>
|
||||
12
app/src/main/res/drawable/kj_home_unselect_icon.xml
Normal file
12
app/src/main/res/drawable/kj_home_unselect_icon.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="32dp"
|
||||
android:height="32dp"
|
||||
android:viewportWidth="32"
|
||||
android:viewportHeight="32">
|
||||
<path
|
||||
android:pathData="M25.069,29.258H6.931C4.766,29.258 3,27.492 3,25.323V13.536C3,12.32 3.575,11.155 4.541,10.414L13.616,3.552C15.019,2.477 16.984,2.477 18.394,3.558L27.456,10.411C28.428,11.155 29.003,12.32 29.003,13.536V25.327C29,27.492 27.234,29.258 25.069,29.258ZM15.997,5.158C15.672,5.158 15.344,5.261 15.072,5.47L6,12.333C5.634,12.614 5.409,13.067 5.409,13.536V25.327C5.409,26.167 6.094,26.848 6.931,26.848H25.066C25.903,26.848 26.587,26.164 26.587,25.327V13.536C26.587,13.067 26.366,12.614 25.991,12.33L16.928,5.477C16.656,5.264 16.325,5.158 15.997,5.158Z"
|
||||
android:fillColor="#D9D9D9"/>
|
||||
<path
|
||||
android:pathData="M19.725,23.049H12.275C11.609,23.049 11.069,22.509 11.069,21.843C11.069,21.177 11.609,20.637 12.275,20.637H19.725C20.391,20.637 20.931,21.177 20.931,21.843C20.928,22.512 20.391,23.049 19.725,23.049Z"
|
||||
android:fillColor="#D9D9D9"/>
|
||||
</vector>
|
||||
14
app/src/main/res/drawable/kj_like_select_icon.xml
Normal file
14
app/src/main/res/drawable/kj_like_select_icon.xml
Normal file
@ -0,0 +1,14 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="32dp"
|
||||
android:height="32dp"
|
||||
android:viewportWidth="32"
|
||||
android:viewportHeight="32">
|
||||
<path
|
||||
android:pathData="M20.345,11.012C17.491,4.852 9.568,6.941 8.604,13.045C7.948,17.194 11.223,20.687 13.653,23.379C15.406,25.357 16.301,26.228 16.918,26.933C17.327,27.422 18.038,27.535 18.578,27.195C19.442,26.724 20.512,26.103 22.839,24.831C26.021,23.147 30.173,20.705 30.828,16.556C31.911,10.47 24.968,5.972 20.345,11.012Z"
|
||||
android:fillColor="#F779D4"/>
|
||||
<path
|
||||
android:pathData="M13.48,8.23C9.34,1.99 1,5.65 1,12.49C1,17.17 5.14,20.41 8.32,22.93C10.6,24.79 11.68,25.57 12.52,26.29C13.06,26.77 13.84,26.77 14.38,26.29C15.22,25.57 16.36,24.73 18.64,22.93C21.82,20.53 25.96,17.11 25.96,12.49C26.08,5.65 17.68,1.93 13.48,8.23Z"
|
||||
android:strokeAlpha="0.9"
|
||||
android:fillColor="#FAC5EB"
|
||||
android:fillAlpha="0.9"/>
|
||||
</vector>
|
||||
12
app/src/main/res/drawable/kj_like_unselect_icon.xml
Normal file
12
app/src/main/res/drawable/kj_like_unselect_icon.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="32dp"
|
||||
android:height="32dp"
|
||||
android:viewportWidth="32"
|
||||
android:viewportHeight="32">
|
||||
<path
|
||||
android:pathData="M16.025,27.611C15.078,27.611 14.119,27.364 13.275,26.873C9.719,24.81 3.653,20.323 3.044,13.426C2.813,11.157 3.525,8.854 5,7.126C6.394,5.495 8.319,4.529 10.422,4.407C12.328,4.351 14.109,4.889 15.609,5.976C15.878,6.17 16.184,6.17 16.45,5.976C18.028,4.829 19.831,4.286 21.641,4.407C23.725,4.529 25.628,5.482 27.003,7.092C28.478,8.82 29.191,11.132 28.956,13.439C28.347,20.26 22.284,24.782 18.725,26.87C17.916,27.364 16.975,27.611 16.025,27.611ZM10.734,6.473C10.663,6.473 10.587,6.473 10.516,6.476C9.006,6.564 7.597,7.27 6.575,8.47C5.466,9.77 4.928,11.507 5.103,13.232C5.631,19.211 11.103,23.223 14.316,25.082C15.363,25.692 16.675,25.695 17.666,25.095C20.897,23.201 26.369,19.157 26.897,13.245C27.075,11.486 26.541,9.739 25.431,8.439C24.425,7.261 23.038,6.564 21.519,6.476H21.509C19.834,6.364 18.491,7.054 17.669,7.654C16.675,8.379 15.387,8.379 14.394,7.654C13.328,6.879 12.066,6.473 10.734,6.473Z"
|
||||
android:fillColor="#D9D9D9"/>
|
||||
<path
|
||||
android:pathData="M10.897,19.416C10.741,19.416 10.584,19.382 10.434,19.307C6.8,17.491 6.759,13.382 6.759,13.21C6.759,12.638 7.222,12.176 7.794,12.176C8.363,12.176 8.825,12.638 8.828,13.207C8.828,13.341 8.891,16.223 11.359,17.457C11.872,17.713 12.078,18.335 11.822,18.844C11.641,19.21 11.275,19.416 10.897,19.416Z"
|
||||
android:fillColor="#D9D9D9"/>
|
||||
</vector>
|
||||
9
app/src/main/res/drawable/like_select_icon.xml
Normal file
9
app/src/main/res/drawable/like_select_icon.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"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M21.349,8.549L21.319,8.312C21.283,8.091 21.235,7.872 21.173,7.656C20.987,6.964 20.646,6.322 20.175,5.781C20.147,5.744 20.117,5.709 20.085,5.676C19.616,5.145 19.039,4.72 18.392,4.43C17.745,4.141 17.044,3.993 16.335,3.996C14.561,3.996 12.896,4.694 11.996,5.732C11.096,4.694 9.428,3.996 7.658,3.996C6.949,3.993 6.248,4.141 5.601,4.43C4.954,4.72 4.377,5.145 3.908,5.676C3.875,5.709 3.845,5.744 3.818,5.781C3.347,6.322 3.006,6.964 2.82,7.656C2.758,7.872 2.709,8.091 2.674,8.312L2.644,8.549C2.628,8.713 2.622,8.878 2.625,9.044C2.625,9.21 2.634,9.377 2.651,9.542C3.026,14.091 11.276,19.461 11.625,19.69L12,19.934L12.375,19.69C12.727,19.465 20.978,14.095 21.349,9.542C21.366,9.377 21.375,9.21 21.375,9.044C21.376,8.878 21.367,8.713 21.349,8.549Z"
|
||||
android:fillColor="#F24180"/>
|
||||
</vector>
|
||||
9
app/src/main/res/drawable/like_unselect_icon.xml
Normal file
9
app/src/main/res/drawable/like_unselect_icon.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"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M21.349,8.549L21.319,8.312C21.283,8.091 21.235,7.872 21.173,7.656C20.987,6.964 20.646,6.322 20.175,5.781C20.147,5.744 20.117,5.709 20.085,5.676C19.616,5.145 19.039,4.72 18.392,4.43C17.745,4.141 17.044,3.993 16.335,3.996C14.561,3.996 12.896,4.694 11.996,5.732C11.096,4.694 9.428,3.996 7.658,3.996C6.949,3.993 6.248,4.141 5.601,4.43C4.954,4.72 4.377,5.145 3.908,5.676C3.875,5.709 3.845,5.744 3.818,5.781C3.347,6.322 3.006,6.964 2.82,7.656C2.758,7.872 2.709,8.091 2.674,8.312L2.644,8.549C2.628,8.713 2.622,8.878 2.625,9.044C2.625,9.21 2.634,9.377 2.651,9.542C3.026,14.091 11.276,19.461 11.625,19.69L12,19.934L12.375,19.69C12.727,19.465 20.978,14.095 21.349,9.542C21.366,9.377 21.375,9.21 21.375,9.044C21.376,8.878 21.367,8.713 21.349,8.549Z"
|
||||
android:fillColor="#ffffff"/>
|
||||
</vector>
|
||||
443
app/src/main/res/layout/activity_main.xml
Normal file
443
app/src/main/res/layout/activity_main.xml
Normal file
@ -0,0 +1,443 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.drawerlayout.widget.DrawerLayout 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:id="@+id/drawer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@mipmap/main_bg_img">
|
||||
|
||||
<View
|
||||
android:id="@+id/view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/frame_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_above="@+id/tab_layout" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/top_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:layout_below="@+id/view"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/menu_btn"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginStart="16dp"
|
||||
app:cardBackgroundColor="#F6F4FF"
|
||||
app:cardCornerRadius="32dp"
|
||||
app:cardElevation="6dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/menu" />
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="48dp"
|
||||
android:gravity="center_horizontal">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginStart="16dp"
|
||||
app:cardBackgroundColor="#F6F4FF"
|
||||
app:cardCornerRadius="32dp"
|
||||
app:cardElevation="6dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:text="@string/app_name"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14dp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<com.lihang.ShadowLayout
|
||||
android:id="@+id/tab_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginStart="-4dp"
|
||||
android:layout_marginEnd="-4dp"
|
||||
app:hl_cornerRadius_leftTop="24dp"
|
||||
app:hl_cornerRadius_rightTop="24dp"
|
||||
app:hl_shadowColor="#2a000000"
|
||||
app:hl_shadowHiddenBottom="true"
|
||||
app:hl_shadowLimit="4dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="80dp"
|
||||
android:background="@color/white"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/home_btn"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/home_img"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/kj_home_select_icon" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/like_btn"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/like_img"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/kj_like_unselect_icon" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</com.lihang.ShadowLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/dialog_home_step_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#99000000"
|
||||
android:visibility="gone">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/activate_home_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:background="@drawable/draw_activate_layout_bg"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingBottom="16dp"
|
||||
android:visibility="visible">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="Keyboard Journey"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14dp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:gravity="center"
|
||||
android:text="requires permission to use"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14dp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:layout_margin="16dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/step_1_home_btn"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="46dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/drw_gray_select_bg"
|
||||
android:gravity="center"
|
||||
android:text="Step 1:Select"
|
||||
android:textColor="#999999"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/step_2_home_btn"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="46dp"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@mipmap/activate_btn_bg"
|
||||
android:gravity="center"
|
||||
android:text="Step 2:Enabled"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<!--android:layout_gravity="start"-->
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="start"
|
||||
android:background="#F6F4FF"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingTop="48dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingBottom="10dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingBottom="10dp">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardCornerRadius="6dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:src="@mipmap/journey_app_logo" />
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:text="@string/app_name"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="16dp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/apply_keyboard_btn"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="56dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:src="@mipmap/keyboard_img" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:text="Keyboard settings"
|
||||
android:textColor="@color/black"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/share_btn"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="56dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:src="@mipmap/share_img" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:text="Share"
|
||||
android:textColor="@color/black"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/privacy_btn"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="56dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:src="@mipmap/privacy_img" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:text="Privacy"
|
||||
android:textColor="@color/black"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/rate_btn"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="56dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:src="@mipmap/rate_us_img" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:text="Rate us"
|
||||
android:textColor="@color/black"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/dialog_step_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#99000000"
|
||||
android:visibility="gone">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/activate_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:background="@drawable/draw_activate_layout_bg"
|
||||
android:orientation="vertical"
|
||||
android:visibility="visible">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="16dp"
|
||||
android:gravity="center"
|
||||
android:text="Activate Keyboard Journey"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14dp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:layout_margin="16dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/step_1_btn"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="46dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/drw_gray_select_bg"
|
||||
android:gravity="center"
|
||||
android:text="Step 1:Select"
|
||||
android:textColor="#999999"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/step_2_btn"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="46dp"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@mipmap/activate_btn_bg"
|
||||
android:gravity="center"
|
||||
android:text="Step 2:Enabled"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
</androidx.drawerlayout.widget.DrawerLayout>
|
||||
55
app/src/main/res/layout/dialog_recommend.xml
Normal file
55
app/src/main/res/layout/dialog_recommend.xml
Normal file
@ -0,0 +1,55 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="340dp"
|
||||
android:gravity="center">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="260dp"
|
||||
android:layout_height="310dp"
|
||||
android:layout_centerHorizontal="true">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:src="@mipmap/recommend_dialog_top_bg" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img"
|
||||
android:layout_width="220dp"
|
||||
android:layout_height="130dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@mipmap/cool_top_banner_img" />
|
||||
</RelativeLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/go_btn"
|
||||
android:layout_width="290dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:src="@mipmap/recommend_dialog_bottom_bg" />
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/cha_btn"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="56dp"
|
||||
android:layout_marginTop="32dp"
|
||||
android:gravity="center">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/cha_icon" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
70
app/src/main/res/layout/fragment_like.xml
Normal file
70
app/src/main/res/layout/fragment_like.xml
Normal file
@ -0,0 +1,70 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<View
|
||||
android:id="@+id/view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="42dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/my_favorite"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18dp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/loading_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone">
|
||||
|
||||
<org.libpag.PAGView
|
||||
android:id="@+id/pag_view"
|
||||
android:layout_width="88dp"
|
||||
android:layout_height="100dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:textSize="14sp"
|
||||
android:textColor="#999999"
|
||||
android:text="loading"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/no_data_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:textSize="16sp"
|
||||
android:textColor="#999999"
|
||||
android:text="No Data"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="6dp"
|
||||
android:overScrollMode="never"
|
||||
android:scrollbars="none" />
|
||||
</LinearLayout>
|
||||
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/drawer"
|
||||
@ -61,13 +61,12 @@
|
||||
android:textSize="16dp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
<LinearLayout
|
||||
android:id="@+id/indicator_go_bg"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="26dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
app:cardBackgroundColor="@color/banner_indicator_one_go_bg_color"
|
||||
app:cardCornerRadius="80dp">
|
||||
android:background="@drawable/draw_go_bg">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/indicator_go_txt"
|
||||
@ -80,7 +79,7 @@
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
</androidx.cardview.widget.CardView>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
@ -109,62 +108,6 @@
|
||||
</RelativeLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:layout_below="@+id/view"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/menu_btn"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginStart="16dp"
|
||||
app:cardBackgroundColor="#F6F4FF"
|
||||
app:cardCornerRadius="32dp"
|
||||
app:cardElevation="6dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/menu" />
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="48dp"
|
||||
android:gravity="center_horizontal">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginStart="16dp"
|
||||
app:cardBackgroundColor="#F6F4FF"
|
||||
app:cardCornerRadius="32dp"
|
||||
app:cardElevation="6dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:text="@string/app_name"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14dp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
@ -194,6 +137,22 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/no_data_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/try_again"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Load error,try again!"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20dp"
|
||||
android:textStyle="italic" />
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv"
|
||||
@ -204,214 +163,4 @@
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<!--android:layout_gravity="start"-->
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="start"
|
||||
android:background="#F6F4FF"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingTop="48dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingBottom="10dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingBottom="10dp">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardCornerRadius="6dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:src="@mipmap/journey_app_logo" />
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:text="@string/app_name"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="16dp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/apply_keyboard_btn"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="56dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:src="@mipmap/keyboard_img" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:text="Keyboard settings"
|
||||
android:textColor="@color/black"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/share_btn"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="56dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:src="@mipmap/shate_img" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:text="Share"
|
||||
android:textColor="@color/black"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/privacy_btn"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="56dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:src="@mipmap/privacy_img" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:text="Privacy"
|
||||
android:textColor="@color/black"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/dialog_step_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#99000000"
|
||||
android:visibility="gone">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/activate_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:background="@drawable/draw_activate_layout_bg"
|
||||
android:orientation="vertical"
|
||||
android:visibility="visible">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="16dp"
|
||||
android:gravity="center"
|
||||
android:text="Activate Keyboard Journey"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14dp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:layout_margin="16dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/step_1_btn"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="46dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/drw_gray_select_bg"
|
||||
android:gravity="center"
|
||||
android:text="Step 1:Select"
|
||||
android:textColor="#999999"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/step_2_btn"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="46dp"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@mipmap/activate_btn_bg"
|
||||
android:gravity="center"
|
||||
android:text="Step 2:Enabled"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
</androidx.drawerlayout.widget.DrawerLayout>
|
||||
</LinearLayout>
|
||||
@ -43,13 +43,30 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/app_name"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="16dp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/like_btn"
|
||||
android:layout_width="42dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:gravity="center">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/like_img"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/like_unselect_icon" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
@ -69,24 +86,24 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:textSize="14sp"
|
||||
android:text="loading"
|
||||
android:textColor="#999999"
|
||||
android:text="loading"/>
|
||||
android:textSize="14sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="24dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
|
||||
BIN
app/src/main/res/mipmap-xxhdpi/main_bg_img.png
Normal file
BIN
app/src/main/res/mipmap-xxhdpi/main_bg_img.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/recommend_dialog_bottom_bg.png
Normal file
BIN
app/src/main/res/mipmap-xxhdpi/recommend_dialog_bottom_bg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 207 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/recommend_dialog_top_bg.png
Normal file
BIN
app/src/main/res/mipmap-xxhdpi/recommend_dialog_top_bg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 614 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/share_img.png
Normal file
BIN
app/src/main/res/mipmap-xxhdpi/share_img.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
@ -9,4 +9,5 @@
|
||||
<string name="applied">Applied</string>
|
||||
<string name="downloaded"> %s %%</string>
|
||||
<string name="preview">Preview</string>
|
||||
<string name="my_favorite">My Favorite</string>
|
||||
</resources>
|
||||
Loading…
Reference in New Issue
Block a user