2
0
mirror of https://github.com/FWGS/xash3d-fwgs synced 2025-01-08 09:25:13 +01:00

Add about page, refactor LauncherActivity, remove unused strings and translations

This commit is contained in:
a1batross 2015-08-16 22:52:54 +06:00
parent f0275dcc92
commit 6af532e3b3
5 changed files with 179 additions and 58 deletions

75
res/layout/about.xml Normal file
View File

@ -0,0 +1,75 @@
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/main_layout"
android:weightSum="1">
<ImageView
android:layout_width="89dp"
android:layout_height="89dp"
android:id="@+id/aboutIcon"
android:layout_gravity="center_horizontal"
android:src="@drawable/ic_launcher" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="@string/about_main"
android:id="@+id/textView"
android:layout_gravity="center_horizontal" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/version_string"
android:id="@+id/textView3"
android:layout_gravity="center_horizontal" />
<TextView
android:layout_width="match_parent"
android:layout_height="225dp"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/about_authors"
android:id="@+id/textView4"
android:layout_weight="3.46"
android:clickable="false"
android:enabled="true"
android:singleLine="false"
android:password="false"
android:longClickable="false"
android:autoText="false" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="GitHub: https://github.com/SDLash3D"
android:id="@+id/textView5"
android:autoText="false"
android:autoLink="web" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="VK: https://vk.com/xashdroid"
android:id="@+id/textView6"
android:autoLink="web" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="@string/about_copyright"
android:id="@+id/textView2"
android:layout_weight="0.58" />
</LinearLayout>
</ScrollView>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
@ -8,68 +8,72 @@
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:orientation="vertical"
tools:context="in.celest.xash3d.LauncherActivity"
android:id="@+id/layout_shortcut">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/launch_button"
android:id="@+id/button_launch"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:onClick="startXash"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/touch_set"
android:id="@+id/touch_set"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:onClick="controlsSettings"/>
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/cmdArgs"
android:layout_below="@+id/textView_args"
android:layout_alignParentLeft="true"
android:layout_alignRight="@+id/textView_args"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="@string/cmd_args_text"
android:id="@+id/textView_args"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"/>
android:id="@+id/textView_args" />
<CheckBox
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_below="@+id/cmdArgs"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="@string/use_controls"
android:id="@+id/useControls"/>
<EditText
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/cmdPath"
android:layout_below="@+id/textView_path"
android:layout_alignParentLeft="true"
android:layout_alignRight="@+id/textView_path"/>
android:id="@+id/cmdArgs" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="@string/text_res_path"
android:id="@+id/textView_path"
android:layout_below="@+id/useControls"/>
</RelativeLayout>
android:id="@+id/textView_path" />
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/cmdPath" />
<CheckBox
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="@string/use_controls"
android:id="@+id/useControls"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/touch_set"
android:id="@+id/touch_set"
android:onClick="controlsSettings" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/about_button"
android:id="@+id/button"
android:onClick="aboutXash" />
<TextView
android:layout_width="fill_parent"
android:layout_height="0dp"
android:id="@+id/textView7"
android:layout_gravity="center_horizontal"
android:layout_weight="1"
android:clickable="false" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/launch_button"
android:id="@+id/button_launch"
android:onClick="startXash"
android:layout_column="6"
android:layout_gravity="right" />
</LinearLayout>

View File

@ -2,7 +2,6 @@
<string name="cmd_args_text">Аргументы командной строки(только для экспертов)</string>
<string name="launch_button">Запустить Xash3D</string>
<string name="title_section1">Команды</string>
<string name="use_controls">Включить экранное управление</string>
<string name="text_res_path">Путь к ресурсам игры</string>
<string name="touch_set">Настройки управления</string>
@ -10,4 +9,18 @@
<string name="shortcut_button_save">Сохранить ярлык</string>
<string name="gamedir">Каталог мода</string>
<string name="shortcut_name">Название ярлыка</string>
<string name="about_authors">Порт на Android осуществлен командой SDLash3D:\n
&#8226; a1batross\n
&#8226; mittorn\n
&#8226; nicknekit\n
Особые благодарности:\n
&#8226; Дяде Мише за Xash3D\n
&#8226; Valve за Half-Life\n
&#8226; Beloko Games за поддержку сенсорного управления\n
&#8226; Разработчикам libSDL2</string>
<string name="about_button">О Xash3D Android</string>
<string name="about_copyright" translatable="false">SDLash3D не связан с Valve или с любыми из их партнеров. Все авторские права принадлежат их соотвественным обладателям.</string>
<string name="action_settings">Настройки</string>
<string name="text_shortcut_test">Ярлык Xash3D (тест)</string>
</resources>

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Xash3D</string>
<string name="launcher_name">Xash3D</string>
<string name="launcher_name_test">Xash3D test</string>
<string name="app_name" translatable="false">Xash3D</string>
<string name="launcher_name" translatable="false">Xash3D</string>
<string name="launcher_name_test" translatable="false">Xash3D_test</string>
<string-array name="double_tap_actions">
<item>None</item>
<item>Shoot</item>
@ -11,20 +11,31 @@
<item>Use</item>
</string-array>
<string name="title_activity_launcher">LauncherActivity</string>
<string name="title_section1">Section 1</string>
<string name="title_section2">Section 2</string>
<string name="title_section3">Section 3</string>
<string name="launch_button">Launch Xash3D!</string>
<string name="action_settings">Settings</string>
<string name="cmd_args_text">Command line arguments(experts only)</string>
<string name="use_controls">Enable touch controls</string>
<string name="text_res_path">Path to game resources</string>
<string name="hello_world">Hello world!</string>
<string name="touch_set">Controls settings</string>
<string name="text_shortcut">Xash3D shortcut</string>
<string name="text_shortcut_test">Xash3D_test shortcut</string>
<string name="shortcut_button_save">Save shortcut</string>
<string name="gamedir">Mod directory</string>
<string name="shortcut_name">Shortcut name</string>
<!-- TODO: Remove or change this placeholder text -->
<string name="about_main" translatable="false">Xash3D Android</string>
<string name="about_copyright">SDLash3D is not affiliated with Valve or any of their partners. All copyrights reserved to their respective owners.</string>
<string name="version_string" translatable="false">v0.15</string>
<string name="about_authors">Port to Android by SDLash3D team: \n
&#8226; a1batross\n
&#8226; mittorn \n
&#8226; nicknekit.\n
Special thanks to:\n
&#8226; Uncle Mike for Xash3D engine\n
&#8226; Valve for Half-Life\n
&#8226; Beloko Games for touch controls support\n
&#8226; libSDL2 developers.\n</string>
<string name="about_button">About Xash3D Android</string>
</resources>

View File

@ -1,6 +1,7 @@
package in.celest.xash3d;
import android.app.Activity;
import android.app.Dialog;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
@ -12,6 +13,8 @@ import android.widget.CompoundButton;
import android.content.ComponentName;
import android.content.pm.PackageManager;
import android.content.SharedPreferences;
import android.content.DialogInterface;
import android.content.DialogInterface.OnDismissListener;
import in.celest.xash3d.hl.R;
import com.beloko.touchcontrols.TouchControlsSettings;
@ -58,6 +61,21 @@ public class LauncherActivity extends Activity {
mSettings.showSettings();
}
public void aboutXash(View view)
{
final Activity a = this;
this.runOnUiThread(new Runnable() {
public void run()
{
final Dialog dialog = new Dialog(a);
dialog.setContentView(R.layout.about);
dialog.setCancelable(true);
dialog.show();
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.