-
Notifications
You must be signed in to change notification settings - Fork 449
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4985 from delta1513/delta-issue-4225
Moved the About dialog to an activity
- Loading branch information
Showing
45 changed files
with
194 additions
and
194 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
android/BOINC/app/src/main/java/edu/berkeley/boinc/attach/AboutActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* This file is part of BOINC. | ||
* http://boinc.berkeley.edu | ||
* Copyright (C) 2022 University of California | ||
* | ||
* BOINC is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU Lesser General Public License | ||
* as published by the Free Software Foundation, | ||
* either version 3 of the License, or (at your option) any later version. | ||
* | ||
* BOINC is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
* See the GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with BOINC. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package edu.berkeley.boinc.attach | ||
|
||
import android.content.pm.PackageManager | ||
import android.content.pm.PackageManager.PackageInfoFlags | ||
import android.os.Build.VERSION | ||
import android.os.Build.VERSION_CODES | ||
import androidx.appcompat.app.AppCompatActivity | ||
import android.os.Bundle | ||
import android.widget.TextView | ||
import edu.berkeley.boinc.R | ||
import edu.berkeley.boinc.utils.Logging | ||
|
||
class AboutActivity : AppCompatActivity() { | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.activity_about) | ||
|
||
val tvVersion = findViewById<TextView>(R.id.BOINCVersionTextView) | ||
|
||
try { | ||
val packageInfo = if (VERSION.SDK_INT >= VERSION_CODES.TIRAMISU) { | ||
packageManager.getPackageInfo(packageName, PackageInfoFlags.of(0)) | ||
} else { | ||
@Suppress("DEPRECATION") | ||
packageManager.getPackageInfo(packageName, 0) | ||
} | ||
tvVersion.text = getString(R.string.about_version, packageInfo.versionName) | ||
} catch (e: PackageManager.NameNotFoundException) { | ||
Logging.logWarning(Logging.Category.USER_ACTION, "version name not found.") | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
<?xml version="1.0" encoding="utf-8"?><!-- | ||
This file is part of BOINC. | ||
http://boinc.berkeley.edu | ||
Copyright (C) 2022 University of California | ||
BOINC is free software; you can redistribute it and/or modify it | ||
under the terms of the GNU Lesser General Public License | ||
as published by the Free Software Foundation, | ||
either version 3 of the License, or (at your option) any later version. | ||
BOINC is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
See the GNU Lesser General Public License for more details. | ||
You should have received a copy of the GNU Lesser General Public License | ||
along with BOINC. If not, see <http://www.gnu.org/licenses/>. | ||
--> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:orientation="vertical" | ||
tools:context=".attach.AboutActivity"> | ||
|
||
<TextView | ||
android:id="@+id/textView5" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:gravity="center_horizontal" | ||
android:paddingTop="16px" | ||
android:text="@string/about_name" | ||
android:textAppearance="?android:attr/textAppearanceLarge" | ||
android:textColor="?android:attr/textColorPrimary" | ||
android:textStyle="bold" /> | ||
|
||
<TextView | ||
android:id="@+id/BOINCVersionTextView" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:gravity="center_horizontal" | ||
android:padding="10dp" | ||
android:textAppearance="?android:attr/textAppearanceSmall" | ||
android:textColor="?android:attr/textColorPrimary" /> | ||
|
||
<TextView | ||
android:id="@+id/textView6" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:gravity="center_horizontal" | ||
android:paddingLeft="10dp" | ||
android:paddingRight="10dp" | ||
android:text="@string/about_copyright" | ||
android:textAppearance="?android:attr/textAppearanceSmall" | ||
android:textColor="?android:attr/textColorPrimary" /> | ||
|
||
<TextView | ||
android:id="@+id/textView7" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:gravity="center_horizontal" | ||
android:text="@string/about_copyright_reserved" | ||
android:textAppearance="?android:attr/textAppearanceSmall" | ||
android:textColor="?android:attr/textColorPrimary" /> | ||
|
||
<TextView | ||
android:id="@+id/textView8" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_margin="10dp" | ||
android:gravity="center_horizontal" | ||
android:text="@string/about_credits" | ||
android:textAppearance="?android:attr/textAppearanceSmall" | ||
android:textColor="?android:attr/textColorPrimary" /> | ||
</LinearLayout> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.