Skip to content

Commit f7d4f46

Browse files
committed
added about page
1 parent 6a4e62b commit f7d4f46

File tree

14 files changed

+109
-49
lines changed

14 files changed

+109
-49
lines changed

buildSrc/src/main/kotlin/Helpers.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ fun Project.setupCore() {
5959
setupCommon()
6060
android.apply {
6161
defaultConfig {
62-
versionCode = 2
63-
versionName = "1.0.1"
62+
versionCode = 4
63+
versionName = "1.0.2"
6464
}
6565
compileOptions.isCoreLibraryDesugaringEnabled = true
6666
lint.apply {

design/src/main/AndroidManifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
<uses-permission android:name="android.permission.INTERNET" />
55
<application>
6+
<activity android:name=".About" />
67
<meta-data
78
android:name="com.google.android.gms.ads.APPLICATION_ID"
89
android:value="@string/admob_app_id"/>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package com.github.oezeb.cypher_connect.design;
2+
3+
import android.os.Bundle
4+
import android.text.method.LinkMovementMethod
5+
import android.view.View
6+
import android.widget.TextView
7+
import androidx.appcompat.app.AppCompatActivity
8+
import androidx.core.text.HtmlCompat
9+
10+
class About : AppCompatActivity() {
11+
override fun onCreate(savedInstanceState: Bundle?) {
12+
super.onCreate(savedInstanceState)
13+
setContentView(R.layout.about)
14+
15+
val html = resources.openRawResource(R.raw.about).bufferedReader().use { it.readText() }
16+
findViewById<TextView>(R.id.about_text).apply {
17+
movementMethod = LinkMovementMethod.getInstance()
18+
text = HtmlCompat.fromHtml(html, HtmlCompat.FROM_HTML_MODE_LEGACY)
19+
}
20+
21+
findViewById<TextView>(R.id.title).apply { text = getString(R.string.about) }
22+
}
23+
24+
fun back(view: View) = finish()
25+
}

design/src/main/java/com/github/oezeb/cypher_connect/design/LocationListDesign.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,15 +131,15 @@ abstract class LocationListDesign : AppCompatActivity() {
131131
finish()
132132
}
133133

134-
findViewById<ImageButton>(R.id.back).apply {
135-
setOnClickListener {
136-
setResult(Activity.RESULT_CANCELED)
137-
finish()
138-
}
139-
}
134+
findViewById<TextView>(R.id.title).apply { text = getString(R.string.app_name) }
140135

141136
// Initialize the Mobile Ads SDK
142137
MobileAds.initialize(this)
143138
findViewById<AdView>(R.id.bannerAdView).apply { loadAd(AdRequest.Builder().build()) }
144139
}
140+
141+
fun back(view: View) {
142+
setResult(Activity.RESULT_CANCELED)
143+
finish()
144+
}
145145
}

design/src/main/java/com/github/oezeb/cypher_connect/design/MainDesign.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import androidx.appcompat.app.AppCompatActivity
66
import android.os.Bundle
77
import android.os.Handler
88
import android.os.Looper
9-
import android.util.Log
109
import android.view.View
1110
import android.widget.ImageButton
1211
import android.widget.TextView
@@ -73,7 +72,6 @@ abstract class MainDesign: AppCompatActivity() {
7372
onClickConnectButton(it)
7473
}
7574
currentLocationButton.setOnClickListener {
76-
Log.d("MainDesign", "currentLocationButton click")
7775
startLocationListActivity.launch(launchLocationListActivityIntent)
7876
}
7977

@@ -237,4 +235,6 @@ abstract class MainDesign: AppCompatActivity() {
237235
// Remove any pending callbacks when the activity is destroyed
238236
handler.removeCallbacksAndMessages(null)
239237
}
238+
239+
fun showAbout(view: View) = startActivity(Intent(this, About::class.java))
240240
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools"
4+
android:layout_width="match_parent"
5+
android:layout_height="match_parent"
6+
android:background="@color/color_primary"
7+
tools:context=".About"
8+
android:orientation="vertical">
9+
<include
10+
android:id="@+id/action_bar_back"
11+
layout="@layout/action_bar_back" />
12+
<ScrollView
13+
android:layout_width="match_parent"
14+
android:layout_height="0dp"
15+
android:layout_weight="1"
16+
android:layout_marginHorizontal="10dp"
17+
android:layout_marginTop="10dp"
18+
android:orientation="vertical">
19+
<TextView
20+
android:id="@+id/about_text"
21+
android:layout_width="match_parent"
22+
android:layout_height="wrap_content"
23+
android:layout_margin="16dp"
24+
android:textColor="@android:color/white"
25+
android:fontFamily="@font/poppins"
26+
android:textIsSelectable="true" />
27+
</ScrollView>
28+
<com.google.android.gms.ads.AdView xmlns:ads="http://schemas.android.com/apk/res-auto"
29+
android:id="@+id/bannerAdView"
30+
android:layout_width="wrap_content"
31+
android:layout_height="wrap_content"
32+
ads:adSize="FULL_BANNER"
33+
ads:adUnitId="@string/admob_banner_id" />
34+
</LinearLayout>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
android:layout_width="match_parent"
5+
android:layout_height="wrap_content"
6+
android:layout_marginTop="20dp"
7+
android:layout_marginHorizontal="20dp">
8+
<TextView
9+
android:id="@+id/title"
10+
android:layout_width="wrap_content"
11+
android:layout_height="wrap_content"
12+
android:fontFamily="@font/poppins_semibold"
13+
android:textAlignment="center"
14+
android:textColor="@android:color/white"
15+
android:textSize="18sp"
16+
app:layout_constraintEnd_toEndOf="parent"
17+
app:layout_constraintStart_toStartOf="parent"
18+
app:layout_constraintTop_toTopOf="parent" />
19+
<ImageButton
20+
android:layout_width="wrap_content"
21+
android:layout_height="wrap_content"
22+
android:background="@android:color/transparent"
23+
android:src="@drawable/baseline_keyboard_arrow_left_36"
24+
android:onClick="back"
25+
app:layout_constraintStart_toStartOf="parent"
26+
app:layout_constraintTop_toTopOf="parent" />
27+
</androidx.constraintlayout.widget.ConstraintLayout>

design/src/main/res/layout/location_list.xml

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,34 +7,9 @@
77
android:background="@color/color_primary"
88
tools:context=".LocationListDesign"
99
android:orientation="vertical">
10-
<androidx.constraintlayout.widget.ConstraintLayout
11-
android:layout_width="match_parent"
12-
android:layout_height="wrap_content"
13-
android:layout_marginTop="20dp"
14-
android:layout_marginHorizontal="20dp">
15-
<TextView
16-
android:id="@+id/app_name"
17-
android:transitionName="app_name"
18-
android:layout_width="wrap_content"
19-
android:layout_height="wrap_content"
20-
android:fontFamily="@font/poppins_semibold"
21-
android:text="@string/app_name"
22-
android:textAlignment="center"
23-
android:textColor="@android:color/white"
24-
android:textSize="18sp"
25-
app:layout_constraintEnd_toEndOf="parent"
26-
app:layout_constraintStart_toStartOf="parent"
27-
app:layout_constraintTop_toTopOf="parent" />
28-
29-
<ImageButton
30-
android:id="@+id/back"
31-
android:layout_width="wrap_content"
32-
android:layout_height="wrap_content"
33-
android:background="@android:color/transparent"
34-
android:src="@drawable/baseline_keyboard_arrow_left_36"
35-
app:layout_constraintStart_toStartOf="parent"
36-
app:layout_constraintTop_toTopOf="parent" />
37-
</androidx.constraintlayout.widget.ConstraintLayout>
10+
<include
11+
android:id="@+id/action_bar_back"
12+
layout="@layout/action_bar_back" />
3813
<androidx.constraintlayout.widget.ConstraintLayout
3914
android:layout_width="match_parent"
4015
android:layout_height="0dp"

design/src/main/res/layout/location_list_item.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
android:paddingHorizontal="20dp"
1111
android:textAlignment="textStart"
1212
android:textAllCaps="false"
13-
android:textColor="@color/white"
13+
android:textColor="@android:color/white"
1414
android:textSize="16sp" />

design/src/main/res/layout/main_design.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@
2727
app:layout_constraintTop_toTopOf="parent" />
2828

2929
<ImageButton
30-
android:id="@+id/info"
3130
android:layout_width="wrap_content"
3231
android:layout_height="wrap_content"
3332
android:background="@android:color/transparent"
3433
android:src="@drawable/info_circle"
34+
android:onClick="showAbout"
3535
app:layout_constraintEnd_toEndOf="parent"
3636
app:layout_constraintTop_toTopOf="parent" />
3737
</androidx.constraintlayout.widget.ConstraintLayout>
@@ -83,7 +83,7 @@
8383
android:text="@string/connected"
8484
android:textAllCaps="true"
8585
android:textSize="13sp"
86-
android:textColor="@color/white"
86+
android:textColor="@android:color/white"
8787
android:fontFamily="@font/poppins_medium"
8888
android:textAlignment="center"
8989
android:visibility="invisible"
@@ -148,7 +148,7 @@
148148
android:layout_height="wrap_content"
149149
android:layout_marginBottom="5dp"
150150
android:fontFamily="@font/poppins"
151-
android:text="Select location"
151+
android:text="@string/select_location"
152152
android:textAlignment="center"
153153
android:textColor="@android:color/white"
154154
android:textSize="16sp"

0 commit comments

Comments
 (0)