Skip to content

Commit

Permalink
Finished About page
Browse files Browse the repository at this point in the history
Except for License text and graphics
  • Loading branch information
svetter committed Jul 6, 2024
1 parent 9a57455 commit 43b68f5
Show file tree
Hide file tree
Showing 5 changed files with 131 additions and 38 deletions.
1 change: 0 additions & 1 deletion .idea/misc.xml

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

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.gmail.simetist.stereomikingcalculator

import android.os.Bundle
import android.widget.Button
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
Expand All @@ -9,15 +10,27 @@ import androidx.core.view.WindowInsetsCompat


class AboutActivity : AppCompatActivity() {
private lateinit var backButton: Button

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
enableEdgeToEdge()
setContentView(R.layout.activity_about)


backButton = findViewById(R.id.backButton)


ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.mainLayout)) { v, insets ->
val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
insets
}



backButton.setOnClickListener {
onBackPressedDispatcher.onBackPressed()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ class MainActivity : AppCompatActivity() {

var ignoreSliderListeners = false

private lateinit var aboutButton: Button

private lateinit var unitsSwitch: Switch
private lateinit var halfAnglesSwitch: Switch
private lateinit var micTypeSwitch: Switch
Expand Down Expand Up @@ -73,6 +75,8 @@ class MainActivity : AppCompatActivity() {
setContentView(R.layout.activity_main)


aboutButton = findViewById(R.id.aboutButton)

unitsSwitch = findViewById(R.id.unitsSwitch)
halfAnglesSwitch = findViewById(R.id.halfAnglesSwitch)
micTypeSwitch = findViewById(R.id.micTypeSwitch)
Expand Down Expand Up @@ -220,7 +224,7 @@ class MainActivity : AppCompatActivity() {
}
}

calcRecAngleButton.setOnClickListener {
aboutButton.setOnClickListener {
startActivity(Intent(this, AboutActivity::class.java))
}

Expand Down
114 changes: 92 additions & 22 deletions app/src/main/res/layout/activity_about.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,43 +6,113 @@
android:layout_width="match_parent"
android:layout_height="match_parent">

<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
<ImageView
android:id="@+id/logoView"
android:layout_width="128dp"
android:layout_height="128dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:text="About this App"
android:textSize="20sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/logo_1024" />

<TextView
android:id="@+id/appNameLabel"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="4dp"
android:text="Stereophonic Calculator"
android:textSize="24sp"
app:layout_constraintBottom_toTopOf="@+id/versionLabel"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toEndOf="@+id/logoView" />

<TextView
android:id="@+id/versionLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:text="Version 0.1"
android:textSize="16sp"
app:layout_constraintBottom_toTopOf="@+id/logoDivider"
app:layout_constraintStart_toStartOf="@+id/appNameLabel" />

<View
android:id="@+id/divider"
android:id="@+id/logoDivider"
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp"
android:background="?android:attr/listDivider"
app:layout_constraintBottom_toBottomOf="@+id/logoView"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView" />
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="@+id/appNameLabel" />

<TextView
android:id="@+id/textView2"
<ScrollView
android:id="@+id/textscrollView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_height="0dp"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:autoLink="web"
android:linksClickable="true"
android:text="Copyright 2024 Simon Vetter\n\nThe full source code of this App is available on GitHub:\nhttps://github.com/svetter/stereocalc\n\nFull credit for the data underlying this app goes to Michael Williams and his paper &quot;The stereophonic zoom&quot; from 2010, available here:\nhttps://www.gracedesign.com/support/StereoZoom10.pdf\nThis is a short and very interesting read, recommended for every user of this app. Indeed, the app is not intended to replace the knowledge from the paper, but to facilitate implementing it in a faster and easier way."
android:textSize="16sp"
android:layout_marginBottom="8dp"
app:layout_constraintBottom_toTopOf="@+id/backButton"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/divider" />
app:layout_constraintTop_toBottomOf="@+id/logoView">

<LinearLayout
android:id="@+id/textScrollLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<TextView
android:id="@+id/appCreditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:autoLink="web"
android:linksClickable="true"
android:text="Copyright 2024 Simon Vetter\n\nThe full source code of this App is available on GitHub:\nhttps://github.com/svetter/stereocalc"
android:textSize="16sp" />

<TextView
android:id="@+id/dataCreditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:autoLink="web"
android:linksClickable="true"
android:text="Full credit for the data underlying this app goes to Michael Williams and his paper &quot;The stereophonic zoom&quot;, available here:\nhttps://www.gracedesign.com/support/StereoZoom10.pdf\nThis is a short and very interesting read, recommended for every user of this app. It is the best way to fully understand what functionality this app provides and how to use it."
android:textSize="16sp" />

<TextView
android:id="@+id/licenseText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:autoLink="web"
android:linksClickable="true"
android:text="This app is available under license X. TODO"
android:textSize="16sp" />

</LinearLayout>
</ScrollView>

<Button
android:id="@+id/backButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:backgroundTint="#9A8C0000"
android:text="Back"
android:textColor="@color/white"
app:cornerRadius="5dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@+id/textscrollView"
app:layout_constraintStart_toStartOf="@+id/textscrollView" />

</androidx.constraintlayout.widget.ConstraintLayout>
35 changes: 21 additions & 14 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,19 @@
android:layout_gravity="center"
tools:context=".MainActivity">

<Button
android:id="@+id/aboutButton"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:backgroundTint="#9A8C0000"
android:text="About"
android:textColor="@color/white"
app:cornerRadius="5dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/unitsSettingLabel"
android:layout_width="wrap_content"
Expand All @@ -32,10 +45,10 @@
android:id="@+id/unitsSwitch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
app:layout_constraintEnd_toStartOf="@+id/imperialLabel"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toBottomOf="@+id/aboutButton" />

<TextView
android:id="@+id/imperialLabel"
Expand All @@ -51,20 +64,18 @@
android:id="@+id/anglesSettingLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:text="Angles"
app:layout_constraintBottom_toBottomOf="@+id/fullAnglesLabel"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintStart_toStartOf="@+id/unitsSettingLabel"
app:layout_constraintTop_toTopOf="@+id/fullAnglesLabel" />

<TextView
android:id="@+id/fullAnglesLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:text="Full"
app:layout_constraintBottom_toBottomOf="@+id/halfAnglesSwitch"
app:layout_constraintEnd_toStartOf="@+id/halfAnglesSwitch"
app:layout_constraintEnd_toEndOf="@+id/metricLabel"
app:layout_constraintTop_toTopOf="@+id/halfAnglesSwitch" />

<Switch
Expand All @@ -79,30 +90,27 @@
android:id="@+id/halfAnglesLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:text="Half (±)"
app:layout_constraintBottom_toBottomOf="@+id/halfAnglesSwitch"
app:layout_constraintStart_toEndOf="@+id/halfAnglesSwitch"
app:layout_constraintStart_toStartOf="@+id/imperialLabel"
app:layout_constraintTop_toTopOf="@+id/halfAnglesSwitch" />

<TextView
android:id="@+id/micTypeSettingLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:text="Microphone type"
app:layout_constraintBottom_toBottomOf="@+id/cardioidLabel"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintStart_toStartOf="@+id/anglesSettingLabel"
app:layout_constraintTop_toTopOf="@+id/cardioidLabel" />

<TextView
android:id="@+id/cardioidLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:text="Cardioid"
app:layout_constraintBottom_toBottomOf="@+id/micTypeSwitch"
app:layout_constraintEnd_toStartOf="@+id/micTypeSwitch"
app:layout_constraintEnd_toEndOf="@+id/fullAnglesLabel"
app:layout_constraintTop_toTopOf="@+id/micTypeSwitch" />

<Switch
Expand All @@ -117,10 +125,9 @@
android:id="@+id/omniLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:text="Omni"
app:layout_constraintBottom_toBottomOf="@+id/micTypeSwitch"
app:layout_constraintStart_toEndOf="@+id/micTypeSwitch"
app:layout_constraintStart_toStartOf="@+id/halfAnglesLabel"
app:layout_constraintTop_toTopOf="@+id/micTypeSwitch" />

<View
Expand Down

0 comments on commit 43b68f5

Please sign in to comment.