This commit is contained in:
lunaticbum 2024-10-17 18:07:31 +09:00
parent 3f2a92b880
commit edca12a137
18 changed files with 629 additions and 772 deletions

View File

@ -51,6 +51,10 @@ import rasel.lunar.launcher.helpers.Constants.Companion.KEY_APPS_COUNT
import rasel.lunar.launcher.helpers.Constants.Companion.KEY_APPS_LAYOUT
import rasel.lunar.launcher.helpers.Constants.Companion.PREFS_APP_NAMES
import rasel.lunar.launcher.helpers.Constants.Companion.PREFS_SETTINGS
import rasel.lunar.launcher.helpers.PrefBoolean
import rasel.lunar.launcher.helpers.PrefKey
import rasel.lunar.launcher.helpers.PrefLong
import rasel.lunar.launcher.helpers.letTrue
import rasel.lunar.launcher.model.AppInfo
import rasel.lunar.launcher.utils.BLog
import rasel.lunar.launcher.utils.JamoUtils
@ -202,7 +206,7 @@ internal class AppDrawer : Fragment() {
super.onViewCreated(view, savedInstanceState)
binding.searchInput.setOnKeyListener { v, keyCode, event ->
//contactList.size < 1 && packageList.size < 1 &&
if (keyCode == 66 && event.action == KeyEvent.ACTION_UP) {
if(PrefBoolean.useQuickLaunch.get(false) && keyCode == 66 && event.action == KeyEvent.ACTION_UP) {
checkResult(binding.searchInput.text.toString())
true
}else {
@ -273,9 +277,9 @@ internal class AppDrawer : Fragment() {
BLog.LOGE("onResume")
fetchApps()
binding.appsCount.visibility = if (settingsPrefs!!.getBoolean(KEY_APPS_COUNT, true)) VISIBLE else GONE
binding.appsCount.visibility = if (PrefBoolean.showAppResultCount.get(false)) VISIBLE else GONE
openSearch()
PrefBoolean.openWithKayboard.get().letTrue { openSearch() }
registCancelSearch()
// BLog.LOGE("onResume after chechHandler.postDelayed(cancelSearch, 3000L)")
}
@ -328,7 +332,8 @@ internal class AppDrawer : Fragment() {
}
}
}
appQuery = newQ.sort(Pair("clickCount", Sort.DESCENDING),Pair("lastUseDate",Sort.DESCENDING)).limit(18).find()
appQuery = newQ.sort(Pair("clickCount", Sort.DESCENDING),Pair("lastUseDate",Sort.DESCENDING))
.limit(PrefLong.maxQueryCount.get(18L).toInt()).find()
appQuery?.let {
if(it.size > 0) {
WorkersDb.getRealm().apply {
@ -356,7 +361,8 @@ internal class AppDrawer : Fragment() {
newQ = newQ.query("name CONTAINS $0 OR chosung CONTAINS $0", keyword)
}
}
contactQuery = newQ.sort(Pair("touchCount", Sort.DESCENDING),Pair("lastedTouchDateTime",Sort.DESCENDING)).limit(18).find()
contactQuery = newQ.sort(Pair("touchCount", Sort.DESCENDING),Pair("lastedTouchDateTime",Sort.DESCENDING))
.limit(PrefLong.maxQueryCount.get(18L).toInt()).find()
contactQuery?.let {
if (it.size > 0)
WorkersDb.getRealm().apply {
@ -483,31 +489,6 @@ internal class AppDrawer : Fragment() {
}
}
private fun setKeyboardPadding() {
// binding.root.viewTreeObserver.addOnGlobalLayoutListener {
// val rect = Rect()
// binding.root.getWindowVisibleDisplayFrame(rect)
// val screenHeight = binding.root.height
// val keyboardHeight = screenHeight - (rect.bottom - rect.top)
//
// when {
// keyboardHeight > screenHeight * 0.15 -> {
// if (!isKeyboardShowing &&
// !settingsPrefs!!.getBoolean(KEY_STATUS_BAR, false)) {
// isKeyboardShowing = true
// binding.root.setPadding(0, 0, 0, keyboardHeight)
// }
// }
// else -> {
// if (isKeyboardShowing) {
// isKeyboardShowing = false
// binding.root.setPadding(0, 0, 0, 0)
// }
// }
// }
// }
}
}
fun normalize(str: String): String {

View File

@ -225,6 +225,18 @@ internal class Feeds : Fragment() , CommadCallabck {
if (input.text.toString().trim().contains(" ")) {
val cmd = input.text.toString().trim().split(" ")
when(cmd[0]) {
"car" -> {
if (cmd[1].trim().length > 2) {
PrefHelper.carName = cmd[1].trim()
}
consoleLog(PrefHelper.carName)
}
"tt" -> {
if (cmd[1].trim().length > 5) {
PrefHelper.telegramSendTarget = cmd[1].trim()
}
consoleLog(PrefHelper.telegramSendTarget)
}
"so"-> {
CoroutineScope(Dispatchers.IO).launch {
consoleLog("${cmd[0]} Start ${cmd[1]}")

View File

@ -1,22 +0,0 @@
package rasel.lunar.launcher.helpers;
import android.annotation.SuppressLint;
import android.bluetooth.BluetoothDevice;
import java.lang.reflect.Method;
import rasel.lunar.launcher.utils.BLog;
public class BleHelper {
@SuppressLint("MissingPermission")
public static boolean isConnected(BluetoothDevice device) {
try {
Method m = device.getClass().getMethod("isConnected", (Class[]) null);
boolean connected = (boolean) m.invoke(device, (Object[]) null);
BLog.INSTANCE.LOGE("D >> " + device.getName() + " || isConnected >>> " + (connected ? "TRUE" : "FALSE"));
return connected;
} catch (Exception e) {
throw new IllegalStateException(e);
}
}
}

View File

@ -76,7 +76,9 @@ class BluetoothManager {
//bondState : 10 (페어링 등록 안됨)
BLog.LOGE("getPairedDevices() / name : ${i.name}")
BLog.LOGE("getPairedDevices() / bondState : ${i.bondState}")
if(i.name.contains("SOUL") && isConnected(i)) {
val isConnected = isConnected(i)
if(PrefHelper.carName.length > 2 && i.name.equals(PrefHelper.carName) && isConnected != PrefHelper.isConnectedCar) {
PrefHelper.isConnectedCar = isConnected
sendToI()
}
}
@ -85,30 +87,34 @@ class BluetoothManager {
fun sendToI() {
CoroutineScope(Dispatchers.IO).launch {
val url = "https://api.telegram.org/bot7934509464:AAE_xUbICxMdywLGnxo7BkeIqA1nVza4P9w/sendMessage?chat_id=83268260&text=돼지가쏘울레탔다요."
//7068729507
// OkHttp 클라이언트 객체 생성
val client = OkHttpClient.Builder()
.connectionPool(ConnectionPool(5, 60, TimeUnit.SECONDS))
.build()
if (PrefHelper.telegramSendTarget.length > 5) {
CoroutineScope(Dispatchers.IO).launch {
val url =
"https://api.telegram.org/bot7934509464:AAE_xUbICxMdywLGnxo7BkeIqA1nVza4P9w/sendMessage?chat_id=${PrefHelper.telegramSendTarget}&text=돼지가쏘울레탔다요."
//7068729507
// OkHttp 클라이언트 객체 생성
val client = OkHttpClient.Builder()
.connectionPool(ConnectionPool(5, 60, TimeUnit.SECONDS))
.build()
// GET 요청 객체 생성
val builder: Request.Builder = Request.Builder().url(url)
.addHeader("Content-Type", "application/json").get()
// GET 요청 객체 생성
val builder: Request.Builder = Request.Builder().url(url)
.addHeader("Content-Type", "application/json").get()
val request: Request = builder.build()
val request: Request = builder.build()
BLog.LOGE("telegram before request ")
// OkHttp 클라이언트로 GET 요청 객체 전송
val response: Response = client.newCall(request).execute()
if (response.isSuccessful()) {
// 응답 받아서 처리
val body: ResponseBody? = response.body()
if (body != null) {
BLog.LOGE("sendToI telegram before request ")
// OkHttp 클라이언트로 GET 요청 객체 전송
val response: Response = client.newCall(request).execute()
if (response.isSuccessful()) {
// 응답 받아서 처리
val body: ResponseBody? = response.body()
if (body != null) {
}
} else BLog.LOGE("telegram Error Occurred")
}
BLog.LOGE("sendToI telegram response isSuccessful ${body}")
} else BLog.LOGE("sendToI telegram Error Occurred")
}
}
}
@SuppressLint("MissingPermission")
@ -156,17 +162,11 @@ class BluetoothManager {
private var bluetoothreceiver = object : BroadcastReceiver(){
override fun onReceive(context: Context?, intent: Intent?) {
var state = intent?.getIntExtra(BluetoothAdapter.EXTRA_STATE, BluetoothAdapter.ERROR)
BLog.LOGE("onReceive() / state : ${state}")
val action = intent!!.action
BLog.LOGE("onReceive() / action : ${action}")
if (context == null) return
if (ActivityCompat.checkSelfPermission(context!!, Manifest.permission.BLUETOOTH_CONNECT) != PackageManager.PERMISSION_GRANTED) return
val device: BluetoothDevice = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE)!!
BLog.LOGE("onReceive() / device.name : ${device.name}")
BLog.LOGE("onReceive() / device.type : ${device.type}")
if(device.name.contains("SOUL") && isConnected(device)) {
sendToI()
}
getPairedDevices()
}
}
}

View File

@ -2,6 +2,93 @@ package rasel.lunar.launcher.helpers
import android.content.Context
import android.content.SharedPreferences
import rasel.lunar.launcher.helpers.PrefHelper.BOOL_PRE
import rasel.lunar.launcher.helpers.PrefHelper.LONG_PRE
import rasel.lunar.launcher.helpers.PrefHelper.STRING_PRE
import rasel.lunar.launcher.helpers.PrefHelper.sharedPreferences
import rasel.lunar.launcher.helpers.PrefKey.TYPE_BOOL
import rasel.lunar.launcher.helpers.PrefKey.TYPE_END
import rasel.lunar.launcher.helpers.PrefKey.TYPE_LONG
import rasel.lunar.launcher.helpers.PrefKey.TYPE_STRING
enum class PrefString {
locationApi,
telegramBotApi,
telegramMyId,
telegramSendTarget,
carName;
fun set(value : String) = PrefHelper.putString(this.name, value)
fun get(def : String? = null) : String = PrefHelper.getString(this.name, def as? String ?: "") ?: ""
}
enum class PrefLong {
shortTimePeriod,
longTimePeriod,
midTimePeriod,
maxQueryCount;
fun set(value : Long) = PrefHelper.putLong(this.name, value)
fun get(def : Long? = null) : Long = PrefHelper.getLong(this.name, def as? Long ?: 0L) ?: 0L
}
enum class PrefBoolean {
location,
isConnectedCar,
useQuickLaunch,
openWithKayboard,
showAppResultCount,;
fun set(value : Boolean) = PrefHelper.putBoolean(this.name, value)
fun get(def : Boolean? = null) : Boolean = PrefHelper.getBoolean(this.name, def as? Boolean ?: false) ?: false
}
enum class PrefKey {
TYPE_STRING,
locationApi,
telegramBotApi,
telegramSendTarget,
carName,
TYPE_LONG,
shortTimePeriod,
longTimePeriod,
midTimePeriod,
maxQueryCount,
TYPE_BOOL,
location,
isConnectedCar,
useQuickLaunch,
openWithKayboard,
showAppResultCount,
TYPE_END;
fun set(value : Any): Unit {
when(this.ordinal) {
in (TYPE_STRING.ordinal..TYPE_LONG.ordinal) -> {
(value as? String)?.let { PrefHelper.putString(this.name, it) }
}
in (TYPE_LONG.ordinal..TYPE_BOOL.ordinal) -> {
(value as? Long)?.let { PrefHelper.putLong(this.name, it) }
}
in (TYPE_BOOL.ordinal..TYPE_END.ordinal) -> {
(value as? Boolean)?.let { PrefHelper.putBoolean(this.name, it) }
}
else -> {}
}
}
fun get(def : Any? = null) : Any? {
when(this.ordinal) {
in (TYPE_STRING.ordinal..TYPE_LONG.ordinal) -> {
return PrefHelper.getString(this.name, def as? String ?: "")
}
in (TYPE_LONG.ordinal..TYPE_BOOL.ordinal) -> {
return PrefHelper.getLong(this.name, def as? Long ?: 0L)
}
in (TYPE_BOOL.ordinal..TYPE_END.ordinal) -> {
return PrefHelper.getBoolean(this.name, def as? Boolean ?: false)
}
else -> {}
}
return null
}
}
object PrefHelper {
val D_PREFIX = "rasel.lunar.launcher.helpers"
@ -12,53 +99,66 @@ object PrefHelper {
this.sharedPreferences = SharedPreferences
}
var sharedPreferences : SharedPreferences? = null
fun getBoolean(key : String, def :Boolean) = this.sharedPreferences?.getBoolean(BOOL_PRE.plus(key),def) ?: def
fun putBoolean(key : String, value :Boolean) = this.sharedPreferences?.edit()?.putBoolean(BOOL_PRE.plus(key),value)?.apply()
fun getLong(key : String, def :Long) = this.sharedPreferences?.getLong(LONG_PRE.plus(key),def) ?: def
fun putLong(key : String, value :Long) = this.sharedPreferences?.edit()?.putLong(LONG_PRE.plus(key),value)?.apply()
fun getString(key : String, def :String) = this.sharedPreferences?.getString(STRING_PRE.plus(key),def) ?: def
fun putString(key : String, value :String) = this.sharedPreferences?.edit()?.putString(STRING_PRE.plus(key),value)?.apply()
fun location(boolean: Boolean) {
sharedPreferences?.edit()?.putBoolean(BOOL_PRE.plus("location"), boolean)?.apply()
}
fun isLocationOn() = sharedPreferences?.getBoolean(BOOL_PRE.plus("location") , false) ?: false
fun location(boolean: Boolean) = PrefKey.location.set(boolean)
fun isLocationOn() = (PrefKey.location.get() as? Boolean) ?: false
var locationApi : String
get() {
return sharedPreferences?.getString(STRING_PRE.plus("location.api"),"") ?: ""
}
set(value) {
sharedPreferences?.edit()?.putString(STRING_PRE.plus("location.api") , value)?.apply()
}
get() = PrefKey.locationApi.get() as? String ?: ""
set(value) = PrefKey.locationApi.set(value)
var telegramBotApi : String
get() {
return sharedPreferences?.getString(STRING_PRE.plus("telegram.api"),"") ?: ""
}
set(value) {
sharedPreferences?.edit()?.putString(STRING_PRE.plus("telegram.api") , value)?.apply()
}
get() = PrefKey.telegramBotApi.get() as? String ?: ""
set(value) = PrefKey.telegramBotApi.set(value)
var telegramSendTarget : String
get() = PrefKey.telegramSendTarget.get() as? String ?: ""
set(value) = PrefKey.telegramSendTarget.set(value)
var carName : String
get() = PrefKey.carName.get() as? String ?: ""
set(value) = PrefKey.carName.set(value)
var shortTimePeriod : Long
get() {
return sharedPreferences?.getLong(LONG_PRE.plus("shortTimePeriod"), 20L) ?: 20L
}
set(value) {
sharedPreferences?.edit()?.putLong(LONG_PRE.plus("shortTimePeriod"),value)?.apply()
}
get() = PrefKey.shortTimePeriod.get(20L) as? Long ?: 20L
set(value) = PrefKey.shortTimePeriod.set(value)
var longTimePeriod : Long
get() {
return sharedPreferences?.getLong(LONG_PRE.plus("longTimePeriod"), 60L) ?: 60L
}
set(value) {
sharedPreferences?.edit()?.putLong(LONG_PRE.plus("longTimePeriod"),value)?.apply()
}
get() = PrefKey.longTimePeriod.get(60L) as? Long ?: 60L
set(value) = PrefKey.longTimePeriod.set(value)
var midTimePeriod : Long
get() {
return sharedPreferences?.getLong(LONG_PRE.plus("midTimePeriod"), 30L) ?: 30L
}
set(value) {
sharedPreferences?.edit()?.putLong(LONG_PRE.plus("midTimePeriod"),value)?.apply()
}
get() = PrefKey.midTimePeriod.get(30L) as? Long ?: 30L
set(value) = PrefKey.midTimePeriod.set(value)
var isConnectedCar : Boolean
get() = PrefKey.isConnectedCar.get() as? Boolean ?: false
set(value) = PrefKey.isConnectedCar.set(value)
var useQuickLaunch : Boolean
get() = PrefKey.useQuickLaunch.get() as? Boolean ?: false
set(value) = PrefKey.useQuickLaunch.set(value)
var openWithKayboard : Boolean
get() = PrefKey.openWithKayboard.get() as? Boolean ?: false
set(value) = PrefKey.openWithKayboard.set(value)
var showAppResultCount : Boolean
get() = PrefKey.showAppResultCount.get() as? Boolean ?: false
set(value) = PrefKey.showAppResultCount.set(value)
}
typealias BLOCK = ()->Unit
inline fun Boolean.letTrue(block: BLOCK) {
if (this) {

View File

@ -324,8 +324,8 @@ internal class LauncherHome : Fragment() {
@SuppressLint("NotifyDataSetChanged")
suspend fun queryWeatherWithLoc(){
WorkersDb.getRealm()
.query<Hour>()
WorkersDb.getRealm().apply {
query<Hour>()
.query("lat == $0 AND lon == $1",
LocationGetter.latitude?.let { BigDecimal.valueOf(it).toDouble() },
LocationGetter.longitude?.let { BigDecimal.valueOf(it).toDouble() }
@ -338,7 +338,7 @@ internal class LauncherHome : Fragment() {
mutableListOf<Hour>().apply {
this.addAll(
// it.filter(hours)
hours
copyFromRealm(hours)
)
}
)
@ -349,7 +349,7 @@ internal class LauncherHome : Fragment() {
mutableListOf<Hour>().apply {
this.addAll(
// it.filter(hours)
hours
copyFromRealm(hours)
)
}
)
@ -362,6 +362,7 @@ internal class LauncherHome : Fragment() {
}
}
}
}
// .asFlow()
// .collect { changes ->
// if (changes.list.size > 0) {

View File

@ -19,10 +19,8 @@
package rasel.lunar.launcher.settings
import android.annotation.SuppressLint
import android.content.Intent
import android.content.SharedPreferences
import android.content.res.Resources
import android.net.Uri
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.google.android.material.bottomsheet.BottomSheetDialog
@ -39,7 +37,7 @@ import rasel.lunar.launcher.settings.childs.Appearances
import rasel.lunar.launcher.settings.childs.Apps
import rasel.lunar.launcher.settings.childs.Misc
import rasel.lunar.launcher.settings.childs.TimeDate
import rasel.lunar.launcher.settings.childs.TodoSettings
import rasel.lunar.launcher.settings.childs.HomeSettings
import rasel.lunar.launcher.settings.childs.WeatherSettings
@ -73,7 +71,7 @@ internal class SettingsActivity : AppCompatActivity() {
}
binding.todo.setOnClickListener {
TodoSettings().show(supportFragmentManager, BOTTOM_SHEET_TAG)
HomeSettings().show(supportFragmentManager, BOTTOM_SHEET_TAG)
}
binding.apps.setOnClickListener {

View File

@ -55,6 +55,9 @@ import rasel.lunar.launcher.helpers.Constants.Companion.KEY_ICON_PACK
import rasel.lunar.launcher.helpers.Constants.Companion.KEY_KEYBOARD_SEARCH
import rasel.lunar.launcher.helpers.Constants.Companion.KEY_QUICK_LAUNCH
import rasel.lunar.launcher.helpers.Constants.Companion.KEY_SCROLLBAR_HEIGHT
import rasel.lunar.launcher.helpers.PrefHelper
import rasel.lunar.launcher.helpers.PrefKey
import rasel.lunar.launcher.helpers.PrefLong
import rasel.lunar.launcher.helpers.UniUtils.Companion.dpToPx
import rasel.lunar.launcher.settings.SettingsActivity.Companion.settingsPrefs
import kotlin.system.exitProcess
@ -84,51 +87,46 @@ internal class Apps : BottomSheetDialogFragment() {
binding = SettingsAppsBinding.inflate(inflater, container, false)
packageManager = requireActivity().packageManager
/* initialize views according to the saved values */
when (settingsPrefs!!.getBoolean(KEY_KEYBOARD_SEARCH, false)) {
false -> binding.keyboardAutoNegative.isChecked = true
true -> binding.keyboardAutoPositive.isChecked = true
binding.keyboardAutoGroup.isChecked = PrefHelper.openWithKayboard
binding.keyboardAutoGroup.setOnCheckedChangeListener { c,v ->
settingsChanged = true
PrefHelper.openWithKayboard = v
}
when (settingsPrefs!!.getBoolean(KEY_QUICK_LAUNCH, true)) {
true -> binding.quickLaunchPositive.isChecked = true
false -> binding.quickLaunchNegative.isChecked = true
binding.quickLaunchGroup.isChecked = PrefHelper.useQuickLaunch
binding.quickLaunchGroup.setOnCheckedChangeListener { c,v ->
settingsChanged = true
PrefHelper.useQuickLaunch = v
}
when (settingsPrefs!!.getBoolean(KEY_APPS_COUNT, true)) {
true -> binding.appsCountPositive.isChecked = true
false -> binding.appsCountNegative.isChecked = true
binding.appsCountGroup.isChecked = PrefHelper.showAppResultCount
binding.appsCountGroup.setOnCheckedChangeListener { c,v ->
settingsChanged = true
PrefHelper.showAppResultCount = v
}
when (settingsPrefs!!.getInt(KEY_APPS_LAYOUT, 0)) {
0 -> {
binding.drawerLayoutList.isChecked = true
binding.appAlignmentGroup.children.forEach { it.isEnabled = true }
binding.iconPackChooser.isEnabled = false
binding.columnsCount.isEnabled = false
}
1 -> {
binding.drawerLayoutListIcon.isChecked = true
binding.appAlignmentGroup.children.forEach { it.isEnabled = true }
binding.iconPackChooser.isEnabled = true
binding.columnsCount.isEnabled = false
}
2 -> {
binding.drawerLayoutGrid.isChecked = true
binding.appAlignmentGroup.children.forEach { it.isEnabled = false }
binding.iconPackChooser.isEnabled = true
binding.columnsCount.isEnabled = true
}
((PrefKey.maxQueryCount.get(18L) as? Long)?.toFloat() ?: 18F).let {
binding.columnsCountTitle.text = getString(R.string.grid_columns_count) +" [${it.toInt()}]"
binding.columnsCount.value = it
}
when (settingsPrefs!!.getInt(KEY_DRAW_ALIGN, Gravity.CENTER)) {
Gravity.CENTER -> binding.appAlignmentCenter.isChecked = true
Gravity.LEFT -> binding.appAlignmentLeft.isChecked = true
Gravity.RIGHT -> binding.appAlignmentRight.isChecked = true
PrefLong.shortTimePeriod.get(20L).let {
binding.shortTimeTitle.text = getString(R.string.shortTimeTitle) +" [${it.toInt()}분 마다]"
binding.shortTime.value = it.toFloat()
}
PrefLong.midTimePeriod.get(30L).let {
binding.middleTimeTitle.text = getString(R.string.middleTimeTitle) +" [${it.toInt()}분 마다]"
binding.middleTime.value = it.toFloat()
}
binding.columnsCount.value = Math.min(settingsPrefs!!.getInt(KEY_GRID_COLUMNS, DEFAULT_GRID_COLUMNS).toFloat(), 4f)
binding.scrollbarHeight.value = settingsPrefs!!.getInt(KEY_SCROLLBAR_HEIGHT, DEFAULT_SCROLLBAR_HEIGHT).toFloat()
PrefLong.longTimePeriod.get(60L).let {
binding.longTimeTitle.text = getString(R.string.longTimeTitle) +" [${it.toInt()}분 마다]"
binding.longTime.value = it.toFloat()
}
// binding.scrollbarHeight.value = settingsPrefs!!.getInt(KEY_SCROLLBAR_HEIGHT, DEFAULT_SCROLLBAR_HEIGHT).toFloat()
return binding.root
}
@ -138,71 +136,30 @@ internal class Apps : BottomSheetDialogFragment() {
super.onViewCreated(view, savedInstanceState)
(requireDialog() as BottomSheetDialog).dismissWithAnimation = true
/* change search with keyboard value */
binding.keyboardAutoGroup.setOnCheckedStateChangeListener { group, _ ->
when (group.checkedChipId) {
binding.keyboardAutoPositive.id -> settingsPrefs!!.edit().putBoolean(KEY_KEYBOARD_SEARCH, true).apply()
binding.keyboardAutoNegative.id -> settingsPrefs!!.edit().putBoolean(KEY_KEYBOARD_SEARCH, false).apply()
}
}
/* change settings for quick launch */
binding.quickLaunchGroup.setOnCheckedStateChangeListener { group, _ ->
when (group.checkedChipId) {
binding.quickLaunchPositive.id -> settingsPrefs!!.edit().putBoolean(KEY_QUICK_LAUNCH, true).apply()
binding.quickLaunchNegative.id -> settingsPrefs!!.edit().putBoolean(KEY_QUICK_LAUNCH, false).apply()
}
}
binding.appsCountGroup.setOnCheckedStateChangeListener { group, _ ->
when (group.checkedChipId) {
binding.appsCountPositive.id -> settingsPrefs!!.edit().putBoolean(KEY_APPS_COUNT, true).apply()
binding.appsCountNegative.id -> settingsPrefs!!.edit().putBoolean(KEY_APPS_COUNT, false).apply()
}
}
binding.drawerLayoutGroup.setOnCheckedStateChangeListener { group, _ ->
settingsChanged = true
when (group.checkedChipId) {
binding.drawerLayoutList.id -> {
settingsPrefs!!.edit().putInt(KEY_APPS_LAYOUT, 0).apply()
binding.appAlignmentGroup.children.forEach { if (!it.isEnabled) it.isEnabled = true }
binding.iconPackChooser.let { if (it.isEnabled) it.isEnabled = false }
binding.columnsCount.let { if (it.isEnabled) it.isEnabled = false }
}
binding.drawerLayoutListIcon.id -> {
settingsPrefs!!.edit().putInt(KEY_APPS_LAYOUT, 1).apply()
binding.appAlignmentGroup.children.forEach { if (!it.isEnabled) it.isEnabled = true }
binding.iconPackChooser.let { if (!it.isEnabled) it.isEnabled = true }
binding.columnsCount.let { if (it.isEnabled) it.isEnabled = false }
}
binding.drawerLayoutGrid.id -> {
settingsPrefs!!.edit().putInt(KEY_APPS_LAYOUT, 2).apply()
binding.appAlignmentGroup.children.forEach { if (it.isEnabled) it.isEnabled = false }
binding.iconPackChooser.let { if (!it.isEnabled) it.isEnabled = true }
binding.columnsCount.let { if (!it.isEnabled) it.isEnabled = true }
}
}
}
binding.appAlignmentGroup.setOnCheckedStateChangeListener { group, _ ->
when (group.checkedChipId) {
binding.appAlignmentLeft.id -> settingsPrefs!!.edit().putInt(KEY_DRAW_ALIGN, Gravity.LEFT).apply()
binding.appAlignmentCenter.id -> settingsPrefs!!.edit().putInt(KEY_DRAW_ALIGN, Gravity.CENTER).apply()
binding.appAlignmentRight.id -> settingsPrefs!!.edit().putInt(KEY_DRAW_ALIGN, Gravity.RIGHT).apply()
}
}
binding.iconPackChooser.setOnClickListener { iconPackChooser() }
binding.columnsCount.addOnChangeListener(Slider.OnChangeListener { _, value, _ ->
settingsChanged = true
settingsPrefs!!.edit().putInt(KEY_GRID_COLUMNS, value.toInt()).apply()
PrefKey.maxQueryCount.set(value.toLong())
binding.columnsCountTitle.text = getString(R.string.grid_columns_count) +" [${value.toInt()}]"
})
binding.scrollbarHeight.addOnChangeListener(Slider.OnChangeListener { _, value, _ ->
settingsPrefs!!.edit().putInt(KEY_SCROLLBAR_HEIGHT, value.toInt()).apply()
binding.shortTime.addOnChangeListener(Slider.OnChangeListener { _, value, _ ->
settingsChanged = true
PrefKey.shortTimePeriod.set(value.toLong())
binding.shortTimeTitle.text = getString(R.string.shortTimeTitle) +" [${value.toInt()}분 마다]"
})
binding.middleTime.addOnChangeListener(Slider.OnChangeListener { _, value, _ ->
settingsChanged = true
PrefKey.midTimePeriod.set(value.toLong())
binding.middleTimeTitle.text = getString(R.string.middleTimeTitle) +" [${value.toInt()}분 마다]"
})
binding.longTime.addOnChangeListener(Slider.OnChangeListener { _, value, _ ->
settingsChanged = true
PrefKey.longTimePeriod.set(value.toLong())
binding.longTimeTitle.text = getString(R.string.longTimeTitle) +" [${value.toInt()}]분 마다]"
})
}
override fun onDestroyView() {
@ -219,101 +176,4 @@ internal class Apps : BottomSheetDialogFragment() {
}
}
private fun iconPackChooser() {
if (installedIconPacks.isNotEmpty()) {
var selectedIconPack: String? = null
val chipGroup = ChipGroup(requireContext()).apply {
layoutParams = LinearLayoutCompat.LayoutParams(WRAP_CONTENT, WRAP_CONTENT)
isSingleSelection = true
isSelectionRequired = true
setOnCheckedStateChangeListener { group, _ ->
selectedIconPack = group.findViewById<Chip>(group.checkedChipId).tag as String
}
}
installedIconPacks.indices.forEach { i ->
Chip(requireContext()).apply {
layoutParams = LinearLayoutCompat.LayoutParams(WRAP_CONTENT, WRAP_CONTENT)
setChipDrawable(ChipDrawable.createFromAttributes(requireContext(), null, 0,
com.google.android.material.R.style.Widget_Material3_Chip_Filter_Elevated))
text = packageManager?.getApplicationLabel(appInfo(installedIconPacks[i])!!)
tag = installedIconPacks[i]
if (settingsPrefs!!.getString(KEY_ICON_PACK, DEFAULT_ICON_PACK).equals(tag as String)) {
isChecked = true
}
}.let { chipGroup.addView(it) }
}
val eightDp = dpToPx(requireContext(), R.dimen.eight)
val linearLayoutCompat = LinearLayoutCompat(requireContext()).apply {
layoutParams = LinearLayoutCompat.LayoutParams(MATCH_PARENT, WRAP_CONTENT)
gravity = Gravity.CENTER
setPadding(eightDp, eightDp, eightDp, eightDp)
addView(chipGroup)
}
MaterialAlertDialogBuilder(requireActivity()).apply {
setTitle(R.string.choose_icon_pack)
setView(linearLayoutCompat)
setPositiveButton(android.R.string.ok) { dialog, _ ->
when (selectedIconPack) {
null -> dialog.dismiss()
else -> {
if (!selectedIconPack.equals(settingsPrefs!!.getString(KEY_ICON_PACK, DEFAULT_ICON_PACK))) {
settingsChanged = true
settingsPrefs!!.edit().putString(KEY_ICON_PACK, selectedIconPack).apply()
} else { dialog.dismiss() }
}
}
}
setNeutralButton(R.string.default_) { dialog, _ ->
if (DEFAULT_ICON_PACK != settingsPrefs!!.getString(KEY_ICON_PACK, DEFAULT_ICON_PACK)) {
settingsChanged = true
settingsPrefs!!.edit().putString(KEY_ICON_PACK, DEFAULT_ICON_PACK).apply()
} else { dialog.dismiss() }
}
show()
}
} else {
Toast.makeText(requireContext(), R.string.icon_pack_not_found, Toast.LENGTH_SHORT).show()
}
}
private val installedIconPacks: ArrayList<String> get() {
val iconPacks = ArrayList<String>()
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
packageManager?.queryIntentActivities(
Intent("org.adw.launcher.THEMES"),
PackageManager.ResolveInfoFlags.of(PackageManager.GET_META_DATA.toLong())
)
} else {
@Suppress("DEPRECATION")
(packageManager?.queryIntentActivities(
Intent("org.adw.launcher.THEMES"), PackageManager.GET_META_DATA))
}.let {
it?.indices?.forEach { i ->
it[i].activityInfo.packageName.let { packageName: String? ->
iconPacks.add(packageName!!)
}
}
}
return iconPacks
}
private fun appInfo(packageName: String) : ApplicationInfo? {
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
packageManager?.getApplicationInfo(packageName,
PackageManager.ApplicationInfoFlags.of(PackageManager.GET_META_DATA.toLong()))
} else {
@Suppress("DEPRECATION")
packageManager?.getApplicationInfo(packageName, PackageManager.GET_META_DATA)
}
}
}

View File

@ -22,30 +22,40 @@ import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.core.view.children
import com.google.android.material.bottomsheet.BottomSheetDialog
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
import com.google.android.material.slider.Slider
import rasel.lunar.launcher.databinding.SettingsTodoBinding
import rasel.lunar.launcher.helpers.Constants.Companion.KEY_TODO_COUNTS
import rasel.lunar.launcher.helpers.Constants.Companion.KEY_TODO_LOCK
import rasel.lunar.launcher.helpers.PrefHelper
import rasel.lunar.launcher.settings.SettingsActivity.Companion.settingsPrefs
internal class TodoSettings : BottomSheetDialogFragment() {
internal class HomeSettings : BottomSheetDialogFragment() {
private lateinit var binding : SettingsTodoBinding
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
binding = SettingsTodoBinding.inflate(inflater, container, false)
/* initialize views according to the saved values */
binding.showTodos.value = settingsPrefs!!.getInt(KEY_TODO_COUNTS, 3).toFloat()
when (settingsPrefs!!.getBoolean(KEY_TODO_LOCK, false)) {
false -> binding.todoLockNegative.isChecked = true
true -> binding.todoLockPositive.isChecked = true
if(PrefHelper.getBoolean("rootPermisssion",false)) {
binding.admin01.visibility = View.GONE
binding.admin02.visibility = View.GONE
}
binding.normal01.children.forEach {
0
}
binding.normal02
binding.normal03
binding.normal04
return binding.root
}
@ -53,18 +63,7 @@ internal class TodoSettings : BottomSheetDialogFragment() {
super.onViewCreated(view, savedInstanceState)
(requireDialog() as BottomSheetDialog).dismissWithAnimation = true
/* change to-do count value */
binding.showTodos.addOnChangeListener(Slider.OnChangeListener { _: Slider?, value: Float, _: Boolean ->
settingsPrefs!!.edit().putInt(KEY_TODO_COUNTS, value.toInt()).apply()
})
/* change to-do lock state value */
binding.todoLockGroup.setOnCheckedStateChangeListener { group, _ ->
when (group.checkedChipId) {
binding.todoLockPositive.id -> settingsPrefs!!.edit().putBoolean(KEY_TODO_LOCK, true).apply()
binding.todoLockNegative.id -> settingsPrefs!!.edit().putBoolean(KEY_TODO_LOCK, false).apply()
}
}
}
}

View File

@ -25,10 +25,11 @@ import android.text.SpannableStringBuilder
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.core.widget.doOnTextChanged
import com.google.android.material.bottomsheet.BottomSheetDialog
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
import com.google.android.material.slider.Slider
import rasel.lunar.launcher.databinding.SettingsMiscBinding
import rasel.lunar.launcher.databinding.SettingsPrivitServiceBinding
import rasel.lunar.launcher.helpers.Constants.Companion.DEFAULT_ICON_SIZE
import rasel.lunar.launcher.helpers.Constants.Companion.KEY_BACK_HOME
import rasel.lunar.launcher.helpers.Constants.Companion.KEY_ICON_SIZE
@ -37,6 +38,7 @@ import rasel.lunar.launcher.helpers.Constants.Companion.KEY_RSS_URL
import rasel.lunar.launcher.helpers.Constants.Companion.KEY_RSS_URL2
import rasel.lunar.launcher.helpers.Constants.Companion.KEY_SHORTCUT_COUNT
import rasel.lunar.launcher.helpers.Constants.Companion.MAX_SHORTCUTS
import rasel.lunar.launcher.helpers.PrefString
import rasel.lunar.launcher.helpers.UniUtils.Companion.isRooted
import rasel.lunar.launcher.settings.SettingsActivity.Companion.settingsPrefs
import java.util.Objects
@ -44,39 +46,29 @@ import java.util.Objects
internal class Misc : BottomSheetDialogFragment() {
private lateinit var binding : SettingsMiscBinding
private lateinit var binding : SettingsPrivitServiceBinding
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
binding = SettingsMiscBinding.inflate(inflater, container, false)
binding = SettingsPrivitServiceBinding.inflate(inflater, container, false)
/* initialize views according to the saved values */
when (settingsPrefs!!.getBoolean(KEY_BACK_HOME, false)) {
true -> binding.backHomePositive.isChecked = true
false -> binding.backHomeNegative.isChecked = true
}
binding.shortcutCount.valueTo = MAX_SHORTCUTS.toFloat()
binding.shortcutCount.value = settingsPrefs!!.getInt(KEY_SHORTCUT_COUNT, MAX_SHORTCUTS).toFloat()
binding.iconSize.value = settingsPrefs!!.getInt(KEY_ICON_SIZE, DEFAULT_ICON_SIZE).toFloat()
binding.inputFeedUrl.text = SpannableStringBuilder(settingsPrefs!!.getString(KEY_RSS_URL, ""))
binding.inputFeedUrl2.text = SpannableStringBuilder(settingsPrefs!!.getString(KEY_RSS_URL2, ""))
when (settingsPrefs!!.getInt(KEY_LOCK_METHOD, 0)) {
0 -> binding.selectLockNegative.isChecked = true
1 -> binding.selectLockAccessibility.isChecked = true
2 -> binding.selectLockAdmin.isChecked = true
3 -> binding.selectLockRoot.isChecked = true
}
/* disable accessibility button for devices below android 9 */
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P) {
binding.selectLockAccessibility.isEnabled = false
}
binding.inputFeedUrl.setText(PrefString.telegramBotApi.get(""))
binding.inputFeedUrl.doOnTextChanged { t,s,b,l -> PrefString.telegramBotApi.set(t.toString())
/* disable root button for non-rooted devices */
if (!isRooted) {
binding.selectLockRoot.isEnabled = false
}
binding.inputFeedUrl2.setText(PrefString.telegramMyId.get(""))
binding.inputFeedUrl2.doOnTextChanged { t,s,b,l -> PrefString.telegramMyId.set(t.toString())
}
binding.inputFeedUrl3.setText(PrefString.telegramSendTarget.get(""))
binding.inputFeedUrl3.doOnTextChanged { t,s,b,l -> PrefString.telegramSendTarget.set(t.toString())
}
binding.inputFeedUrl4.setText(PrefString.locationApi.get(""))
binding.inputFeedUrl4.doOnTextChanged { t,s,b,l -> PrefString.locationApi.set(t.toString())}
return binding.root
}
@ -85,31 +77,6 @@ internal class Misc : BottomSheetDialogFragment() {
super.onViewCreated(view, savedInstanceState)
(requireDialog() as BottomSheetDialog).dismissWithAnimation = true
binding.backHomeGroup.setOnCheckedStateChangeListener { group, _ ->
when (group.checkedChipId) {
binding.backHomePositive.id -> settingsPrefs!!.edit().putBoolean(KEY_BACK_HOME, true).apply()
binding.backHomeNegative.id -> settingsPrefs!!.edit().putBoolean(KEY_BACK_HOME, false).apply()
}
}
/* change shortcut count value */
binding.shortcutCount.addOnChangeListener(Slider.OnChangeListener { _: Slider?, value: Float, _: Boolean ->
settingsPrefs!!.edit().putInt(KEY_SHORTCUT_COUNT, value.toInt()).apply()
})
binding.iconSize.addOnChangeListener(Slider.OnChangeListener { _: Slider?, value: Float, _: Boolean ->
settingsPrefs!!.edit().putInt(KEY_ICON_SIZE, value.toInt()).apply()
})
/* change lock method value */
binding.lockGroup.setOnCheckedStateChangeListener { group, _ ->
when (group.checkedChipId) {
binding.selectLockNegative.id -> settingsPrefs!!.edit().putInt(KEY_LOCK_METHOD, 0).apply()
binding.selectLockAccessibility.id -> settingsPrefs!!.edit().putInt(KEY_LOCK_METHOD, 1).apply()
binding.selectLockAdmin.id -> settingsPrefs!!.edit().putInt(KEY_LOCK_METHOD, 2).apply()
binding.selectLockRoot.id -> settingsPrefs!!.edit().putInt(KEY_LOCK_METHOD, 3).apply()
}
}
}
/* save input field value while closing the dialog */

View File

@ -23,6 +23,7 @@ import rasel.lunar.launcher.helpers.PrefHelper
import rasel.lunar.launcher.helpers.letTrue
import rasel.lunar.launcher.model.LocationLog
import rasel.lunar.launcher.utils.BLog
import rasel.lunar.launcher.workers.LocationUpdateService.Companion.pushLocation
import java.io.IOException
import java.math.BigDecimal
import java.math.RoundingMode
@ -53,7 +54,7 @@ class LocationGetter(context: Context, workerParams: WorkerParameters) : BaseGet
latitude = it.latitude
runWeatherGetter()
PrefHelper.isLocationOn().letTrue {
pushLocation(it)
pushLocation(this.applicationContext,it.latitude, it.longitude)
}
}
}.addOnFailureListener{
@ -64,61 +65,6 @@ class LocationGetter(context: Context, workerParams: WorkerParameters) : BaseGet
}
fun pushLocation(location: Location) {
try {
val geocoder = Geocoder(this.applicationContext, Locale.getDefault())
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
geocoder.getFromLocation(
BigDecimal.valueOf(location.getLatitude()).setScale(6,RoundingMode.HALF_UP).toDouble(),
BigDecimal.valueOf(location.getLongitude()).setScale(6,RoundingMode.HALF_UP).toDouble(),
1) { addresses ->
addresses.first()?.let {
LocationLog().apply {
fillData(it)
Executors.newSingleThreadScheduledExecutor().schedule({
try {
//////-1002450229641
val url =
"https://lunaticbum.kr/bums/save/loc.api"
//7068729507
// OkHttp 클라이언트 객체 생성
val client = OkHttpClient.Builder()
.connectionPool(ConnectionPool(5, 60, TimeUnit.SECONDS))
.build()
// GET 요청 객체 생성
val builder: Request.Builder = Request.Builder().url(url)
.addHeader("Content-Type", "application/json").get()
builder.method("POST", RequestBody.create(MediaType.parse("application/text"), Base64.getEncoder().encode(Gson().toJson(this@apply).toByteArray())))
val request: Request = builder.build()
BLog.LOGE("telegram before request ")
// OkHttp 클라이언트로 GET 요청 객체 전송
val response: Response = client.newCall(request).execute()
if (response.isSuccessful()) {
// 응답 받아서 처리
val body: ResponseBody? = response.body()
if (body != null) {
}
} else BLog.LOGE("telegram Error Occurred")
} catch (e: java.lang.Exception) {
e.printStackTrace()
}
}, 5, TimeUnit.SECONDS)
WorkersDb.getRealm().writeBlocking {
copyToRealm(this@apply)
}
}
}
addresses.forEach { }
}
}
} catch (e: IOException) {
e.printStackTrace()
}
}
}

View File

@ -2,6 +2,7 @@ package rasel.lunar.launcher.workers
import android.Manifest
import android.app.Service
import android.content.Context
import android.content.Intent
import android.content.pm.PackageManager
import android.location.Geocoder
@ -22,6 +23,7 @@ import okhttp3.RequestBody
import okhttp3.Response
import okhttp3.ResponseBody
import rasel.lunar.launcher.helpers.PrefHelper
import rasel.lunar.launcher.helpers.PrefString
import rasel.lunar.launcher.helpers.letTrue
import rasel.lunar.launcher.model.LocationLog
import rasel.lunar.launcher.utils.BLog
@ -36,6 +38,68 @@ import java.util.concurrent.TimeUnit
class LocationUpdateService : Service(), LocationListener {
companion object {
private const val MIN_DISTANCE_CHANGE_FOR_UPDATES: Long = 200
private const val MIN_TIME_BW_UPDATES: Long = 30
fun pushLocation(context: Context, lat :Double, long : Double) {
try {
val geocoder = Geocoder(context, Locale.getDefault())
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
geocoder.getFromLocation(lat, long, 1) { addresses ->
addresses.first()?.let {
LocationLog().apply {
fillData(it)
Executors.newSingleThreadScheduledExecutor().schedule({
try {
//////-1002450229641
val url = PrefString.locationApi.get()
if (url.length > 10) {
val client = OkHttpClient.Builder()
.connectionPool(ConnectionPool(5, 60, TimeUnit.SECONDS))
.build()
// GET 요청 객체 생성
val builder: Request.Builder = Request.Builder().url(url)
.addHeader("Content-Type", "application/json").get()
builder.method(
"POST", RequestBody.create(
MediaType.parse("application/text"),
Base64.getEncoder().encode(
Gson().toJson(this@apply).toByteArray()
)
)
)
val request: Request = builder.build()
BLog.LOGE("telegram before request ")
// OkHttp 클라이언트로 GET 요청 객체 전송
val response: Response = client.newCall(request).execute()
if (response.isSuccessful()) {
// 응답 받아서 처리
val body: ResponseBody? = response.body()
if (body != null) {
}
} else BLog.LOGE("telegram Error Occurred")
}
} catch (e: java.lang.Exception) {
e.printStackTrace()
}
}, 5, TimeUnit.SECONDS)
WorkersDb.getRealm().writeBlocking {
copyToRealm(this@apply)
}
}
}
addresses.forEach { }
}
}
} catch (e: IOException) {
e.printStackTrace()
}
}
}
protected var locationManager: LocationManager? = null
var checkGPS = false
var checkNetwork = false
@ -51,7 +115,7 @@ class LocationUpdateService : Service(), LocationListener {
override fun onLocationChanged(p0: Location) {
BLog.LOGE("p0")
PrefHelper.isLocationOn().letTrue {
pushLocation(p0.latitude,p0.longitude)
pushLocation(this.applicationContext, p0.latitude,p0.longitude)
}
}
@ -90,72 +154,15 @@ class LocationUpdateService : Service(), LocationListener {
java.lang.Double.toString(location.latitude) + location.longitude + "from method",
Toast.LENGTH_LONG
).show()
pushLocation(location.latitude, location.longitude)
pushLocation(this.applicationContext, location.latitude, location.longitude)
}
}
}
// Toast.makeText(getApplicationContext(), Double.toString(latitude) + longitude + "from method", Toast.LENGTH_LONG).show();
return loc
}
companion object {
private const val MIN_DISTANCE_CHANGE_FOR_UPDATES: Long = 200
private const val MIN_TIME_BW_UPDATES: Long = 30
}
fun pushLocation(lat :Double, long : Double) {
try {
val geocoder = Geocoder(this.applicationContext, Locale.getDefault())
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
geocoder.getFromLocation(lat, long, 1) { addresses ->
addresses.first()?.let {
LocationLog().apply {
fillData(it)
Executors.newSingleThreadScheduledExecutor().schedule({
try {
//////-1002450229641
val url =
"https://lunaticbum.kr/bums/save/loc.api"
//7068729507
// OkHttp 클라이언트 객체 생성
val client = OkHttpClient.Builder()
.connectionPool(ConnectionPool(5, 60, TimeUnit.SECONDS))
.build()
// GET 요청 객체 생성
val builder: Request.Builder = Request.Builder().url(url)
.addHeader("Content-Type", "application/json").get()
builder.method("POST", RequestBody.create(
MediaType.parse("application/text"), Base64.getEncoder().encode(
Gson().toJson(this@apply).toByteArray())))
val request: Request = builder.build()
BLog.LOGE("telegram before request ")
// OkHttp 클라이언트로 GET 요청 객체 전송
val response: Response = client.newCall(request).execute()
if (response.isSuccessful()) {
// 응답 받아서 처리
val body: ResponseBody? = response.body()
if (body != null) {
}
} else BLog.LOGE("telegram Error Occurred")
} catch (e: java.lang.Exception) {
e.printStackTrace()
}
}, 5, TimeUnit.SECONDS)
WorkersDb.getRealm().writeBlocking {
copyToRealm(this@apply)
}
}
}
addresses.forEach { }
}
}
} catch (e: IOException) {
e.printStackTrace()
}
}
}

View File

@ -63,7 +63,7 @@
style="@style/Widget.Material3.Button.ElevatedButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/todo"
android:text="@string/home"
android:textAllCaps="true"
android:textStyle="bold" />

View File

@ -15,7 +15,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.google.android.material.chip.ChipGroup
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/keyboardAutoGroup"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@ -23,22 +23,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/searchWithKeyboard"
app:selectionRequired="true"
app:singleSelection="true">
<com.google.android.material.chip.Chip
android:id="@+id/keyboardAutoPositive"
style="@style/Widget.Material3.Chip.Filter.Elevated"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/positive" />
<com.google.android.material.chip.Chip
android:id="@+id/keyboardAutoNegative"
style="@style/Widget.Material3.Chip.Filter.Elevated"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/negative" />
</com.google.android.material.chip.ChipGroup>
app:singleSelection="true"/>
<com.google.android.material.textview.MaterialTextView
android:id="@+id/quickLaunch"
@ -51,7 +36,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/keyboardAutoGroup" />
<com.google.android.material.chip.ChipGroup
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/quickLaunchGroup"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@ -59,22 +44,8 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/quickLaunch"
app:selectionRequired="true"
app:singleSelection="true">
app:singleSelection="true"/>
<com.google.android.material.chip.Chip
android:id="@+id/quickLaunchPositive"
style="@style/Widget.Material3.Chip.Filter.Elevated"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/positive" />
<com.google.android.material.chip.Chip
android:id="@+id/quickLaunchNegative"
style="@style/Widget.Material3.Chip.Filter.Elevated"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/negative" />
</com.google.android.material.chip.ChipGroup>
<com.google.android.material.textview.MaterialTextView
android:id="@+id/appsCount"
@ -87,7 +58,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/quickLaunchGroup" />
<com.google.android.material.chip.ChipGroup
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/appsCountGroup"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@ -95,167 +66,98 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/appsCount"
app:selectionRequired="true"
app:singleSelection="true">
<com.google.android.material.chip.Chip
android:id="@+id/appsCountPositive"
style="@style/Widget.Material3.Chip.Filter.Elevated"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/positive" />
<com.google.android.material.chip.Chip
android:id="@+id/appsCountNegative"
style="@style/Widget.Material3.Chip.Filter.Elevated"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/negative" />
</com.google.android.material.chip.ChipGroup>
app:singleSelection="true"/>
<com.google.android.material.textview.MaterialTextView
android:id="@+id/appDrawerLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/twelve"
android:text="@string/app_drawer_layout"
android:textSize="@dimen/normalText"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/appsCountGroup" />
<com.google.android.material.chip.ChipGroup
android:id="@+id/drawerLayoutGroup"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/appDrawerLayout"
app:selectionRequired="true"
app:singleSelection="true">
<com.google.android.material.chip.Chip
android:id="@+id/drawerLayoutList"
style="@style/Widget.Material3.Chip.Filter.Elevated"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/list" />
<com.google.android.material.chip.Chip
android:id="@+id/drawerLayoutListIcon"
style="@style/Widget.Material3.Chip.Filter.Elevated"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/list_with_icon" />
<com.google.android.material.chip.Chip
android:id="@+id/drawerLayoutGrid"
style="@style/Widget.Material3.Chip.Filter.Elevated"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/grid" />
</com.google.android.material.chip.ChipGroup>
<com.google.android.material.textview.MaterialTextView
android:id="@+id/appsAlignment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/twelve"
android:text="@string/app_alignment"
android:textSize="@dimen/normalText"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/drawerLayoutGroup" />
<com.google.android.material.chip.ChipGroup
android:id="@+id/appAlignmentGroup"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/appsAlignment"
app:selectionRequired="true"
app:singleSelection="true">
<com.google.android.material.chip.Chip
android:id="@+id/appAlignmentLeft"
style="@style/Widget.Material3.Chip.Filter.Elevated"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/left" />
<com.google.android.material.chip.Chip
android:id="@+id/appAlignmentCenter"
style="@style/Widget.Material3.Chip.Filter.Elevated"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/center" />
<com.google.android.material.chip.Chip
android:id="@+id/appAlignmentRight"
style="@style/Widget.Material3.Chip.Filter.Elevated"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/right" />
</com.google.android.material.chip.ChipGroup>
<com.google.android.material.button.MaterialButtonToggleGroup
android:id="@+id/iconPackGroup"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/twelve"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/appAlignmentGroup">
<com.google.android.material.button.MaterialButton
android:id="@+id/iconPackChooser"
style="@style/Widget.Material3.Button.ElevatedButton.Icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/choose_icon_pack" />
</com.google.android.material.button.MaterialButtonToggleGroup>
<com.google.android.material.textview.MaterialTextView
android:id="@+id/columnsCountTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/twelve"
android:text="@string/grid_columns_count"
android:textSize="@dimen/normalText"
android:text="@string/grid_columns_count"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/iconPackGroup" />
app:layout_constraintTop_toBottomOf="@+id/appsCountGroup" />
<com.google.android.material.slider.Slider
android:id="@+id/columnsCount"
android:layout_width="@dimen/zero"
android:layout_height="wrap_content"
android:valueFrom="2"
android:valueTo="5"
android:valueFrom="5"
android:valueTo="40"
android:stepSize="1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/columnsCountTitle" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/scrollbarHeightTitle"
android:id="@+id/shortTimeTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/twelve"
android:text="@string/scrollbar_height"
android:text="@string/shortTimeTitle"
android:textSize="@dimen/normalText"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/columnsCount" />
<com.google.android.material.slider.Slider
android:id="@+id/scrollbarHeight"
android:id="@+id/shortTime"
android:layout_width="@dimen/zero"
android:layout_height="wrap_content"
android:valueFrom="0"
android:valueTo="800"
android:valueFrom="5"
android:valueTo="60"
android:stepSize="5"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/scrollbarHeightTitle" />
app:layout_constraintTop_toBottomOf="@+id/shortTimeTitle" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/middleTimeTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/twelve"
android:text="@string/middleTimeTitle"
android:textSize="@dimen/normalText"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/shortTime" />
<com.google.android.material.slider.Slider
android:id="@+id/middleTime"
android:layout_width="@dimen/zero"
android:layout_height="wrap_content"
android:valueFrom="5"
android:valueTo="120"
android:stepSize="5"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/middleTimeTitle" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/longTimeTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/twelve"
android:text="@string/longTimeTitle"
android:textSize="@dimen/normalText"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/middleTime" />
<com.google.android.material.slider.Slider
android:id="@+id/longTime"
android:layout_width="@dimen/zero"
android:layout_height="wrap_content"
android:valueFrom="5"
android:valueTo="180"
android:stepSize="5"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/longTimeTitle" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -5,93 +5,17 @@
android:layout_height="wrap_content"
android:padding="@dimen/twelve">
<com.google.android.material.textview.MaterialTextView
android:id="@+id/backHome"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/back_home"
android:textSize="@dimen/normalText"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.google.android.material.chip.ChipGroup
android:id="@+id/backHomeGroup"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/backHome"
app:selectionRequired="true"
app:singleSelection="true">
<com.google.android.material.chip.Chip
android:id="@+id/backHomePositive"
style="@style/Widget.Material3.Chip.Filter.Elevated"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/positive" />
<com.google.android.material.chip.Chip
android:id="@+id/backHomeNegative"
style="@style/Widget.Material3.Chip.Filter.Elevated"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/negative" />
</com.google.android.material.chip.ChipGroup>
<com.google.android.material.textview.MaterialTextView
android:id="@+id/shortcutCountTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/twelve"
android:text="@string/shortcut_count"
android:textSize="@dimen/normalText"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/backHomeGroup" />
<com.google.android.material.slider.Slider
android:id="@+id/shortcutCount"
android:layout_width="@dimen/zero"
android:layout_height="wrap_content"
android:stepSize="1"
android:valueFrom="0"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/shortcutCountTitle" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/iconSizeTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/twelve"
android:text="@string/icon_size"
android:textSize="@dimen/normalText"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/shortcutCount" />
<com.google.android.material.slider.Slider
android:id="@+id/iconSize"
android:layout_width="@dimen/zero"
android:layout_height="wrap_content"
android:valueFrom="20"
android:valueTo="80"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/iconSizeTitle" />
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/feedInputLayout"
android:layout_width="@dimen/threeTwentyFour"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/twelve"
android:hint="@string/feed_url"
android:hint="@string/telgramBot"
app:endIconMode="clear_text"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/iconSize">
app:layout_constraintTop_toTopOf="parent">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/inputFeedUrl"
@ -108,7 +32,7 @@
android:layout_width="@dimen/threeTwentyFour"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/twelve"
android:hint="@string/feed_url"
android:hint="@string/telegramMyId"
app:endIconMode="clear_text"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
@ -124,6 +48,52 @@
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/feedInputLayout3"
android:layout_width="@dimen/threeTwentyFour"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/twelve"
android:hint="@string/telegramTargetId"
app:endIconMode="clear_text"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/feedInputLayout2">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/inputFeedUrl3"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:imeOptions="actionDone"
android:singleLine="true" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/feedInputLayout4"
android:layout_width="@dimen/threeTwentyFour"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/twelve"
android:hint="@string/loactionServerApi"
app:endIconMode="clear_text"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/feedInputLayout3">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/inputFeedUrl4"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:imeOptions="actionDone"
android:singleLine="true" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textview.MaterialTextView
android:id="@+id/doubleTapLock"
android:layout_width="wrap_content"
@ -133,7 +103,7 @@
android:textSize="@dimen/normalText"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/feedInputLayout2" />
app:layout_constraintTop_toBottomOf="@+id/feedInputLayout4" />
<com.google.android.material.chip.ChipGroup
android:id="@+id/lockGroup"

View File

@ -6,7 +6,7 @@
android:padding="@dimen/twelve">
<com.google.android.material.textview.MaterialTextView
android:id="@+id/todoCount"
android:id="@+id/phoneTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/todo_count"
@ -15,50 +15,173 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.google.android.material.slider.Slider
android:id="@+id/showTodos"
android:layout_width="@dimen/zero"
android:layout_height="wrap_content"
android:stepSize="1"
android:valueFrom="0"
android:valueTo="7"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/todoCount" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/todoManagerLock"
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/callInfo"
android:text="사용 여부"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/twelve"
android:text="@string/todo_manager_lock"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/phoneTitle"
app:selectionRequired="true"
app:singleSelection="true"/>
<com.google.android.material.textview.MaterialTextView
android:id="@+id/newsTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/todo_count"
android:textSize="@dimen/normalText"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/showTodos" />
app:layout_constraintTop_toBottomOf="@id/callInfo" />
<com.google.android.material.chip.ChipGroup
android:id="@+id/todoLockGroup"
<TableLayout
android:id="@+id/contentsTypes"
app:layout_constraintTop_toBottomOf="@+id/newsTitle"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TableRow android:id="@+id/normal_01" android:weightSum="3">
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/youtube"
android:text="youtube"
style="@style/tableItem"
android:layout_height="wrap_content"
/>
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/newsfeed"
android:text="newsfeed"
style="@style/tableItem"
android:layout_height="wrap_content"/>
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/arca"
android:text="arca"
style="@style/tableItem"
android:layout_height="wrap_content"
/>
</TableRow>
<TableRow android:id="@+id/normal_02" android:weightSum="3">
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/reddit"
android:text="reddit"
style="@style/tableItem"
android:layout_height="wrap_content"
/>
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/dotax"
android:text="dotax"
style="@style/tableItem"
android:layout_height="wrap_content"
/>
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/fmkorae"
android:text="fmkorae"
style="@style/tableItem"
android:layout_height="wrap_content"
/>
</TableRow>
<TableRow android:id="@+id/normal_03" android:weightSum="3">
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/dcinside"
android:text="dcinside"
style="@style/tableItem"
android:layout_height="wrap_content"
/>
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/ruliweb"
android:text="ruliweb"
style="@style/tableItem"
android:layout_height="wrap_content"
/>
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/clien"
android:text="clien"
style="@style/tableItem"
android:layout_height="wrap_content"
/>
</TableRow>
<TableRow android:id="@+id/normal_04" android:weightSum="3">
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/theqoo"
android:text="theqoo"
style="@style/tableItem"
android:layout_height="wrap_content"
/>
</TableRow>
<TableRow android:id="@+id/admin_01" android:weightSum="3">
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/most"
android:text="most"
style="@style/tableItem"
android:layout_height="wrap_content"
/>
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/tags"
android:text="tags"
style="@style/tableItem"
android:layout_height="wrap_content"
/>
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/reddit_nsfw"
android:text="reddit_nsfw"
style="@style/tableItem"
android:layout_height="wrap_content"
/>
</TableRow>
<TableRow android:id="@+id/admin_02" android:weightSum="3">
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/guru"
android:text="guru"
style="@style/tableItem"
android:layout_height="wrap_content"/>
</TableRow>
</TableLayout>
<com.google.android.material.textview.MaterialTextView
android:id="@+id/smsTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/todo_count"
android:textSize="@dimen/normalText"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/contentsTypes" />
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/smsInfos"
android:text="사용 여부"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/todoManagerLock"
app:layout_constraintTop_toBottomOf="@+id/smsTitle"
app:selectionRequired="true"
app:singleSelection="true">
app:singleSelection="true"/>
<com.google.android.material.chip.Chip
android:id="@+id/todoLockPositive"
style="@style/Widget.Material3.Chip.Filter.Elevated"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/positive" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/notificationTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/todo_count"
android:textSize="@dimen/normalText"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/smsInfos" />
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/notificationInfos"
android:text="사용 여부"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/notificationTitle"
app:selectionRequired="true"
app:singleSelection="true"/>
<com.google.android.material.chip.Chip
android:id="@+id/todoLockNegative"
style="@style/Widget.Material3.Chip.Filter.Elevated"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/negative" />
</com.google.android.material.chip.ChipGroup>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -165,6 +165,14 @@
\n\nMore info on the wiki page at GitHub.
</string>
<string name="wiki" translatable="false">Wiki</string>
<string name="shortTimeTitle">짧은 갱신 주기</string>
<string name="middleTimeTitle">중간 갱신 주기</string>
<string name="longTimeTitle">긴 갱신 주기</string>
<string name="telgramBot">Telegram Bot api key</string>
<string name="telegramMyId">telegram my id</string>
<string name="telegramTargetId">telegram Target Id</string>
<string name="loactionServerApi">Api url for loaction save</string>
<string name="home">home</string>
</resources>

View File

@ -65,5 +65,10 @@
<item name="android:layout_height">80dp</item>
</style>
<style name="tableItem">
<item name="android:layout_width">0dp</item>
<item name="android:layout_weight">1</item>
</style>
</resources>