mirror of
https://github.com/SimpleMobileTools/Simple-Calculator.git
synced 2025-02-03 09:17:35 +01:00
updating commons with some design changes
This commit is contained in:
parent
d1e1aae052
commit
7ab5e701e1
@ -63,7 +63,7 @@ android {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'com.github.SimpleMobileTools:Simple-Commons:c070dff787'
|
||||
implementation 'com.github.SimpleMobileTools:Simple-Commons:8ee6c0c17b'
|
||||
implementation 'me.grantland:autofittextview:0.2.1'
|
||||
implementation 'net.objecthunter:exp4j:0.4.8'
|
||||
|
||||
|
@ -4,7 +4,6 @@ import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.view.Menu
|
||||
import android.view.MenuItem
|
||||
import android.view.View
|
||||
import android.view.WindowManager
|
||||
import com.simplemobiletools.calculator.BuildConfig
|
||||
@ -35,6 +34,7 @@ class MainActivity : SimpleActivity(), Calculator {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_main)
|
||||
appLaunched(BuildConfig.APPLICATION_ID)
|
||||
setupOptionsMenu()
|
||||
|
||||
calc = CalculatorImpl(this, applicationContext)
|
||||
|
||||
@ -74,6 +74,7 @@ class MainActivity : SimpleActivity(), Calculator {
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
setupToolbar(main_toolbar)
|
||||
if (storedTextColor != config.textColor) {
|
||||
updateViewColors(calculator_holder, getProperTextColor())
|
||||
}
|
||||
@ -110,20 +111,16 @@ class MainActivity : SimpleActivity(), Calculator {
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
||||
menuInflater.inflate(R.menu.menu, menu)
|
||||
updateMenuItemColors(menu)
|
||||
return true
|
||||
}
|
||||
|
||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||
when (item.itemId) {
|
||||
R.id.history -> showHistory()
|
||||
R.id.settings -> launchSettings()
|
||||
R.id.about -> launchAbout()
|
||||
else -> return super.onOptionsItemSelected(item)
|
||||
private fun setupOptionsMenu() {
|
||||
main_toolbar.setOnMenuItemClickListener { menuItem ->
|
||||
when (menuItem.itemId) {
|
||||
R.id.history -> showHistory()
|
||||
R.id.settings -> launchSettings()
|
||||
R.id.about -> launchAbout()
|
||||
else -> return@setOnMenuItemClickListener false
|
||||
}
|
||||
return@setOnMenuItemClickListener true
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
private fun storeStateVariables() {
|
||||
|
@ -2,19 +2,18 @@ package com.simplemobiletools.calculator.activities
|
||||
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.view.Menu
|
||||
import com.simplemobiletools.calculator.R
|
||||
import com.simplemobiletools.calculator.extensions.calculatorDB
|
||||
import com.simplemobiletools.calculator.extensions.config
|
||||
import com.simplemobiletools.calculator.extensions.updateWidgets
|
||||
import com.simplemobiletools.commons.extensions.*
|
||||
import com.simplemobiletools.commons.helpers.IS_CUSTOMIZING_COLORS
|
||||
import com.simplemobiletools.commons.helpers.NavigationIcon
|
||||
import com.simplemobiletools.commons.helpers.ensureBackgroundThread
|
||||
import kotlinx.android.synthetic.main.activity_settings.*
|
||||
import java.util.*
|
||||
import kotlin.system.exitProcess
|
||||
|
||||
|
||||
class SettingsActivity : SimpleActivity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
@ -24,6 +23,7 @@ class SettingsActivity : SimpleActivity() {
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
setupToolbar(settings_toolbar, NavigationIcon.Arrow)
|
||||
|
||||
setupPurchaseThankYou()
|
||||
setupCustomizeColors()
|
||||
@ -32,7 +32,7 @@ class SettingsActivity : SimpleActivity() {
|
||||
setupPreventPhoneFromSleeping()
|
||||
setupUseCommaAsDecimalMark()
|
||||
setupCustomizeWidgetColors()
|
||||
updateTextColors(settings_scrollview)
|
||||
updateTextColors(settings_nested_scrollview)
|
||||
|
||||
arrayOf(settings_color_customization_label, settings_general_settings_label).forEach {
|
||||
it.setTextColor(getProperPrimaryColor())
|
||||
@ -43,11 +43,6 @@ class SettingsActivity : SimpleActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
||||
updateMenuItemColors(menu)
|
||||
return super.onCreateOptionsMenu(menu)
|
||||
}
|
||||
|
||||
private fun setupPurchaseThankYou() {
|
||||
settings_purchase_thank_you_holder.beGoneIf(isOrWasThankYouInstalled())
|
||||
|
||||
@ -105,8 +100,8 @@ class SettingsActivity : SimpleActivity() {
|
||||
settings_use_comma_as_decimal_mark.toggle()
|
||||
config.useCommaAsDecimalMark = settings_use_comma_as_decimal_mark.isChecked
|
||||
updateWidgets()
|
||||
ensureBackgroundThread {
|
||||
applicationContext.calculatorDB.deleteHistory()
|
||||
ensureBackgroundThread {
|
||||
applicationContext.calculatorDB.deleteHistory()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package com.simplemobiletools.calculator.activities
|
||||
import android.app.Activity
|
||||
import android.appwidget.AppWidgetManager
|
||||
import android.content.Intent
|
||||
import android.content.res.ColorStateList
|
||||
import android.graphics.Color
|
||||
import android.os.Bundle
|
||||
import android.widget.Button
|
||||
@ -63,6 +64,7 @@ class WidgetConfigureActivity : SimpleActivity() {
|
||||
if (mFeatureLockedDialog != null && isOrWasThankYouInstalled()) {
|
||||
mFeatureLockedDialog?.dismissDialog()
|
||||
}
|
||||
setupToolbar(config_toolbar)
|
||||
}
|
||||
|
||||
private fun initVariables() {
|
||||
@ -118,6 +120,7 @@ class WidgetConfigureActivity : SimpleActivity() {
|
||||
mBgColor = mBgColorWithoutTransparency.adjustAlpha(mBgAlpha)
|
||||
widget_background.applyColorFilter(mBgColor)
|
||||
config_bg_color.setFillWithStroke(mBgColor, mBgColor)
|
||||
config_save.backgroundTintList = ColorStateList.valueOf(getProperPrimaryColor())
|
||||
}
|
||||
|
||||
private fun updateTextColor() {
|
||||
@ -130,6 +133,7 @@ class WidgetConfigureActivity : SimpleActivity() {
|
||||
)
|
||||
result.setTextColor(mTextColor)
|
||||
formula.setTextColor(mTextColor)
|
||||
config_save.setTextColor(getProperPrimaryColor().getContrastColor())
|
||||
|
||||
viewIds.forEach {
|
||||
(findViewById<Button>(it)).setTextColor(mTextColor)
|
||||
|
@ -7,6 +7,7 @@ import com.simplemobiletools.calculator.adapters.HistoryAdapter
|
||||
import com.simplemobiletools.calculator.extensions.calculatorDB
|
||||
import com.simplemobiletools.calculator.helpers.CalculatorImpl
|
||||
import com.simplemobiletools.calculator.models.History
|
||||
import com.simplemobiletools.commons.extensions.getAlertDialogBuilder
|
||||
import com.simplemobiletools.commons.extensions.setupDialogStuff
|
||||
import com.simplemobiletools.commons.extensions.toast
|
||||
import com.simplemobiletools.commons.helpers.ensureBackgroundThread
|
||||
@ -18,7 +19,7 @@ class HistoryDialog(activity: SimpleActivity, items: List<History>, calculator:
|
||||
init {
|
||||
val view = activity.layoutInflater.inflate(R.layout.dialog_history, null)
|
||||
|
||||
AlertDialog.Builder(activity)
|
||||
activity.getAlertDialogBuilder()
|
||||
.setPositiveButton(R.string.ok, null)
|
||||
.setNeutralButton(R.string.clear_history) { _, _ ->
|
||||
ensureBackgroundThread {
|
||||
|
@ -1,237 +1,262 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout 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/calculator_holder"
|
||||
android:id="@+id/main_coordinator"
|
||||
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:hapticFeedbackEnabled="true"
|
||||
android:orientation="vertical"
|
||||
tools:context="com.simplemobiletools.calculator.activities.MainActivity"
|
||||
tools:ignore="HardcodedText">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/formula"
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/main_app_bar_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2.1"
|
||||
android:fontFamily="sans-serif-light"
|
||||
android:gravity="end|bottom"
|
||||
android:maxLines="1"
|
||||
android:paddingLeft="@dimen/activity_margin"
|
||||
android:paddingRight="@dimen/activity_margin"
|
||||
android:textSize="@dimen/formula_text_size" />
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/result"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1.8"
|
||||
android:fontFamily="sans-serif-light"
|
||||
android:gravity="center_vertical|end"
|
||||
android:maxLines="1"
|
||||
android:paddingLeft="@dimen/activity_margin"
|
||||
android:paddingRight="@dimen/activity_margin"
|
||||
android:textSize="@dimen/display_text_size"
|
||||
tools:text="0" />
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/main_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="@color/color_primary"
|
||||
app:menu="@menu/menu"
|
||||
app:title="@string/app_launcher_name"
|
||||
app:titleTextAppearance="@style/AppTheme.ActionBar.TitleTextStyle" />
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/calculator_holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2"
|
||||
android:orientation="horizontal">
|
||||
android:hapticFeedbackEnabled="true"
|
||||
android:orientation="vertical"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_7"
|
||||
style="@style/MyButton"
|
||||
<TextView
|
||||
android:id="@+id/formula"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="7" />
|
||||
android:layout_weight="2.1"
|
||||
android:fontFamily="sans-serif-light"
|
||||
android:gravity="end|bottom"
|
||||
android:maxLines="1"
|
||||
android:paddingLeft="@dimen/activity_margin"
|
||||
android:paddingRight="@dimen/activity_margin"
|
||||
android:textSize="@dimen/formula_text_size" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_8"
|
||||
style="@style/MyButton"
|
||||
<TextView
|
||||
android:id="@+id/result"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="8" />
|
||||
android:layout_weight="1.8"
|
||||
android:fontFamily="sans-serif-light"
|
||||
android:gravity="center_vertical|end"
|
||||
android:maxLines="1"
|
||||
android:paddingLeft="@dimen/activity_margin"
|
||||
android:paddingRight="@dimen/activity_margin"
|
||||
android:textSize="@dimen/display_text_size"
|
||||
tools:text="0" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_9"
|
||||
style="@style/MyButton"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="9" />
|
||||
android:layout_weight="2"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_divide"
|
||||
style="@style/MyButton"
|
||||
<Button
|
||||
android:id="@+id/btn_7"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="7" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_8"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="8" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_9"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="9" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_divide"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="÷" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_clear"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="C" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_reset"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="AC"
|
||||
android:visibility="gone" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="÷" />
|
||||
android:layout_weight="2"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_clear"
|
||||
style="@style/MyButton"
|
||||
<Button
|
||||
android:id="@+id/btn_4"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="4" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_5"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="5" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_6"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="6" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_multiply"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="×" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_root"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="√" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="C" />
|
||||
android:layout_weight="2"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_reset"
|
||||
style="@style/MyButton"
|
||||
<Button
|
||||
android:id="@+id/btn_1"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="1" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_2"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="2" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_3"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="3" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_minus"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="-" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_power"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="^" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="AC"
|
||||
android:visibility="gone" />
|
||||
android:layout_weight="2"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_0"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="0" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_decimal"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="." />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_equals"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="=" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_plus"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="+" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_percent"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="%" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_4"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="4" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_5"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="5" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_6"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="6" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_multiply"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="×" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_root"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="√" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_1"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="1" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_2"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="2" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_3"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="3" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_minus"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="-" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_power"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="^" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_0"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="0" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_decimal"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="." />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_equals"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="=" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_plus"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="+" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_percent"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="%" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
@ -1,245 +1,34 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout 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/calculator_holder"
|
||||
android:id="@+id/main_coordinator"
|
||||
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:hapticFeedbackEnabled="true"
|
||||
android:orientation="vertical"
|
||||
tools:context="com.simplemobiletools.calculator.activities.MainActivity"
|
||||
tools:ignore="HardcodedText">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/formula"
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/main_app_bar_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/main_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="@color/color_primary"
|
||||
app:menu="@menu/menu"
|
||||
app:title="@string/app_launcher_name"
|
||||
app:titleTextAppearance="@style/AppTheme.ActionBar.TitleTextStyle" />
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<include
|
||||
layout="@layout/view_calculator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2.1"
|
||||
android:fontFamily="sans-serif-light"
|
||||
android:gravity="end|bottom"
|
||||
android:maxLines="1"
|
||||
android:paddingLeft="@dimen/activity_margin"
|
||||
android:paddingRight="@dimen/activity_margin"
|
||||
android:textSize="@dimen/formula_text_size" />
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/result"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1.8"
|
||||
android:fontFamily="sans-serif-light"
|
||||
android:gravity="center_vertical|end"
|
||||
android:maxLines="1"
|
||||
android:paddingLeft="@dimen/activity_margin"
|
||||
android:paddingRight="@dimen/activity_margin"
|
||||
android:textSize="@dimen/display_text_size"
|
||||
tools:text="0" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_percent"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="%" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_power"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="^" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_root"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="√" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_clear"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="C" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_reset"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="AC"
|
||||
android:visibility="gone" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_7"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="7" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_8"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="8" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_9"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="9" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_divide"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="÷" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_4"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="4" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_5"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="5" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_6"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="6" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_multiply"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="×" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_1"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="1" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_2"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="2" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_3"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="3" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_minus"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="-" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_0"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="0" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_decimal"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="." />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_equals"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="=" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_plus"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="+" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
@ -1,157 +1,182 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/settings_scrollview"
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/settings_coordinator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/settings_holder"
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/settings_app_bar_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/settings_color_customization_label"
|
||||
style="@style/SettingsSectionLabelStyle"
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/settings_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/color_customization" />
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="@color/color_primary"
|
||||
app:title="@string/settings"
|
||||
app:titleTextAppearance="@style/AppTheme.ActionBar.TitleTextStyle" />
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:id="@+id/settings_nested_scrollview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fillViewport="true"
|
||||
android:scrollbars="none"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/settings_color_customization_holder"
|
||||
android:id="@+id/settings_holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/medium_margin"
|
||||
android:background="@drawable/section_holder_stroke"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/settings_customize_colors_holder"
|
||||
style="@style/SettingsHolderTextViewOneLinerStyle"
|
||||
<TextView
|
||||
android:id="@+id/settings_color_customization_label"
|
||||
style="@style/SettingsSectionLabelStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/ripple_top_corners">
|
||||
android:text="@string/color_customization" />
|
||||
|
||||
<com.simplemobiletools.commons.views.MyTextView
|
||||
android:id="@+id/settings_customize_colors_label"
|
||||
style="@style/SettingsTextLabelStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/customize_colors" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/settings_customize_widget_colors_holder"
|
||||
style="@style/SettingsHolderTextViewOneLinerStyle"
|
||||
<LinearLayout
|
||||
android:id="@+id/settings_color_customization_holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/ripple_bottom_corners">
|
||||
android:layout_margin="@dimen/medium_margin"
|
||||
android:background="@drawable/section_holder_stroke"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.simplemobiletools.commons.views.MyTextView
|
||||
android:id="@+id/settings_customize_widget_colors_label"
|
||||
style="@style/SettingsTextLabelStyle"
|
||||
android:layout_width="wrap_content"
|
||||
<RelativeLayout
|
||||
android:id="@+id/settings_customize_colors_holder"
|
||||
style="@style/SettingsHolderTextViewOneLinerStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/customize_widget_colors" />
|
||||
android:background="@drawable/ripple_top_corners">
|
||||
|
||||
</RelativeLayout>
|
||||
<com.simplemobiletools.commons.views.MyTextView
|
||||
android:id="@+id/settings_customize_colors_label"
|
||||
style="@style/SettingsTextLabelStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/customize_colors" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/settings_customize_widget_colors_holder"
|
||||
style="@style/SettingsHolderTextViewOneLinerStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/ripple_bottom_corners">
|
||||
|
||||
<com.simplemobiletools.commons.views.MyTextView
|
||||
android:id="@+id/settings_customize_widget_colors_label"
|
||||
style="@style/SettingsTextLabelStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/customize_widget_colors" />
|
||||
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/settings_general_settings_label"
|
||||
style="@style/SettingsSectionLabelStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/general_settings" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/settings_general_settings_holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/medium_margin"
|
||||
android:background="@drawable/section_holder_stroke"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/settings_purchase_thank_you_holder"
|
||||
style="@style/SettingsHolderTextViewOneLinerStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/ripple_top_corners">
|
||||
|
||||
<com.simplemobiletools.commons.views.MyTextView
|
||||
android:id="@+id/settings_purchase_thank_you"
|
||||
style="@style/SettingsTextLabelStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/purchase_simple_thank_you" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/settings_use_english_holder"
|
||||
style="@style/SettingsHolderCheckboxStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/ripple_background">
|
||||
|
||||
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
|
||||
android:id="@+id/settings_use_english"
|
||||
style="@style/SettingsCheckboxStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/use_english_language" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/settings_vibrate_holder"
|
||||
style="@style/SettingsHolderCheckboxStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/ripple_background">
|
||||
|
||||
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
|
||||
android:id="@+id/settings_vibrate"
|
||||
style="@style/SettingsCheckboxStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/vibrate_on_button_press" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/settings_prevent_phone_from_sleeping_holder"
|
||||
style="@style/SettingsHolderCheckboxStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/ripple_background">
|
||||
|
||||
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
|
||||
android:id="@+id/settings_prevent_phone_from_sleeping"
|
||||
style="@style/SettingsCheckboxStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/prevent_phone_from_sleeping" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/settings_use_comma_as_decimal_mark_holder"
|
||||
style="@style/SettingsHolderCheckboxStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/ripple_bottom_corners">
|
||||
|
||||
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
|
||||
android:id="@+id/settings_use_comma_as_decimal_mark"
|
||||
style="@style/SettingsCheckboxStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/use_comma_as_decimal_mark" />
|
||||
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/settings_general_settings_label"
|
||||
style="@style/SettingsSectionLabelStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/general_settings" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/settings_general_settings_holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/medium_margin"
|
||||
android:background="@drawable/section_holder_stroke"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/settings_purchase_thank_you_holder"
|
||||
style="@style/SettingsHolderTextViewOneLinerStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/ripple_top_corners">
|
||||
|
||||
<com.simplemobiletools.commons.views.MyTextView
|
||||
android:id="@+id/settings_purchase_thank_you"
|
||||
style="@style/SettingsTextLabelStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/purchase_simple_thank_you" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/settings_use_english_holder"
|
||||
style="@style/SettingsHolderCheckboxStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/ripple_background">
|
||||
|
||||
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
|
||||
android:id="@+id/settings_use_english"
|
||||
style="@style/SettingsCheckboxStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/use_english_language" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/settings_vibrate_holder"
|
||||
style="@style/SettingsHolderCheckboxStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/ripple_background">
|
||||
|
||||
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
|
||||
android:id="@+id/settings_vibrate"
|
||||
style="@style/SettingsCheckboxStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/vibrate_on_button_press" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/settings_prevent_phone_from_sleeping_holder"
|
||||
style="@style/SettingsHolderCheckboxStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/ripple_background">
|
||||
|
||||
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
|
||||
android:id="@+id/settings_prevent_phone_from_sleeping"
|
||||
style="@style/SettingsCheckboxStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/prevent_phone_from_sleeping" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/settings_use_comma_as_decimal_mark_holder"
|
||||
style="@style/SettingsHolderCheckboxStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/ripple_bottom_corners">
|
||||
|
||||
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
|
||||
android:id="@+id/settings_use_comma_as_decimal_mark"
|
||||
style="@style/SettingsCheckboxStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/use_comma_as_decimal_mark" />
|
||||
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
244
app/src/main/res/layout/view_calculator.xml
Normal file
244
app/src/main/res/layout/view_calculator.xml
Normal file
@ -0,0 +1,244 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/calculator_holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:hapticFeedbackEnabled="true"
|
||||
android:orientation="vertical"
|
||||
tools:ignore="HardcodedText">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/formula"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2.1"
|
||||
android:fontFamily="sans-serif-light"
|
||||
android:gravity="end|bottom"
|
||||
android:maxLines="1"
|
||||
android:paddingLeft="@dimen/activity_margin"
|
||||
android:paddingRight="@dimen/activity_margin"
|
||||
android:textSize="@dimen/formula_text_size" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/result"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1.8"
|
||||
android:fontFamily="sans-serif-light"
|
||||
android:gravity="center_vertical|end"
|
||||
android:maxLines="1"
|
||||
android:paddingLeft="@dimen/activity_margin"
|
||||
android:paddingRight="@dimen/activity_margin"
|
||||
android:textSize="@dimen/display_text_size"
|
||||
tools:text="0" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_percent"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="%" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_power"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="^" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_root"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="√" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_clear"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="C" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_reset"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="AC"
|
||||
android:visibility="gone" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_7"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="7" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_8"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="8" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_9"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="9" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_divide"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="÷" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_4"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="4" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_5"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="5" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_6"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="6" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_multiply"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="×" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_1"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="1" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_2"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="2" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_3"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="3" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_minus"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="-" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_0"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="0" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_decimal"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="." />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_equals"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="=" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_plus"
|
||||
style="@style/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="+" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
@ -16,7 +16,7 @@
|
||||
|
||||
<include
|
||||
android:id="@+id/widget_content_holder"
|
||||
layout="@layout/activity_main"
|
||||
layout="@layout/view_calculator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
|
@ -1,76 +1,93 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/config_holder"
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/config_coordinator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_margin="@dimen/activity_margin">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/widget_background"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignBottom="@+id/config_calc"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:src="@drawable/widget_round_background" />
|
||||
|
||||
<include
|
||||
android:id="@+id/config_calc"
|
||||
layout="@layout/activity_main"
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/config_app_bar_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_above="@+id/config_bg_seekbar_holder"
|
||||
android:layout_marginBottom="@dimen/activity_margin" />
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/config_bg_color"
|
||||
android:layout_width="@dimen/widget_colorpicker_size"
|
||||
android:layout_height="@dimen/widget_colorpicker_size"
|
||||
android:layout_above="@+id/config_text_color"
|
||||
android:layout_margin="@dimen/tiny_margin" />
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/config_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="@color/color_primary"
|
||||
app:title="@string/app_launcher_name"
|
||||
app:titleTextAppearance="@style/AppTheme.ActionBar.TitleTextStyle" />
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/config_bg_seekbar_holder"
|
||||
android:id="@+id/config_holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignTop="@+id/config_bg_color"
|
||||
android:layout_alignBottom="@+id/config_bg_color"
|
||||
android:layout_marginStart="@dimen/medium_margin"
|
||||
android:layout_toEndOf="@+id/config_bg_color"
|
||||
android:background="@drawable/widget_config_seekbar_background">
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_margin="@dimen/activity_margin"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
|
||||
<com.simplemobiletools.commons.views.MySeekBar
|
||||
android:id="@+id/config_bg_seekbar"
|
||||
android:layout_width="match_parent"
|
||||
<ImageView
|
||||
android:id="@+id/widget_background"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:paddingStart="@dimen/activity_margin"
|
||||
android:paddingEnd="@dimen/activity_margin" />
|
||||
android:layout_alignBottom="@+id/config_calc"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:src="@drawable/widget_round_background" />
|
||||
|
||||
<include
|
||||
android:id="@+id/config_calc"
|
||||
layout="@layout/view_calculator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_above="@+id/config_bg_seekbar_holder"
|
||||
android:layout_marginBottom="@dimen/activity_margin" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/config_bg_color"
|
||||
android:layout_width="@dimen/widget_colorpicker_size"
|
||||
android:layout_height="@dimen/widget_colorpicker_size"
|
||||
android:layout_above="@+id/config_text_color"
|
||||
android:layout_margin="@dimen/tiny_margin" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/config_bg_seekbar_holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignTop="@+id/config_bg_color"
|
||||
android:layout_alignBottom="@+id/config_bg_color"
|
||||
android:layout_marginStart="@dimen/medium_margin"
|
||||
android:layout_toEndOf="@+id/config_bg_color"
|
||||
android:background="@drawable/widget_config_seekbar_background">
|
||||
|
||||
<com.simplemobiletools.commons.views.MySeekBar
|
||||
android:id="@+id/config_bg_seekbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:paddingStart="@dimen/activity_margin"
|
||||
android:paddingEnd="@dimen/activity_margin" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/config_text_color"
|
||||
android:layout_width="@dimen/widget_colorpicker_size"
|
||||
android:layout_height="@dimen/widget_colorpicker_size"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_margin="@dimen/tiny_margin" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/config_save"
|
||||
style="@style/MyWidgetConfigSaveStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:text="@string/ok" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/config_text_color"
|
||||
android:layout_width="@dimen/widget_colorpicker_size"
|
||||
android:layout_height="@dimen/widget_colorpicker_size"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_margin="@dimen/tiny_margin" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/config_save"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:background="@drawable/widget_config_seekbar_background"
|
||||
android:fontFamily="sans-serif-light"
|
||||
android:paddingStart="@dimen/activity_margin"
|
||||
android:paddingEnd="@dimen/activity_margin"
|
||||
android:text="@string/ok"
|
||||
android:textColor="@color/dark_grey"
|
||||
android:textFontWeight="400"
|
||||
android:textSize="@dimen/big_text_size" />
|
||||
|
||||
</RelativeLayout>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
Loading…
x
Reference in New Issue
Block a user