Skip to content

Commit 37c05e8

Browse files
Added OneSiliconDiode Activity and Twin Vibs Spark
1 parent 561ea9c commit 37c05e8

File tree

6 files changed

+108
-10
lines changed

6 files changed

+108
-10
lines changed

app/release/output-metadata.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"version": 2,
3+
"artifactType": {
4+
"type": "APK",
5+
"kind": "Directory"
6+
},
7+
"applicationId": "com.aaxena.calculator",
8+
"variantName": "processReleaseResources",
9+
"elements": [
10+
{
11+
"type": "SINGLE",
12+
"filters": [],
13+
"versionCode": 1,
14+
"versionName": "Aryabhata",
15+
"outputFile": "app-release.apk"
16+
}
17+
]
18+
}

app/src/main/java/com/aaxena/calculator/MainActivity.kt

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
package com.aaxena.calculator
22

33
import android.content.Context
4+
import android.content.Intent
45
import android.os.Bundle
6+
import android.os.Handler
7+
import android.os.Looper
58
import android.os.Vibrator
69
import android.view.KeyEvent
710
import android.widget.Toast
@@ -110,12 +113,16 @@ class MainActivity : AppCompatActivity() {
110113
KeyEvent.KEYCODE_VOLUME_DOWN -> {
111114
if (action == KeyEvent.ACTION_DOWN) {
112115
vibratePhoneLightly()
113-
val sharedPreferences =
114-
getSharedPreferences(SHARED_PREFS, Context.MODE_PRIVATE)
115-
val editor = sharedPreferences.edit()
116-
editor.putString(TEXT,"off");
117-
editor.commit();
118-
Toast.makeText(this,"Haptics Turned Off",LENGTH_SHORT).show()
116+
val delay:Long = 100
117+
Handler(Looper.getMainLooper()).postDelayed({
118+
vibratePhone()
119+
val sharedPreferences =
120+
getSharedPreferences(SHARED_PREFS, Context.MODE_PRIVATE)
121+
val editor = sharedPreferences.edit()
122+
editor.putString(TEXT,"off");
123+
editor.commit()
124+
Toast.makeText(this,"Haptics Turned Off",LENGTH_SHORT).show()
125+
}, delay)
119126
}
120127
true
121128
}
Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
11
package com.aaxena.calculator
22

3-
import androidx.appcompat.app.AppCompatActivity
3+
import android.content.Intent
44
import android.os.Bundle
5+
import android.widget.Toast
6+
import androidx.appcompat.app.AppCompatActivity
7+
import kotlinx.android.synthetic.main.activity_one_silicon_diode.*
58

69
class OneSiliconDiode : AppCompatActivity() {
710
override fun onCreate(savedInstanceState: Bundle?) {
811
super.onCreate(savedInstanceState)
912
setContentView(R.layout.activity_one_silicon_diode)
13+
Toast.makeText(this,"App Developed By One Silicon Diode ;)", Toast.LENGTH_LONG).show()
14+
15+
openCal.setOnClickListener{
16+
val intent = Intent(this, MainActivity::class.java)
17+
startActivity(intent)
18+
overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out)
19+
finish()
20+
}
1021
}
1122
}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,68 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:app="http://schemas.android.com/apk/res-auto"
34
xmlns:tools="http://schemas.android.com/tools"
45
android:layout_width="match_parent"
56
android:layout_height="match_parent"
67
android:background="@drawable/osd_bg"
78
tools:context=".OneSiliconDiode">
89

