Skip to content

Commit

Permalink
V1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Nalende committed Aug 25, 2022
1 parent 451ca22 commit b86ff99
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 25 deletions.
4 changes: 3 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ android {
minSdk 23
targetSdk 32
versionCode 1
versionName "1.0"
versionName "1.1"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
30 changes: 17 additions & 13 deletions app/src/main/java/com/haritaci/altyapiasistani/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package com.haritaci.altyapiasistani

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.haritaci.altyapiasistani.databinding.ActivityMainBinding
import kotlin.math.round

class MainActivity : AppCompatActivity() {
lateinit var binding: ActivityMainBinding
Expand All @@ -17,25 +18,28 @@ class MainActivity : AppCompatActivity() {

binding.hesapButton.setOnClickListener{
if (binding.CihazKotu.text.isNotEmpty()&&binding.baca1Kotu.text.isNotEmpty()&&binding.baca2Kotu.text.isNotEmpty()&&binding.bacaMesafe.text.isNotEmpty()&&binding.cursor.text.isNotEmpty()&&binding.boruCapi.text.isNotEmpty()) {
var Aletkotu = binding.CihazKotu.text.toString().toDouble()
var baca1 = binding.baca1Kotu.text.toString().toDouble()
var baca2 = binding.baca2Kotu.text.toString().toDouble()
var bacamesafe = binding.bacaMesafe.text.toString().toDouble()
var nerdesin =binding.cursor.text.toString().toDouble()
var borucap = binding.boruCapi.text.toString().toDouble()
var bUstu:Double = (((Aletkotu - (baca1 - (((baca1 - baca2)/bacamesafe)*nerdesin))) - borucap)).toDouble()
var bAlti:Double = (Aletkotu - (baca1 - (((baca1 - baca2)/bacamesafe)*nerdesin))).toDouble()
bAlti = Math.floor(bAlti * 100) / 100;
bUstu = Math.floor(bUstu * 100) / 100;
binding.uyari.text = null
val aletkotu = binding.CihazKotu.text.toString().toDouble()
val baca1 = binding.baca1Kotu.text.toString().toDouble()
val baca2 = binding.baca2Kotu.text.toString().toDouble()
val bacamesafe = binding.bacaMesafe.text.toString().toDouble()
val nerdesin =binding.cursor.text.toString().toDouble()
val borucap = binding.boruCapi.text.toString().toDouble()
var bUstu:Double = (((aletkotu - (baca1 - (((baca1 - baca2)/bacamesafe)*nerdesin))) - borucap))
var bAlti:Double = (aletkotu - (baca1 - (((baca1 - baca2)/bacamesafe)*nerdesin)))
bAlti = round(bAlti * 100) / 100
bUstu = round(bUstu * 100) / 100


binding.kaziUst.text = bAlti.toString()
binding.boruUst.text = bUstu.toString()

}


else binding.uyari.text = "HATA!"
binding.uyari.setTextColor(getColor(R.color.red))
else
"HATA!".also { binding.uyari.text = it }
binding.uyari.setTextColor(getColor(R.color.red))
}
}
}
26 changes: 19 additions & 7 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
tools:context=".MainActivity">

<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="8dp"
Expand All @@ -26,6 +27,13 @@
android:layout_height="match_parent"
android:orientation="vertical">

<TextView
android:id="@+id/baslık"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text=" Enterpolasyon"
android:textAppearance="@style/TextAppearance.AppCompat.Body1" />

<LinearLayout
android:layout_width="250dp"
android:layout_height="wrap_content"
Expand All @@ -45,7 +53,7 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:ems="10"
android:hint="@string/uyarı"
android:hint="Cihaz kotu gir (Mt)"
android:inputType="numberDecimal"
android:textSize="14sp"
tools:ignore="TouchTargetSizeCheck,SpeakableTextPresentCheck" />
Expand All @@ -63,7 +71,7 @@
android:layout_width="100dp"
android:layout_height="match_parent"
android:paddingTop="15dp"
android:text="1. Baca Kotu"
android:text="1. Nokta kotu"
android:textAlignment="center" />

<EditText
Expand All @@ -72,7 +80,7 @@
android:layout_height="match_parent"
android:layout_weight="1"
android:ems="10"
android:hint="@string/baca_yuksek"
android:hint="Boru tabanı kotu gir"
android:inputType="numberDecimal"
android:textSize="14sp"
tools:ignore="SpeakableTextPresentCheck,TouchTargetSizeCheck" />
Expand All @@ -90,7 +98,7 @@
android:layout_width="100dp"
android:layout_height="match_parent"
android:paddingTop="15dp"
android:text="2. Baca Kotu"
android:text="2. Nokta kotu"
android:textAlignment="center" />

<EditText
Expand All @@ -99,7 +107,7 @@
android:layout_height="match_parent"
android:layout_weight="1"
android:ems="10"
android:hint="@string/baca_duşuk"
android:hint="Boru tabanı kotu gir"
android:inputType="numberDecimal"
android:textSize="14sp"
tools:ignore="TouchTargetSizeCheck,SpeakableTextPresentCheck" />
Expand All @@ -116,7 +124,7 @@
android:layout_width="100dp"
android:layout_height="match_parent"
android:paddingTop="2dp"
android:text="Bacalar Arası Mesafe"
android:text="Noktalar Arası Mesafe"
android:textAlignment="center" />

<EditText
Expand Down Expand Up @@ -198,6 +206,10 @@
android:layout_height="wrap_content"
android:orientation="vertical">

<Space
android:layout_width="match_parent"
android:layout_height="19dp" />

<Button
android:id="@+id/hesapButton"
style="@style/Widget.AppCompat.Button.Colored"
Expand Down Expand Up @@ -236,7 +248,7 @@
android:id="@+id/textView33"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Boru Altı (kazı)"
android:text="Boru Altı)"
android:textAlignment="center"
android:textSize="14sp" />

Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<string name="app_name">altyapiAsistani</string>
<string name="uyarı">00.00 METRE</string>
<string name="mira_okuma">00.0m</string>
<string name="baca_yuksek">Yüksek Kotlu baca gir</string>
<string name="baca_duşuk">Düşük kotlu baca gir</string>
<string name="nerdesin">Baca 1 den hesapla</string>
<string name="baca_yuksek">Yüksek Kotlu Nokta gir</string>
<string name="baca_duşuk">Düşük Kotlu Nokta gir</string>
<string name="nerdesin">Nokta 1 den hesapla</string>

</resources>

0 comments on commit b86ff99

Please sign in to comment.