About-Dialog improvements and credit to more contributors.

This commit is contained in:
Philipp Crocoll 2013-09-04 06:31:06 +02:00
parent 48ad2b309b
commit 9418e42a7c
11 changed files with 1002 additions and 937 deletions

2
.gitignore vendored
View File

@ -123,3 +123,5 @@ Thumbs.db
/src/java/kp2akeytransform/.settings
/src/Kp2aUnitTests/bin/ReleaseNoNet/Jars
/src/Kp2aUnitTests/bin/ReleaseNoNet
/src/TwofishCipher/bin
/src/TwofishCipher/obj

View File

@ -36,11 +36,15 @@ namespace keepass2android
SetTitle(Resource.String.app_name);
SetVersion();
SetContributors();
Button okButton = (Button) FindViewById(Resource.Id.about_button);
okButton.Click += (sender, e) => {
Dismiss();
};
}
private void SetContributors()
{
TextView tv = (TextView)FindViewById(Resource.Id.further_authors);
tv.Text = Context.GetString(Resource.String.further_authors, new Java.Lang.Object[] { Context.GetString(Resource.String.further_author_names) });
}
private void SetVersion() {
@ -55,9 +59,10 @@ namespace keepass2android
version = "";
}
TextView tv = (TextView) FindViewById(Resource.Id.version);
TextView tv = (TextView) FindViewById(Resource.Id.versionX);
tv.Text = version;
FindViewById(Resource.Id.versionB).Click += (sender, args) => ChangeLog.ShowChangeLog(ctx, () => { });
}
}

View File

