-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
V1.0.5 - allow selection of font size in preferences
* add ant build script (for command line building)
- Loading branch information
Showing
10 changed files
with
312 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,26 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
~ (C) Copyright 2015-2016 by fr3ts0n <[email protected]> | ||
~ | ||
~ This program is free software; you can redistribute it and/or | ||
~ modify it under the terms of the GNU General Public License as | ||
~ published by the Free Software Foundation; either version 2 of | ||
~ the License, or (at your option) any later version. | ||
~ | ||
~ This program is distributed in the hope that it will be useful, | ||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
~ GNU General Public License for more details. | ||
~ You should have received a copy of the GNU General Public License | ||
~ along with this program; if not, write to the Free Software | ||
~ Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
~ MA 02111-1307 USA | ||
~ | ||
--> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.fr3ts0n.stagefever" | ||
android:versionCode="010004" | ||
android:versionName="1.0.4" > | ||
android:versionCode="010005" | ||
android:versionName="1.0.5"> | ||
|
||
<uses-sdk | ||
android:minSdkVersion="15" | ||
|
@@ -33,6 +51,7 @@ | |
<data android:scheme="content" android:mimeType="text/*"/> | ||
</intent-filter> | ||
</activity> | ||
<activity android:name=".SettingsActivity"/> | ||
</application> | ||
|
||
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ (C) Copyright 2015-2016 by fr3ts0n <[email protected]> | ||
~ | ||
~ This program is free software; you can redistribute it and/or | ||
~ modify it under the terms of the GNU General Public License as | ||
~ published by the Free Software Foundation; either version 2 of | ||
~ the License, or (at your option) any later version. | ||
~ | ||
~ This program is distributed in the hope that it will be useful, | ||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
~ GNU General Public License for more details. | ||
~ You should have received a copy of the GNU General Public License | ||
~ along with this program; if not, write to the Free Software | ||
~ Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
~ MA 02111-1307 USA | ||
~ | ||
--> | ||
|
||
<project name="StageFever" default="help"> | ||
|
||
<!-- The local.properties file is created and updated by the 'android' tool. | ||
It contains the path to the SDK. It should *NOT* be checked into | ||
Version Control Systems. --> | ||
<property file="local.properties" /> | ||
|
||
<!-- The ant.properties file can be created by you. It is only edited by the | ||
'android' tool to add properties to it. | ||
This is the place to change some Ant specific build properties. | ||
Here are some properties you may want to change/update: | ||
source.dir | ||
The name of the source directory. Default is 'src'. | ||
out.dir | ||
The name of the output directory. Default is 'bin'. | ||
For other overridable properties, look at the beginning of the rules | ||
files in the SDK, at tools/ant/build.xml | ||
Properties related to the SDK location or the project target should | ||
be updated using the 'android' tool with the 'update' action. | ||
This file is an integral part of the build system for your | ||
application and should be checked into Version Control Systems. | ||
--> | ||
<property file="ant.properties" /> | ||
|
||
<!-- if sdk.dir was not set from one of the property file, then | ||
get it from the ANDROID_HOME env var. | ||
This must be done before we load project.properties since | ||
the proguard config can use sdk.dir --> | ||
<property environment="env" /> | ||
<condition property="sdk.dir" value="${env.ANDROID_HOME}"> | ||
<isset property="env.ANDROID_HOME" /> | ||
</condition> | ||
|
||
<!-- The project.properties file is created and updated by the 'android' | ||
tool, as well as ADT. | ||
This contains project specific properties such as project target, and library | ||
dependencies. Lower level build properties are stored in ant.properties | ||
(or in .classpath for Eclipse projects). | ||
This file is an integral part of the build system for your | ||
application and should be checked into Version Control Systems. --> | ||
<loadproperties srcFile="project.properties" /> | ||
|
||
<!-- quick check on sdk.dir --> | ||
<fail | ||
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable." | ||
unless="sdk.dir" | ||
/> | ||
|
||
<!-- | ||
Import per project custom build rules if present at the root of the project. | ||
This is the place to put custom intermediary targets such as: | ||
-pre-build | ||
-pre-compile | ||
-post-compile (This is typically used for code obfuscation. | ||
Compiled code location: ${out.classes.absolute.dir} | ||
If this is not done in place, override ${out.dex.input.absolute.dir}) | ||
-post-package | ||
-post-build | ||
-pre-clean | ||
--> | ||
<import file="custom_rules.xml" optional="true" /> | ||
|
||
<!-- Import the actual build file. | ||
To customize existing targets, there are two options: | ||
- Customize only one target: | ||
- copy/paste the target into this file, *before* the | ||
<import> task. | ||
- customize it to your needs. | ||
- Customize the whole content of build.xml | ||
- copy/paste the content of the rules files (minus the top node) | ||
into this file, replacing the <import> task. | ||
- customize to your needs. | ||
*********************** | ||
****** IMPORTANT ****** | ||
*********************** | ||
In all cases you must update the value of version-tag below to read 'custom' instead of an integer, | ||
in order to avoid having your file be overridden by tools such as "android update project" | ||
--> | ||
<!-- version-tag: 1 --> | ||
<import file="${sdk.dir}/tools/ant/build.xml" /> | ||
|
||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
~ (C) Copyright 2015-2016 by fr3ts0n <[email protected]> | ||
~ | ||
~ This program is free software; you can redistribute it and/or | ||
~ modify it under the terms of the GNU General Public License as | ||
~ published by the Free Software Foundation; either version 2 of | ||
~ the License, or (at your option) any later version. | ||
~ | ||
~ This program is distributed in the hope that it will be useful, | ||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
~ GNU General Public License for more details. | ||
~ You should have received a copy of the GNU General Public License | ||
~ along with this program; if not, write to the Free Software | ||
~ Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
~ MA 02111-1307 USA | ||
~ | ||
--> | ||
|
||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> | ||
|
||
<EditTextPreference | ||
android:key="font_size_notes" | ||
android:defaultValue="24" | ||
android:selectAllOnFocus="true" | ||
android:singleLine="true" | ||
android:title="@string/font_size_notes" | ||
android:inputType="numberDecimal" | ||
android:summary="@string/font_size_description" /> | ||
|
||
</PreferenceScreen> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
/* | ||
* (C) Copyright 2015-2016 by fr3ts0n <[email protected]> | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License as | ||
* published by the Free Software Foundation; either version 2 of | ||
* the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
* MA 02111-1307 USA | ||
* | ||
*/ | ||
|
||
package com.fr3ts0n.stagefever; | ||
|
||
import android.content.SharedPreferences; | ||
import android.os.Bundle; | ||
import android.preference.EditTextPreference; | ||
import android.preference.ListPreference; | ||
import android.preference.Preference; | ||
import android.preference.PreferenceActivity; | ||
import android.preference.PreferenceFragment; | ||
import android.preference.PreferenceManager; | ||
|
||
public class SettingsActivity | ||
extends PreferenceActivity | ||
{ | ||
/** | ||
* app preferences | ||
*/ | ||
static SharedPreferences prefs; | ||
|
||
@Override | ||
public void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
prefs = PreferenceManager.getDefaultSharedPreferences(this); | ||
// Display the fragment as the main content. | ||
getFragmentManager().beginTransaction() | ||
.replace(android.R.id.content, new PrefsFragment()) | ||
.commit(); | ||
} | ||
|
||
|
||
public static class PrefsFragment | ||
extends PreferenceFragment | ||
implements SharedPreferences.OnSharedPreferenceChangeListener | ||
{ | ||
@Override | ||
public void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
addPreferencesFromResource(R.xml.settings); | ||
// add handler for selection update | ||
prefs.registerOnSharedPreferenceChangeListener(this); | ||
} | ||
|
||
void setValueAsSummary(Preference pref) | ||
{ | ||
if (pref instanceof ListPreference) | ||
{ | ||
ListPreference currPref = (ListPreference) pref; | ||
currPref.setSummary(currPref.getValue()); | ||
} | ||
else | ||
if (pref instanceof EditTextPreference) | ||
{ | ||
EditTextPreference currPref = (EditTextPreference) pref; | ||
currPref.setSummary(currPref.getText()); | ||
} | ||
} | ||
|
||
@Override | ||
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) | ||
{ | ||
Preference pref = findPreference(key); | ||
setValueAsSummary(pref); | ||
} | ||
} | ||
} |
Oops, something went wrong.