Commit f229e205 authored by Haejoong Lee's avatar Haejoong Lee

merged from master branch

parents f4e7c6a0 25b78692
......@@ -20,92 +20,82 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="org.lp20.aikuma.ui.ListenActivity"
android:configChanges="orientation"
android:label="@string/app_name"
android:parentActivityName="org.lp20.aikuma.MainActivity" >
</activity>
<activity
android:name="org.lp20.aikuma.ui.RecordActivity"
android:configChanges="orientation"
android:label="@string/app_name"
android:parentActivityName="org.lp20.aikuma.MainActivity" >
</activity>
<activity
android:name="org.lp20.aikuma.ui.SettingsActivity"
android:configChanges="orientation"
android:label="@string/app_name"
android:parentActivityName="org.lp20.aikuma.MainActivity" >
</activity>
<activity
android:name="org.lp20.aikuma.ui.RecordingMetadataActivity"
android:configChanges="orientation"
android:label="@string/app_name"
android:parentActivityName="org.lp20.aikuma.MainActivity" >
</activity>
<activity
android:name="org.lp20.aikuma.ui.LanguageFilterList"
android:configChanges="orientation"
android:label="@string/app_name"
android:parentActivityName="org.lp20.aikuma.MainActivity" >
</activity>
<activity
android:name="org.lp20.aikuma.ui.SpeakersActivity"
android:configChanges="orientation"
android:label="@string/app_name"
android:parentActivityName="org.lp20.aikuma.MainActivity" >
</activity>
<activity
android:name="org.lp20.aikuma.ui.MainSpeakersActivity"
android:configChanges="orientation"
android:label="@string/app_name"
android:parentActivityName="org.lp20.aikuma.MainActivity" >
</activity>
<activity
android:name="org.lp20.aikuma.ui.AddSpeakerActivity"
android:configChanges="orientation"
android:label="@string/app_name"
android:parentActivityName="org.lp20.aikuma.MainActivity" >
</activity>
<activity
android:name="org.lp20.aikuma.ui.ThumbRespeakActivity"
android:configChanges="orientation"
android:label="@string/app_name"
android:parentActivityName="org.lp20.aikuma.MainActivity" >
</activity>
<activity
android:name="org.lp20.aikuma.ui.PhoneRespeakActivity"
android:configChanges="orientation"
android:label="@string/app_name"
android:parentActivityName="org.lp20.aikuma.MainActivity" >
</activity>
<activity
android:name="org.lp20.aikuma.ui.AddCustomLanguageActivity"
android:configChanges="orientation"
android:label="@string/app_name"
android:parentActivityName="org.lp20.aikuma.MainActivity" >
</activity>
<activity
android:name="org.lp20.aikuma.ui.DefaultLanguagesActivity"
android:configChanges="orientation"
android:label="@string/app_name"
android:parentActivityName="org.lp20.aikuma.SettingsActivity" >
</activity>
<activity
android:name="org.lp20.aikuma.ui.SyncSettingsActivity"
android:configChanges="orientation"
android:label="@string/app_name"
android:parentActivityName="org.lp20.aikuma.SettingsActivity" >
</activity>
<activity
android:name="org.lp20.aikuma.ui.HttpServerActivity"
android:label="@string/http_server_activity_title"
android:parentActivityName="org.lp20.aikuma.MainActivity" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="org.lp20.aikuma.MainActivity" />
</activity>
<activity android:name="org.lp20.aikuma.ui.ListenActivity"
android:configChanges="orientation"
android:label="@string/app_name"
android:parentActivityName="org.lp20.aikuma.MainActivity">
</activity>
<activity android:name="org.lp20.aikuma.ui.RecordActivity"
android:configChanges="orientation"
android:label="@string/app_name"
android:parentActivityName="org.lp20.aikuma.MainActivity">
</activity>
<activity android:name="org.lp20.aikuma.ui.SettingsActivity"
android:configChanges="orientation"
android:label="@string/app_name"
android:parentActivityName="org.lp20.aikuma.MainActivity">
</activity>
<activity android:name="org.lp20.aikuma.ui.RecordingMetadataActivity"
android:configChanges="orientation"
android:label="@string/app_name"
android:parentActivityName="org.lp20.aikuma.MainActivity">
</activity>
<activity android:name="org.lp20.aikuma.ui.LanguageFilterList"
android:configChanges="orientation"
android:label="@string/app_name"
android:parentActivityName="org.lp20.aikuma.MainActivity">
</activity>
<activity android:name="org.lp20.aikuma.ui.SpeakersActivity"
android:configChanges="orientation"
android:label="@string/app_name"
android:parentActivityName="org.lp20.aikuma.MainActivity">
</activity>
<activity android:name="org.lp20.aikuma.ui.MainSpeakersActivity"
android:configChanges="orientation"
android:label="@string/app_name"
android:parentActivityName="org.lp20.aikuma.MainActivity">
</activity>
<activity android:name="org.lp20.aikuma.ui.AddSpeakerActivity"
android:configChanges="orientation"
android:label="@string/app_name"
android:parentActivityName="org.lp20.aikuma.MainActivity">
</activity>
<activity android:name="org.lp20.aikuma.ui.ThumbRespeakActivity"
android:configChanges="orientation"
android:label="@string/app_name"
android:parentActivityName="org.lp20.aikuma.MainActivity">
</activity>
<activity android:name="org.lp20.aikuma.ui.PhoneRespeakActivity"
android:configChanges="orientation"
android:label="@string/app_name"
android:parentActivityName="org.lp20.aikuma.MainActivity">
</activity>
<activity android:name="org.lp20.aikuma.ui.AddCustomLanguageActivity"
android:configChanges="orientation"
android:label="@string/app_name"
android:parentActivityName="org.lp20.aikuma.MainActivity">
</activity>
<activity android:name="org.lp20.aikuma.ui.DefaultLanguagesActivity"
android:configChanges="orientation"
android:label="@string/app_name"
android:parentActivityName="org.lp20.aikuma.SettingsActivity">
</activity>
<activity android:name="org.lp20.aikuma.ui.SyncSettingsActivity"
android:configChanges="orientation"
android:label="@string/app_name"
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>
<activity android:name="org.lp20.aikuma.ui.HttpServerActivity"
android:label="@string/http_server_activity_title"
android:parentActivityName="org.lp20.aikuma.MainActivity" >
<meta-data android:name="android.support.PARENT_ACTIVITY"
android:value="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"
......
......@@ -4,19 +4,18 @@
android:icon="@drawable/record_disabled_32"
android:title="@string/record"
android:showAsAction="always"/>
<item android:id="@+id/help"
android:icon="@drawable/question"
android:title="@string/help"
android:showAsAction="always"/>
<item android:id="@+id/speakers"
android:icon="@drawable/speakers_32"
android:title="@string/speakers"
android:showAsAction="always"/>
<item android:id="@+id/settings"
android:icon="@drawable/settings_32"
android:title="@string/settings"
android:showAsAction="always"/>
<item android:id="@+id/start_http_server"
android:title="@string/connect"
android:showAsAction="never"/>
android:title="@string/settings"/>
<!--android:showAsAction="always"/>-->
<item android:id="@+id/help"
android:icon="@drawable/question"
android:title="@string/help"/>
<!--android:showAsAction="always"/>-->
<item android:id="@+id/about"
android:title="@string/about"/>
</menu>
......@@ -18,30 +18,32 @@
recording and start a new recording?</string>
<string name="defaultLangHeading">Default languages used when adding a
speaker</string>
<string name="speaker_name">Name</string>
<string name="add_iso_language">Add language from list </string>
<string name="add_custom_language">Add Custom Language</string>
<string name="take_photo">Take photo (necessary)</string>
<string name="thumb_respeaking">Thumb commentary</string>
<string name="phone_respeaking">Voice-activated commentary</string>
<string name="syncSettingsHeader">Connect this phone to</string>
<string name="ipAddressHint">IP Address</string>
<string name="usernameHint">Username</string>
<string name="passwordHint">Password</string>
<string name="syncNow">Sync now</string>
<string name="help">Help</string>
<string name="speakers">Speakers</string>
<string name="language_name">Language name</string>
<string name="action_settings">Settings</string>
<string name="connect">Connect</string>
<string name="http_dialog_success">Server started at port %1$d</string>
<string name="http_dialog_failure">Failed to start server</string>
<string name="http_server_activity_title">HTTP Server</string>
<string name="http_server_activity_server_status">Server status</string>
<string name="http_server_activity_host">Host</string>
<string name="http_server_activity_port">Port</string>
<string name="http_server_activity_ip">IP address</string>
<string name="http_ui_start">START</string>
<string name="http_ui_stop">STOP</string>
<string name="http_ui_default_port">8080</string>
<string name="speaker_name">Name
</string>
<string name="add_iso_language">Add language from list </string>
<string name="add_custom_language">Add Custom Language
</string>
<string name="take_photo">Take photo (necessary)</string>
<string name="thumb_respeaking">Thumb commentary</string>
<string name="phone_respeaking">Voice-activated commentary</string>
<string name="syncSettingsHeader">Connect this phone to</string>
<string name="ipAddressHint">IP Address</string>
<string name="usernameHint">Username</string>
<string name="passwordHint">Password</string>
<string name="syncNow">Sync now</string>
<string name="help">Help</string>
<string name="speakers">Speakers</string>
<string name="language_name">Language name</string>
<string name="about">About</string>
<string name="connect">Connect</string>
<string name="http_dialog_success">Server started at port %1$d</string>
<string name="http_dialog_failure">Failed to start server</string>
<string name="http_server_activity_title">HTTP Server</string>
<string name="http_server_activity_server_status">Server status</string>
<string name="http_server_activity_host">Host</string>
<string name="http_server_activity_port">Port</string>
<string name="http_server_activity_ip">IP address</string>
<string name="http_ui_start">START</string>
<string name="http_ui_stop">STOP</string>
<string name="http_ui_default_port">8080</string>
</resources>
/*
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());
}
}
......@@ -79,7 +79,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;
case R.id.start_http_server:
intent = new Intent(activity, HttpServerActivity.class);
......@@ -116,7 +119,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