Move activity labels to strings.xml (and some code formatting)
This commit is contained in:
@ -22,10 +22,10 @@
|
||||
android:uiOptions="splitActionBarWhenNarrow">
|
||||
<activity
|
||||
android:name="com.cradle.iitc_mobile.IITC_Mobile"
|
||||
android:theme="@style/AppBaseTheme"
|
||||
android:configChanges="orientation|keyboard|keyboardHidden|screenSize"
|
||||
android:label="@string/app_name"
|
||||
android:launchMode="singleTop"
|
||||
android:configChanges="orientation|keyboard|keyboardHidden|screenSize">
|
||||
android:theme="@style/AppBaseTheme">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
|
||||
@ -49,12 +49,12 @@
|
||||
|
||||
<data
|
||||
android:host="www.ingress.com"
|
||||
android:scheme="https"
|
||||
android:pathPrefix="/intel"/>
|
||||
android:pathPrefix="/intel"
|
||||
android:scheme="https"/>
|
||||
<data
|
||||
android:host="www.ingress.com"
|
||||
android:scheme="http"
|
||||
android:pathPrefix="/intel"/>
|
||||
android:pathPrefix="/intel"
|
||||
android:scheme="http"/>
|
||||
</intent-filter>
|
||||
|
||||
<!-- Handles geo: URIs -->
|
||||
@ -68,24 +68,24 @@
|
||||
</intent-filter>
|
||||
|
||||
<!-- Points to searchable meta data. -->
|
||||
<meta-data android:name="android.app.searchable"
|
||||
<meta-data
|
||||
android:name="android.app.searchable"
|
||||
android:resource="@xml/searchable"/>
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name=".IITC_PreferenceActivity"
|
||||
android:theme="@style/AppBaseTheme"
|
||||
android:label="@string/app_name"
|
||||
android:configChanges="orientation|keyboard|keyboardHidden|screenSize"/>
|
||||
android:configChanges="orientation|keyboard|keyboardHidden|screenSize"
|
||||
android:label="@string/activity_settings"
|
||||
android:theme="@style/AppBaseTheme"/>
|
||||
<activity
|
||||
android:name=".IITC_PluginPreferenceActivity"
|
||||
android:theme="@style/AppBaseTheme"
|
||||
android:label="@string/app_name"
|
||||
android:configChanges="orientation|keyboard|keyboardHidden|screenSize"/>
|
||||
|
||||
android:configChanges="orientation|keyboard|keyboardHidden|screenSize"
|
||||
android:label="@string/activity_plugins"
|
||||
android:theme="@style/AppBaseTheme"/>
|
||||
<activity
|
||||
android:name=".share.ShareActivity"
|
||||
android:label="@string/app_name"
|
||||
android:label="@string/activity_share"
|
||||
android:noHistory="true"
|
||||
android:parentActivityName="com.cradle.iitc_mobile.IITC_Mobile"
|
||||
android:theme="@android:style/Theme.Holo.Light.DarkActionBar">
|
||||
@ -100,7 +100,7 @@
|
||||
android:excludeFromRecents="true"
|
||||
android:exported="false"
|
||||
android:icon="@drawable/copy"
|
||||
android:label="Copy to clipboard"
|
||||
android:label="@string/activity_share_to_clipboard"
|
||||
android:noHistory="false">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.SEND"/>
|
||||
|
@ -2,6 +2,10 @@
|
||||
<resources>
|
||||
|
||||
<string name="app_name">IITC Mobile</string>
|
||||
<string name="activity_settings">IITC Mobile Settings</string>
|
||||
<string name="activity_plugins">IITC Plugins</string>
|
||||
<string name="activity_share">Share using…</string>
|
||||
<string name="activity_share_to_clipboard">Copy to clipboard</string>
|
||||
<string name="action_settings">Settings</string>
|
||||
<string name="reload">Reload IITC</string>
|
||||
<string name="version">Print Version</string>
|
||||
@ -99,4 +103,5 @@
|
||||
<string name="base_layers">Base Layers</string>
|
||||
<string name="overlay_layers">Overlay Layers</string>
|
||||
<string name="toggle_layer_selection">Deselect/Select all</string>
|
||||
|
||||
</resources>
|
@ -1,6 +1,14 @@
|
||||
package com.cradle.iitc_mobile;
|
||||
|
||||
import android.app.ActionBar;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Scanner;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.AssetManager;
|
||||
import android.os.Bundle;
|
||||
@ -16,15 +24,6 @@ import android.widget.ArrayAdapter;
|
||||
import android.widget.ListAdapter;
|
||||
import android.widget.TextView;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Scanner;
|
||||
import java.util.TreeMap;
|
||||
|
||||
public class IITC_PluginPreferenceActivity extends PreferenceActivity {
|
||||
|
||||
private List<Header> mHeaders;
|
||||
@ -43,9 +42,8 @@ public class IITC_PluginPreferenceActivity extends PreferenceActivity {
|
||||
|
||||
@Override
|
||||
public void onBuildHeaders(List<Header> target) {
|
||||
ActionBar bar = getActionBar();
|
||||
bar.setTitle("IITC Plugins");
|
||||
bar.setDisplayHomeAsUpEnabled(true);
|
||||
getActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
mHeaders = target;
|
||||
// since the plugins container is static,
|
||||
// it is enough to parse the plugin only on first start.
|
||||
@ -62,8 +60,7 @@ public class IITC_PluginPreferenceActivity extends PreferenceActivity {
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
// exit settings when home button (iitc icon) is pressed
|
||||
case android.R.id.home:
|
||||
case android.R.id.home: // exit settings when home button (iitc icon) is pressed
|
||||
onBackPressed();
|
||||
return true;
|
||||
default:
|
||||
@ -157,8 +154,7 @@ public class IITC_PluginPreferenceActivity extends PreferenceActivity {
|
||||
}
|
||||
}
|
||||
|
||||
void addPluginPreference(String src, String plugin_key,
|
||||
boolean user) {
|
||||
void addPluginPreference(String src, String plugin_key, boolean user) {
|
||||
|
||||
// now parse plugin name, description and category
|
||||
String header = src.substring(src.indexOf("==UserScript=="),
|
||||
|
@ -14,8 +14,6 @@ public class IITC_PreferenceActivity extends Activity {
|
||||
|
||||
MainSettings settings = new MainSettings();
|
||||
|
||||
// set action bar title
|
||||
getActionBar().setTitle("IITC Mobile Settings");
|
||||
getActionBar().setHomeButtonEnabled(true);
|
||||
|
||||
// iitc version
|
||||
@ -23,15 +21,16 @@ public class IITC_PreferenceActivity extends Activity {
|
||||
settings.setArguments(bundle);
|
||||
|
||||
// Display the fragment as the main content.
|
||||
getFragmentManager().beginTransaction()
|
||||
.replace(android.R.id.content, settings).commit();
|
||||
getFragmentManager()
|
||||
.beginTransaction()
|
||||
.replace(android.R.id.content, settings)
|
||||
.commit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
// exit settings when home button (iitc icon) is pressed
|
||||
case android.R.id.home:
|
||||
case android.R.id.home: // exit settings when home button (iitc icon) is pressed
|
||||
onBackPressed();
|
||||
return true;
|
||||
default:
|
||||
|
Reference in New Issue
Block a user