diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index bbf3009..9d1a39a 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -16,7 +16,12 @@ android:supportsRtl="true" android:theme="@style/AppTheme" tools:targetApi="31"> - + + diff --git a/app/src/main/assets/privacy.html b/app/src/main/assets/privacy.html new file mode 100644 index 0000000..8138fa8 --- /dev/null +++ b/app/src/main/assets/privacy.html @@ -0,0 +1,121 @@ + + + + + + Privacy Policy + + + +

Privacy Policy

+

Date: June 26, 2024

+ +

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

+ +

Information Collection and Use

+

For a better experience, while using our Service, we may require you to provide us with certain + personally identifiable information, such as users' name, address, location, pictures, etc. The + information that we request will be retained on your device and is not collected or retained by + us in any way and used as described in this privacy policy.

+

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

+

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

+
    +
  • Google Play Services
  • +
  • Google Analytics for Firebase
  • +
  • Firebase Crashlytics
  • +
  • Unity
  • +
  • AppLovin
  • +
  • Pangle
  • +
  • Mintegral
  • +
  • Bigo
  • +
  • Ironsource
  • +
  • Vungle
  • +
+ +

Log Data

+

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

+ +

Cookies

+

Cookies are files with a small amount of data that are commonly used as anonymous unique + identifiers. These are sent to your browser from the websites that you visit and are stored on + your device's internal memory.

+

This Service does not use these “cookies” explicitly. However, the app may use third-party code + and libraries that use “cookies” to collect information and improve their services. You have the + option to either accept or refuse these cookies and know when a cookie is being sent to your + device. If you choose to refuse our cookies, you may not be able to use some portions of this + Service.

+ +

Service Providers

+

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

+
    +
  • To facilitate our Service
  • +
  • To provide the Service on our behalf
  • +
  • To perform Service-related services
  • +
  • To assist us in analyzing how our Service is used
  • +
+

We want to inform users of this Service that these third parties have access to their Personal + Information. The reason is to perform the tasks assigned to them on our behalf. However, they + are obligated not to disclose or use the information for any other purpose.

+ +

Security

+

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

+ +

Links to Other Sites

+

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

+ +

Children’s Privacy

+

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

+ +

Changes to This Privacy Policy

+

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

+ +

Privacy Questions

+

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

+

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

