Page 7 Stage 3

This commit is contained in:
icewithcola 2024-07-27 16:07:47 +08:00
parent 4d35371e4a
commit 71c168488b
29 changed files with 906 additions and 404 deletions

View file

@ -12,8 +12,8 @@ android {
applicationId = "uk.kagurach.android101" applicationId = "uk.kagurach.android101"
minSdk = 28 minSdk = 28
targetSdk = 34 targetSdk = 34
versionCode = 172 versionCode = 173
versionName = "1.7.2" versionName = "1.7.3"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
} }
@ -44,7 +44,7 @@ android {
androidResources { androidResources {
generateLocaleConfig = true generateLocaleConfig = true
} }
buildFeatures{ buildFeatures {
viewBinding = true viewBinding = true
} }
} }
@ -75,6 +75,10 @@ dependencies {
implementation(libs.androidx.datastore.rxjava3) implementation(libs.androidx.datastore.rxjava3)
implementation(libs.androidx.datastore.preferences) implementation(libs.androidx.datastore.preferences)
implementation(libs.androidx.work) implementation(libs.androidx.work)
implementation(libs.androidx.camera.core)
implementation(libs.androidx.camera.view)
implementation(libs.androidx.camera.lifecycle)
implementation(libs.androidx.camera.camera2)
testImplementation(libs.junit) testImplementation(libs.junit)

View file

@ -1,13 +1,11 @@
package uk.kagurach.android101 package uk.kagurach.android101
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import org.junit.Assert.assertEquals
import org.junit.Test import org.junit.Test
import org.junit.runner.RunWith import org.junit.runner.RunWith
import org.junit.Assert.*
/** /**
* Instrumented test, which will execute on an Android device. * Instrumented test, which will execute on an Android device.
* *

View file

@ -3,27 +3,27 @@ package uk.kagurach.android101
import org.junit.Assert import org.junit.Assert
import org.junit.Test import org.junit.Test
import uk.kagurach.android101.helper.ColorHelper import uk.kagurach.android101.helper.ColorHelper
import org.junit.runner.RunWith
class TestColorHelper { class TestColorHelper {
val colorHelper = ColorHelper() val colorHelper = ColorHelper()
@Test @Test
fun Test_toColorInt(){ fun Test_toColorInt() {
Assert.assertEquals(0,colorHelper.toColorInt(0, 0, 0)) Assert.assertEquals(0, colorHelper.toColorInt(0, 0, 0))
Assert.assertEquals(0xfffffe,colorHelper.toColorInt(255, 0xff, 254)) Assert.assertEquals(0xfffffe, colorHelper.toColorInt(255, 0xff, 254))
} }
@Test(expected = Exception::class) @Test(expected = Exception::class)
fun Test_error(){ fun Test_error() {
val wtf1 = colorHelper.toColorInt(-1,256,1) val wtf1 = colorHelper.toColorInt(-1, 256, 1)
} }
@Test @Test
fun Test_toString(){ fun Test_toString() {
Assert.assertEquals("$000000",colorHelper.toString(0,"$")) Assert.assertEquals("$000000", colorHelper.toString(0, "$"))
Assert.assertEquals("#ffffff",colorHelper.toString(0xffffff)) Assert.assertEquals("#ffffff", colorHelper.toString(0xffffff))
Assert.assertEquals("#ABCD12",colorHelper.toString(0xabcd12, upperCase = true)) Assert.assertEquals("#ABCD12", colorHelper.toString(0xabcd12, upperCase = true))
} }

View file

@ -1,14 +1,21 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> <manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-feature
android:name="android.hardware.camera"
android:required="false" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" /> <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.VIBRATE" /> <uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" /> <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="READ_EXTERNAL_STORAGE" /> <uses-permission android:name="READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" /> <uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" <uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="32" /> android:maxSdkVersion="32" />
<uses-permission android:name="android.permission.CAMERA" />
<application <application
android:allowBackup="true" android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules" android:dataExtractionRules="@xml/data_extraction_rules"
@ -18,8 +25,10 @@
android:roundIcon="@mipmap/ic_launcher_round" android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="false" android:supportsRtl="false"
android:theme="@style/Theme.Android101" android:theme="@style/Theme.Android101"
android:usesCleartextTraffic="true" android:usesCleartextTraffic="true">
> <activity
android:name=".additionalActivity.CameraXActivity"
android:exported="false" />
<activity <activity
android:name=".Page7" android:name=".Page7"
android:exported="false" android:exported="false"

View file

@ -70,6 +70,16 @@ public class MainActivity extends KaBaseActivity {
new String[]{Manifest.permission.READ_MEDIA_AUDIO}, new String[]{Manifest.permission.READ_MEDIA_AUDIO},
102); 102);
} }
if (ContextCompat
.checkSelfPermission
(MainActivity.this, Manifest.permission.CAMERA)
!= PackageManager.PERMISSION_GRANTED) {
textViewAppendString(tv, "Acquiring CAMERA");
ActivityCompat.requestPermissions
(MainActivity.this,
new String[]{Manifest.permission.CAMERA},
102);
}
textViewAppendString(tv, "Check Finished"); textViewAppendString(tv, "Check Finished");
textViewAppendString(tv, "提示:常按有惊喜"); textViewAppendString(tv, "提示:常按有惊喜");
} }

View file

@ -12,6 +12,7 @@ import android.util.Log
import android.view.View import android.view.View
import android.view.View.GONE import android.view.View.GONE
import android.view.View.OnClickListener import android.view.View.OnClickListener
import android.view.View.OnLongClickListener
import android.view.View.VISIBLE import android.view.View.VISIBLE
import android.widget.Button import android.widget.Button
import android.widget.EditText import android.widget.EditText
@ -32,14 +33,14 @@ import kotlinx.coroutines.flow.map
import kotlinx.coroutines.runBlocking import kotlinx.coroutines.runBlocking
import okhttp3.Call import okhttp3.Call
import okhttp3.Callback import okhttp3.Callback
import okhttp3.MediaType
import okhttp3.MediaType.Companion.toMediaTypeOrNull import okhttp3.MediaType.Companion.toMediaTypeOrNull
import okhttp3.MultipartBody import okhttp3.MultipartBody
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import okhttp3.Request import okhttp3.Request
import okhttp3.RequestBody import okhttp3.RequestBody.Companion.asRequestBody
import okhttp3.RequestBody.Companion.toRequestBody import okhttp3.RequestBody.Companion.toRequestBody
import okhttp3.Response import okhttp3.Response
import uk.kagurach.android101.additionalActivity.CameraXActivity
import uk.kagurach.android101.helper.ToastHelper import uk.kagurach.android101.helper.ToastHelper
import java.io.File import java.io.File
import java.io.IOException import java.io.IOException
@ -77,6 +78,9 @@ class Page7 : KaBaseActivity() {
findViewById<Button>(R.id.P7ListenAudio).setOnClickListener(RecordButtonHandler()) findViewById<Button>(R.id.P7ListenAudio).setOnClickListener(RecordButtonHandler())
findViewById<Button>(R.id.P7RecordAudio).setOnClickListener(RecordButtonHandler()) findViewById<Button>(R.id.P7RecordAudio).setOnClickListener(RecordButtonHandler())
findViewById<Button>(R.id.P7SendAudio).setOnClickListener(ButtonHandler(this)) findViewById<Button>(R.id.P7SendAudio).setOnClickListener(ButtonHandler(this))
findViewById<Button>(R.id.P7ShotPhoto).setOnClickListener(PhotoButtonHandler(this))
findViewById<Button>(R.id.P7SendPhoto).setOnClickListener(ButtonHandler(this))
} }
inner class ButtonHandler(val activity: Activity) : OnClickListener { inner class ButtonHandler(val activity: Activity) : OnClickListener {
@ -90,6 +94,7 @@ class Page7 : KaBaseActivity() {
// Validate // Validate
if (botAPI.isBlank() || (chatID.isBlank() && v.id != R.id.P7SaveAndSetAPI)) { if (botAPI.isBlank() || (chatID.isBlank() && v.id != R.id.P7SaveAndSetAPI)) {
ToastHelper.ShowToast(getText(R.string.require_api).toString(), baseContext) ToastHelper.ShowToast(getText(R.string.require_api).toString(), baseContext)
return
} }
when (v.id) { when (v.id) {
@ -109,8 +114,22 @@ class Page7 : KaBaseActivity() {
} }
R.id.P7SendMessageButton -> { // 发送文本 R.id.P7SendMessageButton -> { // 发送文本
tgHandler.postText( val text =
activity.findViewById<EditText>(R.id.P7SendMessageText).text.toString() activity.findViewById<EditText>(R.id.P7SendMessageText).text.toString()
if (text.isEmpty()) {
return
}
tgHandler.postText(text) { result ->
runOnUiThread {
resultTextField.text = result
}
}
}
R.id.P7SendAudio -> { // 发送音频
tgHandler.postAudio(
audioUri,
baseContext,
) { result -> ) { result ->
runOnUiThread { runOnUiThread {
resultTextField.text = result resultTextField.text = result
@ -118,15 +137,13 @@ class Page7 : KaBaseActivity() {
} }
} }
R.id.P7SendAudio ->{ // 发送音频 R.id.P7SendPhoto -> { // 发送照片
tgHandler.postAudio( tgHandler.postImage(photoPath) { result ->
audioUri,
baseContext,
){result ->
runOnUiThread { runOnUiThread {
resultTextField.text = result resultTextField.text = result
} }
} }
} }
else -> resultTextField.text = "?" else -> resultTextField.text = "?"
@ -157,13 +174,13 @@ class Page7 : KaBaseActivity() {
val recordIntent = Intent(MediaStore.Audio.Media.RECORD_SOUND_ACTION) val recordIntent = Intent(MediaStore.Audio.Media.RECORD_SOUND_ACTION)
try { try {
startActivityForResult(recordIntent, 0) startActivityForResult(recordIntent, 0)
} catch (e : android.content.ActivityNotFoundException){ } catch (e: android.content.ActivityNotFoundException) {
Log.e("Recorder@Android101",e.printStackTrace().toString()) Log.e("Recorder@Android101", e.printStackTrace().toString())
} }
} }
R.id.P7ListenAudio -> { R.id.P7ListenAudio -> {
if (audioUri!=Uri.EMPTY){ if (audioUri != Uri.EMPTY) {
val mMediaPlayer = MediaPlayer() val mMediaPlayer = MediaPlayer()
mMediaPlayer.reset() mMediaPlayer.reset()
mMediaPlayer.setAudioAttributes( mMediaPlayer.setAudioAttributes(
@ -171,13 +188,24 @@ class Page7 : KaBaseActivity() {
.setContentType(AudioAttributes.CONTENT_TYPE_MUSIC) .setContentType(AudioAttributes.CONTENT_TYPE_MUSIC)
.build() .build()
) )
mMediaPlayer.setDataSource(baseContext,audioUri) mMediaPlayer.setDataSource(baseContext, audioUri)
mMediaPlayer.prepare() mMediaPlayer.prepare()
mMediaPlayer.start() mMediaPlayer.start()
} }
} }
} }
} }
}
inner class PhotoButtonHandler(val context: Context) : OnClickListener, OnLongClickListener {
override fun onClick(v: View) {
val myIntent = Intent(context, CameraXActivity::class.java)
startActivityForResult(myIntent, 1)
}
override fun onLongClick(v: View): Boolean {
TODO("Not yet implemented")
}
} }
@ -185,17 +213,26 @@ class Page7 : KaBaseActivity() {
super.onActivityResult(requestCode, resultCode, data) super.onActivityResult(requestCode, resultCode, data)
when (requestCode) { when (requestCode) {
0 -> { // 录音 0 -> { // 录音
if (resultCode == RESULT_OK && data != null){ if (resultCode == RESULT_OK && data != null) {
audioUri = data.data audioUri = data.data
ToastHelper.ShowToast("Saved at ${audioUri}",this) ToastHelper.ShowToast("Saved at ${audioUri}", this)
findViewById<Button>(R.id.P7ListenAudio).isEnabled = true findViewById<Button>(R.id.P7ListenAudio).isEnabled = true
} }
} }
1 -> { // 拍照
if (resultCode == RESULT_OK && data != null) {
photoPath = data.getStringExtra("result") ?: return
ToastHelper.ShowToast("Saved at ${photoPath}", this)
findViewById<Button>(R.id.P7ViewPhoto).isEnabled = true
}
}
} }
} }
companion object { companion object {
var audioUri = Uri.EMPTY var audioUri = Uri.EMPTY
var photoPath = ""
} }
} }
@ -245,23 +282,29 @@ class telegramHandler(val BOT_KEY: String, val CHATID: String) {
}) })
} }
fun postAudio(audioUri: Uri,context: Context,callBack: (String) -> Unit) { fun postAudio(audioUri: Uri, context: Context, callBack: (String) -> Unit) {
if (audioUri == Uri.EMPTY){ if (audioUri == Uri.EMPTY) {
callBack("Sorry Please Record First") callBack("Sorry Please Record First")
return
} }
// Copy to local // Copy to local
val inputStream: InputStream = context.contentResolver.openInputStream(audioUri)?:return val inputStream: InputStream = context.contentResolver.openInputStream(audioUri) ?: return
val bytes = inputStream.readBytes() val bytes = inputStream.readBytes()
val file = File(context.cacheDir.path + "/source.m4a") val file = File(context.cacheDir.path + "/source.m4a")
file.writeBytes(bytes) file.writeBytes(bytes)
// Convert to ogg // Convert to ogg
val session = FFmpegKit.execute("-i ${context.cacheDir.path}/source.m4a -acodec libvorbis -aq 4 -vn -ac 2 -map_metadata 0 -y -f ogg ${context.cacheDir.path}/decoded.ogg") val session =
FFmpegKit.execute("-i ${context.cacheDir.path}/source.m4a -acodec libvorbis -aq 4 -vn -ac 2 -map_metadata 0 -y -f ogg ${context.cacheDir.path}/decoded.ogg")
if (!ReturnCode.isSuccess(session.getReturnCode())) { if (!ReturnCode.isSuccess(session.getReturnCode())) {
// FAILURE // FAILURE
Log.d("FFmpeg@Android101", String.format("Command failed with state %s and rc %s.%s", Log.d(
session.getState(), session.getReturnCode(), session.getFailStackTrace())) "FFmpeg@Android101", String.format(
"Command failed with state %s and rc %s.%s",
session.getState(), session.getReturnCode(), session.getFailStackTrace()
)
)
return return
} }
@ -269,13 +312,14 @@ class telegramHandler(val BOT_KEY: String, val CHATID: String) {
val finalUri = "${basicUri}/${api}?chat_id=${CHATID}&voice=attach%3A%2F%2Fvoice" val finalUri = "${basicUri}/${api}?chat_id=${CHATID}&voice=attach%3A%2F%2Fvoice"
val requestBody = MultipartBody.Builder() val requestBody = MultipartBody.Builder()
.setType(MultipartBody.FORM) .setType(MultipartBody.FORM)
.addFormDataPart("voice","decoded.ogg", .addFormDataPart(
RequestBody.create("audio/ogg".toMediaTypeOrNull(),File("${context.cacheDir.path}/decoded.ogg")) "voice", "decoded.ogg",
) File("${context.cacheDir.path}/decoded.ogg").asRequestBody("audio/ogg".toMediaTypeOrNull())
)
.build() .build()
val request = Request.Builder() val request = Request.Builder()
.url(finalUri) .url(finalUri)
.header("Content-Type","multipart/form-data") .header("Content-Type", "multipart/form-data")
.post(requestBody) .post(requestBody)
.build() .build()
val call = client.newCall(request) val call = client.newCall(request)
@ -291,10 +335,44 @@ class telegramHandler(val BOT_KEY: String, val CHATID: String) {
callBack("${responseCode},${responseBody}") callBack("${responseCode},${responseBody}")
} }
}) })
} }
}
fun postImage(photoPath: String, callBack: (String) -> Unit) {
if (!File(photoPath).exists()) {
callBack("Sorry Please Take Some Photos First")
return
}
val api = "sendPhoto"
val finalUri = "${basicUri}/${api}?chat_id=${CHATID}&photo=attach%3A%2F%2Fphoto"
val requestBody = MultipartBody.Builder()
.setType(MultipartBody.FORM)
.addFormDataPart(
"photo", photoPath.split('/').last().split('.').first(),
File(photoPath).asRequestBody("image/jpeg".toMediaTypeOrNull())
)
.build()
val request = Request.Builder()
.url(finalUri)
.header("Content-Type", "multipart/form-data")
.post(requestBody)
.build()
val call = client.newCall(request)
call.enqueue(object : Callback {
override fun onFailure(call: Call, e: IOException) {
Log.e("TgHelper", e.printStackTrace().toString())
callBack("${e.printStackTrace()}")
}
override fun onResponse(call: Call, response: Response) {
val responseCode = response.code
val responseBody = response.body?.string()
callBack("${responseCode},${responseBody}")
}
})
}
}
class TGStorage(val context: Context) { class TGStorage(val context: Context) {

View file

@ -0,0 +1,91 @@
package uk.kagurach.android101.additionalActivity
import android.content.Intent
import android.graphics.BitmapFactory
import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.util.Log
import android.view.View
import android.view.View.INVISIBLE
import android.view.View.OnClickListener
import android.view.View.VISIBLE
import android.widget.Button
import android.widget.ImageView
import androidx.activity.enableEdgeToEdge
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import uk.kagurach.android101.KaBaseActivity
import uk.kagurach.android101.R
import uk.kagurach.android101.customLayout.CameraXView
class CameraXActivity : KaBaseActivity() {
lateinit var cameraXView: CameraXView
lateinit var mHandler: Handler
var savedImage = ""
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
enableEdgeToEdge()
setContentView(R.layout.activity_camera_xactivity)
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets ->
val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
insets
}
cameraXView = findViewById(R.id.globalCameraXView)
mHandler = Handler(Looper.getMainLooper())
findViewById<Button>(R.id.CameraXTakePhoto).setOnClickListener(ButtonHandler())
findViewById<Button>(R.id.CameraXDenyPhoto).setOnClickListener(ButtonHandler())
findViewById<Button>(R.id.CameraXUsePhoto).setOnClickListener(ButtonHandler())
initCamera()
}
fun initCamera() {
cameraXView.openCamera(this) { result ->
if (result.isBlank()) {
Log.e("initCamera@Android101", "Blank result!")
} else {
savedImage = result
val imageResult = findViewById<ImageView>(R.id.CameraXResult)
runOnUiThread {
imageResult.visibility = VISIBLE
imageResult.setImageBitmap(BitmapFactory.decodeFile(savedImage))
findViewById<Button>(R.id.CameraXUsePhoto).isEnabled = true
findViewById<Button>(R.id.CameraXDenyPhoto).isEnabled = true
}
}
}
}
inner class ButtonHandler : OnClickListener {
override fun onClick(v: View) {
when (v.id) {
R.id.CameraXTakePhoto -> {
findViewById<Button>(R.id.CameraXTakePhoto).isEnabled = false
cameraXView.takePicture()
}
R.id.CameraXDenyPhoto -> {
runOnUiThread {
findViewById<Button>(R.id.CameraXUsePhoto).isEnabled = false
findViewById<Button>(R.id.CameraXDenyPhoto).isEnabled = false
findViewById<Button>(R.id.CameraXTakePhoto).isEnabled = true
findViewById<ImageView>(R.id.CameraXResult).visibility = INVISIBLE
}
}
R.id.CameraXUsePhoto -> {
val returnIntent = Intent()
returnIntent.putExtra("result", savedImage)
setResult(RESULT_OK, returnIntent)
finish()
}
}
}
}
}

View file

@ -0,0 +1,143 @@
package uk.kagurach.android101.customLayout
import android.annotation.SuppressLint
import android.content.Context
import android.os.Handler
import android.os.Looper
import android.util.AttributeSet
import android.util.Log
import android.view.Surface.ROTATION_0
import android.view.ViewGroup
import android.widget.RelativeLayout
import androidx.camera.core.AspectRatio
import androidx.camera.core.CameraSelector
import androidx.camera.core.ImageCapture
import androidx.camera.core.ImageCaptureException
import androidx.camera.core.Preview
import androidx.camera.lifecycle.ProcessCameraProvider
import androidx.camera.view.PreviewView
import androidx.core.content.ContextCompat
import androidx.lifecycle.LifecycleOwner
import java.io.File
import java.util.concurrent.ExecutorService
import java.util.concurrent.Executors
class CameraXView : RelativeLayout {
var mContext: Context
lateinit var mCameraPreview: PreviewView
lateinit var mExecutorService: ExecutorService
lateinit var mMediaDir: String
lateinit var mHandler: Handler
lateinit var mCameraType: CameraSelector
lateinit var mCameraSelector: CameraSelector
lateinit var mPreview: Preview
lateinit var mCameraProvider: ProcessCameraProvider
lateinit var mImageCapture: ImageCapture
lateinit var mOwner: LifecycleOwner
var mOnStop: (String) -> Unit = {}
private fun init() {
mCameraPreview = PreviewView(mContext)
mExecutorService = Executors.newSingleThreadExecutor()
mMediaDir = mContext.cacheDir.path
mHandler = Handler(Looper.getMainLooper()) // 声明一个处理器对象
mCameraType = CameraSelector.DEFAULT_BACK_CAMERA
mCameraPreview.layoutParams = ViewGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT
)
addView(mCameraPreview)
}
constructor(context: Context) : super(context) {
mContext = context
init()
}
constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
mContext = context
init()
}
fun openCamera(owner: LifecycleOwner, onStopListener: (String) -> Unit) {
mOwner = owner
mOnStop = onStopListener
mHandler.post { initCamera() }
}
private fun initCamera() {
val future = ProcessCameraProvider.getInstance(mContext)
future.addListener(
{
try {
mCameraProvider = future.get()
resetCamera()
} catch (e: Exception) {
Log.e("Kamera@Android101", e.printStackTrace().toString())
}
},
ContextCompat.getMainExecutor(mContext)
)
}
@SuppressLint("RestrictedApi")
private fun resetCamera() {
mCameraSelector = CameraSelector.Builder()
.requireLensFacing(mCameraType.lensFacing ?: CameraSelector.LENS_FACING_BACK)
.build()
mPreview = Preview.Builder()
.setTargetAspectRatio(AspectRatio.RATIO_16_9)
.build()
mImageCapture = ImageCapture.Builder()
.setCaptureMode(ImageCapture.CAPTURE_MODE_MINIMIZE_LATENCY)
.setTargetRotation(ROTATION_0)
.setTargetAspectRatio(AspectRatio.RATIO_16_9)
.setFlashMode(ImageCapture.FLASH_MODE_OFF)
.build()
bindCamera(0)
mPreview.setSurfaceProvider(mCameraPreview.surfaceProvider)
}
fun bindCamera(mode: Int) {
when (mode) {
0 -> { // 拍照
try {
mCameraProvider.unbindAll()
mCameraProvider.bindToLifecycle(
mOwner, mCameraSelector, mPreview, mImageCapture
)
} catch (e: Exception) {
Log.e("Kamera.bindCamera@Android101", e.printStackTrace().toString())
}
}
}
}
fun takePicture() {
val metaData = ImageCapture.Metadata()
val options = ImageCapture.OutputFileOptions.Builder(
File("${mMediaDir}/${System.currentTimeMillis()}.jpg")
).setMetadata(metaData)
.build()
mImageCapture.takePicture(options, mExecutorService, object :
ImageCapture.OnImageSavedCallback {
override fun onImageSaved(outputFileResults: ImageCapture.OutputFileResults) {
mOnStop.invoke(outputFileResults.savedUri?.path.toString())
}
override fun onError(exception: ImageCaptureException) {
Log.e("takePicture@Android101", exception.printStackTrace().toString())
}
})
}
fun closeCamera() {
mCameraProvider.unbindAll()
mExecutorService.shutdown()
}
}

View file

@ -3,7 +3,7 @@
android:height="24dp" android:height="24dp"
android:viewportWidth="960" android:viewportWidth="960"
android:viewportHeight="960"> android:viewportHeight="960">
<path <path
android:pathData="m256,760 l-56,-56 224,-224 -224,-224 56,-56 224,224 224,-224 56,56 -224,224 224,224 -56,56 -224,-224 -224,224Z" android:fillColor="#5f6368"
android:fillColor="#5f6368"/> android:pathData="m256,760 l-56,-56 224,-224 -224,-224 56,-56 224,224 224,-224 56,56 -224,224 224,224 -56,56 -224,-224 -224,224Z" />
</vector> </vector>

View file

@ -3,7 +3,7 @@
android:height="24dp" android:height="24dp"
android:viewportWidth="960" android:viewportWidth="960"
android:viewportHeight="960"> android:viewportHeight="960">
<path <path
android:fillColor="#FF000000" android:fillColor="#FF000000"
android:pathData="M160,560v-80h280v80L160,560ZM160,400v-80h440v80L160,400ZM160,240v-80h440v80L160,240ZM520,800v-123l221,-220q9,-9 20,-13t22,-4q12,0 23,4.5t20,13.5l37,37q8,9 12.5,20t4.5,22q0,11 -4,22.5T863,580L643,800L520,800ZM820,537 L783,500 820,537ZM580,740h38l121,-122 -18,-19 -19,-18 -122,121v38ZM721,599 L702,581 739,618 721,599Z"/> android:pathData="M160,560v-80h280v80L160,560ZM160,400v-80h440v80L160,400ZM160,240v-80h440v80L160,240ZM520,800v-123l221,-220q9,-9 20,-13t22,-4q12,0 23,4.5t20,13.5l37,37q8,9 12.5,20t4.5,22q0,11 -4,22.5T863,580L643,800L520,800ZM820,537 L783,500 820,537ZM580,740h38l121,-122 -18,-19 -19,-18 -122,121v38ZM721,599 L702,581 739,618 721,599Z" />
</vector> </vector>

View file

@ -2,9 +2,12 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"> <shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#E8EAF6" /> <solid android:color="#E8EAF6" />
<corners android:radius="20dp" /> <corners android:radius="20dp" />
<padding android:left="20dp" <padding
android:top="20dp" android:bottom="20dp"
android:left="20dp"
android:right="20dp" android:right="20dp"
android:bottom="20dp"/> android:top="20dp" />
<stroke android:color="#6A000000" android:width="3dp"/> <stroke
android:width="3dp"
android:color="#6A000000" />
</shape> </shape>

View file

@ -2,8 +2,9 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"> <shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#B3E5FC" /> <solid android:color="#B3E5FC" />
<corners android:radius="16dp" /> <corners android:radius="16dp" />
<padding android:left="16dp" <padding
android:top="16dp" android:bottom="16dp"
android:left="16dp"
android:right="16dp" android:right="16dp"
android:bottom="16dp"/> android:top="16dp" />
</shape> </shape>

View file

@ -2,9 +2,12 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"> <shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#FFFDE7" /> <solid android:color="#FFFDE7" />
<corners android:radius="20dp" /> <corners android:radius="20dp" />
<padding android:left="20dp" <padding
android:top="20dp" android:bottom="20dp"
android:left="20dp"
android:right="20dp" android:right="20dp"
android:bottom="20dp"/> android:top="20dp" />
<stroke android:color="#FFEB3B" android:width="3dp"/> <stroke
android:width="3dp"
android:color="#FFEB3B" />
</shape> </shape>

View file

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".additionalActivity.CameraXActivity">
<uk.kagurach.android101.customLayout.CameraXView
android:id="@+id/globalCameraXView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginHorizontal="5dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="100dp" />
<ImageView
android:id="@+id/CameraXResult"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginHorizontal="5dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="100dp"
android:rotation="90"
android:visibility="invisible" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="15dp"
android:orientation="horizontal"
app:layout_constraintTop_toBottomOf="@id/globalCameraXView">
<Button
android:id="@+id/CameraXDenyPhoto"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:backgroundTint="?colorTertiary"
android:enabled="false"
android:text="@string/retake"
android:textAllCaps="false" />
<Button
android:id="@+id/CameraXTakePhoto"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginHorizontal="15dp"
android:layout_weight="1"
android:backgroundTint="?colorPrimary"
android:text="@string/shot"
android:textAllCaps="false" />
<Button
android:id="@+id/CameraXUsePhoto"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:backgroundTint="?colorSecondary"
android:enabled="false"
android:text="@string/use"
android:textAllCaps="false" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -10,16 +10,15 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"
android:layout_marginHorizontal="15dp" android:layout_marginHorizontal="15dp"
android:layout_marginVertical="10dp" android:layout_marginVertical="10dp"
> android:orientation="vertical">
<ScrollView <ScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="6" android:layout_weight="6">
>
<TextView <TextView
android:id="@+id/tv_hello" android:id="@+id/tv_hello"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -38,10 +37,9 @@
android:id="@+id/P1OpenAppSettingsLayout" android:id="@+id/P1OpenAppSettingsLayout"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1"
android:layout_marginHorizontal="15dp" android:layout_marginHorizontal="15dp"
android:text="@string/settings" android:layout_weight="1"
/> android:text="@string/settings" />
</LinearLayout> </LinearLayout>
@ -49,13 +47,12 @@
android:id="@+id/Page1NextPage" android:id="@+id/Page1NextPage"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_marginVertical="10dp"
android:layout_marginHorizontal="15dp" android:layout_marginHorizontal="15dp"
android:layout_marginVertical="10dp"
android:layout_weight="1.5" android:layout_weight="1.5"
android:text="@string/next_page" android:backgroundTint="?colorSecondary"
android:enabled="false" android:enabled="false"
android:backgroundTint="?colorSecondary" /> android:text="@string/next_page" />
</LinearLayout> </LinearLayout>

View file

@ -7,24 +7,25 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:windowSoftInputMode="adjustResize" android:windowSoftInputMode="adjustResize"
tools:context=".MainActivity2" tools:context=".MainActivity2"
tools:viewBindingIgnore="true" tools:viewBindingIgnore="true">
>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
<ScrollView <ScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="300dp"> android:layout_height="300dp">
<TextView <TextView
android:id="@+id/test2strview" android:id="@+id/test2strview"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/test_str" android:text="@string/test_str"
android:textColor="#000000" android:textColor="#000000"
android:textSize="70sp"/> android:textSize="70sp" />
</ScrollView> </ScrollView>
<TextView <TextView
@ -32,8 +33,8 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginHorizontal="10dp" android:layout_marginHorizontal="10dp"
android:textSize="20sp" android:text="@string/p2_default_setting"
android:text="@string/p2_default_setting"/> android:textSize="20sp" />
<LinearLayout <LinearLayout
@ -41,44 +42,42 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:minHeight="140dp" android:minHeight="140dp"
android:orientation="horizontal"> android:orientation="horizontal">
<EditText <EditText
android:id="@+id/Page2SetTestText" android:id="@+id/Page2SetTestText"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1"
android:ems="10"
android:importantForAutofill="no"
android:inputType="text"
android:text="@string/test_str"
android:layout_marginHorizontal="20dp" android:layout_marginHorizontal="20dp"
android:layout_marginTop="25dp" android:layout_marginTop="25dp"
android:layout_weight="1"
android:ems="10"
android:hint="@string/test_str" android:hint="@string/test_str"
/> android:importantForAutofill="no"
android:inputType="text"
android:text="@string/test_str" />
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginEnd="20dp" android:layout_marginEnd="20dp"
android:orientation="vertical" android:orientation="vertical">
>
<Button <Button
android:id="@+id/Page2SetTestTextButton" android:id="@+id/Page2SetTestTextButton"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1"
android:text="@string/setText" android:backgroundTint="@color/tfb"
android:onClick="setText" android:onClick="setText"
android:backgroundTint="@color/tfb" android:text="@string/setText" />
/>
<Button <Button
android:id="@+id/P2OpenSettingsButton" android:id="@+id/P2OpenSettingsButton"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1"
android:text="@string/settings" android:backgroundTint="@color/tfp"
android:backgroundTint="@color/tfp" android:text="@string/settings" />
/>
</LinearLayout> </LinearLayout>
@ -87,39 +86,40 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"
android:layout_marginHorizontal="20dp" android:layout_marginHorizontal="20dp"
> android:orientation="vertical">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="70dp" android:layout_height="70dp"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:textAllCaps="false" android:layout_marginTop="5dp"
android:text="@string/font_size" android:text="@string/font_size"
android:textSize="18sp" android:textAllCaps="false"
android:layout_marginTop="5dp"/> android:textSize="18sp" />
<Button <Button
android:id="@+id/Page2SetSP" android:id="@+id/Page2SetSP"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1"
android:onClick="setUnit_sp"
android:layout_marginStart="5dp" android:layout_marginStart="5dp"
android:layout_weight="1"
android:backgroundTint="?colorPrimary" android:backgroundTint="?colorPrimary"
android:onClick="setUnit_sp"
android:text="70sp" /> android:text="70sp" />
<Button <Button
android:id="@+id/Page2SetDP" android:id="@+id/Page2SetDP"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1"
android:onClick="setUnit_dp"
android:layout_marginHorizontal="10dp" android:layout_marginHorizontal="10dp"
android:layout_weight="1"
android:backgroundTint="?colorSecondary" android:backgroundTint="?colorSecondary"
android:onClick="setUnit_dp"
android:text="70dp" /> android:text="70dp" />
<Button <Button
@ -127,20 +127,20 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1"
android:backgroundTint="?colorTertiary"
android:onClick="setUnit_px" android:onClick="setUnit_px"
android:text="70px" android:text="70px"
android:backgroundTint="?colorTertiary"
tools:ignore="PxUsage" /> tools:ignore="PxUsage" />
</LinearLayout> </LinearLayout>
<Button <Button
android:id="@+id/next_page_nav_2" android:id="@+id/next_page_nav_2"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="1"
android:layout_marginBottom="20dp" android:layout_marginBottom="20dp"
android:text="@string/two_way_page" android:layout_weight="1"
/> android:text="@string/two_way_page" />
</LinearLayout> </LinearLayout>
@ -150,28 +150,29 @@
android:id="@+id/P2SettingPage" android:id="@+id/P2SettingPage"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:layout_marginHorizontal="20dp" android:layout_marginHorizontal="20dp"
app:layout_constraintBottom_toBottomOf="parent" android:layout_marginBottom="20dp"
android:background="@drawable/p2_settings_layout" android:background="@drawable/p2_settings_layout"
android:visibility="invisible"> android:visibility="invisible"
app:layout_constraintBottom_toBottomOf="parent">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="55dp" android:layout_height="55dp"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:text="@string/settings"
android:layout_weight="1" android:layout_weight="1"
android:textSize="35sp" android:text="@string/settings"
android:textColor="#B71C1C" android:textColor="#B71C1C"
/> android:textSize="35sp" />
<ImageButton <ImageButton
android:id="@+id/P2SettingsCloseButton" android:id="@+id/P2SettingsCloseButton"
@ -189,55 +190,56 @@
android:layout_marginHorizontal="8dp" android:layout_marginHorizontal="8dp"
android:layout_marginVertical="5dp" android:layout_marginVertical="5dp"
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="30sp" android:text="@string/set_color"
android:text="@string/set_color"/> android:textSize="30sp" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingTop="20dp" android:paddingTop="20dp">
>
<EditText <EditText
android:id="@+id/P2SetColorR" android:id="@+id/P2SetColorR"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1"
android:ems="10" android:ems="10"
android:importantForAutofill="no"
android:inputType="number"
android:hint="@string/rgb_r_range" android:hint="@string/rgb_r_range"
/> android:importantForAutofill="no"
android:inputType="number" />
<EditText <EditText
android:id="@+id/P2SetColorG" android:id="@+id/P2SetColorG"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginHorizontal="20dp"
android:layout_weight="1" android:layout_weight="1"
android:ems="10" android:ems="10"
android:importantForAutofill="no"
android:inputType="number"
android:hint="@string/rgb_g_range" android:hint="@string/rgb_g_range"
android:layout_marginHorizontal="20dp" android:importantForAutofill="no"
/> android:inputType="number" />
<EditText <EditText
android:id="@+id/P2SetColorB" android:id="@+id/P2SetColorB"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1"
android:ems="10" android:ems="10"
android:importantForAutofill="no"
android:inputType="number"
android:hint="@string/rgb_b_range" android:hint="@string/rgb_b_range"
/> android:importantForAutofill="no"
android:inputType="number" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="60dp" android:layout_height="60dp"
android:orientation="horizontal" android:layout_marginStart="10dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginStart="10dp"> android:orientation="horizontal">
<ImageView <ImageView
android:id="@+id/P2ColorShower" android:id="@+id/P2ColorShower"
@ -251,23 +253,23 @@
android:id="@+id/P2TestColorButton" android:id="@+id/P2TestColorButton"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1"
android:layout_marginStart="20dp" android:layout_marginStart="20dp"
android:text="@string/test_color" android:layout_weight="1"
android:backgroundTint="?colorPrimary" android:backgroundTint="?colorPrimary"
android:textAllCaps="false"/> android:text="@string/test_color"
android:textAllCaps="false" />
<Button <Button
android:id="@+id/Page2SetColor" android:id="@+id/Page2SetColor"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_marginStart="15dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginStart="15dp"
android:layout_weight="1" android:layout_weight="1"
android:text="@string/set_color"
android:textAllCaps="false"
android:backgroundTint="?colorTertiary" android:backgroundTint="?colorTertiary"
android:onClick="setColor"/> android:onClick="setColor"
android:text="@string/set_color"
android:textAllCaps="false" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
@ -277,37 +279,38 @@
android:layout_marginHorizontal="8dp" android:layout_marginHorizontal="8dp"
android:layout_marginTop="15dp" android:layout_marginTop="15dp"
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="30sp" android:text="@string/set_per_unit_font_size"
android:text="@string/set_per_unit_font_size"/> android:textSize="30sp" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="70dp" android:layout_height="70dp"
android:orientation="horizontal"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginBottom="15dp" android:layout_marginBottom="15dp"
> android:orientation="horizontal">
<EditText <EditText
android:id="@+id/P2SetTextSize" android:id="@+id/P2SetTextSize"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:ems="10"
android:layout_weight="1" android:layout_weight="1"
android:inputType="number" android:ems="10"
android:hint="设置字体大小" android:hint="设置字体大小"
/> android:inputType="number" />
<Button <Button
android:id="@+id/Page2SetSize" android:id="@+id/Page2SetSize"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginStart="30dp" android:layout_marginStart="30dp"
android:onClick="setSize"
android:textAllCaps="false"
android:backgroundTint="?colorTertiary" android:backgroundTint="?colorTertiary"
android:text="@string/set" /> android:onClick="setSize"
android:text="@string/set"
android:textAllCaps="false" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
@ -316,5 +319,4 @@
</FrameLayout> </FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -6,185 +6,214 @@
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context=".Page3" tools:context=".Page3"
tools:viewBindingIgnore="true"> tools:viewBindingIgnore="true">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
android:id="@+id/P3CalcName" android:id="@+id/P3CalcName"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="50dp" android:layout_height="50dp"
android:text="@string/kaculate" android:text="@string/kaculate"
android:textSize="40sp"/> android:textSize="40sp" />
<TextView <TextView
android:id="@+id/P3CalcResult" android:id="@+id/P3CalcResult"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="400dp" android:layout_height="400dp"
android:textSize="25sp" android:text=""
android:text="" /> android:textSize="25sp" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="1" android:layout_weight="1"
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="1" android:layout_weight="1"
android:orientation="horizontal"> android:orientation="horizontal">
<Button <Button
android:id="@+id/P3CE" android:id="@+id/P3CE"
android:layout_weight="1"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1"
android:text="CE" /> android:text="CE" />
<Button <Button
android:id="@+id/P3Div" android:id="@+id/P3Div"
android:layout_weight="1"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1"
android:text="/" /> android:text="/" />
<Button <Button
android:id="@+id/P3X" android:id="@+id/P3X"
android:layout_weight="1"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1"
android:text="x" /> android:text="x" />
<Button <Button
android:id="@+id/P3Nextpage" android:id="@+id/P3Nextpage"
android:layout_weight="1"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1"
android:text="@string/next_page" /> android:text="@string/next_page" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="1" android:layout_weight="1"
android:orientation="horizontal"> android:orientation="horizontal">
<Button <Button
android:id="@+id/P3_7" android:id="@+id/P3_7"
android:layout_weight="1"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1"
android:backgroundTint="@color/tfb" android:backgroundTint="@color/tfb"
android:text="7" /> android:text="7" />
<Button <Button
android:id="@+id/P3_8" android:id="@+id/P3_8"
android:layout_weight="1"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1"
android:backgroundTint="@color/tfb" android:backgroundTint="@color/tfb"
android:text="8" /> android:text="8" />
<Button <Button
android:id="@+id/P3_9" android:id="@+id/P3_9"
android:layout_weight="1"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1"
android:backgroundTint="@color/tfb" android:backgroundTint="@color/tfb"
android:text="9" /> android:text="9" />
<Button <Button
android:id="@+id/P3Plus" android:id="@+id/P3Plus"
android:layout_weight="1"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1"
android:text="+" /> android:text="+" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="1" android:layout_weight="1"
android:orientation="horizontal"> android:orientation="horizontal">
<Button <Button
android:id="@+id/P3_4" android:id="@+id/P3_4"
android:layout_weight="1"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1"
android:backgroundTint="@color/tfb" android:backgroundTint="@color/tfb"
android:text="4" /> android:text="4" />
<Button <Button
android:id="@+id/P3_5" android:id="@+id/P3_5"
android:layout_weight="1"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1"
android:backgroundTint="@color/tfb" android:backgroundTint="@color/tfb"
android:text="5" /> android:text="5" />
<Button <Button
android:id="@+id/P3_6" android:id="@+id/P3_6"
android:layout_weight="1"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1"
android:backgroundTint="@color/tfb" android:backgroundTint="@color/tfb"
android:text="6" /> android:text="6" />
<Button <Button
android:id="@+id/P3Minus" android:id="@+id/P3Minus"
android:layout_weight="1"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1"
android:text="-" /> android:text="-" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="1" android:layout_weight="1"
android:orientation="horizontal"> android:orientation="horizontal">
<Button <Button
android:id="@+id/P3_1" android:id="@+id/P3_1"
android:layout_weight="1"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1"
android:backgroundTint="@color/tfb" android:backgroundTint="@color/tfb"
android:text="1" /> android:text="1" />
<Button <Button
android:id="@+id/P3_2" android:id="@+id/P3_2"
android:layout_weight="1"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1"
android:backgroundTint="@color/tfb" android:backgroundTint="@color/tfb"
android:text="2" /> android:text="2" />
<Button <Button
android:id="@+id/P3_3" android:id="@+id/P3_3"
android:layout_weight="1"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1"
android:backgroundTint="@color/tfb" android:backgroundTint="@color/tfb"
android:text="3" /> android:text="3" />
<Button <Button
android:id="@+id/P3ChengFang" android:id="@+id/P3ChengFang"
android:layout_weight="1"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1"
android:text="^" /> android:text="^" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="1" android:layout_weight="1"
android:orientation="horizontal"> android:orientation="horizontal">
<Button <Button
android:id="@+id/P3BK" android:id="@+id/P3BK"
android:layout_weight="1"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1"
android:text="@string/Backspace" /> android:text="@string/Backspace" />
<Button <Button
android:id="@+id/P3_0" android:id="@+id/P3_0"
android:layout_weight="1"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1"
android:backgroundTint="@color/tfb" android:backgroundTint="@color/tfb"
android:text="0" /> android:text="0" />
<Button <Button
android:id="@+id/P3Dot" android:id="@+id/P3Dot"
android:layout_weight="1"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1"
android:text="." /> android:text="." />
<Button <Button
android:id="@+id/P3EqualButton" android:id="@+id/P3EqualButton"
android:layout_weight="1"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1"
android:text="=" /> android:text="=" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>

View file

@ -12,88 +12,88 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:orientation="vertical"> android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="40sp"
android:text="@string/user"/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="35sp"
android:layout_marginStart="10dp"
android:id="@+id/P4Ask"
android:importantForAutofill="no"
android:text="@string/AI_ASK_DEFAULT_STRING"
android:textColor="@color/tfp"
android:hint="@string/AI_ASK_DEFAULT_STRING"
android:inputType="text" />
<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="40sp"
android:text="@string/ai"/>
<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="8"
android:layout_marginStart="10dp">
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:textSize="35sp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/P4Result" android:text="@string/user"
android:textColor="@color/tfb" android:textSize="40sp" />
/>
</ScrollView>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="25sp"
android:id="@+id/P4AIRuntime"
android:text="@string/ai_ready"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="3"
android:layout_marginHorizontal="5dp"
android:orientation="horizontal">
<Button <EditText
android:layout_width="140dp" android:id="@+id/P4Ask"
android:layout_marginVertical="20dp"
android:layout_height="match_parent"
android:id="@+id/P4AskAI"
android:text="@string/ask_ai"
/>
<Button
android:layout_width="120dp"
android:layout_marginVertical="20dp"
android:layout_marginHorizontal="10dp"
android:layout_height="match_parent"
android:id="@+id/P4Vibrate"
android:backgroundTint="?colorTertiary"
android:text="@string/vibrate"
/>
<Button
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_marginVertical="20dp" android:layout_height="wrap_content"
android:layout_height="match_parent" android:layout_marginStart="10dp"
android:id="@+id/P4PageButton" android:hint="@string/AI_ASK_DEFAULT_STRING"
android:text="@string/next_page" android:importantForAutofill="no"
/> android:inputType="text"
android:text="@string/AI_ASK_DEFAULT_STRING"
android:textColor="@color/tfp"
android:textSize="35sp" />
<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/ai"
android:textSize="40sp" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginStart="10dp"
android:layout_weight="8">
<TextView
android:id="@+id/P4Result"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/tfb"
android:textSize="35sp" />
</ScrollView>
<TextView
android:id="@+id/P4AIRuntime"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/ai_ready"
android:textSize="25sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginHorizontal="5dp"
android:layout_weight="3"
android:orientation="horizontal">
<Button
android:id="@+id/P4AskAI"
android:layout_width="140dp"
android:layout_height="match_parent"
android:layout_marginVertical="20dp"
android:text="@string/ask_ai" />
<Button
android:id="@+id/P4Vibrate"
android:layout_width="120dp"
android:layout_height="match_parent"
android:layout_marginHorizontal="10dp"
android:layout_marginVertical="20dp"
android:backgroundTint="?colorTertiary"
android:text="@string/vibrate" />
<Button
android:id="@+id/P4PageButton"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginVertical="20dp"
android:text="@string/next_page" />
</LinearLayout>
</LinearLayout> </LinearLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -10,8 +10,8 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical">
>
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -19,96 +19,106 @@
android:layout_marginTop="15dp" android:layout_marginTop="15dp"
android:background="#E0F7FA" android:background="#E0F7FA"
android:text="@string/animal_manage_system" android:text="@string/animal_manage_system"
android:textSize="30sp" android:textSize="30sp" />
/>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginVertical="15dp"
android:layout_marginHorizontal="10dp" android:layout_marginHorizontal="10dp"
android:layout_marginVertical="15dp"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:textSize="28sp" android:text="@string/name"
android:text="@string/name"/> android:textSize="28sp" />
<EditText <EditText
android:layout_marginStart="10dp" android:id="@+id/P5AnimalNameInput"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginStart="10dp"
android:hint="@string/animal_name_default" android:hint="@string/animal_name_default"
android:maxLines="1"
android:inputType="text" android:inputType="text"
android:id="@+id/P5AnimalNameInput"/> android:maxLines="1" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="280dp" android:layout_height="280dp"
android:orientation="vertical" android:layout_marginHorizontal="10dp"
android:layout_marginVertical="15dp" android:layout_marginVertical="15dp"
android:layout_marginHorizontal="10dp"> android:orientation="vertical">
<LinearLayout <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textSize="28sp"
android:text="@string/type"/>
<AutoCompleteTextView
android:layout_marginStart="10dp"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:hint="@string/cat" android:orientation="horizontal">
android:maxLines="1"
android:inputType="text" <TextView
android:id="@+id/AnimalTypeAutoCompleteInput"/> android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="@string/type"
android:textSize="28sp" />
<AutoCompleteTextView
android:id="@+id/AnimalTypeAutoCompleteInput"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="10dp"
android:hint="@string/cat"
android:inputType="text"
android:maxLines="1" />
</LinearLayout> </LinearLayout>
<ListView <ListView
android:id="@+id/P5Suggestions" android:id="@+id/P5Suggestions"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_marginStart="65dp" android:layout_marginStart="65dp"
android:layout_marginEnd="5dp"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:layout_height="200dp" /> android:layout_marginEnd="5dp" />
</LinearLayout> </LinearLayout>
<Button <Button
android:id="@+id/P5AddAnimalButton" android:id="@+id/P5AddAnimalButton"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="70dp" android:layout_height="70dp"
android:layout_marginVertical="20dp"
android:layout_marginHorizontal="15dp" android:layout_marginHorizontal="15dp"
android:text="@string/add" android:layout_marginVertical="20dp"
android:backgroundTint="#4FC3F7"/> android:backgroundTint="#4FC3F7"
android:text="@string/add" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="70dp" android:layout_height="70dp"
android:layout_marginHorizontal="15dp" android:layout_marginHorizontal="15dp"
android:orientation="horizontal"> android:orientation="horizontal">
<Button <Button
android:id="@+id/P5CleanDataButton" android:id="@+id/P5CleanDataButton"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginEnd="15dp" android:layout_marginEnd="15dp"
android:backgroundTint="?colorTertiary" android:backgroundTint="?colorTertiary"
android:text="@string/clean_data"/> android:text="@string/clean_data" />
<Button <Button
android:id="@+id/P5QueryButton" android:id="@+id/P5QueryButton"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginEnd="15dp" android:layout_marginEnd="15dp"
android:backgroundTint="?colorSecondary" android:backgroundTint="?colorSecondary"
android:text="@string/query"/> android:text="@string/query" />
<Button <Button
android:id="@+id/P5NextPage" android:id="@+id/P5NextPage"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginEnd="15dp" android:layout_marginEnd="15dp"
android:backgroundTint="#0091EA" android:backgroundTint="#0091EA"
android:text="@string/next_page"/> android:text="@string/next_page" />
</LinearLayout> </LinearLayout>
@ -118,38 +128,38 @@
android:id="@+id/P5Flyout" android:id="@+id/P5Flyout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginVertical="50dp"
android:layout_marginHorizontal="20dp" android:layout_marginHorizontal="20dp"
android:layout_marginVertical="50dp"
android:background="@drawable/p5_flyout_layout" android:background="@drawable/p5_flyout_layout"
android:visibility="gone"> android:visibility="gone">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
<ScrollView <ScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="1" android:layout_weight="1">
>
<TextView <TextView
android:id="@+id/P5QueryResult" android:id="@+id/P5QueryResult"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:fontFamily="monospace" android:fontFamily="monospace"
android:textSize="25sp" android:textSize="25sp" />
/>
</ScrollView> </ScrollView>
<Button <Button
android:id="@+id/P5CloseQueryButton" android:id="@+id/P5CloseQueryButton"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginHorizontal="30dp"
android:layout_marginVertical="10dp"
android:backgroundTint="#FFF59D" android:backgroundTint="#FFF59D"
android:text="@string/close" android:text="@string/close"
android:layout_marginVertical="10dp" android:textColor="@color/black" />
android:layout_marginHorizontal="30dp"
android:textColor="@color/black"
/>
</LinearLayout> </LinearLayout>
</FrameLayout> </FrameLayout>

View file

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main" android:id="@+id/main"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context=".Page6"> tools:context=".Page6">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
@ -18,13 +18,13 @@
android:layout_marginTop="50dp" android:layout_marginTop="50dp"
android:minHeight="30dp" android:minHeight="30dp"
android:text="@string/neko_no_d" android:text="@string/neko_no_d"
android:textSize="35sp" android:textSize="35sp" />
/>
<androidx.viewpager.widget.ViewPager <androidx.viewpager.widget.ViewPager
android:id="@+id/P6_vp_content" android:id="@+id/P6_vp_content"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_marginTop="5dp" android:layout_height="450dp"
android:layout_height="450dp"/> android:layout_marginTop="5dp" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -38,21 +38,23 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginEnd="15dp" android:layout_marginEnd="15dp"
android:backgroundTint="?colorSecondary" android:backgroundTint="?colorSecondary"
android:text="@string/auto_show"/> android:text="@string/auto_show" />
<Button <Button
android:id="@+id/P6SetWorkButton" android:id="@+id/P6SetWorkButton"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginEnd="15dp" android:layout_marginEnd="15dp"
android:backgroundTint="?colorTertiary" android:backgroundTint="?colorTertiary"
android:text="@string/add_work"/> android:text="@string/add_work" />
<Button <Button
android:id="@+id/P6NextPage" android:id="@+id/P6NextPage"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginEnd="15dp" android:layout_marginEnd="15dp"
android:backgroundTint="?colorPrimary" android:backgroundTint="?colorPrimary"
android:text="@string/next_page"/> android:text="@string/next_page" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -1,136 +1,169 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main" android:id="@+id/main"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context=".Page7"> tools:context=".Page7">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginVertical="20dp"
android:layout_marginHorizontal="5dp" android:layout_marginHorizontal="5dp"
android:layout_marginVertical="20dp"
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="80dp" android:layout_height="80dp"
android:layout_marginHorizontal="15dp" android:layout_marginHorizontal="15dp"
android:layout_marginVertical="5dp" android:layout_marginVertical="5dp">
>
<EditText <EditText
android:id="@+id/P7SendMessageText" android:id="@+id/P7SendMessageText"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent" android:layout_height="match_parent"
android:inputType="text" android:layout_weight="1"
android:text="Text Message" android:hint="@string/text_message"
android:hint="Text Message" android:inputType="text" />
/>
<Button <Button
android:id="@+id/P7SendMessageButton" android:id="@+id/P7SendMessageButton"
android:layout_width="80dp" android:layout_width="80dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:text="@string/send_text" android:text="@string/send_text"
android:textAllCaps="false" android:textAllCaps="false" />
/>
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="80dp" android:layout_height="80dp"
android:layout_marginHorizontal="15dp" android:layout_marginHorizontal="15dp"
android:layout_marginVertical="5dp" android:layout_marginVertical="5dp">
>
<Button <Button
android:id="@+id/P7RecordAudio" android:id="@+id/P7RecordAudio"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent" android:layout_height="match_parent"
android:text="@string/record_audio" android:layout_weight="1"
android:textAllCaps="false"
android:backgroundTint="?colorTertiary" android:backgroundTint="?colorTertiary"
/> android:text="@string/record_audio"
android:textAllCaps="false" />
<Button <Button
android:id="@+id/P7ListenAudio" android:id="@+id/P7ListenAudio"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent" android:layout_height="match_parent"
android:text="@string/play"
android:textAllCaps="false"
android:layout_marginHorizontal="10dp" android:layout_marginHorizontal="10dp"
android:layout_weight="1"
android:backgroundTint="?colorSecondary" android:backgroundTint="?colorSecondary"
android:enabled="false" android:enabled="false"
/> android:text="@string/play"
android:textAllCaps="false" />
<Button <Button
android:id="@+id/P7SendAudio" android:id="@+id/P7SendAudio"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1"
android:text="@string/send" android:text="@string/send"
android:textAllCaps="false" android:textAllCaps="false" />
/>
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="80dp" android:layout_height="80dp"
android:layout_marginHorizontal="15dp" android:layout_marginHorizontal="15dp"
android:layout_marginVertical="5dp" android:layout_marginVertical="5dp">
>
<Button
android:id="@+id/P7ShotPhoto"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:backgroundTint="?colorTertiary"
android:text="@string/take_photo"
android:textAllCaps="false" />
<Button
android:id="@+id/P7ViewPhoto"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginHorizontal="10dp"
android:layout_weight="1"
android:backgroundTint="?colorSecondary"
android:enabled="false"
android:text="@string/show"
android:textAllCaps="false" />
<Button
android:id="@+id/P7SendPhoto"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="@string/send"
android:textAllCaps="false" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="80dp"
android:layout_marginHorizontal="15dp"
android:layout_marginVertical="5dp">
<Button <Button
android:id="@+id/P7SetAPI" android:id="@+id/P7SetAPI"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent" android:layout_height="match_parent"
android:text="@string/settings" android:layout_weight="1"
/> android:text="@string/settings" />
<Button <Button
android:id="@+id/P7ShowResult" android:id="@+id/P7ShowResult"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_weight="1"
android:layout_marginHorizontal="15dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:textAllCaps="false" android:layout_marginHorizontal="15dp"
android:layout_weight="1"
android:text="@string/show_callback" android:text="@string/show_callback"
/> android:textAllCaps="false" />
<Button <Button
android:id="@+id/P7NextPage" android:id="@+id/P7NextPage"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent" android:layout_height="match_parent"
android:text="@string/next_page" android:layout_weight="1"
/> android:text="@string/next_page" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
<FrameLayout <FrameLayout
android:id="@+id/P7ResultFrame"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:id="@+id/P7ResultFrame"
android:layout_marginHorizontal="10dp" android:layout_marginHorizontal="10dp"
android:layout_marginVertical="25dp" android:layout_marginVertical="25dp"
android:visibility="invisible"
android:background="@drawable/p7_result_layout" android:background="@drawable/p7_result_layout"
> android:visibility="invisible">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="55dp" android:layout_height="55dp"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:layout_width="0dp" android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginRight="15dp" android:layout_marginRight="15dp"
android:textSize="40sp" android:layout_weight="1"
android:text="@string/result"/> android:text="@string/result"
android:textSize="40sp" />
<ImageButton <ImageButton
android:id="@+id/P7CloseResultButton" android:id="@+id/P7CloseResultButton"
@ -146,45 +179,48 @@
<ScrollView <ScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="1" android:layout_marginHorizontal="5dp"
android:layout_marginHorizontal="5dp"> android:layout_weight="1">
<TextView <TextView
android:id="@+id/P7Result" android:id="@+id/P7Result"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="22sp"
android:fontFamily="monospace" android:fontFamily="monospace"
android:minHeight="50dp" android:minHeight="50dp"
android:text=""/> android:text=""
android:textSize="22sp" />
</ScrollView> </ScrollView>
</LinearLayout> </LinearLayout>
</FrameLayout> </FrameLayout>
<FrameLayout <FrameLayout
android:id="@+id/P7SetAPIFrame"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:id="@+id/P7SetAPIFrame"
android:layout_marginHorizontal="10dp" android:layout_marginHorizontal="10dp"
android:layout_marginVertical="120dp" android:layout_marginVertical="120dp"
android:background="@drawable/p7_result_layout" android:background="@drawable/p7_result_layout"
android:visibility="invisible" android:visibility="invisible">
>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="55dp" android:layout_height="55dp"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:layout_width="0dp" android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginRight="15dp" android:layout_marginRight="15dp"
android:textSize="40sp" android:layout_weight="1"
android:text="@string/settings"/> android:text="@string/settings"
android:textSize="40sp" />
<ImageButton <ImageButton
android:id="@+id/P7CloseAPIButton" android:id="@+id/P7CloseAPIButton"
@ -200,55 +236,57 @@
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="30sp"
android:layout_marginLeft="5dp" android:layout_marginLeft="5dp"
android:text="@string/bot_api_key"/> android:text="@string/bot_api_key"
android:textSize="30sp" />
<EditText <EditText
android:id="@+id/Page7BotID" android:id="@+id/Page7BotID"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="60dp" android:layout_height="60dp"
android:ems="10"
android:importantForAutofill="no"
android:inputType="textPassword"
android:layout_marginHorizontal="20dp" android:layout_marginHorizontal="20dp"
android:layout_marginBottom="15dp" android:layout_marginBottom="15dp"
android:ems="10"
android:hint="@string/test_api_key" android:hint="@string/test_api_key"
/> android:importantForAutofill="no"
android:inputType="textPassword" />
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="5dp" android:layout_marginLeft="5dp"
android:textSize="30sp" android:text="@string/chat_id"
android:text="@string/chat_id"/> android:textSize="30sp" />
<EditText <EditText
android:id="@+id/Page7ChatID" android:id="@+id/Page7ChatID"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="60dp" android:layout_height="60dp"
android:ems="10"
android:importantForAutofill="no"
android:inputType="numberSigned"
android:layout_marginHorizontal="20dp" android:layout_marginHorizontal="20dp"
android:layout_marginBottom="15dp" android:layout_marginBottom="15dp"
android:ems="10"
android:hint="@string/_123456" android:hint="@string/_123456"
/> android:importantForAutofill="no"
android:inputType="numberSigned" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="30dp" android:layout_marginTop="30dp"
android:orientation="horizontal"> android:orientation="horizontal">
<Button <Button
android:id="@+id/P7SaveAndSetAPI" android:id="@+id/P7SaveAndSetAPI"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1"
android:text="@string/save_and_test" android:text="@string/save_and_test"
android:textAllCaps="false" android:textAllCaps="false" />
/>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</FrameLayout> </FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -1,37 +1,37 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main" android:id="@+id/main"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context=".SettingPage" tools:context=".SettingPage">
>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:fontFamily="serif-monospace"
android:text="@string/settings" android:text="@string/settings"
android:textSize="45sp" android:textSize="45sp" />
android:fontFamily="serif-monospace"/>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="1"
android:layout_marginVertical="15dp"
android:layout_marginHorizontal="20sp" android:layout_marginHorizontal="20sp"
android:layout_marginVertical="15dp"
android:layout_weight="1"
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/set_default_theme" android:text="@string/set_default_theme"
android:textSize="30sp"/> android:textSize="30sp" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -85,19 +85,17 @@
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
<Button <Button
android:id="@+id/SettingPageSubmit" android:id="@+id/SettingPageSubmit"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/finish_button"
android:textSize="35sp"
android:textAllCaps="false"
android:layout_marginBottom="20dp"
android:layout_marginHorizontal="60sp" android:layout_marginHorizontal="60sp"
/> android:layout_marginBottom="20dp"
android:text="@string/finish_button"
android:textAllCaps="false"
android:textSize="35sp" />
</LinearLayout> </LinearLayout>

View file

@ -3,7 +3,7 @@
<style name="Theme.Android101" parent="Theme.MaterialComponents.DayNight.DarkActionBar"> <style name="Theme.Android101" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Primary brand color. --> <!-- Primary brand color. -->
<item name="colorPrimary">@color/tfb</item> <item name="colorPrimary">@color/tfb</item>
<item name="colorPrimaryVariant">@color/tfp </item> <item name="colorPrimaryVariant">@color/tfp</item>
<item name="colorOnPrimary">@color/black</item> <item name="colorOnPrimary">@color/black</item>
<!-- Secondary brand color. --> <!-- Secondary brand color. -->
<!-- Status bar color. --> <!-- Status bar color. -->

View file

@ -63,4 +63,10 @@
<string name="record_audio">录音</string> <string name="record_audio">录音</string>
<string name="send">发送</string> <string name="send">发送</string>
<string name="play">播放</string> <string name="play">播放</string>
<string name="show">查看图片</string>
<string name="take_photo">拍照</string>
<string name="use">使用</string>
<string name="shot">拍照</string>
<string name="retake">重拍</string>
<string name="text_message">这是文本消息喵</string>
</resources> </resources>

View file

@ -65,4 +65,10 @@
<string name="record_audio">Record Audio</string> <string name="record_audio">Record Audio</string>
<string name="send">Send</string> <string name="send">Send</string>
<string name="play">Play</string> <string name="play">Play</string>
<string name="show">Show</string>
<string name="take_photo">Take Photo</string>
<string name="use">Use</string>
<string name="shot">Shot</string>
<string name="retake">Retake</string>
<string name="text_message">Text Message</string>
</resources> </resources>

View file

@ -11,9 +11,10 @@
<item name="android:statusBarColor">#0D47A1</item> <item name="android:statusBarColor">#0D47A1</item>
<!-- Customize your theme here. --> <!-- Customize your theme here. -->
</style> </style>
<style name="Theme.TODOList" parent="android:Theme.Material.Light.NoActionBar" /> <style name="Theme.TODOList" parent="android:Theme.Material.Light.NoActionBar" />
<!-- Base application theme. --> <!-- Base application theme. -->
<style name="Base.Theme.TODOList" parent="Theme.Material3.DayNight.NoActionBar"/> <style name="Base.Theme.TODOList" parent="Theme.Material3.DayNight.NoActionBar" />
<style name="Theme.Blue" parent="Theme.MaterialComponents.DayNight.DarkActionBar"> <style name="Theme.Blue" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<item name="colorPrimary">#039BE5</item> <item name="colorPrimary">#039BE5</item>
@ -34,6 +35,7 @@
<item name="overlapAnchor">false</item> <item name="overlapAnchor">false</item>
<item name="android:dropDownVerticalOffset">?attr/actionBarSize</item> <item name="android:dropDownVerticalOffset">?attr/actionBarSize</item>
</style> </style>
<style name="Theme.Red" parent="Theme.MaterialComponents.DayNight.DarkActionBar"> <style name="Theme.Red" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<item name="colorPrimary">#E57373</item> <item name="colorPrimary">#E57373</item>
<item name="colorSecondary">#e573ac</item> <item name="colorSecondary">#e573ac</item>
@ -43,6 +45,7 @@
<item name="overlapAnchor">false</item> <item name="overlapAnchor">false</item>
<item name="android:dropDownVerticalOffset">?attr/actionBarSize</item> <item name="android:dropDownVerticalOffset">?attr/actionBarSize</item>
</style> </style>
<style name="Theme.Cyan" parent="Theme.MaterialComponents.DayNight.DarkActionBar"> <style name="Theme.Cyan" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<item name="colorPrimary">#00ACC1</item> <item name="colorPrimary">#00ACC1</item>
<item name="colorSecondary">#00c177</item> <item name="colorSecondary">#00c177</item>
@ -52,6 +55,7 @@
<item name="overlapAnchor">false</item> <item name="overlapAnchor">false</item>
<item name="android:dropDownVerticalOffset">?attr/actionBarSize</item> <item name="android:dropDownVerticalOffset">?attr/actionBarSize</item>
</style> </style>
<style name="Theme.Pink" parent="Theme.MaterialComponents.DayNight.DarkActionBar"> <style name="Theme.Pink" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<item name="colorPrimary">#FF80AB</item> <item name="colorPrimary">#FF80AB</item>
<item name="colorSecondary">#ff80ea</item> <item name="colorSecondary">#ff80ea</item>

View file

@ -1,15 +1,15 @@
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android"> <shortcuts xmlns:android="http://schemas.android.com/apk/res/android">
<shortcut <shortcut
android:shortcutId="start_TODO"
android:enabled="true" android:enabled="true"
android:icon="@drawable/ic_launcher_todo" android:icon="@drawable/ic_launcher_todo"
android:shortcutShortLabel="@string/todo_app_short_label" android:shortcutDisabledMessage="@string/todo_app"
android:shortcutId="start_TODO"
android:shortcutLongLabel="@string/todo_app" android:shortcutLongLabel="@string/todo_app"
android:shortcutDisabledMessage="@string/todo_app"> android:shortcutShortLabel="@string/todo_app_short_label">
<intent <intent
android:action="android.intent.action.VIEW" android:action="android.intent.action.VIEW"
android:targetPackage="uk.kagurach.android101" android:targetClass="uk.kagurach.android101.todoList.TodoListMainActivity"
android:targetClass="uk.kagurach.android101.todoList.TodoListMainActivity" /> android:targetPackage="uk.kagurach.android101" />
<categories android:name="android.shortcut.conversation" /> <categories android:name="android.shortcut.conversation" />
<capability-binding android:key="actions.intent.CREATE_MESSAGE" /> <capability-binding android:key="actions.intent.CREATE_MESSAGE" />
</shortcut> </shortcut>

View file

@ -1,9 +1,8 @@
package uk.kagurach.android101 package uk.kagurach.android101
import org.junit.Assert.assertEquals
import org.junit.Test import org.junit.Test
import org.junit.Assert.*
/** /**
* Example local unit test, which will execute on the development machine (host). * Example local unit test, which will execute on the development machine (host).
* *

View file

@ -8,23 +8,25 @@ junitVersion = "1.2.1"
espressoCore = "3.6.1" espressoCore = "3.6.1"
appcompat = "1.7.0" appcompat = "1.7.0"
material = "1.12.0" material = "1.12.0"
activity = "1.9.0" activity = "1.9.1"
constraintlayout = "2.1.4" constraintlayout = "2.1.4"
lifecycleRuntimeKtx = "2.8.3" lifecycleRuntimeKtx = "2.8.4"
activityCompose = "1.9.0" activityCompose = "1.9.1"
composeBom = "2024.06.00" composeBom = "2024.06.00"
roomCommon = "2.6.1" roomCommon = "2.6.1"
roomKtx = "2.6.1" roomKtx = "2.6.1"
navigationFragmentKtx = "2.7.7" navigationFragmentKtx = "2.7.7"
navigationUiKtx = "2.7.7" navigationUiKtx = "2.7.7"
annotation = "1.8.0" annotation = "1.8.1"
lifecycleLivedataKtx = "2.8.3" lifecycleLivedataKtx = "2.8.4"
lifecycleViewmodelKtx = "2.8.3" lifecycleViewmodelKtx = "2.8.4"
datastoreRxjava3 = "1.1.1" datastoreRxjava3 = "1.1.1"
androidxWork = "2.9.0" androidxWork = "2.9.0"
okHttp3 = "4.9.3" okHttp3 = "4.9.3"
moshiJson = "1.15.1" moshiJson = "1.15.1"
ffmpegKit = "6.0-2" ffmpegKit = "6.0-2"
cameraX = "1.3.4"
cameraView = "1.3.4"
[libraries] [libraries]
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" } androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
@ -55,6 +57,10 @@ androidx-lifecycle-livedata-ktx = { group = "androidx.lifecycle", name = "lifecy
androidx-lifecycle-viewmodel-ktx = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-ktx", version.ref = "lifecycleViewmodelKtx" } androidx-lifecycle-viewmodel-ktx = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-ktx", version.ref = "lifecycleViewmodelKtx" }
androidx-datastore-rxjava3 = { group = "androidx.datastore", name = "datastore-rxjava3", version.ref = "datastoreRxjava3" } androidx-datastore-rxjava3 = { group = "androidx.datastore", name = "datastore-rxjava3", version.ref = "datastoreRxjava3" }
androidx-work = { group = "androidx.work", name="work-runtime", version.ref = "androidxWork" } androidx-work = { group = "androidx.work", name="work-runtime", version.ref = "androidxWork" }
androidx-camera-core = { group = "androidx.camera",name = "camera-core",version.ref="cameraX"}
androidx-camera-camera2 = { group = "androidx.camera",name = "camera-camera2",version.ref="cameraX"}
androidx-camera-lifecycle = { group = "androidx.camera",name = "camera-lifecycle",version.ref="cameraX"}
androidx-camera-view = { group = "androidx.camera",name="camera-view",version.ref="cameraView"}
okhttp3 = { group = "com.squareup.okhttp3", name="okhttp",version.ref="okHttp3"} okhttp3 = { group = "com.squareup.okhttp3", name="okhttp",version.ref="okHttp3"}
moshi = {group="com.squareup.moshi",name="moshi-kotlin",version.ref="moshiJson"} moshi = {group="com.squareup.moshi",name="moshi-kotlin",version.ref="moshiJson"}