some rewrites and reorganization here and there

This commit is contained in:
tibbi 2017-11-05 16:25:01 +01:00
parent ce43c1a890
commit df5be92141
51 changed files with 176 additions and 197 deletions

View File

@ -27,11 +27,17 @@ android {
signingConfig signingConfigs.release
}
}
lintOptions {
checkReleaseBuilds false
abortOnError false
}
}
dependencies {
compile 'com.simplemobiletools:commons:2.35.4'
compile 'com.simplemobiletools:commons:2.35.5'
compile 'me.grantland:autofittextview:0.2.1'
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
testCompile 'junit:junit:4.12'
testCompile 'org.robolectric:robolectric:3.3.2'
@ -40,7 +46,18 @@ dependencies {
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support.test:rules:0.5'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
}
buildscript {
ext.kotlin_version = '1.1.51'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
}
}
def Properties props = new Properties()
@ -48,12 +65,11 @@ def propFile = new File('signing.properties')
if (propFile.canRead()) {
props.load(new FileInputStream(propFile))
if (props != null && props.containsKey('STORE_FILE') && props.containsKey('STORE_PASSWORD') &&
props.containsKey('KEY_ALIAS') && props.containsKey('KEY_PASSWORD')) {
if (props != null && props.containsKey('STORE_FILE') && props.containsKey('KEY_ALIAS') && props.containsKey('PASSWORD')) {
android.signingConfigs.release.storeFile = file(props['STORE_FILE'])
android.signingConfigs.release.storePassword = props['STORE_PASSWORD']
android.signingConfigs.release.storePassword = props['PASSWORD']
android.signingConfigs.release.keyAlias = props['KEY_ALIAS']
android.signingConfigs.release.keyPassword = props['KEY_PASSWORD']
android.signingConfigs.release.keyPassword = props['PASSWORD']
} else {
println 'signing.properties found but some entries are missing'
android.buildTypes.release.signingConfig = null
@ -62,7 +78,3 @@ if (propFile.canRead()) {
println 'signing.properties not found'
android.buildTypes.release.signingConfig = null
}
repositories {
mavenCentral()
maven { url "https://jitpack.io" }
}

View File

@ -1,17 +0,0 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in $ANDROID_HOME/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest
package="com.simplemobiletools.calculator"
xmlns:android="http://schemas.android.com/apk/res/android">
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.simplemobiletools.calculator">
<application
android:allowBackup="true"
@ -27,6 +27,11 @@
</intent-filter>
</activity>
<activity
android:name=".activities.SettingsActivity"
android:label="@string/settings"
android:parentActivityName=".activities.MainActivity"/>
<activity
android:name="com.simplemobiletools.commons.activities.AboutActivity"
android:label="@string/about"
@ -37,19 +42,14 @@
android:label="@string/third_party_licences"
android:parentActivityName="com.simplemobiletools.commons.activities.AboutActivity"/>
<activity
android:name=".activities.SettingsActivity"
android:label="@string/settings"
android:parentActivityName=".activities.MainActivity"/>
<activity
android:name="com.simplemobiletools.commons.activities.CustomizationActivity"
android:label="@string/customize_colors"
android:parentActivityName=".activities.SettingsActivity"/>
<receiver
android:name=".MyWidgetProvider"
android:icon="@mipmap/widget_preview">
android:name=".helpers.MyWidgetProvider"
android:icon="@drawable/img_widget_preview">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE"/>
</intent-filter>

View File

@ -7,7 +7,9 @@ import android.content.Intent
import android.os.Bundle
import android.view.Menu
import android.view.MenuItem
import com.simplemobiletools.calculator.*
import com.simplemobiletools.calculator.BuildConfig
import com.simplemobiletools.calculator.R
import com.simplemobiletools.calculator.helpers.*
import com.simplemobiletools.commons.extensions.toast
import com.simplemobiletools.commons.extensions.value
import com.simplemobiletools.commons.helpers.LICENSE_AUTOFITTEXTVIEW
@ -18,9 +20,7 @@ import kotlinx.android.synthetic.main.activity_main.*
import me.grantland.widget.AutofitHelper
class MainActivity : SimpleActivity(), Calculator {
companion object {
private lateinit var mCalc: CalculatorImpl
}
@ -62,13 +62,21 @@ class MainActivity : SimpleActivity(), Calculator {
override fun onOptionsItemSelected(item: MenuItem): Boolean {
when (item.itemId) {
R.id.settings -> startActivity(Intent(applicationContext, SettingsActivity::class.java))
R.id.about -> startAboutActivity(R.string.app_name, LICENSE_KOTLIN or LICENSE_AUTOFITTEXTVIEW or LICENSE_ROBOLECTRIC or LICENSE_ESPRESSO, BuildConfig.VERSION_NAME)
R.id.settings -> launchSettings()
R.id.about -> launchAbout()
else -> return super.onOptionsItemSelected(item)
}
return true
}
private fun launchSettings() {
startActivity(Intent(applicationContext, SettingsActivity::class.java))
}
private fun launchAbout() {
startAboutActivity(R.string.app_name, LICENSE_KOTLIN or LICENSE_AUTOFITTEXTVIEW or LICENSE_ROBOLECTRIC or LICENSE_ESPRESSO, BuildConfig.VERSION_NAME)
}
private fun copyToClipboard(copyResult: Boolean): Boolean {
var value = formula.value
if (copyResult) {

View File

@ -11,8 +11,12 @@ import android.view.View
import android.widget.Button
import android.widget.RemoteViews
import android.widget.SeekBar
import com.simplemobiletools.calculator.*
import com.simplemobiletools.calculator.R
import com.simplemobiletools.calculator.helpers.MyWidgetProvider
import com.simplemobiletools.commons.dialogs.ColorPickerDialog
import com.simplemobiletools.commons.helpers.PREFS_KEY
import com.simplemobiletools.commons.helpers.WIDGET_BG_COLOR
import com.simplemobiletools.commons.helpers.WIDGET_TEXT_COLOR
import kotlinx.android.synthetic.main.activity_main.*
import kotlinx.android.synthetic.main.widget_config.*
@ -75,7 +79,7 @@ class WidgetConfigureActivity : AppCompatActivity() {
config_bg_seekbar.progress = (mBgAlpha * 100).toInt()
updateBackgroundColor()
mTextColor = prefs.getInt(WIDGET_TEXT_COLOR, resources.getColor(R.color.colorPrimary))
mTextColor = prefs.getInt(WIDGET_TEXT_COLOR, resources.getColor(R.color.color_primary))
updateTextColor()
formula.text = "15,937*5"

View File

@ -1,4 +1,4 @@
package com.simplemobiletools.calculator
package com.simplemobiletools.calculator.helpers
interface Calculator {
fun setValue(value: String)

View File

@ -1,5 +1,6 @@
package com.simplemobiletools.calculator
package com.simplemobiletools.calculator.helpers
import com.simplemobiletools.calculator.R
import com.simplemobiletools.calculator.operation.OperationFactory
class CalculatorImpl {
@ -81,7 +82,7 @@ class CalculatorImpl {
private fun formatString(str: String): String {
// if the number contains a decimal, do not try removing the leading zero anymore, nor add group separator
// it would prevent writing values like 1.02
if (str.contains("."))
if (str.contains(""))
return str
val doubleValue = Formatter.stringToDouble(str)
@ -93,13 +94,12 @@ class CalculatorImpl {
mBaseValue = value
}
val displayedNumberAsDouble: Double
get() = Formatter.stringToDouble(displayedNumber!!)
private fun getDisplayedNumberAsDouble() = Formatter.stringToDouble(displayedNumber!!)
fun handleResult() {
mSecondValue = displayedNumberAsDouble
mSecondValue = getDisplayedNumberAsDouble()
calculateResult()
mBaseValue = displayedNumberAsDouble
mBaseValue = getDisplayedNumberAsDouble()
}
fun calculateResult() {
@ -158,40 +158,40 @@ class CalculatorImpl {
if (mLastKey != DIGIT)
return
mSecondValue = displayedNumberAsDouble
mSecondValue = getDisplayedNumberAsDouble()
calculateResult()
mLastKey = EQUALS
}
fun decimalClicked() {
private fun decimalClicked() {
var value = displayedNumber
if (!value!!.contains("."))
value += "."
if (!value!!.contains(""))
value += ""
setValue(value)
}
fun zeroClicked() {
private fun zeroClicked() {
val value = displayedNumber
if (value != "0")
addDigit(0)
}
private fun getSign(lastOperation: String?): String {
return when (lastOperation) {
PLUS -> "+"
MINUS -> "-"
MULTIPLY -> "*"
DIVIDE -> "/"
MODULO -> "%"
POWER -> "^"
ROOT -> ""
else -> ""
}
private fun getSign(lastOperation: String?) = when (lastOperation) {
PLUS -> "+"
MINUS -> "-"
MULTIPLY -> "*"
DIVIDE -> "/"
MODULO -> "%"
POWER -> "^"
ROOT -> ""
else -> ""
}
fun numpadClicked(id: Int) {
if (mLastKey == EQUALS)
if (mLastKey == EQUALS) {
mLastOperation = EQUALS
}
mLastKey = DIGIT
resetValueIfNeeded()

View File

@ -1,4 +1,4 @@
package com.simplemobiletools.calculator
package com.simplemobiletools.calculator.helpers
val DIGIT = "digit"
val EQUALS = "equals"
@ -23,10 +23,3 @@ val SIX = "six"
val SEVEN = "seven"
val EIGHT = "eight"
val NINE = "nine"
// shared preferences
val PREFS_KEY = "Calculator"
val IS_FIRST_RUN = "is_first_run"
val IS_DARK_THEME = "is_dark_theme"
val WIDGET_BG_COLOR = "widget_bg_color"
val WIDGET_TEXT_COLOR = "widget_text_color"

View File

@ -1,4 +1,4 @@
package com.simplemobiletools.calculator
package com.simplemobiletools.calculator.helpers
import java.text.DecimalFormat
import java.text.DecimalFormatSymbols
@ -17,7 +17,5 @@ object Formatter {
return formatter.format(d)
}
fun stringToDouble(str: String): Double {
return str.replace(",".toRegex(), "").toDouble()
}
fun stringToDouble(str: String) = str.replace(",", "").toDouble()
}

View File

@ -1,4 +1,4 @@
package com.simplemobiletools.calculator
package com.simplemobiletools.calculator.helpers
import android.app.PendingIntent
import android.appwidget.AppWidgetManager
@ -10,8 +10,12 @@ import android.content.SharedPreferences
import android.graphics.Color
import android.view.View
import android.widget.RemoteViews
import com.simplemobiletools.calculator.R
import com.simplemobiletools.calculator.activities.MainActivity
import com.simplemobiletools.commons.helpers.PREFS_KEY
import com.simplemobiletools.commons.helpers.WIDGET_BG_COLOR
import com.simplemobiletools.commons.helpers.WIDGET_TEXT_COLOR
class MyWidgetProvider : AppWidgetProvider(), Calculator {
@ -103,9 +107,7 @@ class MyWidgetProvider : AppWidgetProvider(), Calculator {
}
}
private fun initPrefs(context: Context?): SharedPreferences {
return context!!.getSharedPreferences(PREFS_KEY, Context.MODE_PRIVATE)
}
private fun initPrefs(context: Context?) = context!!.getSharedPreferences(PREFS_KEY, Context.MODE_PRIVATE)
private fun updateTextColors(color: Int) {
val viewIds = intArrayOf(R.id.formula, R.id.result, R.id.btn_0, R.id.btn_1, R.id.btn_2, R.id.btn_3, R.id.btn_4, R.id.btn_5, R.id.btn_6, R.id.btn_7, R.id.btn_8, R.id.btn_9, R.id.btn_modulo, R.id.btn_power, R.id.btn_root, R.id.btn_clear, R.id.btn_reset, R.id.btn_divide, R.id.btn_multiply, R.id.btn_minus, R.id.btn_plus, R.id.btn_decimal, R.id.btn_equals)

View File

@ -5,7 +5,5 @@ import com.simplemobiletools.calculator.operation.base.Operation
class MinusOperation(baseValue: Double, secondValue: Double) : BinaryOperation(baseValue, secondValue), Operation {
override fun getResult(): Double {
return baseValue - secondValue
}
override fun getResult() = baseValue - secondValue
}

View File

@ -5,7 +5,5 @@ import com.simplemobiletools.calculator.operation.base.Operation
class MultiplyOperation(baseValue: Double, secondValue: Double) : BinaryOperation(baseValue, secondValue), Operation {
override fun getResult(): Double {
return baseValue * secondValue
}
override fun getResult() = baseValue * secondValue
}

View File

@ -1,6 +1,6 @@
package com.simplemobiletools.calculator.operation
import com.simplemobiletools.calculator.*
import com.simplemobiletools.calculator.helpers.*
import com.simplemobiletools.calculator.operation.base.Operation
object OperationFactory {

View File

@ -5,7 +5,5 @@ import com.simplemobiletools.calculator.operation.base.Operation
class PlusOperation(baseValue: Double, secondValue: Double) : BinaryOperation(baseValue, secondValue), Operation {
override fun getResult(): Double {
return baseValue + secondValue
}
override fun getResult() = baseValue + secondValue
}

View File

@ -5,7 +5,5 @@ import com.simplemobiletools.calculator.operation.base.UnaryOperation
class RootOperation(value: Double) : UnaryOperation(value), Operation {
override fun getResult(): Double {
return Math.sqrt(value)
}
override fun getResult() = Math.sqrt(value)
}

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

View File

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:id="@+id/calculator_holder"
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:orientation="vertical"
@ -30,8 +30,8 @@
android:maxLines="1"
android:paddingLeft="@dimen/activity_margin"
android:paddingRight="@dimen/activity_margin"
android:text="0"
android:textSize="@dimen/display_text_size"/>
android:textSize="@dimen/display_text_size"
tools:text="0"/>
<LinearLayout
android:layout_width="match_parent"

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
android:id="@+id/settings_scrollview"
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/settings_scrollview"
android:layout_width="match_parent"
android:layout_height="wrap_content">

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 621 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

View File

@ -14,4 +14,9 @@
Diese App ist nur eine von vielen unserer Apps. Du kannst alle anderen hier finden: http://www.simplemobiletools.com
</string>
<!--
Haven't found some strings? There's more at
https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res
-->
</resources>

View File

@ -8,11 +8,15 @@
<string name="app_long_description">
No hay conversión de unidades, usted puede copiar el resultado o la fórmula en el portapapeles con una pulsación prolongada.
El color del texto del widget puede ser personalizado, además del color y la transparencia del fondo. Presione el resultado o la fórmula en el widget para abrir la aplicación.
No contiene anuncios ni permisos innecesarios. Es completamente OpenSource y además provee un tema oscuro.
Esta aplicación es tan solo una pequeña parte de una serie de aplicaciones. Puede encontrar el resto en http://www.simplemobiletools.com
</string>
<!--
Haven't found some strings? There's more at
https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res
-->
</resources>

View File

@ -5,5 +5,18 @@
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<string name="app_short_description">Une calculette avec les fonctions de base et un widget customisable.</string>
<string name="app_long_description">Pas de conversion d\'unité, restez appuyé sur le résultat d\'une formule pour le copier. La couleur du texte, du fond et la transparence peuvent être modifiés. Appuyez sur le résultat ou la formule du widget pour ouvrir l\'application. Pas de pub ou d\'autorisations inutiles. Complètement opensource et fournit un thème sombre. Cette application fait partie d\'une collection, disponibles sur http://www.simplemobiletools.com</string>
<string name="app_long_description">
Pas de conversion d\'unité, restez appuyé sur le résultat d\'une formule pour le copier.
La couleur du texte, du fond et la transparence peuvent être modifiés. Appuyez sur le résultat ou la formule du widget pour ouvrir l\'application.
Pas de pub ou d\'autorisations inutiles. Complètement opensource et fournit un thème sombre.
Cette application fait partie d\'une collection, disponibles sur http://www.simplemobiletools.com
</string>
<!--
Haven't found some strings? There's more at
https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res
-->
</resources>

View File

@ -10,8 +10,13 @@
The text color of the widget can be customized, as well as the color and the alpha of the background. Press the result or formula in the widget to open the app.
Contains no ads or unnecessary permissions. It is fully opensource, provides a Dark theme too.
Contains no ads or unnecessary permissions. It is fully opensource, provides customizable colors.
This app is just one piece of a bigger series of apps. You can find the rest of them at http://www.simplemobiletools.com
</string>
<!--
Haven't found some strings? There's more at
https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res
-->
</resources>

View File

@ -14,4 +14,9 @@
このアプリは、大きな一連のアプリの一つです。 他のアプリ http://www.simplemobiletools.com で見つけることができます
</string>
<!--
Haven't found some strings? There's more at
https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res
-->
</resources>

View File

@ -14,4 +14,9 @@
Esta aplicação é apenas parte de um conjunto mais vasto de aplicações. Saiba mais em http://www.simplemobiletools.com
</string>
<!--
Haven't found some strings? There's more at
https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res
-->
</resources>

View File

@ -14,4 +14,9 @@
Это только одно приложение из множества других в серии. Вы можете найти остальные на http://www.simplemobiletools.com
</string>
<!--
Haven't found some strings? There's more at
https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res
-->
</resources>

View File

@ -10,8 +10,13 @@
Farbu textu widgetu možno prispôsobiť, rovnako ako farbu a priehľadnosť pozadia. Ak chcete aplikáciu otvoriť, stlačte výsledok alebo vzorec v miniaplikácii.
Neobsahuje žiadne reklamy a nepotrebné oprávnenia. Je plne opensource, poskytuje aj tmavú tému.
Neobsahuje žiadne reklamy a nepotrebné oprávnenia. Je opensource, poskytuje možnosť zmeny farieb.
Táto aplikácia je iba jednou zo skupiny aplikácií. Ostatné viete nájsť na http://www.simplemobiletools.com
</string>
<!--
Haven't found some strings? There's more at
https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res
-->
</resources>

View File

@ -14,4 +14,9 @@
Denna app är bara en del av en större serie appar. Du hittar resten av dem på http://www.simplemobiletools.com
</string>
<!--
Haven't found some strings? There's more at
https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res
-->
</resources>

View File

@ -3,42 +3,6 @@
<string name="app_launcher_name">Hesap Makinesi</string>
<string name="copied_to_clipboard">Panoya kopyalanan değer</string>
<!-- About -->
<string name="about">Hakkında</string>
<string name="website">Daha basit uygulamalar ve kaynak kodu:\nhttp://simplemobiletools.com</string>
<string name="email_label">Görüşlerinizi veya önerilerinizi şu adrese gönderin:</string>
<string name="email" translatable="false">hello@simplemobiletools.com</string>
<string name="third_party_licences_underlined"><u> Üçüncü taraf lisansları </u></string>
<string name="invite_friends_underlined"><u>Arkadaşlarınızı davet edin</u></string>
<string name="share_text">Hey, gel ve adresini ziyaret et %1$s de %2$s</string>
<string name="invite_via">aracılığıyla davet et</string>
<string name="rate_us_underlined"><u> Play Store da oy verin </u></string>
<string name="follow_us">Bizi takip edin:</string>
<string name="copyright">v %1$s\nTelif Hakkı © Simple Mobile Tools %2$d</string>
<!-- Settings -->
<string name="settings">Ayarlar</string>
<string name="dark_theme">Koyu Tema</string>
<!-- License -->
<string name="notice">Bu uygulama hayatımı kolaylaştırmak için aşağıdaki üçüncü parti kitaplıklarını kullanıyor. Teşekkür ederim.</string>
<string name="third_party_licences">Üçüncü taraf lisansları</string>
<string name="butterknife_title"><u>Butter Knife (görünüş enjektörü)</u></string>
<string name="butterknife_text" translatable="false">Telif Hakkı 2013 Jake Wharton\n\nApache Lisansı, Version 2.0 (\"Lisans\") kapsamında lisanslanmıştır; bu dosyayı Lisans\'a uygunluk dışında kullanamazsınız. Lisansın bir kopyasını aşağıdaki adresten edinebilirsiniz:\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nGeçerli yasalar tarafından talep edilmediği veya yazılı olarak kabul edilmedikçe, Lisans kapsamında dağıtılan yazılımlar, \"OLDUĞU GİBİ\" ESNASINDA, HİÇBİR GARANTİ VE KOŞULU HİÇBİR ZAMAN OLMAKSIZIN, \"açık ve kapalı\" olarak dağıtılır, izinleri ve sınırlamaları düzenleyen özel lisan için Lisans\'ı görüntüler. Lisans kapsamında.</string>
<string name="butterknife_url" translatable="false">https://github.com/JakeWharton/butterknife</string>
<string name="ambilwarna_title"><u> AmbilWarna (renk seçici) </u></string>
<string name="ambilwarna_text" translatable="false">2015 Yuku\n\nApache Lisansı, Version 2.0 (\"Lisans\") kapsamında lisanslanmıştır; bu dosyayı Lisans\'a uygunluğunuz dışında kullanamazsınız. Lisansın bir kopyasını aşağıdaki adresten edinebilirsiniz:\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nYürürlükteki kanunların gerektirmediği veya yazılı olarak kabul edilmediği sürece, Lisans kapsamında dağıtılan yazılımlar, açık veya zımni herhangi bir garanti veya koşul olmadan \"OLDUĞU GİBİ\" temelinde dağıtılır. Lisans altındaki izinler ve sınırlamalara tabi spesifik dil için Lisans\'a bakın.</string>
<string name="ambilwarna_url" translatable="false">https://github.com/yukuku/ambilwarna</string>
<string name="autofittextview_title"><u> AutoFitTextView (metin görüntüsünü otomatik küçültme) </u></string>
<string name="autofittextview_text" translatable="false">Telif hakkı 2014 Grantland Çiğneme\n\nApache Lisansı, Version 2.0 (\"Lisans\") kapsamında lisanslanmıştır; bu dosyayı Lisans\'a uygunluğunuz dışında kullanamazsınız. Lisansın bir kopyasını aşağıdaki adresten edinebilirsiniz:\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nYürürlükteki kanunların gerektirmediği veya yazılı olarak kabul edilmediği sürece, Lisans kapsamında dağıtılan yazılımlar, açık veya zımni herhangi bir garanti veya koşul olmadan \"OLDUĞU GİBİ\" temelinde dağıtılır. Lisans altındaki izinler ve sınırlamalara tabi spesifik dil için Lisans\'a bakın.</string>
<string name="autofittextview_url" translatable="false">https://github.com/grantland/android-autofittextview</string>
<string name="robolectric_title"><u>Robolectric (birim test çerçevesi)</u></string>
<string name="robolectric_text" translatable="false">MIT Lisansı\n\nTelif Hakkı (c) 2010 Xtreme Labs and Pivotal Labs\n\nYazılımın herhangi bir kimliğini ve ilgili dokümantasyon dosyalarını (\"Yazılım\") temin eden herhangi bir şahsa, sınırlama olmaksızın Yazılım\'da uğraşmak için, bunlarla sınırlı olmaksızın, bunlarla sınırlı olmaksızın, bunlarla sınırlı olmaksızın, , yayınlamayı, dağıtmayı, alt lisans almayı ve / veya satmayı ve Yazılım\'ın verildiği kişileri aşağıdaki koşullara tabi olarak izin vermeyi kabul ve taahhüt eder:\n\nYukarıdaki telif hakkı bildirimi ve bu izin bildirimi tüm kopyalarının veya Yazılımın önemli kısımlarına dahil edilecektir.\n\nYAZILIM HERHANGİ BİR AÇIK YA DA KAPALI, DAHİL ANCAK TİCARİ BİR AMACA UYGUNLUK VE HAK İHLALİ GARANTİLER SINIRLI DEĞİLDİR GARANTİ OLMAKSIZIN, \"OLDUĞU GİBİ\" SAĞLANIR. YAZARLAR VE TELİF HAKKI SAHİPLERİ SÖZLEŞME İHLALİ, OUT OF, VEYA YAZILIM VEYA KULLANIM VEYA DİĞER İŞLERİNDEN KAYNAKLANAN, HAKSIZ VEYA BAŞKA HERHANGİ BİR İDDİA, HASAR VEYA DİĞER SORUMLULUK SORUMLU TUTULAMAZ YAZILIM.</string>
<string name="robolectric_url" translatable="false">https://github.com/robolectric/robolectric</string>
<string name="espresso_title"><u>Espresso (UI test çerçevesi)</u></string>
<string name="espresso_text" translatable="false">Telif Hakkı 2014 Android Açık Kaynak Projesi\n\nApache Lisansı, Version 2.0 (\"Lisans\") kapsamında lisanslanmıştır; bu dosyayı Lisans\'a uygunluğunuz dışında kullanamazsınız. Lisansın bir kopyasını aşağıdaki adresten edinebilirsiniz:\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nYürürlükteki kanunların gerektirmediği veya yazılı olarak kabul edilmediği sürece, Lisans kapsamında dağıtılan yazılımlar, açık veya zımni herhangi bir garanti veya koşul olmadan \"OLDUĞU GİBİ\" temelinde dağıtılır. Lisans altındaki izinler ve sınırlamalara tabi spesifik dil için Lisans\'a bakın.</string>
<string name="espresso_url" translatable="false">https://google.github.io/android-testing-support-library/docs/espresso/index.html</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<string name="app_short_description">Temel fonksiyonları ve özelleştirilebilir bir araç\'lı bir hesap makinesi.</string>
<string name="app_long_description">
@ -46,8 +10,13 @@
The text color of the widget can be customized, as well as the color and the alpha of the background. Press the result or formula in the widget to open the app.
Contains no ads or unnecessary permissions. It is fully opensource, provides a Dark theme too.
Contains no ads or unnecessary permissions. It is fully opensource, provides customizable colors.
This app is just one piece of a bigger series of apps. You can find the rest of them at http://www.simplemobiletools.com
</string>
<!--
Haven't found some strings? There's more at
https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res
-->
</resources>

View File

@ -1,7 +1,7 @@
<resources>
<style name="MyButton" parent="Widget.AppCompat.Button">
<item name="android:textColor">@color/colorPrimary</item>
<item name="android:textColor">@color/color_primary</item>
<item name="android:background">?android:attr/selectableItemBackgroundBorderless</item>
<item name="android:textSize">@dimen/button_text_size</item>
<item name="android:fontFamily">sans-serif-light</item>

View File

@ -1,8 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#fff68630</color>
<color name="colorPrimaryDark">#ffe27725</color>
<color name="colorAccent">@color/colorPrimary</color>
<color name="text_grey">#77000000</color>
<color name="dark_grey_pressed_mask">#11000000</color>
</resources>

View File

@ -10,8 +10,13 @@
The text color of the widget can be customized, as well as the color and the alpha of the background. Press the result or formula in the widget to open the app.
Contains no ads or unnecessary permissions. It is fully opensource, provides a Dark theme too.
Contains no ads or unnecessary permissions. It is fully opensource, provides customizable colors.
This app is just one piece of a bigger series of apps. You can find the rest of them at http://www.simplemobiletools.com
</string>
<!--
Haven't found some strings? There's more at
https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res
-->
</resources>

View File

@ -1,45 +1,12 @@
<resources>
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="actionBarStyle">@style/AppTheme.ActionBarStyle</item>
<item name="android:textSize">@dimen/normal_text_size</item>
</style>
<style name="AppTheme.Dark" parent="Theme.AppCompat">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="actionBarStyle">@style/AppTheme.ActionBarStyle</item>
<item name="android:textSize">@dimen/normal_text_size</item>
<item name="android:windowBackground">@android:color/black</item>
</style>
<style name="MainTheme" parent="@style/AppTheme">
<item name="android:textColor">@android:color/white</item>
</style>
<style name="AppTheme" parent="AppTheme.Base"/>
<style name="MyButton" parent="Widget.AppCompat.Button">
<item name="android:textColor">@color/colorPrimary</item>
<item name="android:textColor">@color/color_primary</item>
<item name="android:background">@drawable/button</item>
<item name="android:textSize">@dimen/button_text_size</item>
<item name="android:fontFamily">sans-serif-light</item>
</style>
<style name="MyWidgetConfigTheme" parent="@style/AppTheme">
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowShowWallpaper">true</item>
</style>
<style name="AppTheme.ActionBarStyle" parent="@style/Base.Widget.AppCompat.ActionBar">
<item name="background">@color/colorPrimary</item>
<item name="titleTextStyle">@style/AppTheme.ActionBar.TitleTextStyle</item>
</style>
<style name="AppTheme.ActionBar.TitleTextStyle" parent="@android:style/TextAppearance.Holo.Widget.ActionBar.Title">
<item name="android:fontFamily">sans-serif</item>
<item name="android:textSize">20sp</item>
</style>
</resources>

View File

@ -1,9 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
android:configure="com.simplemobiletools.calculator.activities.WidgetConfigureActivity"
android:initialLayout="@layout/activity_main"
android:minHeight="@dimen/min_widget_height"
android:minWidth="@dimen/min_widget_width"
android:previewImage="@mipmap/widget_preview"
android:resizeMode="horizontal|vertical"
android:updatePeriodMillis="36000000"/>
<appwidget-provider
xmlns:android="http://schemas.android.com/apk/res/android"
android:configure="com.simplemobiletools.calculator.activities.WidgetConfigureActivity"
android:initialLayout="@layout/activity_main"
android:minHeight="@dimen/min_widget_height"
android:minWidth="@dimen/min_widget_width"
android:previewImage="@drawable/img_widget_preview"
android:resizeMode="horizontal|vertical"
android:updatePeriodMillis="36000000"/>

View File

@ -1,6 +1,7 @@
package com.simplemobiletools.calculator
import com.simplemobiletools.calculator.activities.MainActivity
import com.simplemobiletools.calculator.helpers.*
import junit.framework.Assert.assertEquals
import org.junit.Before
import org.junit.Test

View File

@ -1,14 +1,11 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.1.51'
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
@ -18,9 +15,8 @@ buildscript {
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
maven { url "https://jitpack.io" }
maven { url "https://maven.google.com" }
}
}

View File

@ -1,4 +1,3 @@
STORE_FILE=/path/to/your.keystore
STORE_PASSWORD=yourkeypass
KEY_ALIAS=projectkeyalias
KEY_PASSWORD=yourkeypass
PASSWORD=yourpass