Commit 25b78692 authored by Oliver Adams's avatar Oliver Adams

Closes #168

parent aba2edae
......@@ -82,7 +82,12 @@
<activity android:name="org.lp20.aikuma.ui.SyncSettingsActivity"
android:configChanges="orientation"
android:label="@string/app_name"
android:parentActivityName="org.lp20.aikuma.SettingsActivity">
android:parentActivityName="org.lp20.aikuma.ui.SettingsActivity">
</activity>
<activity android:name="org.lp20.aikuma.ui.AboutActivity"
android:configChanges="orientation"
android:label="@string/app_name"
android:parentActivityName="org.lp20.aikuma.MainActivity">
</activity>
</application>
</manifest>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:focusable="true"
android:focusableInTouchMode="true"
>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/versionField"
android:text=""
android:textSize="15sp"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/usageField"
android:text=""
android:textSize="15sp"
/>
</LinearLayout>
......@@ -6,20 +6,6 @@
android:focusable="true"
android:focusableInTouchMode="true"
>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/versionField"
android:text=""
android:textSize="15sp"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/usageField"
android:text=""
android:textSize="15sp"
/>
<Button
android:id="@+id/goToDefaultLanguages"
android:layout_width="match_parent"
......
/*
Copyright (C) 2013, The Aikuma Project
AUTHORS: Oliver Adams and Florian Hanke
*/
package org.lp20.aikuma.ui;
import android.os.Bundle;
//import android.view.View;
import android.widget.TextView;
import org.lp20.aikuma.R;
import org.lp20.aikuma.util.UsageUtils;
/**
* An activity that gives various information about the app including version
* number and usage statistics.
*
* @author Oliver Adams <oliver.adams@gmail.com>
*/
public class AboutActivity extends AikumaActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.about);
setupVersionInfo();
setupUsageInfo();
}
// Retrieves information about the Aikuma version.
private void setupVersionInfo() {
TextView versionField = (TextView) findViewById(R.id.versionField);
try {
versionField.setText("Version: " +
this.getPackageManager().getPackageInfo(
this.getPackageName(), 0).versionName);
} catch (android.content.pm.PackageManager.NameNotFoundException e) {
//Just leave the textview empty.
}
}
// Retrievs information about the user and displays it.
private void setupUsageInfo() {
TextView usageField = (TextView) findViewById(R.id.usageField);
usageField.setText("Recording time used: " + UsageUtils.timeUsed(16000, 16) +
"\nRecording time available: " + UsageUtils.timeAvailable(16000, 16) +
"\nOriginal recordings: " + UsageUtils.numOriginals() +
"\nCommentaries: " + UsageUtils.numCommentaries());
}
}
......@@ -77,7 +77,10 @@ public class MenuBehaviour {
case R.id.settings:
intent = new Intent(activity, SettingsActivity.class);
activity.startActivity(intent);
//openSettingsActivity;
return true;
case R.id.about:
intent = new Intent(activity, AboutActivity.class);
activity.startActivity(intent);
return true;
default:
return true;
......@@ -110,7 +113,10 @@ public class MenuBehaviour {
case R.id.settings:
intent = new Intent(activity, SettingsActivity.class);
activity.startActivity(intent);
//openSettingsActivity;
return true;
case R.id.about:
intent = new Intent(activity, AboutActivity.class);
activity.startActivity(intent);
return true;
default:
return true;
......
......@@ -39,8 +39,6 @@ public class SettingsActivity extends AikumaActivity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.settings);
getVersionInfo();
getUsageInfo();
}
@Override
......@@ -92,28 +90,6 @@ public class SettingsActivity extends AikumaActivity {
public void onStopTrackingTouch(SeekBar seekBar) {}
}
);
}
// Retrieves information about the Aikuma version.
private void getVersionInfo() {
TextView versionField = (TextView) findViewById(R.id.versionField);
try {
versionField.setText("Version: " +
this.getPackageManager().getPackageInfo(
this.getPackageName(), 0).versionName);
} catch (android.content.pm.PackageManager.NameNotFoundException e) {
//Just leave the textview empty.
}
}
// Retrievs information about the user and displays it.
private void getUsageInfo() {
TextView usageField = (TextView) findViewById(R.id.usageField);
usageField.setText("Recording time used: " + UsageUtils.timeUsed(16000, 16) +
"\nRecording time available: " + UsageUtils.timeAvailable(16000, 16) +
"\nOriginal recordings: " + UsageUtils.numOriginals() +
"\nCommentaries: " + UsageUtils.numCommentaries());
}
/**
......@@ -135,9 +111,4 @@ public class SettingsActivity extends AikumaActivity {
Intent intent = new Intent(this, SyncSettingsActivity.class);
startActivity(intent);
}
@Override
public void onBackPressed() {
this.finish();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment