Added about activity.

This commit is contained in:
Dennis Guse
2019-07-27 13:08:28 +02:00
parent d8a0265ad0
commit 9483241d43
8 changed files with 145 additions and 6 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
+1
View File
@@ -84,6 +84,7 @@ limitations under the License.
android:theme="@style/ThemeCustom"
tools:replace="android:label">
<!-- Activities -->
<activity android:name="de.dennisguse.opentracks.AboutActivity" />
<activity
android:name="de.dennisguse.opentracks.AggregatedStatsActivity"
android:label="@string/menu_aggregated_statistics" />
@@ -0,0 +1,37 @@
package de.dennisguse.opentracks;
import android.os.Bundle;
import android.view.Menu;
import android.widget.TextView;
import androidx.annotation.Nullable;
import de.dennisguse.opentracks.util.SystemUtils;
public class AboutActivity extends AbstractActivity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setTitle(getString(R.string.about_preference_title));
TextView textDescription = findViewById(R.id.about_text_description);
textDescription.setText(getString(R.string.about_description));
TextView textVersion = findViewById(R.id.about_text_version);
textVersion.setText(getString(R.string.about_version, SystemUtils.getAppVersion(this)));
TextView textURL = findViewById(R.id.about_app_url);
textURL.setText(getString(R.string.about_url, getString(R.string.app_web_url)));
}
protected int getLayoutResId() {
return R.layout.about;
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
return false;
}
}
@@ -36,8 +36,6 @@ import java.io.File;
*/
public class IntentUtils {
public static final String TEXT_PLAIN_TYPE = "text/plain";
private IntentUtils() {
}
+76
View File
@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView
android:id="@+id/imageView"
android:layout_width="match_parent"
android:layout_height="239dp"
android:contentDescription="@string/image_my_tracks_logo"
android:scaleType="fitCenter"
android:src="@drawable/ic_logo" />
<TextView
style="@style/TextLarge"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/app_name"
android:textSize="24sp" />
<View style="@style/StatsHorizontalLine" />
<TextView
android:id="@+id/about_text_description"
style="@style/TextMedium"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="12dp" />
<View style="@style/StatsHorizontalLine" />
<TextView
android:id="@+id/about_text_version"
style="@style/TextSmall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="6dp" />
<TextView
android:id="@+id/about_app_url"
style="@style/TextSmall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:autoLink="web"
android:gravity="center"
android:padding="6dp" />
<TextView
style="@style/TextSmall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:autoLink="web"
android:gravity="center"
android:padding="6dp"
android:text="@string/about_history" />
<View style="@style/StatsHorizontalLine" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="12dp"
android:text="@string/about_libraries" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/third_party_libraries" />
</LinearLayout>
+3 -2
View File
@@ -14,12 +14,13 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
<resources>
<!-- DO NOT TRANSLATE ANY STRINGS IN THIS FILE. -->
<string name="app_web_url" translatable="false">https://github.com/dennisguse/opentracks</string>
<string name="chart_x_axis_distance" translatable="false">DISTANCE</string>
<string name="chart_x_axis_time" translatable="false">TIME</string>
<!-- List here all used libraries (will be shown in the about activity -->
<string name="third_party_libraries" translatable="false"><a href="https://developer.android.com/topic/libraries/support-library/">Google\'s androidX support</a> (Apache License, Version 2.0)</string>
<string name="marker_statistics_icon_url" translatable="false">http://maps.google.com/mapfiles/ms/micons/ylw-pushpin.png</string>
<string name="marker_waypoint_icon_url" translatable="false">http://maps.google.com/mapfiles/ms/micons/blue-pushpin.png</string>
<string name="app_web_url" translatable="false">TODO</string>
<string name="permission_notification_value" translatable="false">de.dennisguse.opentracks.MYTRACKS_NOTIFICATIONS</string>
<string name="sensor_type_value_none" translatable="false">NONE</string>
<string name="sensor_unit_beats_per_minute" translatable="false">BPM</string>
+21 -1
View File
@@ -15,7 +15,27 @@ limitations under the License.
-->
<resources>
<!-- Activity Type -->
<string name="about_preference_title" translate_description="In the about activity, the title.">
About OpenTracks
</string>
<string name="about_description" translate_description="In the about activity, the description of the app.">
<i>OpenTracks</i> is a sport tracking application that completely respects your privacy.
</string>
<string name="about_url" translate_description="In the about activity, the URL to the source code repository.">
Project web page: <a href="%1$s">%1$s</a>
</string>
<string name="about_version" translate_description="In the about activity, the version of the source code (i.e., Android's versionName).">
Version: %1$s
</string>
<string name="about_history" translatate_description="In the about activity, the relationship with MyTracks.">
OpenTracks is a fork of <a href="https://code.google.com/archive/p/mytracks/"><i>Google\'s MyTracks</i></a> (discontinued in 2016).
</string>
<string name="about_libraries" translatate_description="In the about activity, the header of the 3rd party libraries.">
Libraries
</string>
<!-- Activity Type -->
<string name="activity_type_airplane" translation_description="When entering an 'Activity type', in the auto-complete text box, the
completion suggestion for airplane.">
airplane
+6
View File
@@ -35,4 +35,10 @@ limitations under the License.
android:key="@string/settings_advanced_key"
android:persistent="false"
android:title="@string/settings_advanced" />
<Preference
android:title="@string/about_preference_title">
<intent
android:targetPackage="de.dennisguse.opentracks"
android:targetClass="de.dennisguse.opentracks.AboutActivity" />
</Preference>
</PreferenceScreen>