@ -87,37 +87,11 @@ namespace keepass2android
if (showChangeLog)
{
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.SetTitle(GetString(Resource.String.ChangeLog_title));
String[] changeLog = {
GetString(Resource.String.ChangeLog_0_8_5),
GetString(Resource.String.ChangeLog_0_8_4),
GetString(Resource.String.ChangeLog_0_8_3),
GetString(Resource.String.ChangeLog_0_8_2),
GetString(Resource.String.ChangeLog_0_8_1),
GetString(Resource.String.ChangeLog_0_8),
GetString(Resource.String.ChangeLog_0_7),
GetString(Resource.String.ChangeLog)
};
builder.SetPositiveButton(Android.Resource.String.Ok,(dlgSender, dlgEvt)=>{});
builder.SetMessage("temp");
Dialog dialog = builder.Create();
dialog.DismissEvent += (sender, e) =>
{
LaunchNextActivity();
};
dialog.Show();
TextView message = (TextView) dialog.FindViewById(Android.Resource.Id.Message);
message.MovementMethod = LinkMovementMethod.Instance;
message.TextFormatted = Html.FromHtml(ConcatChangeLog(changeLog));
message.LinksClickable = true;
ChangeLog.ShowChangeLog(this, LaunchNextActivity);
} else
}
else
{
LaunchNextActivity();
}
@ -128,34 +102,6 @@ namespace keepass2android
}
string ConcatChangeLog(string[] changeLog)
{
string res = "";
bool isFirst = true;
foreach (string c in changeLog)
{
res += c;
if (isFirst)
{
if (res.EndsWith("\n") == false)
res += "\n";
string donateUrl = GetString(Resource.String.donate_url,
new Java.Lang.Object[]{Resources.Configuration.Locale.Language,
PackageName
});
res += " * <a href=\""+donateUrl
+"\">"+
GetString(Resource.String.ChangeLog_keptDonate)
+"<a/>";
isFirst = false;
}
while (res.EndsWith("\n\n") == false)
res += "\n";
}
return res.Replace("\n","<br>");
}
IOConnectionInfo LoadIoc(string defaultFileName)
{

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
>
<TextView
android:id="@+id/about_title"
android:layout_width="wrap_content"
@ -19,45 +28,43 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/divider1"
style="@style/InfoHeader"
android:text="@string/version_label" />
<TextView
android:id="@+id/version"
android:id="@+id/versionX"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/divider1"
android:layout_alignParentRight="true" />
android:layout_below="@id/version_title"
android:text="1.a.b"
/>
<Button
android:id="@+id/versionB"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/versionX"
android:text="@string/version_history"
/>
<ImageView
android:id="@+id/divider2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/version_title"
android:layout_below="@id/versionB"
android:scaleType="fitXY"
android:src="@android:drawable/divider_horizontal_dark" />
<TextView
android:id="@+id/homepage"
android:id="@+id/feedback_title"
style="@style/InfoHeader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/divider2"
android:text="@string/about_homepage" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/homepage_short"
android:layout_below="@id/divider2"
android:layout_alignParentRight="true"
android:autoLink="web" />
android:text="@string/about_feedback" />
<TextView
android:id="@+id/feedback"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/homepage"
android:text="@string/about_feedback" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/issues"
android:layout_below="@id/homepage"
android:layout_alignParentRight="true"
android:layout_below="@id/feedback_title"
android:autoLink="web" />
<ImageView
android:id="@+id/divider3"
@ -67,23 +74,52 @@
android:scaleType="fitXY"
android:src="@android:drawable/divider_horizontal_dark" />
<TextView
android:id="@+id/disclaimer"
android:id="@+id/disclaimer_title"
style="@style/InfoHeader"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/divider3"
android:text="@string/disclaimer_formal" />
<Button
android:id="@+id/about_button"
android:text="Please note" />
<TextView
android:id="@+id/disclaimer"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/disclaimer_title"
android:text="@string/disclaimer_formal" />
<TextView
android:id="@+id/contributors_title"
style="@style/InfoHeader"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_below="@id/disclaimer"
android:layout_centerHorizontal="true"
android:text="@android:string/ok"
android:width="100sp" />
android:text="Contributors" />
<TextView
android:id="@+id/author"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/contributors_title"
android:text="@string/author" />
<TextView
android:id="@+id/further_authors"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/author"
/>
<TextView
android:id="@+id/plugin1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/further_authors"
android:text="@string/credit_plugin1" />
<TextView
android:id="@+id/Credit"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/about_button"
android:layout_below="@id/plugin1"
android:text="@string/CreditsText" />
</RelativeLayout>
</ScrollView>

View File

@ -72,6 +72,19 @@
<item name="android:textSize">14sp</item>
<item name="android:textStyle">bold</item>
</style>
<style name="InfoHeader" parent="android:Widget.Holo.Light.TextView">
<item name="android:drawableBottom">@drawable/section_header</item>
<item name="android:drawablePadding">2dp</item>
<item name="android:layout_marginLeft">0dip</item>
<item name="android:layout_marginRight">12dip</item>
<item name="android:layout_marginBottom">3dp</item>
<item name="android:layout_marginTop">8dp</item>
<item name="android:paddingLeft">4dp</item>
<item name="android:textAllCaps">true</item>
<item name="android:textColor">@color/light_gray</item>
<item name="android:textSize">14sp</item>
<item name="android:textStyle">bold</item>
</style>
<style name="BottomBarActionButton" parent="android:style/Widget.Holo.Light.ActionButton">
<item name="android:background">#c8c8c8</item>

View File

@ -23,6 +23,7 @@
<string name="donate_url"><![CDATA[http://philipp.crocoll.net/donate.php?lang=%1$s&app=%2$s]]></string>
<string name="homepage">http://keepass2android.codeplex.com</string>
<string name="homepage_short">keepass2android.codeplex.com</string>
<string name="further_author_names">Alex Vallat</string>
<string name="issues">http://keepass2android.codeplex.com</string>
<string name="oi_filemanager_market">market://details?id=org.openintents.filemanager</string>
<string name="oi_filemanager_web">https://openintents.googlecode.com/files/FileManager-2.0.2.apk</string>

View File

@ -0,0 +1,7 @@
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
</resources>

View File

@ -178,6 +178,10 @@
<string name="warning_read_only">Your sd card is currently read-only. You may not be able to save changes to your database.</string>
<string name="warning_unmounted">Your sd card is not currently mounted on your device. You will not be able to load or create your database.</string>
<string name="version_label">Version</string>
<string name="version_history">Version history</string>
<string name="author">Keepass2Android is developed by Philipp Crocoll.</string>
<string name="further_authors">Thanks to code contributions by %1$s.</string>
<string name="credit_plugin1">The Twofish Cipher Plugin for Keepass was developed by Scott Greenberg and is included in KP2A.</string>
<string name="regular_expression">Regular expression</string>
<string name="TanExpiresOnUse_title">Tan expires on use</string>
<string name="TanExpiresOnUse_summary">Mark TAN entries expired when using them</string>

View File

@ -87,6 +87,18 @@
<item name="android:textStyle">bold</item>
<item name="@android:background">@android:color/transparent</item>
</style>
<style name="InfoHeader">
<item name="android:drawableBottom">@drawable/section_header</item>
<item name="android:drawablePadding">1dp</item>
<item name="android:layout_marginBottom">3dp</item>
<item name="android:layout_marginTop">8dp</item>
<item name="android:paddingLeft">0dp</item>
<item name="android:textAllCaps">true</item>
<item name="android:textColor">@color/emphasis</item>
<item name="android:textSize">14sp</item>
<item name="android:textStyle">bold</item>
<item name="@android:background">@android:color/transparent</item>
</style>
<style name="EditEntryButton">
</style>

View File

@ -79,6 +79,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="app\ApplicationBroadcastReceiver.cs" />
<Compile Include="ChangeLog.cs" />
<Compile Include="icons\DrawableFactory.cs" />
<Compile Include="icons\Icons.cs" />
<Compile Include="Resources\Resource.designer.cs" />
@ -731,4 +732,7 @@
<ItemGroup>
<AndroidResource Include="Resources\drawable\ic_launcher_red.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\values\dimens.xml" />
</ItemGroup>
</Project>