split Manifest for net/nonet

This commit is contained in:
PhilippC 2013-02-27 06:23:22 +01:00
parent 4d80e4e640
commit c6d2e26682
7 changed files with 411 additions and 372 deletions

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="2" android:versionName="0.5.1 beta" package="keepass2android.keepass2android" android:installLocation="preferExternal">
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="14" />
<application android:label="keepass2android" android:icon="@drawable/ic_launcher"></application>
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
</manifest>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="2" android:versionName="0.5.1 beta" package="keepass2android.keepass2android"> <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="2" android:versionName="0.5.1 beta" package="keepass2android.keepass2android_nonet">
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="14" /> <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="14" />
<application android:label="keepass2android" android:icon="@drawable/ic_launcher"></application> <application android:label="keepass2android" android:icon="@drawable/ic_launcher"></application>
<uses-permission android:name="android.permission.VIBRATE" /> <uses-permission android:name="android.permission.VIBRATE" />

File diff suppressed because it is too large Load Diff

View File

@ -13,6 +13,8 @@
<string name="algorithm_colon">Algorithm</string> <string name="algorithm_colon">Algorithm</string>
<string name="app_name">Keepass2Android</string> <string name="app_name">Keepass2Android</string>
<string name="short_app_name">KP2A</string> <string name="short_app_name">KP2A</string>
<string name="app_name_nonet">Keepass2Android Offline</string>
<string name="short_app_name_nonet">KP2A Offline</string>
<string name="app_timeout">Application timeout</string> <string name="app_timeout">Application timeout</string>
<string name="app_timeout_summary">Time before locking database when the application is inactive.</string> <string name="app_timeout_summary">Time before locking database when the application is inactive.</string>
<string name="application">Application</string> <string name="application">Application</string>

View File

@ -29,12 +29,28 @@ using Android.Widget;
namespace keepass2android namespace keepass2android
{ {
public static class AppNameResolver
{
public static string AppName
{
get { return "@string/app_name";}
}
public static string AppNameShort
{
get { return "@string/app_name_short";}
}
}
///Application class for Keepass2Android: Contains static Database variable to be used by all components. ///Application class for Keepass2Android: Contains static Database variable to be used by all components.
#if NoNet
[Application(Debuggable=false, Label=AppNameResolver.AppName)]
#else
#if RELEASE #if RELEASE
[Application(Debuggable=false, Label="@string/app_name")] [Application(Debuggable=false, Label="@string/app_name")]
#else #else
[Application(Debuggable=true, Label="@string/app_name")] [Application(Debuggable=true, Label="@string/app_name")]
#endif #endif
#endif
public class App : Application { public class App : Application {
public App (IntPtr javaReference, JniHandleOwnership transfer) public App (IntPtr javaReference, JniHandleOwnership transfer)

View File

@ -124,6 +124,11 @@ namespace keepass2android
openFileButton.Click += openFileButtonClick; openFileButton.Click += openFileButtonClick;
//OPEN URL //OPEN URL
Button openUrlButton = (Button)FindViewById(Resource.Id.start_open_url); Button openUrlButton = (Button)FindViewById(Resource.Id.start_open_url);
#if NoNet
openUrlButton.Visibility = ViewStates.Gone;
#endif
EventHandler openUrlButtonClick = (object sender, EventArgs e) => EventHandler openUrlButtonClick = (object sender, EventArgs e) =>
{ {
if (currentAction == CurrentAction.OpenURL) if (currentAction == CurrentAction.OpenURL)
@ -138,6 +143,7 @@ namespace keepass2android
enterFilenameDetails.Visibility = enterFilenameDetails.Text == "" ? ViewStates.Gone : ViewStates.Visible; enterFilenameDetails.Visibility = enterFilenameDetails.Text == "" ? ViewStates.Gone : ViewStates.Visible;
}; };
openUrlButton.Click += openUrlButtonClick; openUrlButton.Click += openUrlButtonClick;
//CREATE NEW //CREATE NEW
Button createNewButton = (Button)FindViewById(Resource.Id.start_create); Button createNewButton = (Button)FindViewById(Resource.Id.start_create);
EventHandler createNewButtonClick = (object sender, EventArgs e) => EventHandler createNewButtonClick = (object sender, EventArgs e) =>

View File

@ -50,6 +50,7 @@
<AndroidUseSharedRuntime>False</AndroidUseSharedRuntime> <AndroidUseSharedRuntime>False</AndroidUseSharedRuntime>
<AndroidLinkMode>SdkOnly</AndroidLinkMode> <AndroidLinkMode>SdkOnly</AndroidLinkMode>
<DefineConstants>NoNet</DefineConstants> <DefineConstants>NoNet</DefineConstants>
<DeployExternal>True</DeployExternal>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />