Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 0 additions & 84 deletions app/src/main/java/be/robinj/distrohopper/AboutActivity.java

This file was deleted.

72 changes: 72 additions & 0 deletions app/src/main/java/be/robinj/distrohopper/AboutActivity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
package be.robinj.distrohopper

import android.content.Intent
import android.media.MediaPlayer
import android.net.Uri
import android.os.Bundle
import android.text.Html
import android.text.method.LinkMovementMethod
import android.view.View
import android.widget.ImageView
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity

class AboutActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
this.setContentView(R.layout.activity_about)
InsetsHelper.applySystemBarsPadding(this)

try {
val pkgInfo = this.packageManager.getPackageInfo(this.packageName, 0)

val tvDevUrl = this.findViewById<TextView>(R.id.tvDevUrl)
val tvDevEmail = this.findViewById<TextView>(R.id.tvDevEmail)
val tvVersion = this.findViewById<TextView>(R.id.tvVersion)
val ivLogo = this.findViewById<ImageView>(R.id.ivLogo)

tvDevUrl.text = Html.fromHtml("<a href=\"http://robinj.be/\">RobinJ.be</a>", Html.FROM_HTML_MODE_LEGACY)
tvDevEmail.text = Html.fromHtml("<a href=\"mailto:[email protected]\">[email protected]</a>", Html.FROM_HTML_MODE_LEGACY)
tvVersion.text = "v" + pkgInfo.versionName

tvDevUrl.movementMethod = LinkMovementMethod.getInstance()
tvDevEmail.movementMethod = LinkMovementMethod.getInstance()

this.findViewById<View>(R.id.linkGithub).setOnClickListener {
this.openUrl(this.getString(R.string.about_github_url))
}
this.findViewById<View>(R.id.linkTransifex).setOnClickListener {
this.openUrl(this.getString(R.string.about_transifex_url))
}

val context = this.baseContext

ivLogo.setOnClickListener(object : View.OnClickListener {
private var clicked = 0
private var player: MediaPlayer? = null

override fun onClick(view: View) {
if (++this.clicked % 3 == 0) {
val player = this.player
?: MediaPlayer.create(context, R.raw.ubuntu).also { this.player = it }

player.seekTo(0)
player.start()
}
}
})
} catch (ex: Exception) {
val exh = ExceptionHandler(ex)
exh.show(this)
}
}

private fun openUrl(url: String) {
try {
this.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(url)))
} catch (ex: Exception) {
val exh = ExceptionHandler(ex)
exh.show(this)
}
}
}
10 changes: 10 additions & 0 deletions app/src/main/res/drawable/about_card_background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Frosted-glass card surface for the About screen sections, matching the
rounded, translucent look of the app's modern dialogs. -->
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="@dimen/dialog_item_corner_radius" />
<solid android:color="@color/transparentblack60" />
<stroke
android:width="1dp"
android:color="@color/transparentblack70" />
</shape>
10 changes: 10 additions & 0 deletions app/src/main/res/drawable/ic_about_github.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="@color/dialog_on_surface">
<path
android:fillColor="@android:color/white"
android:pathData="M12,2C6.48,2 2,6.48 2,12c0,4.42 2.87,8.17 6.84,9.5c0.5,0.09 0.68,-0.22 0.68,-0.48c0,-0.24 -0.01,-0.87 -0.01,-1.7c-2.78,0.6 -3.37,-1.34 -3.37,-1.34c-0.45,-1.16 -1.11,-1.47 -1.11,-1.47c-0.91,-0.62 0.07,-0.61 0.07,-0.61c1,0.07 1.53,1.03 1.53,1.03c0.89,1.53 2.34,1.09 2.91,0.83c0.09,-0.65 0.35,-1.09 0.63,-1.34c-2.22,-0.25 -4.55,-1.11 -4.55,-4.94c0,-1.09 0.39,-1.98 1.03,-2.68c-0.1,-0.25 -0.45,-1.27 0.1,-2.65c0,0 0.84,-0.27 2.75,1.02c0.8,-0.22 1.65,-0.33 2.5,-0.33c0.85,0 1.7,0.11 2.5,0.33c1.91,-1.29 2.75,-1.02 2.75,-1.02c0.55,1.38 0.2,2.4 0.1,2.65c0.64,0.7 1.03,1.59 1.03,2.68c0,3.84 -2.34,4.68 -4.57,4.93c0.36,0.31 0.68,0.92 0.68,1.85c0,1.34 -0.01,2.42 -0.01,2.75c0,0.27 0.18,0.58 0.69,0.48C19.14,20.16 22,16.42 22,12C22,6.48 17.52,2 12,2z" />
</vector>
10 changes: 10 additions & 0 deletions app/src/main/res/drawable/ic_about_translate.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="@color/dialog_on_surface">
<path
android:fillColor="@android:color/white"
android:pathData="M12.87,15.07l-2.54,-2.51l0.03,-0.03c1.74,-1.94 2.98,-4.17 3.71,-6.53L17,6L17,4h-7L10,2L8,2v2L1,4v1.99h11.17C11.5,7.92 10.44,9.75 9,11.35C8.07,10.32 7.3,9.19 6.69,8h-2c0.73,1.63 1.73,3.17 2.98,4.56l-5.09,5.02L4,19l5,-5l3.11,3.11l0.76,-2.04zM18.5,10h-2L12,22h2l1.12,-3h4.75L21,22h2l-4.5,-12zM15.88,17l1.62,-4.33L19.12,17h-3.24z" />
</vector>
101 changes: 101 additions & 0 deletions app/src/main/res/layout/activity_about.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,107 @@

