# HG changeset patch # User David Barts # Date 1617638911 25200 # Node ID cfb19d4ccf7803d01126c0a0366418db0f54f55b # Parent d723d07d5bc07dfcdb71bf1a280ceb2d880f9a37 About screen (but it has broken Edit screen). diff -r d723d07d5bc0 -r cfb19d4ccf78 app/src/main/AndroidManifest.xml --- a/app/src/main/AndroidManifest.xml Sat Apr 03 09:24:30 2021 -0700 +++ b/app/src/main/AndroidManifest.xml Mon Apr 05 09:08:31 2021 -0700 @@ -13,8 +13,20 @@ android:supportsRtl="true" android:theme="@style/Theme.SimpleResizer"> - - + + + + + + diff -r d723d07d5bc0 -r cfb19d4ccf78 app/src/main/assets/about_body.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/src/main/assets/about_body.html Mon Apr 05 09:08:31 2021 -0700 @@ -0,0 +1,10 @@ + +

This program lets you downsample and rotate image files. Doing so + makes for smaller images that get sent faster and which always + display right-side-up.

+

It also strips out the metadata (such as phone make and model) that your + camera app silently puts into each image, thus helping to protect your + privacy.

+

It does not modify any existing files; it writes new files, leaving + your original images alone.

+

More information may be found here.

\ No newline at end of file diff -r d723d07d5bc0 -r cfb19d4ccf78 app/src/main/assets/about_copyright.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/src/main/assets/about_copyright.html Mon Apr 05 09:08:31 2021 -0700 @@ -0,0 +1,4 @@ + +

Simple Resizer
+© MMXXI, David W. Barts
+MIT License

\ No newline at end of file diff -r d723d07d5bc0 -r cfb19d4ccf78 app/src/main/assets/about_promo.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/src/main/assets/about_promo.html Mon Apr 05 09:08:31 2021 -0700 @@ -0,0 +1,2 @@ + +

Hire me?

\ No newline at end of file diff -r d723d07d5bc0 -r cfb19d4ccf78 app/src/main/java/com/bartsent/simpleresizer/About.kt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/src/main/java/com/bartsent/simpleresizer/About.kt Mon Apr 05 09:08:31 2021 -0700 @@ -0,0 +1,36 @@ +package com.bartsent.simpleresizer + +import android.os.Bundle +import android.text.Html +import android.text.Spanned +import android.text.method.LinkMovementMethod +import android.widget.TextView +import androidx.appcompat.app.AppCompatActivity +import com.bartsent.simpleresizer.databinding.ActivityAboutBinding +import java.io.InputStreamReader + +class About : AppCompatActivity() { + + private lateinit var binding: ActivityAboutBinding + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + binding = ActivityAboutBinding.inflate(layoutInflater) + setContentView(binding.root) + binding.aboutCopyright.setFromAsset("about_copyright.html") + binding.aboutBody.setFromAsset("about_body.html") + binding.aboutPromo.setFromAsset("about_promo.html") + } + + private fun TextView.setFromAsset(name:String): Unit { + text = fromHtml(InputStreamReader(assets.open(name)).use { it.readText() }) + movementMethod = LinkMovementMethod.getInstance() + } + + private fun fromHtml(s: String): Spanned = + if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N) + Html.fromHtml(s, Html.FROM_HTML_MODE_LEGACY) + else + Html.fromHtml(s) + +} diff -r d723d07d5bc0 -r cfb19d4ccf78 app/src/main/java/com/bartsent/simpleresizer/EditImage.kt --- a/app/src/main/java/com/bartsent/simpleresizer/EditImage.kt Sat Apr 03 09:24:30 2021 -0700 +++ b/app/src/main/java/com/bartsent/simpleresizer/EditImage.kt Mon Apr 05 09:08:31 2021 -0700 @@ -62,13 +62,19 @@ } override fun onOptionsItemSelected(item: MenuItem): Boolean { - if (item.itemId == R.id.settings_item) { - startActivity( - Intent(Intent.ACTION_APPLICATION_PREFERENCES, null, this, - SettingsActivity::class.java)) - return true + when (item.itemId) { + R.id.settings_item -> { + startActivity( + Intent(Intent.ACTION_APPLICATION_PREFERENCES, null, this, + SettingsActivity::class.java)) + return true + } + R.id.about_item -> { + startActivity(Intent(this, About::class.java )) + return true + } + else -> return false } - return false } // Cribbed from: https://stackoverflow.com/questions/5568874/how-to-extract-the-file-name-from-uri-returned-from-intent-action-get-content diff -r d723d07d5bc0 -r cfb19d4ccf78 app/src/main/res/drawable-anydpi/ic_action_about.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/src/main/res/drawable-anydpi/ic_action_about.xml Mon Apr 05 09:08:31 2021 -0700 @@ -0,0 +1,11 @@ + + + diff -r d723d07d5bc0 -r cfb19d4ccf78 app/src/main/res/drawable-hdpi/ic_action_about.png Binary file app/src/main/res/drawable-hdpi/ic_action_about.png has changed diff -r d723d07d5bc0 -r cfb19d4ccf78 app/src/main/res/drawable-mdpi/ic_action_about.png Binary file app/src/main/res/drawable-mdpi/ic_action_about.png has changed diff -r d723d07d5bc0 -r cfb19d4ccf78 app/src/main/res/drawable-xhdpi/ic_action_about.png Binary file app/src/main/res/drawable-xhdpi/ic_action_about.png has changed diff -r d723d07d5bc0 -r cfb19d4ccf78 app/src/main/res/drawable-xxhdpi/ic_action_about.png Binary file app/src/main/res/drawable-xxhdpi/ic_action_about.png has changed diff -r d723d07d5bc0 -r cfb19d4ccf78 app/src/main/res/layout/activity_about.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/src/main/res/layout/activity_about.xml Mon Apr 05 09:08:31 2021 -0700 @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + diff -r d723d07d5bc0 -r cfb19d4ccf78 app/src/main/res/menu/menu_edit.xml --- a/app/src/main/res/menu/menu_edit.xml Sat Apr 03 09:24:30 2021 -0700 +++ b/app/src/main/res/menu/menu_edit.xml Mon Apr 05 09:08:31 2021 -0700 @@ -3,6 +3,12 @@ xmlns:app="http://schemas.android.com/apk/res-auto"> + + Scale Type JPEG Output Quality Settings + About + + + About + \ No newline at end of file