diff --git a/app/WallpaperKeyboard.jks b/app/WallpaperKeyboard.jks new file mode 100644 index 0000000..f8572d6 Binary files /dev/null and b/app/WallpaperKeyboard.jks differ diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 481bb43..e0cd407 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -18,4 +18,19 @@ # If you keep the line number information, uncomment this to # hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file +#-renamesourcefileattribute SourceFile + +-keepclassmembers class com.keyboard.wallpaperkeyboard.MyApplication { + public static final java.lang.String DB_NAME; + public static final int DB_VERSION; +} + +-keepclassmembers class * { + @androidx.room.Query ; +} +-keep class com.keyboard.wallpaperkeyboard.data.database.AppDatabase { *; } +-keep class com.keyboard.wallpaperkeyboard.data.entity.WallpaperEntity { *; } +-keep class com.keyboard.wallpaperkeyboard.data.dao.WallpaperEntityDao { *; } + +-keep class com.omicronapplications.** { *; } +-keep class net.sf.sevenzipjbinding.** { *; } \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 2cc81ea..f57b18c 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -23,13 +23,13 @@ android:name=".ui.activity.WallpaperActivity" android:exported="false" /> diff --git a/app/src/main/java/com/keyboard/wallpaperkeyboard/data/dao/WallpaperEntityDao.java b/app/src/main/java/com/keyboard/wallpaperkeyboard/data/dao/WallpaperEntityDao.java index 12bf49c..29e793d 100644 --- a/app/src/main/java/com/keyboard/wallpaperkeyboard/data/dao/WallpaperEntityDao.java +++ b/app/src/main/java/com/keyboard/wallpaperkeyboard/data/dao/WallpaperEntityDao.java @@ -28,4 +28,7 @@ public interface WallpaperEntityDao { @Query("SELECT * FROM WallpaperEntity WHERE className = :name") LiveData> getCategoryByName(String name); + + @Query("SELECT * FROM WallpaperEntity LIMIT :limit OFFSET :offset") + LiveData> getRecommended(int limit, int offset); } diff --git a/app/src/main/java/com/keyboard/wallpaperkeyboard/data/repository/PathRepository.java b/app/src/main/java/com/keyboard/wallpaperkeyboard/data/repository/WallpaperPathRepository.java similarity index 72% rename from app/src/main/java/com/keyboard/wallpaperkeyboard/data/repository/PathRepository.java rename to app/src/main/java/com/keyboard/wallpaperkeyboard/data/repository/WallpaperPathRepository.java index f7a9b38..8aa8363 100644 --- a/app/src/main/java/com/keyboard/wallpaperkeyboard/data/repository/PathRepository.java +++ b/app/src/main/java/com/keyboard/wallpaperkeyboard/data/repository/WallpaperPathRepository.java @@ -1,12 +1,14 @@ package com.keyboard.wallpaperkeyboard.data.repository; -public class PathRepository { +public class WallpaperPathRepository { public static String NORMAL_KEY_BACKGROUND = "btn_keyboard_key_normal_normal.9.png"; public static String ACTION_KEY_BACKGROUND = "btn_keyboard_key_functional_normal.9.png"; + public static String SPACE_KEY_BACKGROUND = "btn_keyboard_spacekey_normal_normal.9.png"; public static String DELETE_ICON = "sym_keyboard_delete_normal.png"; public static String SHIFT_ICON = "sym_keyboard_shift.png"; public static String SHIFT_LOCK_ICON = "sym_keyboard_shift_locked.png"; public static String RETURN_ICON = "sym_keyboard_return_normal.png"; + public static String SPACE_ICON = "sym_keyboard_space_led.9.png"; } diff --git a/app/src/main/java/com/keyboard/wallpaperkeyboard/data/repository/WallpaperRepository.java b/app/src/main/java/com/keyboard/wallpaperkeyboard/data/repository/WallpaperRepository.java index d3d7e8a..105b1cc 100644 --- a/app/src/main/java/com/keyboard/wallpaperkeyboard/data/repository/WallpaperRepository.java +++ b/app/src/main/java/com/keyboard/wallpaperkeyboard/data/repository/WallpaperRepository.java @@ -37,4 +37,8 @@ public class WallpaperRepository { public LiveData> getCategoryByName(String name) { return wallpaperEntityDao.getCategoryByName(name); } + + public LiveData> getRecommended(int limit, int offset) { + return wallpaperEntityDao.getRecommended(limit, offset); + } } diff --git a/app/src/main/java/com/keyboard/wallpaperkeyboard/inputmethod/keyboardthem/WallpaperKeyboardThem.java b/app/src/main/java/com/keyboard/wallpaperkeyboard/inputmethod/keyboardthem/WallpaperKeyboardThem.java index ff3867e..6448e73 100644 --- a/app/src/main/java/com/keyboard/wallpaperkeyboard/inputmethod/keyboardthem/WallpaperKeyboardThem.java +++ b/app/src/main/java/com/keyboard/wallpaperkeyboard/inputmethod/keyboardthem/WallpaperKeyboardThem.java @@ -11,9 +11,10 @@ import android.util.Xml; import androidx.core.content.ContextCompat; +import com.keyboard.wallpaperkeyboard.MyApplication; import com.keyboard.wallpaperkeyboard.R; -import com.keyboard.wallpaperkeyboard.data.repository.PathRepository; -import com.keyboard.wallpaperkeyboard.util.EnhancedFileUtil; +import com.keyboard.wallpaperkeyboard.data.repository.WallpaperPathRepository; +import com.keyboard.wallpaperkeyboard.util.EnhancedFileUtils; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; @@ -25,10 +26,12 @@ import java.io.StringReader; public class WallpaperKeyboardThem { private Drawable actionBackgroundDrawable; private Drawable normalBackgroundDrawable; + private Drawable spaceBackgroundDrawable; private Drawable shiftIconDrawable; private Drawable shiftLockIconDrawable; private Drawable deleteIconDrawable; private Drawable returnIconDrawable; + private Drawable spaceIconDrawable; private Drawable backgroundDrawable; private int normalKeyColor; @@ -37,17 +40,19 @@ public class WallpaperKeyboardThem { private static final String COLOR_NORMAL_KEY_TEXT = "key_text_color_normal"; private static final String COLOR_ACTION_KEY_TEXT = "key_text_color_functional"; - private static final int DEFAULT_SHIFT_ICON = android.R.drawable.stat_sys_upload; - private static final int DEFAULT_SHIFT_LOCK_ICON = android.R.drawable.stat_sys_upload; - private static final int DEFAULT_DELETE_ICON = android.R.drawable.ic_input_delete; - private static final int DEFAULT_RETURN_ICON = android.R.drawable.screen_background_light_transparent; - private static final int DEFAULT_BACKGROUND_COLOR = R.color.black; + private static final int DEFAULT_SHIFT_ICON = R.drawable.shift; + private static final int DEFAULT_SHIFT_LOCK_ICON = R.drawable.shift_lock; + private static final int DEFAULT_DELETE_ICON = R.drawable.delete; + private static final int DEFAULT_RETURN_ICON = R.drawable.return_back; + private static final int DEFAULT_SPACE_ICON = R.drawable.space; + private static final int DEFAULT_BACKGROUND_COLOR = R.color.soft_black; public WallpaperKeyboardThem(Context context) { shiftIconDrawable = ContextCompat.getDrawable(context, DEFAULT_SHIFT_ICON); shiftLockIconDrawable = ContextCompat.getDrawable(context, DEFAULT_SHIFT_LOCK_ICON); deleteIconDrawable = ContextCompat.getDrawable(context, DEFAULT_DELETE_ICON); returnIconDrawable = ContextCompat.getDrawable(context, DEFAULT_RETURN_ICON); + spaceIconDrawable = ContextCompat.getDrawable(context, DEFAULT_SPACE_ICON); backgroundDrawable = ContextCompat.getDrawable(context, DEFAULT_BACKGROUND_COLOR); normalKeyColor = ContextCompat.getColor(context, R.color.white); actionKeyColor = normalKeyColor; @@ -65,6 +70,10 @@ public class WallpaperKeyboardThem { return normalBackgroundDrawable; } + public Drawable getSpaceBackgroundDrawable() { + return spaceBackgroundDrawable; + } + public Drawable getDeleteIconDrawable() { return deleteIconDrawable; } @@ -77,6 +86,10 @@ public class WallpaperKeyboardThem { return returnIconDrawable; } + public Drawable getSpaceIconDrawable() { + return spaceIconDrawable; + } + public Drawable getShiftLockIconDrawable() { return shiftLockIconDrawable; } @@ -94,12 +107,14 @@ public class WallpaperKeyboardThem { if (!resDirPath.isEmpty()) { updateKeyColors(resDirPath); backgroundDrawable = getKeyboardBackground(con, resDirPath); - returnIconDrawable = getDrawableForKeyBackground(con, resDirPath, PathRepository.RETURN_ICON); - normalBackgroundDrawable = getDrawableForKeyBackground(con, resDirPath, PathRepository.NORMAL_KEY_BACKGROUND); - actionBackgroundDrawable = getDrawableForKeyBackground(con, resDirPath, PathRepository.ACTION_KEY_BACKGROUND); - deleteIconDrawable = getDrawableForKeyBackground(con, resDirPath, PathRepository.DELETE_ICON); - shiftIconDrawable = getDrawableForKeyBackground(con, resDirPath, PathRepository.SHIFT_ICON); - shiftLockIconDrawable = getDrawableForKeyBackground(con, resDirPath, PathRepository.SHIFT_LOCK_ICON); + normalBackgroundDrawable = getDrawableForKeyBackground(con, resDirPath, WallpaperPathRepository.NORMAL_KEY_BACKGROUND); + actionBackgroundDrawable = getDrawableForKeyBackground(con, resDirPath, WallpaperPathRepository.ACTION_KEY_BACKGROUND); + spaceBackgroundDrawable = getDrawableForKeyBackground(con, resDirPath, WallpaperPathRepository.SPACE_KEY_BACKGROUND); + returnIconDrawable = getDrawableForKeyBackground(con, resDirPath, WallpaperPathRepository.RETURN_ICON); + spaceIconDrawable = getDrawableForKeyBackground(con, resDirPath, WallpaperPathRepository.SPACE_ICON); + deleteIconDrawable = getDrawableForKeyBackground(con, resDirPath, WallpaperPathRepository.DELETE_ICON); + shiftIconDrawable = getDrawableForKeyBackground(con, resDirPath, WallpaperPathRepository.SHIFT_ICON); + shiftLockIconDrawable = getDrawableForKeyBackground(con, resDirPath, WallpaperPathRepository.SHIFT_LOCK_ICON); } } @@ -118,13 +133,12 @@ public class WallpaperKeyboardThem { File colorXmlFile = new File(colorXmlPath); if (!colorXmlFile.exists()) { - Log.w("updateKeyColors", "File not found: " + colorXmlPath); return; } try { XmlPullParser parser = Xml.newPullParser(); - String fileContent = EnhancedFileUtil.readFileToString(colorXmlFile); + String fileContent = EnhancedFileUtils.readFileToString(colorXmlFile); parser.setInput(new StringReader(fileContent)); int eventType = parser.getEventType(); @@ -140,15 +154,12 @@ public class WallpaperKeyboardThem { } else if (COLOR_ACTION_KEY_TEXT.equals(attributeName)) { actionKeyColor = Color.parseColor(colorValue); } - } else { - Log.w("updateKeyColors", "Invalid color value for: " + attributeName); } } } eventType = parser.next(); } - } catch (XmlPullParserException | IOException e) { - Log.e("updateKeyColors", "Error parsing colors XML", e); + } catch (XmlPullParserException | IOException ignored) { } } @@ -161,11 +172,7 @@ public class WallpaperKeyboardThem { } private String getWallpaperPath(Context context) { - SharedPreferences prefs = context.getSharedPreferences("keyboard_info", Context.MODE_PRIVATE); - String path = prefs.getString("wallpaper_path", ""); - if (path.isEmpty()) { - Log.w("KeyboardThemeManager", "Wallpaper path is empty."); - } - return path; + SharedPreferences prefs = context.getSharedPreferences(MyApplication.PREF_NAME, Context.MODE_PRIVATE); + return prefs.getString(MyApplication.KEY_FILE_PATH, ""); } } diff --git a/app/src/main/java/com/keyboard/wallpaperkeyboard/inputmethod/keyboardview/WallpaperKeyboardView.java b/app/src/main/java/com/keyboard/wallpaperkeyboard/inputmethod/keyboardview/WallpaperKeyboardView.java index a4a5be8..d8fedae 100644 --- a/app/src/main/java/com/keyboard/wallpaperkeyboard/inputmethod/keyboardview/WallpaperKeyboardView.java +++ b/app/src/main/java/com/keyboard/wallpaperkeyboard/inputmethod/keyboardview/WallpaperKeyboardView.java @@ -9,11 +9,11 @@ import android.inputmethodservice.KeyboardView; import android.util.AttributeSet; import com.keyboard.wallpaperkeyboard.inputmethod.keyboardthem.WallpaperKeyboardThem; -import com.keyboard.wallpaperkeyboard.util.DrawableUtils; +import com.keyboard.wallpaperkeyboard.util.KeyboardDrawableUtil; import java.util.List; -public class WallpaperKeyboardView extends KeyboardView{ +public class WallpaperKeyboardView extends KeyboardView { private final Paint mPaint; private final WallpaperKeyboardThem wallpaperKeyboardThem; private ShiftState shiftState = ShiftState.NORMAL; @@ -25,7 +25,7 @@ public class WallpaperKeyboardView extends KeyboardView{ super(context, attrs); wallpaperKeyboardThem = new WallpaperKeyboardThem(context); mPaint = new Paint(); - mPaint.setTextSize(DrawableUtils.spToPx(TEXT_SIZE_LARGE, context)); + mPaint.setTextSize(KeyboardDrawableUtil.spToPx(TEXT_SIZE_LARGE, context)); setPreviewEnabled(false); } @@ -44,16 +44,20 @@ public class WallpaperKeyboardView extends KeyboardView{ switch (keyCode) { case Keyboard.KEYCODE_SHIFT: - DrawableUtils.drawKeyIcon(key, getShiftDrawable(), canvas, this); + KeyboardDrawableUtil.drawKeyboardKeyIcon(key, getShiftDrawable(), canvas, this); break; case Keyboard.KEYCODE_DELETE: - DrawableUtils.drawKeyIcon(key, wallpaperKeyboardThem.getDeleteIconDrawable(), canvas, this); + KeyboardDrawableUtil.drawKeyboardKeyIcon(key, wallpaperKeyboardThem.getDeleteIconDrawable(), canvas, this); drawKeyLabel(key, canvas); break; case Keyboard.KEYCODE_DONE: - DrawableUtils.drawKeyIcon(key, wallpaperKeyboardThem.getReturnIconDrawable(), canvas, this); + KeyboardDrawableUtil.drawKeyboardKeyIcon(key, wallpaperKeyboardThem.getReturnIconDrawable(), canvas, this); + break; + + case 32: + KeyboardDrawableUtil.drawKeyboardKeyIcon(key, wallpaperKeyboardThem.getSpaceIconDrawable(), canvas, this); break; default: @@ -79,7 +83,11 @@ public class WallpaperKeyboardView extends KeyboardView{ private Drawable getKeyBackgroundDrawable(int keyCode) { if (isActionKey(keyCode)) { - return wallpaperKeyboardThem.getActionBackgroundDrawable(); + if (keyCode == 32) { + return wallpaperKeyboardThem.getSpaceBackgroundDrawable(); + } else { + return wallpaperKeyboardThem.getActionBackgroundDrawable(); + } } else { return wallpaperKeyboardThem.getNormalBackgroundDrawable(); } @@ -113,7 +121,7 @@ public class WallpaperKeyboardView extends KeyboardView{ float yPos = key.y + key.height / 2f - (mPaint.descent() + mPaint.ascent()) / 2f; xPos -= mPaint.measureText(key.label.toString()) / 2f; - mPaint.setTextSize(DrawableUtils.spToPx(TEXT_SIZE_NORMAL, this.getContext())); + mPaint.setTextSize(KeyboardDrawableUtil.spToPx(TEXT_SIZE_NORMAL, this.getContext())); canvas.drawText(key.label.toString(), xPos, yPos, mPaint); } } @@ -131,5 +139,4 @@ public class WallpaperKeyboardView extends KeyboardView{ public void setShiftState(ShiftState state) { this.shiftState = state; } - } diff --git a/app/src/main/java/com/keyboard/wallpaperkeyboard/inputmethod/service/WallpaperKeyboardService.java b/app/src/main/java/com/keyboard/wallpaperkeyboard/inputmethod/service/WallpaperKeyboardService.java index c4c929c..e8e2b06 100644 --- a/app/src/main/java/com/keyboard/wallpaperkeyboard/inputmethod/service/WallpaperKeyboardService.java +++ b/app/src/main/java/com/keyboard/wallpaperkeyboard/inputmethod/service/WallpaperKeyboardService.java @@ -48,7 +48,7 @@ public class WallpaperKeyboardService extends InputMethodService implements Keyb @Override public void onWindowShown() { super.onWindowShown(); - updateKeyboardBackground(); // 更新背景 + updateKeyboardBackground(); } @Override diff --git a/app/src/main/java/com/keyboard/wallpaperkeyboard/ui/activity/MainActivity.java b/app/src/main/java/com/keyboard/wallpaperkeyboard/ui/activity/MainActivity.java index 15364cb..f507874 100644 --- a/app/src/main/java/com/keyboard/wallpaperkeyboard/ui/activity/MainActivity.java +++ b/app/src/main/java/com/keyboard/wallpaperkeyboard/ui/activity/MainActivity.java @@ -71,7 +71,7 @@ public class MainActivity extends AppCompatActivity { int iconResId = getIconResource(tab.getPosition(), isSelected); mainItemCustomBinding.image.setImageResource(iconResId); - int textColor = isSelected ? R.color.blue : R.color.black; + int textColor = isSelected ? R.color.blue : R.color.gray; mainItemCustomBinding.text.setTextColor(ContextCompat.getColor(MainActivity.this, textColor)); } } @@ -80,7 +80,7 @@ public class MainActivity extends AppCompatActivity { private void setTab(MainItemCustomBinding mainCustomBinding, int position) { int iconResId = getIconResource(position, false); - int textColorResId = R.color.black; + int textColorResId = R.color.gray; switch (position) { case 0: diff --git a/app/src/main/java/com/keyboard/wallpaperkeyboard/ui/activity/SplashActivity.java b/app/src/main/java/com/keyboard/wallpaperkeyboard/ui/activity/SplashActivity.java index 81eeb2b..ff8ea6f 100644 --- a/app/src/main/java/com/keyboard/wallpaperkeyboard/ui/activity/SplashActivity.java +++ b/app/src/main/java/com/keyboard/wallpaperkeyboard/ui/activity/SplashActivity.java @@ -1,6 +1,8 @@ package com.keyboard.wallpaperkeyboard.ui.activity; +import android.content.Intent; import android.os.Bundle; +import android.os.CountDownTimer; import androidx.activity.EdgeToEdge; import androidx.appcompat.app.AppCompatActivity; @@ -8,19 +10,77 @@ import androidx.core.graphics.Insets; import androidx.core.view.ViewCompat; import androidx.core.view.WindowInsetsCompat; +import com.bumptech.glide.Glide; +import com.bumptech.glide.load.resource.bitmap.RoundedCorners; import com.keyboard.wallpaperkeyboard.R; +import com.keyboard.wallpaperkeyboard.databinding.ActivitySplashBinding; public class SplashActivity extends AppCompatActivity { + private ActivitySplashBinding binding; + private static final long TOTAL_TIME = 3000; + private CountDownTimer countDownTimer; + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + binding = ActivitySplashBinding.inflate(getLayoutInflater()); + setContentView(binding.getRoot()); + EdgeToEdge.enable(this); - setContentView(R.layout.activity_splash); ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> { Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars()); v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom); return insets; }); + + initEvent(); + } + + private void initEvent() { + loadImage(); + startProgressTimer(); + } + + private void startProgressTimer() { + countDownTimer = new CountDownTimer(TOTAL_TIME, 100) { + @Override + public void onTick(long millisUntilFinished) { + int percentage = (int) (100 - (float) millisUntilFinished / TOTAL_TIME * 100); + binding.progressBar.setProgress(percentage); + } + + @Override + public void onFinish() { + startMain(); + } + }; + + countDownTimer.start(); + } + + private void loadImage() { + Glide.with(this) + .load(R.mipmap.placeholder) + .transform(new RoundedCorners(16)) + .into(binding.splashImage); + } + + private void startMain() { + binding.progressBar.setProgress(100); + + Intent intent = new Intent(SplashActivity.this, MainActivity.class); + startActivity(intent); + finish(); + } + + @Override + protected void onDestroy() { + super.onDestroy(); + if (countDownTimer != null) { + countDownTimer.cancel(); + } + binding = null; } } \ No newline at end of file diff --git a/app/src/main/java/com/keyboard/wallpaperkeyboard/ui/activity/WallpaperActivity.java b/app/src/main/java/com/keyboard/wallpaperkeyboard/ui/activity/WallpaperActivity.java index 56a5418..07ba463 100644 --- a/app/src/main/java/com/keyboard/wallpaperkeyboard/ui/activity/WallpaperActivity.java +++ b/app/src/main/java/com/keyboard/wallpaperkeyboard/ui/activity/WallpaperActivity.java @@ -11,6 +11,7 @@ import androidx.appcompat.app.AppCompatActivity; import androidx.core.graphics.Insets; import androidx.core.view.ViewCompat; import androidx.core.view.WindowInsetsCompat; +import androidx.lifecycle.Observer; import androidx.lifecycle.ViewModelProvider; import androidx.recyclerview.widget.GridLayoutManager; @@ -24,16 +25,23 @@ import com.keyboard.wallpaperkeyboard.callback.DownloadAndUnzipCallback; import com.keyboard.wallpaperkeyboard.data.entity.WallpaperEntity; import com.keyboard.wallpaperkeyboard.databinding.ActivityWallpaperBinding; import com.keyboard.wallpaperkeyboard.ui.adapter.InputMethodAdapter; +import com.keyboard.wallpaperkeyboard.ui.dialog.SelectInputMethodDialog; import com.keyboard.wallpaperkeyboard.ui.viewmodel.WallpaperViewModel; -import com.keyboard.wallpaperkeyboard.util.FileDownloadAndUnzipUtil; +import com.keyboard.wallpaperkeyboard.util.InputMethodCheckerUtils; +import com.keyboard.wallpaperkeyboard.util.FileDownloadAndUnzipUtils; import com.keyboard.wallpaperkeyboard.util.ItemDecoration; import java.util.ArrayList; +import java.util.List; +import java.util.Random; public class WallpaperActivity extends AppCompatActivity { private ActivityWallpaperBinding binding; private WallpaperViewModel wallpaperViewModel; private WallpaperEntity wallpaperEntity; + private InputMethodAdapter inputMethodAdapter; + private int limit = 1; + private int offset = 20; private String title; private String zipUrl; @@ -66,12 +74,16 @@ public class WallpaperActivity extends AppCompatActivity { wallpaperViewModel = new ViewModelProvider(this).get(WallpaperViewModel.class); + Random random = new Random(); + limit = random.nextInt(800); + offset = limit + 20; + title = wallpaperEntity.getTitle(); zipUrl = wallpaperEntity.getZipUrl(); - InputMethodAdapter inputMethodAdapter = new InputMethodAdapter(wallpaperViewModel, this, new ArrayList<>(), this, 1); + inputMethodAdapter = new InputMethodAdapter(wallpaperViewModel, this, new ArrayList<>(), this, 1); binding.recyclerView.setAdapter(inputMethodAdapter); - binding.recyclerView.setLayoutManager(new GridLayoutManager(this, 2)); + binding.recyclerView.setLayoutManager(new GridLayoutManager(this, 1)); binding.recyclerView.addItemDecoration(new ItemDecoration(20, 15, 20)); if (wallpaperEntity.getPreview() != null) { @@ -91,26 +103,33 @@ public class WallpaperActivity extends AppCompatActivity { binding.title.setText(title); setLike(); + getRecommended(); } private void downloadAndUnzip() { showView(); - FileDownloadAndUnzipUtil.downloadAndUnzipFile(WallpaperActivity.this, zipUrl, new DownloadAndUnzipCallback() { - @Override - public void onResult(boolean success, String resultPath) { - if (success) { - SharedPreferences preferences = getSharedPreferences(MyApplication.PREF_NAME, MODE_PRIVATE); - preferences.edit().putString(MyApplication.KEY_FILE_PATH, resultPath).apply(); - hideView(); - showToast("Wallpaper applied successfully!"); - jumpToWriteActivity(); - } else { - hideView(); - showToast("Failed to apply wallpaper!"); + if (!InputMethodCheckerUtils.isAppInputMethodEnabled() || !InputMethodCheckerUtils.isAppInputMethodActive()) { + SelectInputMethodDialog dialog = new SelectInputMethodDialog(); + dialog.show(getSupportFragmentManager(), "SelectInputMethodDialog"); + hideView(); + } else { + FileDownloadAndUnzipUtils.downloadAndUnzipFile(WallpaperActivity.this, zipUrl, new DownloadAndUnzipCallback() { + @Override + public void onResult(boolean success, String resultPath) { + if (success) { + SharedPreferences preferences = getSharedPreferences(MyApplication.PREF_NAME, MODE_PRIVATE); + preferences.edit().putString(MyApplication.KEY_FILE_PATH, resultPath).apply(); + hideView(); + showToast("Wallpaper applied successfully!"); + jumpToWriteActivity(); + } else { + hideView(); + showToast("Failed to apply wallpaper!"); + } } - } - }); + }); + } } private void loadImage() { @@ -126,6 +145,17 @@ public class WallpaperActivity extends AppCompatActivity { .into(binding.imageView); } + private void getRecommended() { + wallpaperViewModel + .getRecommended(limit, offset) + .observe(this, new Observer>() { + @Override + public void onChanged(List wallpaperEntities) { + inputMethodAdapter.updateData(wallpaperEntities); + } + }); + } + private void setLike() { binding.like.setImageResource(wallpaperEntity.getLike() ? R.drawable.like : R.drawable.un_like); } @@ -151,12 +181,12 @@ public class WallpaperActivity extends AppCompatActivity { Toast.makeText(WallpaperActivity.this, message, Toast.LENGTH_SHORT).show(); } - private void showView(){ + private void showView() { binding.progressBar.setVisibility(View.VISIBLE); binding.view.setVisibility(View.VISIBLE); } - private void hideView(){ + private void hideView() { binding.progressBar.setVisibility(View.GONE); binding.view.setVisibility(View.GONE); } diff --git a/app/src/main/java/com/keyboard/wallpaperkeyboard/ui/activity/WriteActivity.java b/app/src/main/java/com/keyboard/wallpaperkeyboard/ui/activity/WriteActivity.java index 541e6ef..596591e 100644 --- a/app/src/main/java/com/keyboard/wallpaperkeyboard/ui/activity/WriteActivity.java +++ b/app/src/main/java/com/keyboard/wallpaperkeyboard/ui/activity/WriteActivity.java @@ -1,6 +1,8 @@ package com.keyboard.wallpaperkeyboard.ui.activity; +import android.content.Context; import android.os.Bundle; +import android.view.inputmethod.InputMethodManager; import androidx.activity.EdgeToEdge; import androidx.appcompat.app.AppCompatActivity; @@ -9,18 +11,45 @@ import androidx.core.view.ViewCompat; import androidx.core.view.WindowInsetsCompat; import com.keyboard.wallpaperkeyboard.R; +import com.keyboard.wallpaperkeyboard.databinding.ActivityWriteBinding; public class WriteActivity extends AppCompatActivity { + private ActivityWriteBinding binding; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); EdgeToEdge.enable(this); - setContentView(R.layout.activity_write); + binding = ActivityWriteBinding.inflate(getLayoutInflater()); + setContentView(binding.getRoot()); ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> { Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars()); v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom); return insets; }); + + initEvent(); + } + + private void initEvent() { + binding.back.setOnClickListener(v -> finish()); + } + + @Override + public void onWindowFocusChanged(boolean hasFocus) { + super.onWindowFocusChanged(hasFocus); + if (hasFocus) { + binding.editText.requestFocus(); + InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); + if (imm != null) { + imm.showSoftInput(binding.editText, InputMethodManager.SHOW_IMPLICIT); + } + } + } + + @Override + protected void onDestroy() { + super.onDestroy(); + binding = null; } } \ No newline at end of file diff --git a/app/src/main/java/com/keyboard/wallpaperkeyboard/ui/dialog/SelectInputMethodDialog.java b/app/src/main/java/com/keyboard/wallpaperkeyboard/ui/dialog/SelectInputMethodDialog.java index 6c19c69..fb7fbe8 100644 --- a/app/src/main/java/com/keyboard/wallpaperkeyboard/ui/dialog/SelectInputMethodDialog.java +++ b/app/src/main/java/com/keyboard/wallpaperkeyboard/ui/dialog/SelectInputMethodDialog.java @@ -23,7 +23,7 @@ import com.bumptech.glide.load.resource.bitmap.RoundedCorners; import com.keyboard.wallpaperkeyboard.MyApplication; import com.keyboard.wallpaperkeyboard.R; import com.keyboard.wallpaperkeyboard.databinding.SelectDialogBinding; -import com.keyboard.wallpaperkeyboard.util.InputMethodUtils; +import com.keyboard.wallpaperkeyboard.util.InputMethodCheckerUtils; public class SelectInputMethodDialog extends DialogFragment { private SelectDialogBinding binding; @@ -58,7 +58,7 @@ public class SelectInputMethodDialog extends DialogFragment { @Override public void onChange(boolean selfChange) { super.onChange(selfChange); - if (InputMethodUtils.isInputMethodEnabled() && InputMethodUtils.isCurrentInputMethodActive()) { + if (InputMethodCheckerUtils.isAppInputMethodEnabled() && InputMethodCheckerUtils.isAppInputMethodActive()) { dismiss(); } } @@ -93,7 +93,7 @@ public class SelectInputMethodDialog extends DialogFragment { private void loadImage() { Glide.with(requireContext()) - .load(R.mipmap.ic_launcher_round) + .load(R.mipmap.placeholder) .transform(new RoundedCorners(16)) .into(binding.imageView); } @@ -111,8 +111,8 @@ public class SelectInputMethodDialog extends DialogFragment { } private void updateDialogState() { - boolean isInputMethodEnabled = InputMethodUtils.isInputMethodEnabled(); - boolean isCurrentInputMethodActive = InputMethodUtils.isCurrentInputMethodActive(); + boolean isInputMethodEnabled = InputMethodCheckerUtils.isAppInputMethodEnabled(); + boolean isCurrentInputMethodActive = InputMethodCheckerUtils.isAppInputMethodActive(); binding.firstSelect.setClickable(!isInputMethodEnabled); binding.firstSelect.setSelected(isInputMethodEnabled); diff --git a/app/src/main/java/com/keyboard/wallpaperkeyboard/ui/viewmodel/WallpaperViewModel.java b/app/src/main/java/com/keyboard/wallpaperkeyboard/ui/viewmodel/WallpaperViewModel.java index 671cdfe..a2e2075 100644 --- a/app/src/main/java/com/keyboard/wallpaperkeyboard/ui/viewmodel/WallpaperViewModel.java +++ b/app/src/main/java/com/keyboard/wallpaperkeyboard/ui/viewmodel/WallpaperViewModel.java @@ -37,4 +37,8 @@ public class WallpaperViewModel extends AndroidViewModel { public LiveData> getCategoryByName(String name) { return wallpaperRepository.getCategoryByName(name); } + + public LiveData> getRecommended(int limit, int offset) { + return wallpaperRepository.getRecommended(limit, offset); + } } diff --git a/app/src/main/java/com/keyboard/wallpaperkeyboard/util/DrawableUtils.java b/app/src/main/java/com/keyboard/wallpaperkeyboard/util/DrawableUtils.java deleted file mode 100644 index a08b328..0000000 --- a/app/src/main/java/com/keyboard/wallpaperkeyboard/util/DrawableUtils.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.keyboard.wallpaperkeyboard.util; - -import android.content.Context; -import android.graphics.Canvas; -import android.graphics.Rect; -import android.graphics.drawable.Drawable; -import android.inputmethodservice.Keyboard; -import android.util.TypedValue; - -import com.keyboard.wallpaperkeyboard.inputmethod.keyboardview.WallpaperKeyboardView; - -public class DrawableUtils { - - public static void drawKeyIcon(Keyboard.Key currentKey, - Drawable drawKeyIcon, - Canvas myCanvas, - WallpaperKeyboardView wallpaperKeyboardView) { - currentKey.icon = drawKeyIcon; - currentKey.icon.setBounds(getIconBounds(currentKey, drawKeyIcon, wallpaperKeyboardView)); - currentKey.icon.draw(myCanvas); - } - - private static Rect getIconBounds(Keyboard.Key currentKey, - Drawable drawKeyIcon, - WallpaperKeyboardView wallpaperKeyboardView) { - float icon_w = drawKeyIcon.getIntrinsicWidth(); - float icon_h = drawKeyIcon.getIntrinsicHeight(); - float icon_wr = icon_w / currentKey.width; - float icon_hr = icon_h / currentKey.height; - - float tep1, tep2; - if (icon_wr > icon_hr) { - tep2 = icon_wr; - tep1 = Math.max(icon_wr, 0.5f); - } else { - tep2 = icon_hr; - tep1 = Math.max(icon_hr, 0.5f); - } - - icon_h = (icon_h / tep2) * tep1; - icon_w = (icon_w / tep2) * tep1; - - int top = (int) (currentKey.y + wallpaperKeyboardView.getPaddingTop() + (currentKey.height - icon_h) / 2); - int left = (int) (currentKey.x + wallpaperKeyboardView.getPaddingLeft() + (currentKey.width - icon_w) / 2); - int bottom = top + (int) icon_h; - int right = left + (int) icon_w; - - return new Rect(left, top, right, bottom); - } - - public static float spToPx(Float values, Context context) { - return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, values, context.getResources().getDisplayMetrics()); - } - -} diff --git a/app/src/main/java/com/keyboard/wallpaperkeyboard/util/EnhancedFileUtil.java b/app/src/main/java/com/keyboard/wallpaperkeyboard/util/EnhancedFileUtils.java similarity index 98% rename from app/src/main/java/com/keyboard/wallpaperkeyboard/util/EnhancedFileUtil.java rename to app/src/main/java/com/keyboard/wallpaperkeyboard/util/EnhancedFileUtils.java index 825abb3..ef2df7c 100644 --- a/app/src/main/java/com/keyboard/wallpaperkeyboard/util/EnhancedFileUtil.java +++ b/app/src/main/java/com/keyboard/wallpaperkeyboard/util/EnhancedFileUtils.java @@ -12,7 +12,7 @@ import java.io.InputStreamReader; import java.io.OutputStream; import java.nio.file.Files; -public class EnhancedFileUtil { +public class EnhancedFileUtils { public static void copyFile(File sourceFile, File destinationFile) throws IOException { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { try (InputStream in = Files.newInputStream(sourceFile.toPath()); diff --git a/app/src/main/java/com/keyboard/wallpaperkeyboard/util/FileDownloadAndUnzipUtil.java b/app/src/main/java/com/keyboard/wallpaperkeyboard/util/FileDownloadAndUnzipUtils.java similarity index 97% rename from app/src/main/java/com/keyboard/wallpaperkeyboard/util/FileDownloadAndUnzipUtil.java rename to app/src/main/java/com/keyboard/wallpaperkeyboard/util/FileDownloadAndUnzipUtils.java index 70c1be3..38f40a8 100644 --- a/app/src/main/java/com/keyboard/wallpaperkeyboard/util/FileDownloadAndUnzipUtil.java +++ b/app/src/main/java/com/keyboard/wallpaperkeyboard/util/FileDownloadAndUnzipUtils.java @@ -28,8 +28,8 @@ import java.io.RandomAccessFile; import java.util.logging.Level; import java.util.logging.Logger; -public class FileDownloadAndUnzipUtil { - private static final Logger LOGGER = Logger.getLogger(FileDownloadAndUnzipUtil.class.getName()); +public class FileDownloadAndUnzipUtils { + private static final Logger LOGGER = Logger.getLogger(FileDownloadAndUnzipUtils.class.getName()); public static void downloadAndUnzipFile(Context context, String url, DownloadAndUnzipCallback callback) { downloadFile(context, url, new DownloadCallback() { @@ -84,7 +84,7 @@ public class FileDownloadAndUnzipUtil { } File destinationFile = new File(downloadDir, resource.getName()); - EnhancedFileUtil.copyFile(resource, destinationFile); + EnhancedFileUtils.copyFile(resource, destinationFile); callback.onDownloadCall(true, destinationFile); LOGGER.log(Level.INFO, "resource: " + destinationFile); diff --git a/app/src/main/java/com/keyboard/wallpaperkeyboard/util/InputMethodCheckerUtils.java b/app/src/main/java/com/keyboard/wallpaperkeyboard/util/InputMethodCheckerUtils.java new file mode 100644 index 0000000..d0c3dbf --- /dev/null +++ b/app/src/main/java/com/keyboard/wallpaperkeyboard/util/InputMethodCheckerUtils.java @@ -0,0 +1,34 @@ +package com.keyboard.wallpaperkeyboard.util; + +import android.content.Context; +import android.provider.Settings; +import android.view.inputmethod.InputMethodInfo; +import android.view.inputmethod.InputMethodManager; + +import com.keyboard.wallpaperkeyboard.MyApplication; + +import java.util.List; + +public class InputMethodCheckerUtils { + private static final InputMethodManager inputMethodManager = + (InputMethodManager) MyApplication.application.getSystemService(Context.INPUT_METHOD_SERVICE); + + public static boolean isAppInputMethodEnabled() { + if (inputMethodManager == null) { + return false; + } + List enabledInputMethods = inputMethodManager.getEnabledInputMethodList(); + for (InputMethodInfo inputMethodInfo : enabledInputMethods) { + if (inputMethodInfo.getId().startsWith(MyApplication.application.getPackageName())) { + return true; + } + } + return false; + } + + public static boolean isAppInputMethodActive() { + String currentInputMethod = Settings.Secure.getString(MyApplication.application.getContentResolver(), Settings.Secure.DEFAULT_INPUT_METHOD); + return currentInputMethod != null && currentInputMethod.startsWith(MyApplication.application.getPackageName()); + } +} + diff --git a/app/src/main/java/com/keyboard/wallpaperkeyboard/util/InputMethodUtils.java b/app/src/main/java/com/keyboard/wallpaperkeyboard/util/InputMethodUtils.java deleted file mode 100644 index baeb794..0000000 --- a/app/src/main/java/com/keyboard/wallpaperkeyboard/util/InputMethodUtils.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.keyboard.wallpaperkeyboard.util; - -import android.content.Context; -import android.provider.Settings; -import android.view.inputmethod.InputMethodInfo; -import android.view.inputmethod.InputMethodManager; - -import com.key.vibekeyboard.MyApplication; - -import java.util.List; - -public class InputMethodUtils { - private static final InputMethodManager methodManager = - (InputMethodManager) MyApplication.instance.getSystemService(Context.INPUT_METHOD_SERVICE); - - public static boolean isInputMethodEnabled() { - List enabledInputMethods = methodManager.getEnabledInputMethodList(); - for (InputMethodInfo inputMethodInfo : enabledInputMethods) { - if (inputMethodInfo.getId().startsWith(MyApplication.instance.getPackageName())) { - return true; - } - } - return false; - } - - public static boolean isCurrentInputMethodActive() { - String currentInputMethod = Settings.Secure.getString(MyApplication.instance.getContentResolver(), Settings.Secure.DEFAULT_INPUT_METHOD); - return currentInputMethod != null && currentInputMethod.startsWith(MyApplication.instance.getPackageName()); - } -} - diff --git a/app/src/main/java/com/keyboard/wallpaperkeyboard/util/KeyboardDrawableUtil.java b/app/src/main/java/com/keyboard/wallpaperkeyboard/util/KeyboardDrawableUtil.java new file mode 100644 index 0000000..748d548 --- /dev/null +++ b/app/src/main/java/com/keyboard/wallpaperkeyboard/util/KeyboardDrawableUtil.java @@ -0,0 +1,61 @@ +package com.keyboard.wallpaperkeyboard.util; + +import android.content.Context; +import android.graphics.Canvas; +import android.graphics.Rect; +import android.graphics.drawable.Drawable; +import android.inputmethodservice.Keyboard; +import android.util.TypedValue; + +import com.keyboard.wallpaperkeyboard.inputmethod.keyboardview.WallpaperKeyboardView; + +public class KeyboardDrawableUtil { + public static void drawKeyboardKeyIcon(Keyboard.Key currentKey, + Drawable keyIconDrawable, + Canvas canvas, + WallpaperKeyboardView keyboardView) { + if (currentKey == null || keyIconDrawable == null || canvas == null || keyboardView == null) { + return; + } + currentKey.icon = keyIconDrawable; + currentKey.icon.setBounds(getIconDrawingBounds(currentKey, keyIconDrawable, keyboardView)); + currentKey.icon.draw(canvas); + } + + private static Rect getIconDrawingBounds(Keyboard.Key currentKey, + Drawable keyIconDrawable, + WallpaperKeyboardView keyboardView) { + if (currentKey == null || keyIconDrawable == null || keyboardView == null) { + return new Rect(); + } + float iconWidth = keyIconDrawable.getIntrinsicWidth(); + float iconHeight = keyIconDrawable.getIntrinsicHeight(); + float widthRatio = iconWidth / currentKey.width; + float heightRatio = iconHeight / currentKey.height; + + float scaleFactor; + float minScale = 0.5f; + if (widthRatio > heightRatio) { + scaleFactor = Math.max(widthRatio, minScale); + } else { + scaleFactor = Math.max(heightRatio, minScale); + } + + iconHeight = (iconHeight / Math.max(widthRatio, heightRatio)) * scaleFactor; + iconWidth = (iconWidth / Math.max(widthRatio, heightRatio)) * scaleFactor; + + int top = (int) (currentKey.y + keyboardView.getPaddingTop() + (currentKey.height - iconHeight) / 2); + int left = (int) (currentKey.x + keyboardView.getPaddingLeft() + (currentKey.width - iconWidth) / 2); + int bottom = top + (int) iconHeight; + int right = left + (int) iconWidth; + + return new Rect(left, top, right, bottom); + } + + public static float spToPx(float spValue, Context context) { + if (context == null) { + return 0; + } + return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, spValue, context.getResources().getDisplayMetrics()); + } +} diff --git a/app/src/main/res/drawable/collection.xml b/app/src/main/res/drawable/collection.xml index d4e74c7..743d441 100644 --- a/app/src/main/res/drawable/collection.xml +++ b/app/src/main/res/drawable/collection.xml @@ -5,5 +5,5 @@ android:viewportHeight="1024"> + android:fillColor="@color/blue"/> diff --git a/app/src/main/res/drawable/delete.xml b/app/src/main/res/drawable/delete.xml new file mode 100644 index 0000000..e7934a0 --- /dev/null +++ b/app/src/main/res/drawable/delete.xml @@ -0,0 +1,15 @@ + + + + + diff --git a/app/src/main/res/drawable/dialog_select_background.xml b/app/src/main/res/drawable/dialog_select_background.xml new file mode 100644 index 0000000..35af838 --- /dev/null +++ b/app/src/main/res/drawable/dialog_select_background.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/home.xml b/app/src/main/res/drawable/home.xml index ff08fee..14844f3 100644 --- a/app/src/main/res/drawable/home.xml +++ b/app/src/main/res/drawable/home.xml @@ -4,6 +4,6 @@ android:viewportWidth="1152" android:viewportHeight="1024"> diff --git a/app/src/main/res/drawable/input_border.xml b/app/src/main/res/drawable/input_border.xml new file mode 100644 index 0000000..4fa7cc6 --- /dev/null +++ b/app/src/main/res/drawable/input_border.xml @@ -0,0 +1,8 @@ + + + + + + diff --git a/app/src/main/res/drawable/progress_bar_color.xml b/app/src/main/res/drawable/progress_bar_color.xml new file mode 100644 index 0000000..dc730d9 --- /dev/null +++ b/app/src/main/res/drawable/progress_bar_color.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/return_back.xml b/app/src/main/res/drawable/return_back.xml new file mode 100644 index 0000000..f34d4f1 --- /dev/null +++ b/app/src/main/res/drawable/return_back.xml @@ -0,0 +1,12 @@ + + + + diff --git a/app/src/main/res/drawable/rounded_rectangle_gray.xml b/app/src/main/res/drawable/rounded_rectangle_gray.xml new file mode 100644 index 0000000..990507f --- /dev/null +++ b/app/src/main/res/drawable/rounded_rectangle_gray.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/app/src/main/res/drawable/shift.xml b/app/src/main/res/drawable/shift.xml new file mode 100644 index 0000000..0788cba --- /dev/null +++ b/app/src/main/res/drawable/shift.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/shift_lock.xml b/app/src/main/res/drawable/shift_lock.xml new file mode 100644 index 0000000..a57af47 --- /dev/null +++ b/app/src/main/res/drawable/shift_lock.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/space.xml b/app/src/main/res/drawable/space.xml new file mode 100644 index 0000000..d1f75a2 --- /dev/null +++ b/app/src/main/res/drawable/space.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/un_collection.xml b/app/src/main/res/drawable/un_collection.xml index a8b409b..53ac328 100644 --- a/app/src/main/res/drawable/un_collection.xml +++ b/app/src/main/res/drawable/un_collection.xml @@ -1,4 +1,9 @@ - - - - \ No newline at end of file + + + diff --git a/app/src/main/res/drawable/un_home.xml b/app/src/main/res/drawable/un_home.xml index a8b409b..3af2158 100644 --- a/app/src/main/res/drawable/un_home.xml +++ b/app/src/main/res/drawable/un_home.xml @@ -1,4 +1,9 @@ - - - - \ No newline at end of file + + + diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 14973a4..daaaf3c 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -8,13 +8,27 @@ android:background="@color/soft_black" tools:context=".ui.activity.MainActivity"> + + + app:layout_constraintTop_toBottomOf="@+id/title" /> + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_write.xml b/app/src/main/res/layout/activity_write.xml index 016428e..90efce5 100644 --- a/app/src/main/res/layout/activity_write.xml +++ b/app/src/main/res/layout/activity_write.xml @@ -8,4 +8,38 @@ android:background="@color/soft_black" tools:context=".ui.activity.WriteActivity"> + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/item_keyboard.xml b/app/src/main/res/layout/item_keyboard.xml index c0e9e00..be39bfe 100644 --- a/app/src/main/res/layout/item_keyboard.xml +++ b/app/src/main/res/layout/item_keyboard.xml @@ -16,6 +16,7 @@ android:paddingTop="5dp" android:paddingEnd="10dp" android:paddingBottom="5dp" + android:layout_marginTop="10dp" android:text="@string/app_name" android:textColor="@color/black" android:textSize="14sp" diff --git a/app/src/main/res/layout/select_dialog.xml b/app/src/main/res/layout/select_dialog.xml index e3c8087..4635ed4 100644 --- a/app/src/main/res/layout/select_dialog.xml +++ b/app/src/main/res/layout/select_dialog.xml @@ -9,9 +9,9 @@ android:id="@+id/image_view" android:layout_width="150dp" android:layout_height="150dp" - android:layout_marginTop="24dp" + android:layout_marginTop="32dp" android:layout_marginBottom="16dp" - android:src="@mipmap/ic_launcher_round" + android:src="@mipmap/placeholder" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> @@ -20,9 +20,8 @@ android:id="@+id/title" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginTop="16dp" - android:layout_marginBottom="16dp" - android:text="" + android:layout_marginTop="32dp" + android:text="Please select an input method" android:textColor="@color/white" android:textSize="18sp" android:textStyle="bold" @@ -34,8 +33,8 @@ android:id="@+id/first_select" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginTop="10dp" - android:background="@drawable/rounded_rectangle_purple" + android:layout_marginTop="32dp" + android:background="@drawable/dialog_select_background" android:gravity="center" android:orientation="horizontal" android:paddingStart="16dp" @@ -50,7 +49,7 @@ android:layout_width="24dp" android:layout_height="24dp" android:layout_marginEnd="8dp" - android:src="@mipmap/ic_launcher_round" /> + android:src="@mipmap/placeholder" /> + android:src="@mipmap/placeholder" /> diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml deleted file mode 100644 index 6f3b755..0000000 --- a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.png b/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000..00f4854 Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/app/src/main/res/mipmap-hdpi/ic_launcher.webp deleted file mode 100644 index c209e78..0000000 Binary files a/app/src/main/res/mipmap-hdpi/ic_launcher.webp and /dev/null differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.png b/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000..3106d37 Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/app/src/main/res/mipmap-mdpi/ic_launcher.webp deleted file mode 100644 index 4f0f1d6..0000000 Binary files a/app/src/main/res/mipmap-mdpi/ic_launcher.webp and /dev/null differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000..244cd21 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xhdpi/ic_launcher.webp deleted file mode 100644 index 948a307..0000000 Binary files a/app/src/main/res/mipmap-xhdpi/ic_launcher.webp and /dev/null differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..09e62a1 Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp deleted file mode 100644 index 28d4b77..0000000 Binary files a/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp and /dev/null differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000..1286076 Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp deleted file mode 100644 index aa7d642..0000000 Binary files a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp and /dev/null differ diff --git a/app/src/main/res/mipmap-xxxhdpi/placeholder.png b/app/src/main/res/mipmap-xxxhdpi/placeholder.png index 8a76492..f694ae1 100644 Binary files a/app/src/main/res/mipmap-xxxhdpi/placeholder.png and b/app/src/main/res/mipmap-xxxhdpi/placeholder.png differ diff --git a/app/src/main/res/xml/im.xml b/app/src/main/res/xml/im.xml index b6ccf6b..44fb4c3 100644 --- a/app/src/main/res/xml/im.xml +++ b/app/src/main/res/xml/im.xml @@ -2,7 +2,7 @@ diff --git a/keystore.properties b/keystore.properties new file mode 100644 index 0000000..ad3b85c --- /dev/null +++ b/keystore.properties @@ -0,0 +1,6 @@ +app_name=Wallpaper Keyboard +package_name=com.keyboard.wallpaperkeyboard +keystoreFile=app/WallpaperKeyboard.jks +key_alias=WallpaperKeyboardkey0 +key_store_password=WallpaperKeyboard +key_password=WallpaperKeyboard