This commit is contained in:
ocean 2026-01-07 18:42:20 +08:00
parent 1ae2a9d552
commit 8c8f04cc17
3 changed files with 16 additions and 13 deletions

View File

@ -19,8 +19,8 @@ android {
applicationId = "com.keyborad.theme.trendyborad" applicationId = "com.keyborad.theme.trendyborad"
minSdk = 24 minSdk = 24
targetSdk = 36 targetSdk = 36
versionCode = 6 versionCode = 7
versionName = "1.5" versionName = "1.6"
setProperty( setProperty(
"archivesBaseName", "archivesBaseName",
"TrendyBoard-" + versionName + "(${versionCode})_$timestamp" "TrendyBoard-" + versionName + "(${versionCode})_$timestamp"

View File

@ -45,10 +45,11 @@ public class TrendyMyInputMethodService extends InputMethodService implements Tr
private VideoView videoView; private VideoView videoView;
private int a = R.xml.xml_one; private int a = R.xml.xml_one;
private int b= R.xml.xml_two; private int b = R.xml.xml_two;
private int c = R.xml.xml_three; private int c = R.xml.xml_three;
private int curImeAction = EditorInfo.IME_ACTION_UNSPECIFIED; private int curImeAction = EditorInfo.IME_ACTION_UNSPECIFIED;
@SuppressLint("InflateParams") @SuppressLint("InflateParams")
@Override @Override
public View onCreateInputView() { public View onCreateInputView() {
@ -73,7 +74,7 @@ public class TrendyMyInputMethodService extends InputMethodService implements Tr
@Override @Override
public void onWindowHidden() { public void onWindowHidden() {
super.onWindowHidden(); super.onWindowHidden();
if(videoView.isPlaying()){ if (videoView.isPlaying()) {
videoView.pause(); videoView.pause();
} }
@ -86,18 +87,18 @@ public class TrendyMyInputMethodService extends InputMethodService implements Tr
curImeAction = TrendyCommon.INSTANCE.getTextForImeAction(currentInputEditorInfo.imeOptions); curImeAction = TrendyCommon.INSTANCE.getTextForImeAction(currentInputEditorInfo.imeOptions);
String skinPath = TrendySaveCurrentTheme.INSTANCE.getSkinPath(); String skinPath = TrendySaveCurrentTheme.INSTANCE.getSkinPath();
if(skinPath == null || skinPath.isEmpty()){ if (skinPath == null || skinPath.isEmpty()) {
Log.d(TrendyApp.TAG, "---------skinPath= bull"); Log.d(TrendyApp.TAG, "---------skinPath= bull");
myKeyBoardView.updateUi(curImeAction); myKeyBoardView.updateUi(curImeAction);
}else { } else {
Log.d(TrendyApp.TAG, "---------skinPath= 1111"); Log.d(TrendyApp.TAG, "---------skinPath= 1111");
com.keyborad.theme.trendyborad.trendykeyboardhelper.TrendyKeyFunctions.INSTANCE.readBgOrVideo(this, new Function2<String, Drawable, Unit>() { com.keyborad.theme.trendyborad.trendykeyboardhelper.TrendyKeyFunctions.INSTANCE.readBgOrVideo(this, new Function2<String, Drawable, Unit>() {
@Override @Override
public Unit invoke(String s, Drawable drawable) { public Unit invoke(String s, Drawable drawable) {
Log.d(TrendyApp.TAG, "---------s= "+s+"---------drawable="+drawable); Log.d(TrendyApp.TAG, "---------s= " + s + "---------drawable=" + drawable);
if (s != null) { if (s != null) {
myKeyBoardView.setBackground(null); myKeyBoardView.setBackground(null);
if(s.endsWith(".gif")){ if (s.endsWith(".gif")) {
imBG.setVisibility(View.VISIBLE); imBG.setVisibility(View.VISIBLE);
videoView.setVisibility(View.GONE); videoView.setVisibility(View.GONE);
Glide.with(TrendyMyInputMethodService.this) Glide.with(TrendyMyInputMethodService.this)
@ -115,8 +116,8 @@ public class TrendyMyInputMethodService extends InputMethodService implements Tr
} }
return false; return false;
} }
}).into(imBG) ; }).into(imBG);
}else if(s.endsWith(".mp4")){ } else if (s.endsWith(".mp4")) {
imBG.setVisibility(View.GONE); imBG.setVisibility(View.GONE);
videoView.setVisibility(View.VISIBLE); videoView.setVisibility(View.VISIBLE);
videoView.setVideoPath(s); videoView.setVideoPath(s);
@ -144,7 +145,9 @@ public class TrendyMyInputMethodService extends InputMethodService implements Tr
@Override @Override
public void onDestroy() { public void onDestroy() {
super.onDestroy(); super.onDestroy();
videoView.stopPlayback(); if (videoView != null) {
videoView.stopPlayback();
}
} }
@Override @Override

View File

@ -1,6 +1,6 @@
<resources xmlns:tools="http://schemas.android.com/tools"> <resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. --> <!-- Base application theme. -->
<style name="MyKeyBoard" beanWrapper="Theme.MaterialComponents.DayNight.NoActionBar"> <style name="MyKeyBoard" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<!-- Primary brand color. --> <!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_200</item> <item name="colorPrimary">@color/purple_200</item>
<item name="colorPrimaryVariant">@color/purple_700</item> <item name="colorPrimaryVariant">@color/purple_700</item>