Skip to content

Commit

Permalink
Merge pull request #65 from amirisback/develop/create-theme-for-keyboard
Browse files Browse the repository at this point in the history
FEATURE :: Theme Keyboard
  • Loading branch information
amirisback authored Mar 16, 2024
2 parents 773c99e + cef3d13 commit 58dc1af
Show file tree
Hide file tree
Showing 50 changed files with 740 additions and 371 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -916,6 +916,25 @@ https://user-images.githubusercontent.com/24654871/231431022-4410933f-7199-4967-

</table>

### Multi Theme Suppported
<table>

<tr>
<th>Setup Theme (Light)</th>
<th>Theme Applied (Light)</th>
<th>Setup Theme (Dark)</th>
<th>Theme Applied (Dark)</th>
</tr>

<tr>
<td><img width="200px" height="420px" src="https://amirisback.github.io/keyboard/docs/image/ss/theme/light/ss-1.jpg"></td>
<td><img width="200px" height="420px" src="https://amirisback.github.io/keyboard/docs/image/ss/theme/light/ss-2.jpg"></td>
<td><img width="200px" height="420px" src="https://amirisback.github.io/keyboard/docs/image/ss/theme/dark/ss-1.jpg"></td>
<td><img width="200px" height="420px" src="https://amirisback.github.io/keyboard/docs/image/ss/theme/dark/ss-2.jpg"></td>
</tr>

</table>

## Documentation
- https://github.com/SimpleMobileTools/Simple-Keyboard
- Clone From This
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
android:name=".ui.toggle.ToggleActivity"
android:exported="false" />

<activity
android:name=".ui.theme.ThemeActivity"
android:exported="false" />

<activity android:name=".ui.language.KeyboardLanguageActivity"
android:exported="false" />

Expand Down
16 changes: 0 additions & 16 deletions app/src/main/java/com/frogobox/appkeyboard/MainApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,8 @@ import android.content.Context
import android.os.Build
import androidx.emoji2.bundled.BundledEmojiCompatConfig
import androidx.emoji2.text.EmojiCompat
import com.frogobox.appkeyboard.di.koin.databaseModule
import com.frogobox.appkeyboard.di.koin.delegateModule
import com.frogobox.appkeyboard.di.koin.repositoryModule
import com.frogobox.appkeyboard.di.koin.viewModelModule
import com.frogobox.sdk.FrogoKoinApplication
import dagger.hilt.android.HiltAndroidApp
import org.koin.core.KoinApplication
import java.util.Locale

/**
Expand Down Expand Up @@ -43,17 +38,6 @@ class MainApp : FrogoKoinApplication() {

}

override fun setupKoinModule(koinApplication: KoinApplication) {
koinApplication.modules(
listOf(
delegateModule,
repositoryModule,
databaseModule,
viewModelModule,
)
)
}

override fun onCreate() {
super.onCreate()
instance = this
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
package com.frogobox.appkeyboard.common.ext

import android.content.Context
import com.frogobox.appkeyboard.util.Constant.PREF_KEYBOARD_TYPE
import com.frogobox.appkeyboard.util.Constant.PREF_ROOT_NAME
import com.frogobox.libkeyboard.R
import com.frogobox.sdk.delegate.preference.PreferenceDelegatesImpl

/**
* Created by Faisal Amir on 24/10/22
* -----------------------------------------
Expand All @@ -14,9 +8,4 @@ import com.frogobox.sdk.delegate.preference.PreferenceDelegatesImpl
* -----------------------------------------
* Copyright (C) Frogobox ID / amirisback
* All rights reserved
*/

fun Context.getKeyboardType(): Int {
val pref = PreferenceDelegatesImpl(this, PREF_ROOT_NAME)
return pref.loadPrefInt(PREF_KEYBOARD_TYPE, R.xml.keys_letters_qwerty)
}
*/
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.frogobox.appkeyboard.common.ext

/**
* Created by faisalamircs on 16/03/2024
* -----------------------------------------
* Name : Muhammad Faisal Amir
* E-mail : [email protected]
* Github : github.com/amirisback
* -----------------------------------------
*/


Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ package com.frogobox.appkeyboard.data.local.autotext
* https://github.com/amirisback
*/

import androidx.room.*
import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.Query
import androidx.room.Update
import com.frogobox.appkeyboard.model.AutoTextEntity
import com.frogobox.appkeyboard.model.AutoTextLabel
import com.frogobox.appkeyboard.model.AutoTextLabelType
import io.reactivex.rxjava3.core.Completable
import io.reactivex.rxjava3.core.Single