10+
<ImageView
11+
android:id="@+id/imageView"
12+
android:layout_width="105dp"
13+
android:layout_height="105dp"
14+
android:contentDescription="@string/app_logo"
15+
app:layout_constraintBottom_toBottomOf="parent"
16+
app:layout_constraintEnd_toEndOf="parent"
17+
app:layout_constraintStart_toStartOf="parent"
18+
app:layout_constraintTop_toTopOf="parent"
19+
app:layout_constraintVertical_bias="0.0"
20+
app:srcCompat="@drawable/ic_calc" />
21+
22+
<TextView
23+
android:id="@+id/textView"
24+
android:layout_width="wrap_content"
25+
android:layout_height="wrap_content"
26+
android:fontFamily="@font/productsansbold"
27+
android:text="@string/the_calc_project"
28+
android:textAlignment="center"
29+
android:textColor="@color/white"
30+
android:textSize="36sp"
31+
app:layout_constraintBottom_toBottomOf="parent"
32+
app:layout_constraintEnd_toEndOf="parent"
33+
app:layout_constraintStart_toStartOf="parent"
34+
app:layout_constraintTop_toBottomOf="@+id/imageView"
35+
app:layout_constraintVertical_bias="0.13999999" />
36+
37+
<TextView
38+
android:id="@+id/textView2"
39+
android:layout_width="wrap_content"
40+
android:layout_height="wrap_content"
41+
android:fontFamily="@font/productsans"
42+
android:text="@string/about"
43+
android:textAlignment="center"
44+
android:textColor="@color/buop"
45+
android:textSize="16sp"
46+
app:layout_constraintBottom_toBottomOf="parent"
47+
app:layout_constraintEnd_toEndOf="parent"
48+
app:layout_constraintHorizontal_bias="0.0"
49+
app:layout_constraintStart_toStartOf="parent"
50+
app:layout_constraintTop_toBottomOf="@+id/textView"
51+
app:layout_constraintVertical_bias="0.291" />
52+
53+
<Button
54+
android:id="@+id/openCal"
55+
android:layout_width="wrap_content"
56+
android:layout_height="wrap_content"
57+
android:background="@android:color/transparent"
58+
android:fontFamily="@font/productsansbold"
59+
android:text="@string/opening"
60+
android:textAllCaps="false"
61+
android:textColor="@color/white"
62+
android:textSize="16sp"
63+
app:layout_constraintBottom_toBottomOf="parent"
64+
app:layout_constraintEnd_toEndOf="parent"
65+
app:layout_constraintStart_toStartOf="parent"
66+
app:layout_constraintTop_toBottomOf="@+id/textView2"
67+
app:rippleColor="@color/black" />
968
</androidx.constraintlayout.widget.ConstraintLayout>

app/src/main/res/values/strings.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
<string name="_8">8</string>
99
<string name="multiply">*</string>
1010
<string name="_9">9</string>
11-
<string name="app_dev_name">App Developed By One Silicon Diode ;)</string>
1211
<string name="app_shortcut_desc">OneSDiode</string>
1312
<string name="_4">4</string>
1413
<string name="_5">5</string>
@@ -22,4 +21,8 @@
2221
<string name="euqals">=</string>
2322
<string name="decimal">.</string>
2423
<string name="error">Error</string>
24+
<string name="the_calc_project">The CalC Project</string>
25+
<string name="app_logo">app logo</string>
26+
<string name="about">This Application was Created Out of the developer\'s curiosity towards Kotlin.\n\nIt is fully open source and can be found on github at:\n\nhttps://github.com/the-rebooted-coder/Friendly-Kotlin-Calculator</string>
27+
<string name="opening">Open Calculator</string>
2528
</resources>

app/src/main/res/xml-v25/shortcuts.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
android:enabled="true"
55
android:icon="@drawable/app_dev"
66
android:shortcutId="app_developer"
7-
android:shortcutLongLabel="@string/app_dev_name"
7+
android:shortcutLongLabel="@string/app_shortcut_desc"
88
android:shortcutShortLabel="@string/app_shortcut_desc">
99

1010
<intent
1111
android:action="android.intent.action.VIEW"
12-
android:targetClass="com.aaxena.calculator.MainActivity"
12+
android:targetClass="com.aaxena.calculator.OneSiliconDiode"
1313
android:targetPackage="com.aaxena.calculator"/>
1414
</shortcut>
1515

0 commit comments

Comments
 (0)