✨
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 11 KiB |
@@ -32,7 +32,7 @@ class AudioGalleryActivity : BaseGalleryActivity(), FileProcessCallback {
|
||||
uriList.add(uri)
|
||||
}
|
||||
} else {
|
||||
result.data?.data?.let { uriList.add(it) } // Single file selected
|
||||
result.data?.data?.let { uriList.add(it) }
|
||||
}
|
||||
|
||||
if (uriList.isNotEmpty()) {
|
||||
|
||||
@@ -32,7 +32,6 @@ abstract class BaseGalleryActivity : AppCompatActivity() {
|
||||
if (granted || Build.VERSION.SDK_INT >= Build.VERSION_CODES.R && Environment.isExternalStorageManager()) {
|
||||
loadFiles()
|
||||
} else {
|
||||
// Handle permission denial case
|
||||
showPermissionDeniedDialog()
|
||||
}
|
||||
}
|
||||
@@ -47,6 +46,29 @@ abstract class BaseGalleryActivity : AppCompatActivity() {
|
||||
|
||||
fileManager = FileManager(this, this)
|
||||
|
||||
binding.fabAdd.text = when(fileType){
|
||||
FileManager.FileType.IMAGE -> {
|
||||
"Add Image"
|
||||
}
|
||||
FileManager.FileType.AUDIO -> {
|
||||
"Add Audio"
|
||||
}
|
||||
FileManager.FileType.VIDEO -> {
|
||||
"Add Video"
|
||||
}
|
||||
FileManager.FileType.DOCUMENT -> {
|
||||
"Add Files"
|
||||
}
|
||||
}
|
||||
binding.recyclerView.setOnScrollChangeListener { _, _, scrollY, _, oldScrollY ->
|
||||
if (scrollY > oldScrollY && binding.fabAdd.isExtended) {
|
||||
|
||||
binding.fabAdd.shrink()
|
||||
} else if (scrollY < oldScrollY && !binding.fabAdd.isExtended) {
|
||||
|
||||
binding.fabAdd.extend()
|
||||
}
|
||||
}
|
||||
setupRecyclerView()
|
||||
checkPermissionsAndLoadFiles()
|
||||
}
|
||||
@@ -56,7 +78,7 @@ abstract class BaseGalleryActivity : AppCompatActivity() {
|
||||
ActivityResultContracts.StartIntentSenderForResult()
|
||||
) { result ->
|
||||
if (result.resultCode == RESULT_OK) {
|
||||
loadFiles() // Refresh the list after deletion
|
||||
loadFiles()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -103,7 +125,7 @@ abstract class BaseGalleryActivity : AppCompatActivity() {
|
||||
abstract fun openPreview()
|
||||
|
||||
private fun showPermissionDeniedDialog() {
|
||||
// Show a dialog or a message informing the user about the importance of permissions
|
||||
// permission denied
|
||||
}
|
||||
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||
|
||||
@@ -33,11 +33,7 @@ class ImageGalleryActivity : BaseGalleryActivity(), FileProcessCallback {
|
||||
setupFabButton()
|
||||
|
||||
intentSenderLauncher = registerForActivityResult(ActivityResultContracts.StartIntentSenderForResult()){
|
||||
if (it.resultCode == RESULT_OK){
|
||||
// Toast.makeText(this, "Photo Deleted Successfully", Toast.LENGTH_SHORT).show()
|
||||
}else{
|
||||
Toast.makeText(this, "Failed to hide/unhide photo", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
if (it.resultCode != RESULT_OK) Toast.makeText(this, "Failed to hide/unhide photo", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
|
||||
pickImageLauncher = registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { result ->
|
||||
@@ -51,7 +47,7 @@ class ImageGalleryActivity : BaseGalleryActivity(), FileProcessCallback {
|
||||
uriList.add(uri)
|
||||
}
|
||||
} else {
|
||||
result.data?.data?.let { uriList.add(it) } // Single file selected
|
||||
result.data?.data?.let { uriList.add(it) }
|
||||
}
|
||||
|
||||
if (uriList.isNotEmpty()) {
|
||||
|
||||
@@ -125,6 +125,7 @@ class MainActivity : AppCompatActivity(), DialogActionsCallback {
|
||||
|
||||
private fun clearDisplay() {
|
||||
currentExpression = "0"
|
||||
binding.total.text = ""
|
||||
lastWasOperator = false
|
||||
hasDecimal = false
|
||||
updateDisplay()
|
||||
@@ -187,7 +188,30 @@ class MainActivity : AppCompatActivity(), DialogActionsCallback {
|
||||
|
||||
private fun updateDisplay() {
|
||||
binding.display.text = currentExpression
|
||||
|
||||
if (currentExpression == "0"){
|
||||
binding.total.text = ""
|
||||
return
|
||||
}
|
||||
// Evaluate the expression and update total
|
||||
try {
|
||||
val expression = ExpressionBuilder(currentExpression).build()
|
||||
val result = expression.evaluate()
|
||||
|
||||
// Format the result and update total.text
|
||||
val formattedResult = if (result.toLong().toDouble() == result) {
|
||||
result.toLong().toString()
|
||||
} else {
|
||||
String.format("%.2f", result)
|
||||
}
|
||||
|
||||
binding.total.text = formattedResult
|
||||
} catch (e: Exception) {
|
||||
// Show a blank or placeholder for invalid expressions
|
||||
binding.total.text = ""
|
||||
}
|
||||
}
|
||||
|
||||
private fun cutNumbers() {
|
||||
if (currentExpression.isNotEmpty()){
|
||||
if (currentExpression.length == 1){
|
||||
|
||||
@@ -6,6 +6,7 @@ import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import devs.org.calculator.adapters.ImagePreviewAdapter
|
||||
import devs.org.calculator.callbacks.DialogActionsCallback
|
||||
import devs.org.calculator.databinding.ActivityPreviewBinding
|
||||
import devs.org.calculator.utils.DialogUtil
|
||||
import devs.org.calculator.utils.FileManager
|
||||
@@ -21,6 +22,7 @@ class PreviewActivity : AppCompatActivity() {
|
||||
private lateinit var filetype: FileManager.FileType
|
||||
private lateinit var adapter: ImagePreviewAdapter
|
||||
private lateinit var fileManager: FileManager
|
||||
private val dialogUtil = DialogUtil(this)
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
@@ -62,7 +64,7 @@ class PreviewActivity : AppCompatActivity() {
|
||||
|
||||
private fun setupImagePreview() {
|
||||
adapter = ImagePreviewAdapter(this, filetype)
|
||||
adapter.images = files // Set initial data
|
||||
adapter.images = files
|
||||
binding.viewPager.adapter = adapter
|
||||
|
||||
binding.viewPager.setCurrentItem(currentPosition, false)
|
||||
@@ -75,40 +77,58 @@ class PreviewActivity : AppCompatActivity() {
|
||||
binding.delete.setOnClickListener {
|
||||
val fileUri = FileManager.FileManager().getContentUriImage(this, files[binding.viewPager.currentItem], filetype)
|
||||
if (fileUri != null) {
|
||||
MaterialAlertDialogBuilder(this)
|
||||
.setTitle("Delete File")
|
||||
.setMessage("Are you sure you want to Delete this file?")
|
||||
.setPositiveButton("Delete") { dialog, _ ->
|
||||
lifecycleScope.launch {
|
||||
FileManager(this@PreviewActivity, this@PreviewActivity).deletePhotoFromExternalStorage(fileUri)
|
||||
removeFileFromList(binding.viewPager.currentItem)
|
||||
dialogUtil.showMaterialDialog(
|
||||
"Delete File",
|
||||
"Are you sure to Delete this file permanently?",
|
||||
"Delete Permanently",
|
||||
"Cancel",
|
||||
object : DialogActionsCallback{
|
||||
override fun onPositiveButtonClicked() {
|
||||
lifecycleScope.launch {
|
||||
FileManager(this@PreviewActivity, this@PreviewActivity).deletePhotoFromExternalStorage(fileUri)
|
||||
removeFileFromList(binding.viewPager.currentItem)
|
||||
}
|
||||
}
|
||||
dialog.dismiss()
|
||||
|
||||
override fun onNegativeButtonClicked() {
|
||||
|
||||
}
|
||||
|
||||
override fun onNaturalButtonClicked() {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
.setNegativeButton("Cancel") { dialog, _ ->
|
||||
dialog.dismiss()
|
||||
}
|
||||
.show()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
binding.unHide.setOnClickListener {
|
||||
val fileUri = FileManager.FileManager().getContentUriImage(this, files[binding.viewPager.currentItem], filetype)
|
||||
if (fileUri != null) {
|
||||
MaterialAlertDialogBuilder(this)
|
||||
.setTitle("Unhide File")
|
||||
.setMessage("Are you sure you want to Unhide this file?")
|
||||
.setPositiveButton("Unhide") { dialog, _ ->
|
||||
lifecycleScope.launch {
|
||||
FileManager(this@PreviewActivity, this@PreviewActivity).copyFileToNormalDir(fileUri)
|
||||
removeFileFromList(binding.viewPager.currentItem)
|
||||
dialogUtil.showMaterialDialog(
|
||||
"Unhide File",
|
||||
"Are you sure you want to Unhide this file?",
|
||||
"Unhide",
|
||||
"Cancel",
|
||||
object : DialogActionsCallback{
|
||||
override fun onPositiveButtonClicked() {
|
||||
lifecycleScope.launch {
|
||||
FileManager(this@PreviewActivity, this@PreviewActivity).copyFileToNormalDir(fileUri)
|
||||
removeFileFromList(binding.viewPager.currentItem)
|
||||
}
|
||||
}
|
||||
dialog.dismiss()
|
||||
|
||||
override fun onNegativeButtonClicked() {
|
||||
|
||||
}
|
||||
|
||||
override fun onNaturalButtonClicked() {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
.setNegativeButton("Cancel") { dialog, _ ->
|
||||
dialog.dismiss()
|
||||
}
|
||||
.show()
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,17 +11,33 @@ import com.google.android.material.textfield.TextInputEditText
|
||||
import devs.org.calculator.databinding.ActivitySetupPasswordBinding
|
||||
import devs.org.calculator.utils.PrefsUtil
|
||||
import devs.org.calculator.R
|
||||
import devs.org.calculator.databinding.ActivityChangePasswordBinding
|
||||
|
||||
class SetupPasswordActivity : AppCompatActivity() {
|
||||
private lateinit var binding: ActivitySetupPasswordBinding
|
||||
private lateinit var binding2: ActivityChangePasswordBinding
|
||||
private lateinit var prefsUtil: PrefsUtil
|
||||
private var hasPassword = false
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
binding = ActivitySetupPasswordBinding.inflate(layoutInflater)
|
||||
binding2 = ActivityChangePasswordBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
prefsUtil = PrefsUtil(this)
|
||||
|
||||
prefsUtil = PrefsUtil(this)
|
||||
hasPassword = prefsUtil.hasPassword()
|
||||
|
||||
if (hasPassword){
|
||||
setContentView(binding2.root)
|
||||
}else{
|
||||
setContentView(binding.root)
|
||||
}
|
||||
clickListeners()
|
||||
|
||||
}
|
||||
|
||||
private fun clickListeners(){
|
||||
binding.btnSavePassword.setOnClickListener {
|
||||
val password = binding.etPassword.text.toString()
|
||||
val confirmPassword = binding.etConfirmPassword.text.toString()
|
||||
@@ -62,7 +78,38 @@ class SetupPasswordActivity : AppCompatActivity() {
|
||||
else Toast.makeText(this, "Security question not set yet.", Toast.LENGTH_SHORT).show()
|
||||
|
||||
}
|
||||
binding2.btnChangePassword.setOnClickListener{
|
||||
val oldPassword = binding2.etOldPassword.text.toString()
|
||||
val newPassword = binding2.etNewPassword.text.toString()
|
||||
if (oldPassword.isEmpty()) {
|
||||
binding2.etOldPassword.error = "This field can't be empty"
|
||||
return@setOnClickListener
|
||||
}
|
||||
if (newPassword.isEmpty()) {
|
||||
binding2.etNewPassword.error = "This field can't be empty"
|
||||
return@setOnClickListener
|
||||
}
|
||||
|
||||
if (prefsUtil.validatePassword(oldPassword)){
|
||||
if (oldPassword != newPassword){
|
||||
prefsUtil.savePassword(newPassword)
|
||||
Toast.makeText(this, "Password reset successfully", Toast.LENGTH_SHORT).show()
|
||||
startActivity(Intent(this, MainActivity::class.java))
|
||||
finish()
|
||||
|
||||
}else {
|
||||
Toast.makeText(this, "Old Password And New Password Not Be Same", Toast.LENGTH_SHORT).show()
|
||||
binding2.etNewPassword.error = "Old Password And New Password Not Be Same"
|
||||
}
|
||||
}else {
|
||||
Toast.makeText(this, "Wrong password entered", Toast.LENGTH_SHORT).show()
|
||||
binding2.etOldPassword.error = "Old Password Not Matching"
|
||||
}
|
||||
}
|
||||
binding2.btnResetPassword.setOnClickListener{
|
||||
if (prefsUtil.getSecurityQuestion() != null) showSecurityQuestionDialog(prefsUtil.getSecurityQuestion().toString())
|
||||
else Toast.makeText(this, "Security question not set yet.", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
|
||||
private fun showSecurityQuestionDialog(securityQuestion: String) {
|
||||
@@ -71,6 +118,7 @@ class SetupPasswordActivity : AppCompatActivity() {
|
||||
val questionTextView: TextView = dialogView.findViewById(R.id.security_question)
|
||||
questionTextView.text = securityQuestion
|
||||
|
||||
|
||||
MaterialAlertDialogBuilder(this)
|
||||
.setTitle("Answer the Security Question!")
|
||||
.setView(dialogView)
|
||||
|
||||
@@ -16,6 +16,8 @@ import com.bumptech.glide.Glide
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import devs.org.calculator.R
|
||||
import devs.org.calculator.activities.PreviewActivity
|
||||
import devs.org.calculator.callbacks.DialogActionsCallback
|
||||
import devs.org.calculator.utils.DialogUtil
|
||||
import devs.org.calculator.utils.FileManager
|
||||
import kotlinx.coroutines.launch
|
||||
import java.io.File
|
||||
@@ -30,6 +32,23 @@ class FileAdapter(
|
||||
private val selectedItems = mutableSetOf<Int>()
|
||||
private var isSelectionMode = false
|
||||
private var fileName = "Unknown File"
|
||||
private var fileTypes = when (fileType) {
|
||||
|
||||
FileManager.FileType.IMAGE -> {
|
||||
"IMAGE"
|
||||
}
|
||||
|
||||
FileManager.FileType.VIDEO -> {
|
||||
"VIDEO"
|
||||
}
|
||||
|
||||
FileManager.FileType.AUDIO -> {
|
||||
"AUDIO"
|
||||
}
|
||||
|
||||
else -> "DOCUMENT"
|
||||
|
||||
}
|
||||
|
||||
inner class FileViewHolder(view: View) : RecyclerView.ViewHolder(view) {
|
||||
private val imageView: ImageView = view.findViewById(R.id.imageView)
|
||||
@@ -63,24 +82,6 @@ class FileAdapter(
|
||||
}
|
||||
itemView.setOnClickListener {
|
||||
|
||||
|
||||
var fileTypes = when (fileType) {
|
||||
|
||||
FileManager.FileType.IMAGE -> {
|
||||
"IMAGE"
|
||||
}
|
||||
|
||||
FileManager.FileType.VIDEO -> {
|
||||
"VIDEO"
|
||||
}
|
||||
|
||||
FileManager.FileType.AUDIO -> {
|
||||
"AUDIO"
|
||||
}
|
||||
|
||||
else -> "DOCUMENT"
|
||||
|
||||
}
|
||||
val intent = Intent(context, PreviewActivity::class.java).apply {
|
||||
putExtra("type", fileTypes)
|
||||
putExtra("position", position)
|
||||
@@ -101,29 +102,36 @@ class FileAdapter(
|
||||
fileName = FileManager.FileName(context).getFileNameFromUri(fileUri)?.toString()
|
||||
?: "Unknown File"
|
||||
|
||||
|
||||
MaterialAlertDialogBuilder(context)
|
||||
.setTitle("Details")
|
||||
.setMessage("File Name: $fileName\n\nFile Path: $file\n\nYou can delete or unhide this file.")
|
||||
.setPositiveButton("Delete") { dialog, _ ->
|
||||
lifecycleOwner.lifecycleScope.launch {
|
||||
FileManager(context, lifecycleOwner).deletePhotoFromExternalStorage(
|
||||
fileUri
|
||||
)
|
||||
DialogUtil(context).showMaterialDialogWithNaturalButton(
|
||||
"$fileTypes DETAILS",
|
||||
"File Name: $fileName\n\nFile Path: $file\n\nYou can permanently delete or unhide this file.",
|
||||
"Delete Permanently",
|
||||
"Unhide",
|
||||
"Cancel",
|
||||
object : DialogActionsCallback {
|
||||
override fun onPositiveButtonClicked() {
|
||||
lifecycleOwner.lifecycleScope.launch {
|
||||
FileManager(context, lifecycleOwner).deletePhotoFromExternalStorage(
|
||||
fileUri
|
||||
)
|
||||
}
|
||||
val currentList = currentList.toMutableList()
|
||||
currentList.remove(file)
|
||||
submitList(currentList)
|
||||
}
|
||||
|
||||
override fun onNegativeButtonClicked() {
|
||||
FileManager(context, lifecycleOwner).copyFileToNormalDir(fileUri)
|
||||
val currentList = currentList.toMutableList()
|
||||
currentList.remove(file)
|
||||
submitList(currentList)
|
||||
}
|
||||
|
||||
override fun onNaturalButtonClicked() {
|
||||
|
||||
}
|
||||
val currentList = currentList.toMutableList()
|
||||
currentList.remove(file)
|
||||
submitList(currentList)
|
||||
dialog.dismiss()
|
||||
}
|
||||
.setNegativeButton("Unhide") { dialog, _ ->
|
||||
FileManager(context, lifecycleOwner).copyFileToNormalDir(fileUri)
|
||||
val currentList = currentList.toMutableList()
|
||||
currentList.remove(file)
|
||||
submitList(currentList)
|
||||
dialog.dismiss()
|
||||
}
|
||||
.show()
|
||||
)
|
||||
|
||||
return@setOnLongClickListener true
|
||||
}
|
||||
@@ -145,12 +153,10 @@ class FileAdapter(
|
||||
|
||||
class FileDiffCallback : DiffUtil.ItemCallback<File>() {
|
||||
override fun areItemsTheSame(oldItem: File, newItem: File): Boolean {
|
||||
// Compare based on file path or another unique identifier
|
||||
return oldItem.path == newItem.path
|
||||
}
|
||||
|
||||
override fun areContentsTheSame(oldItem: File, newItem: File): Boolean {
|
||||
// Compare the content of files if needed
|
||||
return oldItem == newItem
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,12 +5,15 @@ import android.content.Context
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import android.provider.MediaStore
|
||||
import android.view.View
|
||||
import android.widget.Toast
|
||||
import androidx.activity.result.ActivityResultLauncher
|
||||
import androidx.activity.result.IntentSenderRequest
|
||||
import androidx.documentfile.provider.DocumentFile
|
||||
import androidx.lifecycle.LifecycleOwner
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import com.google.android.material.textfield.TextInputEditText
|
||||
import devs.org.calculator.R
|
||||
import devs.org.calculator.callbacks.DialogActionsCallback
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.withContext
|
||||
|
||||
5
app/src/main/res/drawable/plus.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:viewportHeight="20" android:viewportWidth="20" android:width="24dp">
|
||||
|
||||
<path android:fillColor="@color/textColor" android:fillType="evenOdd" android:pathData="M9,17a1,1 0,1 0,2 0v-6h6a1,1 0,1 0,0 -2h-6V3a1,1 0,1 0,-2 0v6H3a1,1 0,0 0,0 2h6v6z"/>
|
||||
|
||||
</vector>
|
||||
78
app/src/main/res/layout/activity_change_password.xml
Normal file
@@ -0,0 +1,78 @@
|
||||
<?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"
|
||||
android:padding="16dp"
|
||||
tools:context=".activities.SetupPasswordActivity">
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/tvTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Change Password"
|
||||
android:textSize="24sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/tilOldPassword"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="32dp"
|
||||
android:hint="Enter Old Password"
|
||||
app:endIconMode="password_toggle"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvTitle">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/etOldPassword"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:imeOptions="actionNext"
|
||||
android:singleLine="true"
|
||||
android:inputType="number" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/tilNewPassword"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:hint="Enter New Password"
|
||||
app:endIconMode="password_toggle"
|
||||
app:layout_constraintTop_toBottomOf="@id/tilOldPassword">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/etNewPassword"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:imeOptions="actionNext"
|
||||
android:singleLine="true"
|
||||
android:inputType="number" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btnChangePassword"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="32dp"
|
||||
android:padding="12dp"
|
||||
android:text="Change Password"
|
||||
app:layout_constraintTop_toBottomOf="@id/tilNewPassword" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btnResetPassword"
|
||||
style="@style/Widget.MaterialComponents.Button.TextButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="Forgot Password?"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/btnChangePassword" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -3,6 +3,7 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
@@ -11,14 +12,28 @@
|
||||
android:layout_height="match_parent"
|
||||
android:padding="8dp" />
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
<!-- <com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton-->
|
||||
<!-- android:id="@+id/fabAdd"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_gravity="bottom|end"-->
|
||||
<!-- android:layout_margin="16dp"-->
|
||||
<!-- android:contentDescription="Compose"-->
|
||||
<!-- android:icon="@drawable/plus"-->
|
||||
<!-- android:text="Add File"-->
|
||||
<!-- app:elevation="6dp"/>-->
|
||||
|
||||
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
|
||||
android:id="@+id/fabAdd"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_marginEnd="25dp"
|
||||
android:layout_marginBottom="35dp"
|
||||
android:contentDescription="Add file"
|
||||
android:src="@android:drawable/ic_input_add" />
|
||||
android:contentDescription="Compose"
|
||||
app:iconPadding="8dp"
|
||||
app:icon="@android:drawable/ic_input_add"
|
||||
android:text="Add file"/>
|
||||
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
@@ -13,8 +13,8 @@
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/fabAdd"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_marginEnd="25dp"
|
||||
android:layout_marginBottom="35dp"
|
||||
|
||||
@@ -9,23 +9,45 @@
|
||||
tools:context=".activities.MainActivity">
|
||||
|
||||
<!-- Calculator Display -->
|
||||
<TextView
|
||||
android:id="@+id/display"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="160dp"
|
||||
android:layout_margin="16dp"
|
||||
android:layout_weight="3"
|
||||
android:layout_marginTop="0dp"
|
||||
android:elevation="4dp"
|
||||
android:gravity="end|bottom"
|
||||
android:padding="10dp"
|
||||
android:text="0"
|
||||
android:textSize="48sp"
|
||||
android:autoSizeTextType="uniform"
|
||||
android:autoSizeMinTextSize="20sp"
|
||||
android:autoSizeMaxTextSize="48sp"
|
||||
android:autoSizeStepGranularity="2sp"
|
||||
tools:ignore="Suspicious0dp" />
|
||||
android:orientation="vertical"
|
||||
android:gravity="right|bottom">
|
||||
<TextView
|
||||
android:id="@+id/display"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="end|bottom"
|
||||
android:padding="10dp"
|
||||
android:text="0"
|
||||
android:textSize="48sp"
|
||||
android:autoSizeTextType="uniform"
|
||||
android:autoSizeMinTextSize="20sp"
|
||||
android:autoSizeMaxTextSize="48sp"
|
||||
android:autoSizeStepGranularity="2sp"
|
||||
tools:ignore="Suspicious0dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/total"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="end|bottom"
|
||||
android:paddingRight="10dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:text=""
|
||||
android:textSize="26sp"
|
||||
android:autoSizeTextType="uniform"
|
||||
android:autoSizeMinTextSize="20sp"
|
||||
android:autoSizeMaxTextSize="48sp"
|
||||
android:autoSizeStepGranularity="2sp"
|
||||
tools:ignore="Suspicious0dp" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@mipmap/ic_launcher_background"/>
|
||||
<background android:drawable="@color/ic_launcher_background"/>
|
||||
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||
<monochrome android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||
</adaptive-icon>
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@mipmap/ic_launcher_background"/>
|
||||
<background android:drawable="@color/ic_launcher_background"/>
|
||||
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||
<monochrome android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||
</adaptive-icon>
|
||||
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1006 B |
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 776 B |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 8.8 KiB After Width: | Height: | Size: 8.0 KiB |
4
app/src/main/res/values/ic_launcher_background.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="ic_launcher_background">#3DDC84</color>
|
||||
</resources>
|
||||