Expand Down Expand Up @@ -42,7 +46,7 @@ interface AutoTextDao {
fun getByTitle(search: String): Single<List<AutoTextEntity>>

@Query("SELECT * FROM auto_text WHERE label = :search ORDER BY id ASC")
fun getByLabel(search: AutoTextLabel) : Single<List<AutoTextEntity>>
fun getByLabel(search: AutoTextLabelType) : Single<List<AutoTextEntity>>

@Query("SELECT * FROM auto_text WHERE body LIKE '%' || :search || '%' ORDER BY id ASC")
fun getByBody(search: String) : Single<List<AutoTextEntity>>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.frogobox.appkeyboard.di.hilt
package com.frogobox.appkeyboard.di

import android.content.Context
import com.frogobox.appkeyboard.data.local.autotext.AutoTextDao
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.frogobox.appkeyboard.di.hilt
package com.frogobox.appkeyboard.di

import dagger.Module
import dagger.hilt.InstallIn
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.frogobox.appkeyboard.di.hilt
package com.frogobox.appkeyboard.di

import com.frogobox.appkeyboard.di.*
import com.frogobox.appkeyboard.repository.autotext.AutoTextRepository
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.frogobox.appkeyboard.di.hilt
package com.frogobox.appkeyboard.di

import dagger.Module
import dagger.hilt.InstallIn
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.frogobox.appkeyboard.di.hilt
package com.frogobox.appkeyboard.di

import android.content.Context
import com.frogobox.appkeyboard.util.Constant.PREF_ROOT_NAME
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ data class AutoTextEntity(
var title: String = "",

@ColumnInfo(name = "label")
var label: AutoTextLabel = AutoTextLabel.USER,
var label: AutoTextLabelType = AutoTextLabelType.USER,

@ColumnInfo(name = "date")
var date: String = "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import androidx.annotation.Keep


@Keep
enum class AutoTextLabel {
enum class AutoTextLabelType {
DEFAULT,
USER
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ import androidx.annotation.Keep
*/

@Keep
data class KeyboardFeature(
data class KeyboardFeatureModel(
var id: String,
var type: KeyboardFeatureType,
var text: String,
var icon: Int,
var state: Boolean = false
)
Original file line number Diff line number Diff line change
@@ -1,24 +1,39 @@
package com.frogobox.appkeyboard.model

import androidx.annotation.Keep
import com.frogobox.appkeyboard.R

/**
* Created by Faisal Amir on 10/03/23
* https://github.com/amirisback
*/

@Keep
enum class KeyboardFeatureType(val id: String, val title: String) {
NEWS("menu_news","News API"),
MOVIE("menu_movie","Movie API"),
WEB("menu_web","Search Website"),
FORM("menu_form","Form"),
AUTO_TEXT("menu_auto_text","Auto Text"),
TEMPLATE_TEXT_APP("menu_play_store_app","App Review"),
TEMPLATE_TEXT_GAME("menu_play_store_game","Game Review"),
TEMPLATE_TEXT_SALE("menu_template_text_sale","Sale Admin"),
TEMPLATE_TEXT_LOVE("menu_template_text_love","Love Emoji"),
TEMPLATE_TEXT_GREETING("menu_template_text_greeting", "Greeting"),
CHANGE_KEYBOARD("menu_change_keyboard","Change Keyboard"),
SETTING("menu_setting","Setting")
enum class KeyboardFeatureType(val id: String, val text: String, val icon: Int) {
NEWS("menu_news", "News API", R.drawable.ic_menu_news),
MOVIE("menu_movie", "Movie API", R.drawable.ic_menu_movie),
WEB("menu_web", "Search Website", R.drawable.ic_menu_website),
FORM("menu_form", "Form", R.drawable.ic_menu_form),
AUTO_TEXT("menu_auto_text", "Auto Text", R.drawable.ic_menu_auto_text),
TEMPLATE_TEXT_APP("menu_play_store_app", "App Review", R.drawable.ic_menu_ps_app),
TEMPLATE_TEXT_GAME("menu_play_store_game", "Game Review", R.drawable.ic_menu_ps_game),
TEMPLATE_TEXT_SALE("menu_template_text_sale", "Sale Admin", R.drawable.ic_menu_ps_sale),
TEMPLATE_TEXT_LOVE("menu_template_text_love", "Love Emoji", R.drawable.ic_menu_ps_love),
TEMPLATE_TEXT_GREETING("menu_template_text_greeting", "Greeting", R.drawable.ic_menu_ps_greeting),
CHANGE_KEYBOARD("menu_change_keyboard", "Change Keyboard", R.drawable.ic_menu_keyboard),
SETTING("menu_setting", "Setting", R.drawable.ic_menu_setting);

fun mapToModel(): KeyboardFeatureModel {
return KeyboardFeatureModel(
this.id,
this.text,
this.icon
)
}

companion object {
infix fun from(value: String): KeyboardFeatureType =
entries.firstOrNull { it.id == value } ?: AUTO_TEXT
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.frogobox.appkeyboard.model

/**
* Created by faisalamircs on 16/03/2024
* -----------------------------------------
* Name : Muhammad Faisal Amir
* E-mail : [email protected]
* Github : github.com/amirisback
* -----------------------------------------
*/


data class KeyboardThemeModel(
val name: String,
val description: String,
val themType: ThemeType,
val background: Int,
)
Loading

0 comments on commit 58dc1af

Please sign in to comment.