</LinearLayout>

<!-- Description -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:padding="16dp"
android:background="@drawable/about_card_background"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@color/dialog_on_surface"
android:lineSpacingMultiplier="1.15"
android:text="@string/about_description" />

<!-- Get involved -->
<LinearLayout
android:id="@+id/linkGithub"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:padding="16dp"
android:gravity="center_vertical"
android:background="@drawable/about_card_background"
android:clickable="true"
android:focusable="true"
android:foreground="?android:attr/selectableItemBackground">

<ImageView
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_marginEnd="16dp"
android:src="@drawable/ic_about_github"
android:contentDescription="@string/about_github_title" />

<LinearLayout
android:orientation="vertical"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1">

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@color/dialog_on_surface"
android:text="@string/about_github_title" />

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/dialog_on_surface_variant"
android:text="@string/about_github_subtitle" />
</LinearLayout>

</LinearLayout>

<LinearLayout
android:id="@+id/linkTransifex"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:padding="16dp"
android:gravity="center_vertical"
android:background="@drawable/about_card_background"
android:clickable="true"
android:focusable="true"
android:foreground="?android:attr/selectableItemBackground">

<ImageView
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_marginEnd="16dp"
android:src="@drawable/ic_about_translate"
android:contentDescription="@string/about_transifex_title" />

<LinearLayout
android:orientation="vertical"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1">

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@color/dialog_on_surface"
android:text="@string/about_transifex_title" />

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/dialog_on_surface_variant"
android:text="@string/about_transifex_subtitle" />
</LinearLayout>

</LinearLayout>


</LinearLayout>
</ScrollView>
Expand Down
7 changes: 7 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@
<string name="title_activity_theme_preferences">Themes</string>
<string name="title_activity_dev_logs">Logs</string>
<string name="developed_by">Developed by Robin Jacobs</string>
<string name="about_description">I started DistroHopper back in high school as a (far too) young Linux enthusiast who wanted something resembling the Linux desktop on his first smartphone. I hope 15+ years later of on-and-off development you still enjoy what I started back then :-)</string>
<string name="about_github_title">Contribute on GitHub</string>
<string name="about_github_subtitle">DistroHopper is open source — browse the code, report issues, or send a pull request.</string>
<string name="about_transifex_title">Help translate</string>
<string name="about_transifex_subtitle">Speak another language? Help translate DistroHopper on Transifex.</string>
<string name="about_github_url" translatable="false">https://github.com/RobinJ1995/DistroHopper</string>
<string name="about_transifex_url" translatable="false">https://explore.transifex.com/distrohopper/</string>
<string name="button_back">Back</string>
<string name="button_about">About</string>
<string name="button_apply">Apply</string>
Expand Down
Loading