+ + diff --git a/app/src/main/java/com/key/coolkeyboard/CoolKeyboardSkin.java b/app/src/main/java/com/key/coolkeyboard/CoolKeyboardSkin.java index cb76408..7518031 100644 --- a/app/src/main/java/com/key/coolkeyboard/CoolKeyboardSkin.java +++ b/app/src/main/java/com/key/coolkeyboard/CoolKeyboardSkin.java @@ -29,10 +29,12 @@ public class CoolKeyboardSkin extends Application { private static Context context; public static List mydataList; private static boolean insert; + private static boolean init; private SharedPreferences sp; private SharedPreferences.Editor editor; - private static final String PRE_NAME = "Mypre"; - private static final String PRE_KEY = "isinsert"; + public static final String PRE_NAME = "Mypre"; + public static final String PRE_KEY = "isinsert"; + public static final String PRE_KEY_INIT = "isinit"; public static List alllist = new ArrayList<>(); public static List lovelist = new ArrayList<>(); public static List coollist = new ArrayList<>(); @@ -128,9 +130,27 @@ public class CoolKeyboardSkin extends Application { initData(); + initKey(); } + private void initKey() { + sp = getSharedPreferences(PRE_NAME, MODE_PRIVATE); + init = sp.getBoolean(PRE_KEY, false); + if (!init) { + + Mytool.runIO(new Runnable() { + @Override + public void run() { + init = true; + editor = sp.edit(); + editor.putBoolean(PRE_KEY, init); + editor.apply(); + } + }); + } + } + private void initSdk() { // ATSDK.integrationChecking(context); diff --git a/app/src/main/java/com/key/coolkeyboard/activity/MainActivity.java b/app/src/main/java/com/key/coolkeyboard/activity/MainActivity.java index a571a84..c335ff1 100644 --- a/app/src/main/java/com/key/coolkeyboard/activity/MainActivity.java +++ b/app/src/main/java/com/key/coolkeyboard/activity/MainActivity.java @@ -1,6 +1,8 @@ package com.key.coolkeyboard.activity; import androidx.activity.EdgeToEdge; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; import androidx.core.graphics.Insets; import androidx.core.view.ViewCompat; @@ -9,23 +11,62 @@ import androidx.fragment.app.Fragment; import androidx.viewpager.widget.ViewPager; import android.annotation.SuppressLint; +import android.app.Dialog; +import android.content.BroadcastReceiver; import android.content.Context; +import android.content.DialogInterface; +import android.content.Intent; +import android.content.IntentFilter; +import android.content.SharedPreferences; +import android.graphics.Bitmap; +import android.graphics.drawable.ColorDrawable; +import android.graphics.drawable.Drawable; import android.os.Bundle; +import android.provider.Settings; +import android.util.Log; +import android.view.Gravity; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; import android.view.inputmethod.InputMethodManager; +import android.widget.ImageView; +import android.widget.Toast; +import com.bumptech.glide.Glide; +import com.bumptech.glide.load.DataSource; +import com.bumptech.glide.load.engine.GlideException; +import com.bumptech.glide.request.RequestListener; +import com.bumptech.glide.request.target.CustomTarget; +import com.bumptech.glide.request.target.Target; +import com.bumptech.glide.request.transition.Transition; import com.google.android.material.tabs.TabLayout; +import com.key.coolkeyboard.CoolKeyboardSkin; import com.key.coolkeyboard.R; import com.key.coolkeyboard.adapter.PageAdapter; +import com.key.coolkeyboard.data.MydataBase; +import com.key.coolkeyboard.data.Otherdata; import com.key.coolkeyboard.databinding.ActivityMainBinding; import com.key.coolkeyboard.fragment.LikeFragment; import com.key.coolkeyboard.fragment.MainFragment; +import com.key.coolkeyboard.tool.Mytool; +import com.key.coolkeyboard.tool.StaticValue; +import java.io.File; import java.util.ArrayList; +import java.util.Collections; import java.util.List; public class MainActivity extends AppCompatActivity { ActivityMainBinding binding; private List list = new ArrayList<>(); + + private Dialog dialog; + private Dialog toastDialog; + private BroadcastReceiver broadcastReceiver; + private static final InputMethodManager methodManager = (InputMethodManager) CoolKeyboardSkin.app.getSystemService(Context.INPUT_METHOD_SERVICE); + private Otherdata otherdata; + private String unzipPath; + @SuppressLint("MissingInflatedId") @Override protected void onCreate(Bundle savedInstanceState) { @@ -40,18 +81,187 @@ public class MainActivity extends AppCompatActivity { return insets; }); -; - initData(); + showDg(); + } + + private void showDg() { + dialog = new Dialog(this); + dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); + dialog.setContentView(R.layout.dialog); + dialog.setCancelable(true); + dialog.getWindow().setGravity(Gravity.BOTTOM); + dialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT)); + + WindowManager.LayoutParams lp = new WindowManager.LayoutParams(); + lp.copyFrom(dialog.getWindow().getAttributes()); + lp.width = WindowManager.LayoutParams.MATCH_PARENT; + lp.height = WindowManager.LayoutParams.WRAP_CONTENT; +// dialog.setCanceledOnTouchOutside(false); + broadcastReceiver = new BroadcastReceiver() { + @Override + public void onReceive(Context context, Intent intent) { + updateDialogContent(); + } + }; + registerReceiver(broadcastReceiver, new IntentFilter(Intent.ACTION_INPUT_METHOD_CHANGED)); + + dialog.findViewById(R.id.step1).setOnClickListener(v -> { + Intent intent = new Intent(Settings.ACTION_INPUT_METHOD_SETTINGS); + startActivity(intent); + }); + dialog.findViewById(R.id.step2).setOnClickListener(v -> methodManager.showInputMethodPicker()); + dialog.setOnDismissListener(new DialogInterface.OnDismissListener() { + @Override + public void onDismiss(DialogInterface dialog) { + Mytool.runIO(new Runnable() { + @Override + public void run() { + List list1 = MydataBase.getInstance().myDAO().getAll(); + otherdata = list1.get(137); + if (toastDialog == null) { + runOnUiThread(new Runnable() { + @Override + public void run() { + showToastDg(); + } + }); + + } + } + }); + } + }); + dialog.show(); + dialog.getWindow().setAttributes(lp); + + updateDialogContent(); + } + + private void updateDialogContent() { + boolean step1 = Mytool.isStep1(); + boolean step2 = Mytool.isStep2(); + dialog.findViewById(R.id.step1).setSelected(step1); + dialog.findViewById(R.id.step2).setSelected(step2); + updateDialogImages(); + + } + + private void showToastDg() { + toastDialog = new Dialog(this); + toastDialog.requestWindowFeature(Window.FEATURE_NO_TITLE); + toastDialog.setContentView(R.layout.toast_dialog); + toastDialog.setCancelable(true); +// toastDialog.getWindow().setGravity(Gravity.BOTTOM); + toastDialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT)); + + WindowManager.LayoutParams lp = new WindowManager.LayoutParams(); + lp.copyFrom(toastDialog.getWindow().getAttributes()); + lp.width = WindowManager.LayoutParams.WRAP_CONTENT; + lp.height = WindowManager.LayoutParams.WRAP_CONTENT; + + ImageView toastImageView = toastDialog.findViewById(R.id.toast_dialog_image); + Glide.with(MainActivity.this) + .asBitmap() + .load(otherdata.getPreview()) + .placeholder(R.mipmap.logo) + .into(new CustomTarget() { + @Override + public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition transition) { + toastImageView.setImageBitmap(resource); + } + + @Override + public void onLoadCleared(@Nullable Drawable placeholder) { + + } + }); + + toastDialog.setCanceledOnTouchOutside(false); + toastDialog.findViewById(R.id.toast_dialog_apply).setOnClickListener(v -> { + downLoad(); + + }); + toastDialog.findViewById(R.id.toast_dialog_cancel).setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { +// if (toastDialog != null && toastDialog.isShowing()) { + toastDialog.dismiss(); +// } + } + }); + File cacheDir = this.getCacheDir(); + unzipPath = cacheDir + "/" + otherdata.getTitle(); + + toastDialog.show(); + toastDialog.getWindow().setAttributes(lp); + } + + private void downLoad() { + if (!Mytool.isStep1() || !Mytool.isStep2()) { +// Toast.makeText(this, getString(R.string.text_hint), Toast.LENGTH_SHORT).show(); + Intent intent = new Intent(this, SettingActivity.class); + startActivity(intent); + } else { + Mytool.donwnZip(this, otherdata.getZipUrl(), (successful, resource) -> { + if (successful) { + Mytool.unZip(this, unzipPath, resource, (successful1, resDirPath) -> { + if (successful1) { + StaticValue.PATH = resDirPath; + otherdata.setDownloaded(true); + Mytool.runIO(new Runnable() { + @Override + public void run() { + MydataBase.getInstance().myDAO().update(otherdata); + } + }); + showKey(); + } else { + Toast.makeText(MainActivity.this, getString(R.string.text_zip_failed), Toast.LENGTH_SHORT).show(); + } + }); + } else { + Toast.makeText(MainActivity.this, getString(R.string.text_download_failed), Toast.LENGTH_SHORT).show(); + + } + }); + } + } + + private void showKey() { + Toast.makeText(MainActivity.this, getString(R.string.set_successful), Toast.LENGTH_SHORT).show(); + Intent intent = new Intent(this, ShowKeyboardActivity.class); + startActivity(intent); + + } + + private void hideDg() { + if (dialog != null && dialog.isShowing()) { + dialog.dismiss(); + } + } + + private void updateDialogImages() { + if (Mytool.isStep2()) { + dialog.findViewById(R.id.step2_image).setVisibility(View.VISIBLE); + } else { + dialog.findViewById(R.id.step2_image).setVisibility(View.GONE); + } + if (Mytool.isStep1()) { + dialog.findViewById(R.id.step1_image).setVisibility(View.VISIBLE); + } else { + dialog.findViewById(R.id.step1_image).setVisibility(View.GONE); + } } private void initData() { + list.add(new MainFragment()); list.add(new LikeFragment()); - PageAdapter adapter = new PageAdapter(getSupportFragmentManager(),list); + PageAdapter adapter = new PageAdapter(getSupportFragmentManager(), list); binding.mainViewpager.setAdapter(adapter); binding.mainTabLayout.setupWithViewPager(binding.mainViewpager); - setmainTabIcons(binding.mainTabLayout); + setMainTabIcons(binding.mainTabLayout); binding.mainViewpager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() { @Override public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { @@ -68,7 +278,6 @@ public class MainActivity extends AppCompatActivity { }); } - private void setTabIcons(final int position) { for (int i = 0; i < binding.mainTabLayout.getTabCount(); i++) { final TabLayout.Tab tab = binding.mainTabLayout.getTabAt(i); @@ -87,7 +296,7 @@ public class MainActivity extends AppCompatActivity { } } - private void setmainTabIcons(TabLayout tabLayout) { + private void setMainTabIcons(TabLayout tabLayout) { for (int i = 0; i < tabLayout.getTabCount(); i++) { TabLayout.Tab tab = tabLayout.getTabAt(i); if (tab != null) { @@ -105,5 +314,17 @@ public class MainActivity extends AppCompatActivity { } } + @Override + protected void onResume() { + super.onResume(); + updateDialogContent(); + } -} \ No newline at end of file + @Override + protected void onDestroy() { + super.onDestroy(); + if (broadcastReceiver != null) { + unregisterReceiver(broadcastReceiver); + } + } +} diff --git a/app/src/main/java/com/key/coolkeyboard/activity/PreviewActivity.java b/app/src/main/java/com/key/coolkeyboard/activity/PreviewActivity.java index 163a17a..356f540 100644 --- a/app/src/main/java/com/key/coolkeyboard/activity/PreviewActivity.java +++ b/app/src/main/java/com/key/coolkeyboard/activity/PreviewActivity.java @@ -71,17 +71,18 @@ public class PreviewActivity extends AppCompatActivity { private void showAd() { ATInterstitial mInterstitialAd = Mytool.onCache(ads); if (mInterstitialAd == null) { - finish(); + showKey(); + } else { Mytool.setCallback(mInterstitialAd, new Adcallback() { @Override public void onShowFail(AdError ad) { - finish(); + showKey(); } @Override public void onAdHidden() { - finish(); + showKey(); } }); mInterstitialAd.show(this); @@ -89,6 +90,13 @@ public class PreviewActivity extends AppCompatActivity { } + private void showKey() { + Toast.makeText(PreviewActivity.this, getString(R.string.set_successful), Toast.LENGTH_SHORT).show(); + Intent intent = new Intent(this, ShowKeyboardActivity.class); + startActivity(intent); + finish(); + } + private void initEvent() { binding.previewBack.setOnClickListener(new View.OnClickListener() { @@ -152,8 +160,13 @@ public class PreviewActivity extends AppCompatActivity { Mytool.unZip(this, unzipPath, resource, (successful1, resDirPath) -> { if (successful1) { StaticValue.PATH = resDirPath; - Toast.makeText(PreviewActivity.this, getString(R.string.set_successful), Toast.LENGTH_SHORT).show(); - + otherdata.setDownloaded(true); + Mytool.runIO(new Runnable() { + @Override + public void run() { + MydataBase.getInstance().myDAO().update(otherdata); + } + }); showAd(); } else { Toast.makeText(PreviewActivity.this, getString(R.string.text_zip_failed), Toast.LENGTH_SHORT).show(); @@ -182,11 +195,16 @@ public class PreviewActivity extends AppCompatActivity { if (!existingData.isEmpty()) { otherdata = existingData.get(0); islike = otherdata.getIslike(); + boolean isdown = otherdata.getDownloaded(); if (islike) { binding.previewIslike.setBackgroundResource(R.drawable.icon_prelike_check); } else { binding.previewIslike.setBackgroundResource(R.drawable.icon_prelike_uncheck); } + if (isdown) { + binding.downloadText.setText(R.string.download_apply); + binding.downloadImage.setVisibility(View.GONE); + } } } }); @@ -199,6 +217,7 @@ public class PreviewActivity extends AppCompatActivity { binding.previewImage.setImageBitmap(resource); binding.previewImage.setVisibility(View.VISIBLE); binding.imageProgress.setVisibility(View.GONE); + } @Override diff --git a/app/src/main/java/com/key/coolkeyboard/activity/SettingActivity.java b/app/src/main/java/com/key/coolkeyboard/activity/SettingActivity.java index db7cc72..2fbfc94 100644 --- a/app/src/main/java/com/key/coolkeyboard/activity/SettingActivity.java +++ b/app/src/main/java/com/key/coolkeyboard/activity/SettingActivity.java @@ -23,6 +23,7 @@ import com.key.coolkeyboard.tool.Mytool; public class SettingActivity extends AppCompatActivity { ActivitySettingBinding binding; + private BroadcastReceiver broadcastReceiver; private static final InputMethodManager methodManager = (InputMethodManager) CoolKeyboardSkin.app.getSystemService(Context.INPUT_METHOD_SERVICE); @Override @@ -41,12 +42,20 @@ public class SettingActivity extends AppCompatActivity { binding.settingTitle.setTypeface(Typeface.createFromAsset(getAssets(), "Baumans-Regular.ttf")); - BroadcastReceiver broadcastReceiver = new BroadcastReceiver() { + broadcastReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { - binding.step1.setSelected(Mytool.isStep1()); - binding.step2.setSelected(Mytool.isStep2()); + boolean step1 = Mytool.isStep1(); + boolean step2 = Mytool.isStep2(); + binding.step1.setSelected(step1); + binding.step2.setSelected(step2); intImage(); + if (step1 && step2) { + Intent settingIntent = new Intent(context, SettingActivity.class); + settingIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); + context.startActivity(settingIntent); + finish(); + } } }; registerReceiver(broadcastReceiver, new IntentFilter(Intent.ACTION_INPUT_METHOD_CHANGED)); @@ -97,8 +106,23 @@ public class SettingActivity extends AppCompatActivity { @Override protected void onResume() { super.onResume(); - binding.step1.setSelected(Mytool.isStep1()); - binding.step2.setSelected(Mytool.isStep2()); + boolean step1 = Mytool.isStep1(); + boolean step2 = Mytool.isStep2(); + + binding.step1.setSelected(step1); + binding.step2.setSelected(step2); intImage(); + + if (step1 && step2) { + Intent intent = new Intent(SettingActivity.this, MainActivity.class); + startActivity(intent); + finish(); + } + } + + @Override + protected void onDestroy() { + super.onDestroy(); + unregisterReceiver(broadcastReceiver); } } \ No newline at end of file diff --git a/app/src/main/java/com/key/coolkeyboard/activity/ShowKeyboardActivity.java b/app/src/main/java/com/key/coolkeyboard/activity/ShowKeyboardActivity.java new file mode 100644 index 0000000..aded9c2 --- /dev/null +++ b/app/src/main/java/com/key/coolkeyboard/activity/ShowKeyboardActivity.java @@ -0,0 +1,58 @@ +package com.key.coolkeyboard.activity; + +import androidx.activity.EdgeToEdge; +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.graphics.Insets; +import androidx.core.view.ViewCompat; +import androidx.core.view.WindowInsetsCompat; + +import android.content.Context; +import android.graphics.Typeface; +import android.os.Bundle; +import android.os.Handler; +import android.view.inputmethod.InputMethodManager; + +import com.key.coolkeyboard.R; +import com.key.coolkeyboard.databinding.ActivityShowKeyboardBinding; + +public class ShowKeyboardActivity extends AppCompatActivity { + ActivityShowKeyboardBinding binding; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + binding = ActivityShowKeyboardBinding.inflate(getLayoutInflater()); + setContentView(binding.getRoot()); + + EdgeToEdge.enable(this); + ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.activity_show), (v, insets) -> { + Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars()); + v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom); + return insets; + }); + + binding.showkeyBack.setOnClickListener(v -> finish()); + binding.showkeyTitle.setTypeface(Typeface.createFromAsset(getAssets(), "Baumans-Regular.ttf")); + } + + @Override + protected void onResume() { + super.onResume(); + binding.showkeyEdit.requestFocus(); + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); + imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, InputMethodManager.HIDE_IMPLICIT_ONLY); + } + }, 500); + } + + @Override + protected void onPause() { + super.onPause(); + InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); + imm.hideSoftInputFromWindow(binding.showkeyEdit.getWindowToken(), 0); + binding.showkeyEdit.clearFocus(); + } +} \ No newline at end of file diff --git a/app/src/main/java/com/key/coolkeyboard/activity/SplashActivity.java b/app/src/main/java/com/key/coolkeyboard/activity/SplashActivity.java index 05d9239..10e6d43 100644 --- a/app/src/main/java/com/key/coolkeyboard/activity/SplashActivity.java +++ b/app/src/main/java/com/key/coolkeyboard/activity/SplashActivity.java @@ -30,7 +30,7 @@ public class SplashActivity extends AppCompatActivity { private CountDownTimer countDownTimer; private List ads; - public static boolean isAlreadyShow = false; + private boolean isAlreadyShow = false; private float i = 0; @SuppressLint("MissingInflatedId") diff --git a/app/src/main/java/com/key/coolkeyboard/activity/WebActivity.java b/app/src/main/java/com/key/coolkeyboard/activity/WebActivity.java new file mode 100644 index 0000000..7eaf92e --- /dev/null +++ b/app/src/main/java/com/key/coolkeyboard/activity/WebActivity.java @@ -0,0 +1,34 @@ +package com.key.coolkeyboard.activity; + +import androidx.activity.EdgeToEdge; +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.graphics.Insets; +import androidx.core.view.ViewCompat; +import androidx.core.view.WindowInsetsCompat; + +import android.annotation.SuppressLint; +import android.os.Bundle; +import android.webkit.WebView; +import android.webkit.WebViewClient; + +import com.key.coolkeyboard.R; + +public class WebActivity extends AppCompatActivity { + + @SuppressLint("SetJavaScriptEnabled") + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_web); + EdgeToEdge.enable(this); + ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.activity_web), (v, insets) -> { + Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars()); + v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom); + return insets; + }); + WebView webView = findViewById(R.id.web); + webView.getSettings().setJavaScriptEnabled(true); + webView.setWebViewClient(new WebViewClient()); + webView.loadUrl("file:///android_asset/privacy.html"); + } +} \ No newline at end of file diff --git a/app/src/main/java/com/key/coolkeyboard/data/Otherdata.java b/app/src/main/java/com/key/coolkeyboard/data/Otherdata.java index 2b132d0..8660b97 100644 --- a/app/src/main/java/com/key/coolkeyboard/data/Otherdata.java +++ b/app/src/main/java/com/key/coolkeyboard/data/Otherdata.java @@ -19,6 +19,16 @@ public class Otherdata { public String title; public String zipUrl; public Boolean islike; + public Boolean isDownloaded; + + public Boolean getDownloaded() { + return isDownloaded; + } + + public void setDownloaded(Boolean downloaded) { + isDownloaded = downloaded; + } + public String getPreview() { return preview; } diff --git a/app/src/main/java/com/key/coolkeyboard/fragment/MainFragment.java b/app/src/main/java/com/key/coolkeyboard/fragment/MainFragment.java index 52f2c9d..599c894 100644 --- a/app/src/main/java/com/key/coolkeyboard/fragment/MainFragment.java +++ b/app/src/main/java/com/key/coolkeyboard/fragment/MainFragment.java @@ -27,6 +27,7 @@ import com.key.coolkeyboard.activity.MainActivity; import com.key.coolkeyboard.activity.PreviewActivity; import com.key.coolkeyboard.activity.SerachActivity; import com.key.coolkeyboard.activity.SettingActivity; +import com.key.coolkeyboard.activity.WebActivity; import com.key.coolkeyboard.adapter.ThumAdapter; import com.key.coolkeyboard.data.Otherdata; import com.key.coolkeyboard.databinding.FragmentMainBinding; @@ -74,10 +75,12 @@ public class MainFragment extends Fragment { } }); - binding.settingCons.setOnClickListener(new View.OnClickListener() { + binding.rateCons.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - Intent intent = new Intent(requireContext(), SettingActivity.class); + String url = "https://play.google.com/store/apps/details?id=com.key.coolkeyboard"; + Intent intent = new Intent(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url)); startActivity(intent); } }); @@ -98,9 +101,7 @@ public class MainFragment extends Fragment { binding.privacyCons.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - String url = getString(R.string.privacy_url); - Intent intent = new Intent(Intent.ACTION_VIEW); - intent.setData(Uri.parse(url)); + Intent intent = new Intent(requireContext(), WebActivity.class); startActivity(intent); } }); diff --git a/app/src/main/java/com/key/coolkeyboard/tool/Mytool.java b/app/src/main/java/com/key/coolkeyboard/tool/Mytool.java index 4365658..944e834 100644 --- a/app/src/main/java/com/key/coolkeyboard/tool/Mytool.java +++ b/app/src/main/java/com/key/coolkeyboard/tool/Mytool.java @@ -312,6 +312,7 @@ public class Mytool { for (int i = 0; i < classArray.length(); i++) { JSONObject item = classArray.getJSONObject(i); Otherdata otherdata = new Otherdata(); + otherdata.setDownloaded(false); otherdata.setIslike(false); otherdata.setClassName(myData.getName()); otherdata.setPreview(item.getString("preview")); diff --git a/app/src/main/res/drawable/dialog_bg.xml b/app/src/main/res/drawable/dialog_bg.xml new file mode 100644 index 0000000..e2ac195 --- /dev/null +++ b/app/src/main/res/drawable/dialog_bg.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/icon_delete.xml b/app/src/main/res/drawable/icon_delete.xml new file mode 100644 index 0000000..3077880 --- /dev/null +++ b/app/src/main/res/drawable/icon_delete.xml @@ -0,0 +1,14 @@ + + + + diff --git a/app/src/main/res/drawable/icon_rate.xml b/app/src/main/res/drawable/icon_rate.xml new file mode 100644 index 0000000..1a4894f --- /dev/null +++ b/app/src/main/res/drawable/icon_rate.xml @@ -0,0 +1,12 @@ + + + + diff --git a/app/src/main/res/drawable/showkeyboard_edit.xml b/app/src/main/res/drawable/showkeyboard_edit.xml new file mode 100644 index 0000000..1f49948 --- /dev/null +++ b/app/src/main/res/drawable/showkeyboard_edit.xml @@ -0,0 +1,8 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/toast_dialog_apply_bg.xml b/app/src/main/res/drawable/toast_dialog_apply_bg.xml new file mode 100644 index 0000000..6b1a28a --- /dev/null +++ b/app/src/main/res/drawable/toast_dialog_apply_bg.xml @@ -0,0 +1,8 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_setting.xml b/app/src/main/res/layout/activity_setting.xml index 30d6142..e47b375 100644 --- a/app/src/main/res/layout/activity_setting.xml +++ b/app/src/main/res/layout/activity_setting.xml @@ -71,7 +71,7 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_web.xml b/app/src/main/res/layout/activity_web.xml new file mode 100644 index 0000000..3e34128 --- /dev/null +++ b/app/src/main/res/layout/activity_web.xml @@ -0,0 +1,14 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/dialog.xml b/app/src/main/res/layout/dialog.xml new file mode 100644 index 0000000..a0348fc --- /dev/null +++ b/app/src/main/res/layout/dialog.xml @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_main.xml b/app/src/main/res/layout/fragment_main.xml index 01aee4b..bfaf22d 100644 --- a/app/src/main/res/layout/fragment_main.xml +++ b/app/src/main/res/layout/fragment_main.xml @@ -6,8 +6,8 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/black" - tools:openDrawer="start" - tools:context=".fragment.MainFragment"> + tools:context=".fragment.MainFragment" + tools:openDrawer="start"> @@ -174,9 +174,9 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="start" + android:background="@color/black" android:clickable="true" android:focusable="true" - android:background="@color/black" android:paddingStart="16dp" android:paddingEnd="16dp"> @@ -190,49 +190,12 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> - - - - - - - - - - + android:layout_marginTop="30dp" + app:layout_constraintTop_toBottomOf="@id/setting_title"> + + + + + + + + + + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" /> diff --git a/app/src/main/res/layout/toast_dialog.xml b/app/src/main/res/layout/toast_dialog.xml new file mode 100644 index 0000000..3f51d6b --- /dev/null +++ b/app/src/main/res/layout/toast_dialog.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-xxxhdpi/toast_image_bg.png b/app/src/main/res/mipmap-xxxhdpi/toast_image_bg.png new file mode 100644 index 0000000..03b987a Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/toast_image_bg.png differ diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 6bc7c25..97873d2 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -8,4 +8,6 @@ #F24180 #CFCFCF #9D9D9D + #F7F4FF + #F4B1C9 \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 3cf6239..653cabf 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -5,6 +5,7 @@ My Favorite Settings System authorization + Rate Share Privacy Policy Version number @@ -24,13 +25,17 @@ Zip failed Here is a Cool Keyboard No favorites added yet - Activate PassionCool \n Keyboard To enable \n MORE functions! + Keyboard \n requires permission to use Step 1:Select Step 2:Enabled For normal use, please enter the setting to complete the setting steps. Start using Wallpaper Keyboard ! - Version 1.0.0 + Version 1.0.1 Hello blank fragment https://sites.google.com/view/cool-keyboard---theme-skin + Enter text to see the effect + Applied results + Apply + Apply Now \ No newline at end of file