Fixed about screen

This commit is contained in:
Ziver Koc 2014-07-29 10:27:48 +02:00
parent ba153f5708
commit 433f60dac7
6 changed files with 20 additions and 8 deletions

View file

@ -32,5 +32,5 @@
</activity> </activity>
</application> </application>
<uses-permission android:name="android.permission.INTERNET"></uses-permission> <uses-permission android:name="android.permission.INTERNET" />
</manifest> </manifest>

View file

@ -2,7 +2,7 @@
<body> <body>
<h1>About</h1> <h1>About</h1>
<hr /> <hr />
This application was developed by Ziver Koc 2014 at Ericsson AB. This application was developed by Ziver Koc (Ericsson AB).
<br /><br /> <br /><br />
<h3>Attributions:</h3> <h3>Attributions:</h3>
<ul> <ul>

View file

@ -13,7 +13,7 @@ public class AboutActivity extends Activity{
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
WebView view = new WebView(this); WebView view = new WebView(this);
view.loadUrl("file://assets/www/about.html"); view.loadUrl("file:///android_asset/www/about.html");
this.setContentView(view); this.setContentView(view);
} }
} }

View file

@ -57,8 +57,8 @@ public class MainActivity extends FragmentActivity
currentExecutor = 0; currentExecutor = 0;
UeControlExecutor exec = new UeControlExecutor(); UeControlExecutor exec = new UeControlExecutor();
exec.addBehaviour(new UeBehaviourSleep(1000)); exec.addBehaviour(new UeBehaviourSleep());
exec.addBehaviour(new UeBehaviourSurfing("http://google.com")); exec.addBehaviour(new UeBehaviourSurfing());
exec.addBehaviour(new UeBehaviourSleep(4000)); exec.addBehaviour(new UeBehaviourSleep(4000));
exec.setThroughputListener(statusFragment.getThroughputListener()); exec.setThroughputListener(statusFragment.getThroughputListener());
executors.add(exec); executors.add(exec);
@ -70,6 +70,7 @@ public class MainActivity extends FragmentActivity
FragmentManager fragmentManager = getFragmentManager(); FragmentManager fragmentManager = getFragmentManager();
fragmentManager.beginTransaction() fragmentManager.beginTransaction()
.replace(R.id.container, BehaviourListFragment.newInstance(position)).commit(); .replace(R.id.container, BehaviourListFragment.newInstance(position)).commit();
currentExecutor = position;
} }
public void onSectionAttached(int number) { public void onSectionAttached(int number) {

View file

@ -1,7 +1,9 @@
package com.ericsson.uecontrol.gui; package com.ericsson.uecontrol.gui;
import android.app.Activity; import android.app.Activity;
import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.preference.Preference;
import android.preference.PreferenceFragment; import android.preference.PreferenceFragment;
import com.ericsson.uecontrol.R; import com.ericsson.uecontrol.R;
@ -15,6 +17,7 @@ public class SettingsActivity extends Activity {
getFragmentManager().beginTransaction() getFragmentManager().beginTransaction()
.replace(android.R.id.content, new SettingsFragment()) .replace(android.R.id.content, new SettingsFragment())
.commit(); .commit();
} }
@ -25,6 +28,15 @@ public class SettingsActivity extends Activity {
// Load the preferences from an XML resource // Load the preferences from an XML resource
addPreferencesFromResource(R.xml.preferences); addPreferencesFromResource(R.xml.preferences);
// Setup About intent
Preference aboutPreference = findPreference("about");
aboutPreference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener(){
public boolean onPreferenceClick(Preference preference) {
startActivity(new Intent(getActivity(), AboutActivity.class));
return true;
}
});
} }
} }
} }

View file

@ -20,12 +20,11 @@
android:title="@string/pref_other_title" android:title="@string/pref_other_title"
android:key="pref_key_storage_settings"> android:key="pref_key_storage_settings">
<PreferenceScreen <Preference
android:key="about" android:key="about"
android:title="@string/pref_about" android:title="@string/pref_about"
android:defaultValue="false"> android:defaultValue="false">
<intent android:targetClass="com.ericsson.uecontrol.gui.AboutActivity" /> </Preference>
</PreferenceScreen>
</PreferenceCategory> </PreferenceCategory>
</PreferenceScreen> </PreferenceScreen>