Skip to content

Commit

Permalink
Added license and about screen
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuowei committed Apr 27, 2012
1 parent 008a94a commit 2eac2fc
Show file tree
Hide file tree
Showing 9 changed files with 832 additions and 63 deletions.
1 change: 1 addition & 0 deletions AndroidManifest.xml
Expand Up @@ -19,5 +19,6 @@
<activity android:name=".InventorySlotsActivity"/>
<activity android:name=".EditInventorySlotActivity"/>
<activity android:name=".BrowseItemsActivity"/>
<activity android:name=".AboutAppActivity"/>
</application>
</manifest>
674 changes: 674 additions & 0 deletions LICENSE.txt

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions ant.properties
Expand Up @@ -15,3 +15,5 @@
# 'key.alias' for the name of the key to use.
# The password will be asked during the build when you use the 'release' target.

key.store=androidreleasekey.keystore
key.alias=androidreleasekey
132 changes: 69 additions & 63 deletions icon.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions res/layout/about.xml
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:id="@+id/about_appnametext"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/app_name"
android:textSize="15pt"/>

<TextView
android:id="@+id/about_appversiontext"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>

<TextView
android:id="@+id/about_librarycreditstext"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/about_librarycredits"/>

<TextView
android:id="@+id/about_copyrighttext"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/about_copyright"/>

</LinearLayout>
6 changes: 6 additions & 0 deletions res/menu/worldselect_menu.xml
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/worldselect_about"
android:icon="@android:drawable/ic_menu_info_details"
android:title="@string/about_about"/>
</menu>
14 changes: 14 additions & 0 deletions res/values/strings.xml
Expand Up @@ -18,4 +18,18 @@
<string name="backup">Create Backup</string>
<string name="backupcreated">Backup Created: </string>
<string name="backupfailed">Backup failed.</string>
<string name="about_about">About</string>
<string name="about_copyright">Copyright (C) 2012 Zhuowei Zhang\n\n
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 3 of the License, or
(at your option) any later version.\n

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.\n
</string>
<string name="about_librarycredits">This app uses the SpoutNBT library developed by
the SpoutDev team.</string>
</resources>
12 changes: 12 additions & 0 deletions src/net/zhuoweizhang/pocketinveditor/AboutAppActivity.java
@@ -0,0 +1,12 @@
package net.zhuoweizhang.pocketinveditor;

import android.app.Activity;
import android.os.Bundle;

public final class AboutAppActivity extends Activity {

public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.about);
}
}
24 changes: 24 additions & 0 deletions src/net/zhuoweizhang/pocketinveditor/PocketInvEditorActivity.java
Expand Up @@ -11,6 +11,9 @@
import android.os.Bundle;
import android.os.Environment;
import android.view.View;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import static android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.AdapterView;
Expand Down Expand Up @@ -74,6 +77,27 @@ private void loadMaterials() {
new Thread(new MaterialLoader(getResources().getXml(R.xml.item_data))).start();
}

public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.worldselect_menu, menu);
return true;
}

public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.worldselect_about:
displayAboutActivity();
return true;
default:
return super.onOptionsItemSelected(item);
}
}

public void displayAboutActivity() {
Intent intent = new Intent(this, AboutAppActivity.class);
startActivity(intent);
}

private final class FindWorldsThread implements Runnable {

private final PocketInvEditorActivity activity;
Expand Down

0 comments on commit 2eac2fc

Please sign in to comment.