mirror of
https://github.com/OMGeeky/andors-trail.git
synced 2026-02-02 06:51:20 +01:00
Layout tweaks and bug fixes.
This commit is contained in:
@@ -1,83 +1,83 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
style="@style/AndorsTrail_Blue_TabFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal" >
|
||||
|
||||
<LinearLayout
|
||||
style="@style/AndorsTrail_Blue_StdFrame"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="left"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/heroinfo_wornequipment" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal" >
|
||||
|
||||
<include layout="@layout/heroinfo_equipped" />
|
||||
|
||||
<include layout="@layout/heroinfo_statsicons" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="left"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<LinearLayout
|
||||
style="@style/AndorsTrail_Blue_StdFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="left"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/heroinfo_inventory" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="right"
|
||||
android:orientation="horizontal" >
|
||||
|
||||
<Button
|
||||
android:id="@+id/inventorylist_category_filters_button"
|
||||
style="@style/AndorsTrail_Blue_SpinnerEmulator"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="5dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="left"
|
||||
android:text="" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/inventorylist_sort_filters_button"
|
||||
style="@style/AndorsTrail_Blue_SpinnerEmulator"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="left"
|
||||
android:text="" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<ListView
|
||||
android:id="@+id/inventorylist_root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
style="@style/AndorsTrail_Blue_TabFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal" >
|
||||
|
||||
<LinearLayout
|
||||
style="@style/AndorsTrail_Blue_StdFrame"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="left"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/heroinfo_wornequipment" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal" >
|
||||
|
||||
<include layout="@layout/heroinfo_equipped" />
|
||||
|
||||
<include layout="@layout/heroinfo_statsicons" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="left"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<LinearLayout
|
||||
style="@style/AndorsTrail_Blue_StdFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="left"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/heroinfo_inventory" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="right"
|
||||
android:orientation="horizontal" >
|
||||
|
||||
<Button
|
||||
android:id="@+id/inventorylist_category_filters_button"
|
||||
style="@style/AndorsTrail_Blue_SpinnerEmulator"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="5dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="left"
|
||||
android:text="" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/inventorylist_sort_filters_button"
|
||||
style="@style/AndorsTrail_Blue_SpinnerEmulator"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="left"
|
||||
android:text="" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<ListView
|
||||
android:id="@+id/inventorylist_root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -4,4 +4,5 @@
|
||||
style="@style/checkedListItem"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="5dp"
|
||||
android:drawableRight="@drawable/ui_blue_radiobutton" />
|
||||
|
||||
@@ -1,96 +1,76 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:paddingTop="20dp"
|
||||
android:paddingBottom="20dp" >
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.1"
|
||||
android:orientation="vertical" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/dialog_hitrect"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="0.8"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dialog_title"
|
||||
style="@style/titleWithIcon"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/ui_blue_richframe"
|
||||
android:drawableLeft="@drawable/char_hero"
|
||||
android:gravity="center_vertical" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/dialog_description_container"
|
||||
style="@style/AndorsTrail_Blue_StdFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingRight="5dp"
|
||||
android:paddingTop="5dp" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dialog_description"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/dialog_content_container"
|
||||
style="@style/AndorsTrail_Blue_StdFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.8"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingRight="5dp"
|
||||
android:paddingTop="5dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/dialog_button_container"
|
||||
style="@style/AndorsTrail_Blue_StdFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="horizontal"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingRight="5dp"
|
||||
android:paddingTop="5dp" >
|
||||
|
||||
<Button
|
||||
android:id="@+id/dialog_template_button"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.1"
|
||||
android:orientation="vertical" />
|
||||
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/dialog_hitrect"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dialog_title"
|
||||
style="@style/titleWithIcon"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/ui_blue_richframe"
|
||||
android:drawableLeft="@drawable/char_hero"
|
||||
android:gravity="center_vertical" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/dialog_description_container"
|
||||
style="@style/AndorsTrail_Blue_StdFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingRight="5dp"
|
||||
android:paddingTop="5dp" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dialog_description"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/dialog_content_container"
|
||||
style="@style/AndorsTrail_Blue_StdFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.8"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingRight="5dp"
|
||||
android:paddingTop="5dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/dialog_button_container"
|
||||
style="@style/AndorsTrail_Blue_StdFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="horizontal"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingRight="5dp"
|
||||
android:paddingTop="5dp" >
|
||||
|
||||
<Button
|
||||
android:id="@+id/dialog_template_button"
|
||||
style="@style/AndorsTrail_Blue_TextButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -1,76 +1,76 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
style="@style/AndorsTrail_Blue_TabFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<LinearLayout
|
||||
style="@style/AndorsTrail_Blue_StdFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="left"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/heroinfo_wornequipment" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal" >
|
||||
|
||||
<include layout="@layout/heroinfo_equipped" />
|
||||
|
||||
<include layout="@layout/heroinfo_statsicons" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/ui_blue_stdframe"
|
||||
android:gravity="left"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/heroinfo_inventory" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="right"
|
||||
android:orientation="horizontal" >
|
||||
|
||||
<Button
|
||||
android:id="@+id/inventorylist_category_filters_button"
|
||||
style="@style/AndorsTrail_Blue_SpinnerEmulator"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="5dp"
|
||||
android:gravity="left"
|
||||
android:text="" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/inventorylist_sort_filters_button"
|
||||
style="@style/AndorsTrail_Blue_SpinnerEmulator"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="left"
|
||||
android:text="" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<ListView
|
||||
android:id="@+id/inventorylist_root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
style="@style/AndorsTrail_Blue_TabFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<LinearLayout
|
||||
style="@style/AndorsTrail_Blue_StdFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="left"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/heroinfo_wornequipment" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal" >
|
||||
|
||||
<include layout="@layout/heroinfo_equipped" />
|
||||
|
||||
<include layout="@layout/heroinfo_statsicons" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/ui_blue_stdframe"
|
||||
android:gravity="left"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/heroinfo_inventory" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="right"
|
||||
android:orientation="horizontal" >
|
||||
|
||||
<Button
|
||||
android:id="@+id/inventorylist_category_filters_button"
|
||||
style="@style/AndorsTrail_Blue_SpinnerEmulator"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="5dp"
|
||||
android:gravity="left"
|
||||
android:text="" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/inventorylist_sort_filters_button"
|
||||
style="@style/AndorsTrail_Blue_SpinnerEmulator"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="left"
|
||||
android:text="" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<ListView
|
||||
android:id="@+id/inventorylist_root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -1,57 +1,58 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
style="@style/AndorsTrail_Blue_TabFrame">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/ui_blue_stdframe"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/heroinfo_listskills_number_of_increases"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="left"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:text="@string/skill_number_of_increases_several" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/skillList_filters_spinners"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="right"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/skillList_category_filters_button"
|
||||
style="@style/AndorsTrail_Blue_SpinnerEmulator"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="5dp"
|
||||
android:gravity="left"
|
||||
android:text="" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/skillList_sort_filters_button"
|
||||
style="@style/AndorsTrail_Blue_SpinnerEmulator"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="left"
|
||||
android:text="" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<ListView
|
||||
android:id="@+id/heroinfo_listskills_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
style="@style/AndorsTrail_Blue_TabFrame">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/ui_blue_stdframe"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/heroinfo_listskills_number_of_increases"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="left"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:text="@string/skill_number_of_increases_several" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/skillList_filters_spinners"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="right"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/skillList_category_filters_button"
|
||||
style="@style/AndorsTrail_Blue_SpinnerEmulator"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="5dp"
|
||||
android:gravity="left"
|
||||
android:text="" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/skillList_sort_filters_button"
|
||||
style="@style/AndorsTrail_Blue_SpinnerEmulator"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="left"
|
||||
android:text="" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<ListView
|
||||
android:id="@+id/heroinfo_listskills_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:dividerHeight="2dp" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -5,7 +5,8 @@
|
||||
android:gravity="left"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<!-- <TextView
|
||||
<!--
|
||||
<TextView
|
||||
android:id="@+id/quickslot_assign_title"
|
||||
style="@style/titleWithIcon"
|
||||
android:layout_width="match_parent"
|
||||
@@ -20,12 +21,13 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/ui_blue_stdframe"
|
||||
android:text="@string/inventory_selectitem"
|
||||
android:textColor="@color/ui_blue_textbutton_textcolor" /> -->
|
||||
android:textColor="@color/ui_blue_textbutton_textcolor" />
|
||||
-->
|
||||
|
||||
<ListView
|
||||
android:id="@+id/quickbuttons_assignlist"
|
||||
style="@style/AndorsTrail_Blue_List_Frameless"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/ui_blue_stdframe_bg" />
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -1,47 +1,46 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="left"
|
||||
style="@style/AndorsTrail_Blue_TabFrame"
|
||||
android:orientation="vertical">
|
||||
style="@style/AndorsTrail_Blue_TabFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="left"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/AndorsTrail_Blue_StdFrame"
|
||||
android:orientation="horizontal">
|
||||
<LinearLayout
|
||||
style="@style/AndorsTrail_Blue_StdFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/shop_gc"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableLeft="@drawable/ui_icon_coins"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_gravity="left"
|
||||
/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
/>
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/shoplist_sort_filters"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:orientation="horizontal"
|
||||
android:layout_gravity="right"
|
||||
android:prompt="@string/shop_item_sort" />
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
android:id="@+id/shop_gc"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="left"
|
||||
android:drawableLeft="@drawable/ui_icon_coins"
|
||||
android:gravity="center_vertical" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.2" />
|
||||
|
||||
<ListView
|
||||
android:id="@+id/shop_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
<Button
|
||||
android:id="@+id/shoplist_sort_filters"
|
||||
style="@style/AndorsTrail_Blue_SpinnerEmulator"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="right"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="left"
|
||||
android:orientation="horizontal" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
<ListView
|
||||
android:id="@+id/shop_list"
|
||||
style="@style/AndorsTrail_Blue_List_Frameless"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -30,7 +30,7 @@
|
||||
<item name="android:windowIsTranslucent">true</item>
|
||||
<item name="android:checkboxStyle">@style/AndorsTrail_Blue_Checkbox</item>
|
||||
<item name="android:radioButtonStyle">@style/AndorsTrail_Blue_RadioButton</item>
|
||||
<item name="android:listViewStyle">@style/AndorsTrail_Blue_List</item>
|
||||
<item name="android:listViewStyle">@style/AndorsTrail_Blue_List</item>
|
||||
<item name="android:spinnerStyle">@style/AndorsTrail_Blue_Spinner</item>
|
||||
<item name="android:spinnerDropDownItemStyle">@style/AndorsTrail_Blue_SpinnerDropDown</item>
|
||||
<item name="android:dialogTheme">@style/AndorsTrailStyle.Dialog</item>
|
||||
|
||||
@@ -63,6 +63,12 @@
|
||||
<!-- <item name="android:dividerHeight">1dp</item> -->
|
||||
</style>
|
||||
|
||||
<style name="AndorsTrail_Blue_List_Frameless" parent="android:style/Widget.ListView">
|
||||
<item name="android:background">@android:color/transparent</item>
|
||||
<item name="android:divider">@drawable/ui_blue_listseparator</item>
|
||||
<!-- <item name="android:dividerHeight">1dp</item> -->
|
||||
</style>
|
||||
|
||||
<style name="AndorsTrail_Blue_TextButton" parent="android:style/Widget.Button">
|
||||
<item name="android:background">@drawable/ui_blue_textbutton</item>
|
||||
<item name="android:textColor">@color/ui_blue_textbutton_textcolor</item>
|
||||
|
||||
@@ -182,12 +182,13 @@ public final class Dialogs {
|
||||
|
||||
public static void showGroundLoot(final MainActivity mainActivity, final ControllerContext controllers, final WorldContext world, final Loot loot, final String msg) {
|
||||
showLoot(mainActivity, controllers, world, loot, Collections.singletonList(loot), R.string.dialog_groundloot_title, msg);
|
||||
}
|
||||
}
|
||||
|
||||
private static void showLoot(final MainActivity mainActivity, final ControllerContext controllers, final WorldContext world, final Loot combinedLoot, final Iterable<Loot> lootBags, final int title, final String msg) {
|
||||
final ListView itemList = new ListView(mainActivity);
|
||||
itemList.setBackgroundResource(android.R.color.transparent);
|
||||
itemList.setLayoutParams(new ListView.LayoutParams(ListView.LayoutParams.MATCH_PARENT, ListView.LayoutParams.WRAP_CONTENT));
|
||||
// itemList.setPadding(20, 0, 20, 20);
|
||||
// itemList.setPadding(20, 0, 20, 20);
|
||||
itemList.setAdapter(new ItemContainerAdapter(mainActivity, world.tileManager, combinedLoot.items, world.model.player));
|
||||
|
||||
final Dialog d = CustomDialogFactory.createDialog(mainActivity,
|
||||
@@ -195,8 +196,8 @@ public final class Dialogs {
|
||||
mainActivity.getResources().getDrawable(R.drawable.ui_icon_equipment),
|
||||
msg,
|
||||
combinedLoot.items.isEmpty() ? null : itemList,
|
||||
true);
|
||||
|
||||
true);
|
||||
|
||||
itemList.setOnItemClickListener(new OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
|
||||
@@ -229,9 +230,9 @@ public final class Dialogs {
|
||||
controllers.itemController.pickupAll(lootBags);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
CustomDialogFactory.addDismissButton(d, R.string.dialog_close);
|
||||
|
||||
|
||||
showDialogAndPause(d, controllers, new OnDismissListener() {
|
||||
@Override
|
||||
public void onDismiss(DialogInterface arg0) {
|
||||
@@ -258,71 +259,71 @@ public final class Dialogs {
|
||||
}
|
||||
|
||||
public static void showConfirmRest(final Activity currentActivity, final ControllerContext controllerContext, final MapObject area) {
|
||||
// Dialog d = new AlertDialog.Builder(new ContextThemeWrapper(currentActivity, R.style.AndorsTrailStyle))
|
||||
// .setTitle(R.string.dialog_rest_title)
|
||||
// .setMessage(R.string.dialog_rest_confirm_message)
|
||||
// .setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {
|
||||
// @Override
|
||||
// public void onClick(DialogInterface dialog, int which) {
|
||||
// controllerContext.mapController.rest(area);
|
||||
// }
|
||||
// })
|
||||
|
||||
//
|
||||
// .setNegativeButton(android.R.string.no, null)
|
||||
// .create();
|
||||
// Dialog d = new AlertDialog.Builder(new ContextThemeWrapper(currentActivity, R.style.AndorsTrailStyle))
|
||||
// .setTitle(R.string.dialog_rest_title)
|
||||
// .setMessage(R.string.dialog_rest_confirm_message)
|
||||
// .setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {
|
||||
// @Override
|
||||
// public void onClick(DialogInterface dialog, int which) {
|
||||
// controllerContext.mapController.rest(area);
|
||||
// }
|
||||
// })
|
||||
|
||||
//
|
||||
// .setNegativeButton(android.R.string.no, null)
|
||||
// .create();
|
||||
final Dialog d = CustomDialogFactory.createDialog(currentActivity,
|
||||
currentActivity.getResources().getString(R.string.dialog_rest_title),
|
||||
null,
|
||||
currentActivity.getResources().getString(R.string.dialog_rest_confirm_message),
|
||||
null,
|
||||
true);
|
||||
|
||||
|
||||
CustomDialogFactory.addButton(d, android.R.string.yes, new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
controllerContext.mapController.rest(area);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
CustomDialogFactory.addDismissButton(d, android.R.string.no);
|
||||
|
||||
showDialogAndPause(d, controllerContext);
|
||||
}
|
||||
public static void showRested(final Activity currentActivity, final ControllerContext controllerContext) {
|
||||
// Dialog d = new AlertDialog.Builder(new ContextThemeWrapper(currentActivity, R.style.AndorsTrailStyle))
|
||||
// .setTitle(R.string.dialog_rest_title)
|
||||
// .setMessage(R.string.dialog_rest_message)
|
||||
// .setNeutralButton(android.R.string.ok, null)
|
||||
// .create();
|
||||
// Dialog d = new AlertDialog.Builder(new ContextThemeWrapper(currentActivity, R.style.AndorsTrailStyle))
|
||||
// .setTitle(R.string.dialog_rest_title)
|
||||
// .setMessage(R.string.dialog_rest_message)
|
||||
// .setNeutralButton(android.R.string.ok, null)
|
||||
// .create();
|
||||
final Dialog d = CustomDialogFactory.createDialog(currentActivity,
|
||||
currentActivity.getResources().getString(R.string.dialog_rest_title),
|
||||
null,
|
||||
currentActivity.getResources().getString(R.string.dialog_rest_message),
|
||||
null,
|
||||
true);
|
||||
|
||||
|
||||
|
||||
|
||||
CustomDialogFactory.addDismissButton(d, android.R.string.ok);
|
||||
|
||||
showDialogAndPause(d, controllerContext);
|
||||
}
|
||||
|
||||
public static void showNewVersion(final Activity currentActivity) {
|
||||
// new AlertDialog.Builder(new ContextThemeWrapper(currentActivity, R.style.AndorsTrailStyle))
|
||||
// .setTitle(R.string.dialog_newversion_title)
|
||||
// .setMessage(R.string.dialog_newversion_message)
|
||||
// .setNeutralButton(android.R.string.ok, null)
|
||||
// .show();
|
||||
|
||||
// new AlertDialog.Builder(new ContextThemeWrapper(currentActivity, R.style.AndorsTrailStyle))
|
||||
// .setTitle(R.string.dialog_newversion_title)
|
||||
// .setMessage(R.string.dialog_newversion_message)
|
||||
// .setNeutralButton(android.R.string.ok, null)
|
||||
// .show();
|
||||
|
||||
final Dialog d = CustomDialogFactory.createDialog(currentActivity,
|
||||
currentActivity.getResources().getString(R.string.dialog_newversion_title),
|
||||
null,
|
||||
currentActivity.getResources().getString(R.string.dialog_newversion_message),
|
||||
null,
|
||||
true);
|
||||
|
||||
|
||||
|
||||
|
||||
CustomDialogFactory.addDismissButton(d, android.R.string.ok);
|
||||
|
||||
CustomDialogFactory.show(d);
|
||||
@@ -386,34 +387,32 @@ public final class Dialogs {
|
||||
}
|
||||
|
||||
public static void showCombatLog(final Context context, final ControllerContext controllerContext, final WorldContext world) {
|
||||
final String[] combatLogMessages = world.model.combatLog.getAllMessages();
|
||||
String[] combatLogMessages = world.model.combatLog.getAllMessages();
|
||||
|
||||
View view = null;
|
||||
String msg = null;
|
||||
if (combatLogMessages.length > 0) {
|
||||
ListView itemList = null;
|
||||
itemList = new ListView(context);
|
||||
itemList.setLayoutParams(new ListView.LayoutParams(ListView.LayoutParams.MATCH_PARENT, ListView.LayoutParams.WRAP_CONTENT));
|
||||
itemList.setStackFromBottom(true);
|
||||
itemList.setTranscriptMode(ListView.TRANSCRIPT_MODE_ALWAYS_SCROLL);
|
||||
itemList.setChoiceMode(ListView.CHOICE_MODE_NONE);
|
||||
itemList.setBackgroundResource(R.color.ui_blue_stdframe_bg);
|
||||
itemList.setAdapter(new ArrayAdapter<String>(context, R.layout.combatlog_row, android.R.id.text1, combatLogMessages));
|
||||
view = itemList;
|
||||
} else {
|
||||
msg = context.getResources().getString(R.string.combat_log_noentries);
|
||||
ListView itemList = null;
|
||||
itemList = new ListView(context);
|
||||
itemList.setLayoutParams(new ListView.LayoutParams(ListView.LayoutParams.MATCH_PARENT, ListView.LayoutParams.WRAP_CONTENT));
|
||||
itemList.setStackFromBottom(true);
|
||||
itemList.setTranscriptMode(ListView.TRANSCRIPT_MODE_ALWAYS_SCROLL);
|
||||
itemList.setChoiceMode(ListView.CHOICE_MODE_NONE);
|
||||
itemList.setBackgroundResource(R.color.ui_blue_stdframe_bg);
|
||||
if (combatLogMessages.length <= 0) {
|
||||
combatLogMessages = new String[] {context.getResources().getString(R.string.combat_log_noentries)};
|
||||
}
|
||||
itemList.setAdapter(new ArrayAdapter<String>(context, R.layout.combatlog_row, android.R.id.text1, combatLogMessages));
|
||||
view = itemList;
|
||||
|
||||
final Dialog d = CustomDialogFactory.createDialog(context,
|
||||
context.getResources().getString(R.string.combat_log_title),
|
||||
context.getResources().getDrawable(R.drawable.ui_icon_combat),
|
||||
msg,
|
||||
null,
|
||||
view,
|
||||
true);
|
||||
|
||||
|
||||
|
||||
|
||||
CustomDialogFactory.addDismissButton(d, R.string.dialog_close);
|
||||
|
||||
|
||||
showDialogAndPause(d, controllerContext);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
package com.gpl.rpg.AndorsTrail.activity;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceActivity;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import com.gpl.rpg.AndorsTrail.AndorsTrailApplication;
|
||||
import com.gpl.rpg.AndorsTrail.R;
|
||||
|
||||
public final class Preferences extends PreferenceActivity {
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
super.onCreate(savedInstanceState);
|
||||
if (AndorsTrailApplication.getApplicationFromActivity(this).getPreferences().fullscreen) {
|
||||
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
||||
} else {
|
||||
getWindow().setFlags(0, WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
||||
}
|
||||
addPreferencesFromResource(R.xml.preferences);
|
||||
}
|
||||
}
|
||||
package com.gpl.rpg.AndorsTrail.activity;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceActivity;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import com.gpl.rpg.AndorsTrail.AndorsTrailApplication;
|
||||
import com.gpl.rpg.AndorsTrail.R;
|
||||
|
||||
public final class Preferences extends PreferenceActivity {
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
super.onCreate(savedInstanceState);
|
||||
if (AndorsTrailApplication.getApplicationFromActivity(this).getPreferences().fullscreen) {
|
||||
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
||||
} else {
|
||||
getWindow().setFlags(0, WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
||||
}
|
||||
addPreferencesFromResource(R.xml.preferences);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,130 +1,131 @@
|
||||
package com.gpl.rpg.AndorsTrail.activity.fragment;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
||||
import android.content.res.Resources;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.ListView;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.gpl.rpg.AndorsTrail.AndorsTrailApplication;
|
||||
import com.gpl.rpg.AndorsTrail.Dialogs;
|
||||
import com.gpl.rpg.AndorsTrail.R;
|
||||
import com.gpl.rpg.AndorsTrail.context.WorldContext;
|
||||
import com.gpl.rpg.AndorsTrail.model.actor.Monster;
|
||||
import com.gpl.rpg.AndorsTrail.model.actor.Player;
|
||||
import com.gpl.rpg.AndorsTrail.model.item.ItemContainer;
|
||||
import com.gpl.rpg.AndorsTrail.resource.tiles.TileCollection;
|
||||
import com.gpl.rpg.AndorsTrail.view.ShopItemContainerAdapter;
|
||||
import com.gpl.rpg.AndorsTrail.view.ShopItemContainerAdapter.OnContainerItemClickedListener;
|
||||
|
||||
public abstract class ShopActivityFragment extends Fragment implements OnContainerItemClickedListener {
|
||||
|
||||
protected static final int INTENTREQUEST_ITEMINFO = 3;
|
||||
protected static final int INTENTREQUEST_BULKSELECT = 9;
|
||||
|
||||
protected WorldContext world;
|
||||
protected Player player;
|
||||
|
||||
protected ItemContainer shopInventory;
|
||||
private TextView shop_gc;
|
||||
private ShopItemContainerAdapter listAdapter;
|
||||
private Spinner shoplist_sort;
|
||||
|
||||
protected abstract boolean isSellingInterface();
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
final AndorsTrailApplication app = AndorsTrailApplication.getApplicationFromActivity(getActivity());
|
||||
if (!app.isInitialized()) return;
|
||||
this.world = app.getWorld();
|
||||
this.player = world.model.player;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
View v = inflater.inflate(R.layout.shoplist, container, false);
|
||||
|
||||
final Monster npc = Dialogs.getMonsterFromIntent(getActivity().getIntent(), world);
|
||||
|
||||
final Resources res = getResources();
|
||||
|
||||
shop_gc = (TextView) v.findViewById(R.id.shop_gc);
|
||||
|
||||
ListView shoplist = (ListView) v.findViewById(R.id.shop_list);
|
||||
|
||||
shopInventory = npc.getShopItems(player);
|
||||
|
||||
HashSet<Integer> iconIDs = world.tileManager.getTileIDsFor(shopInventory);
|
||||
iconIDs.addAll(world.tileManager.getTileIDsFor(player.inventory));
|
||||
TileCollection tiles = world.tileManager.loadTilesFor(iconIDs, res);
|
||||
final boolean isSelling = isSellingInterface();
|
||||
listAdapter = new ShopItemContainerAdapter(getActivity(), tiles, world.tileManager, player, isSelling ? player.inventory : shopInventory, this, isSelling);
|
||||
shoplist.setAdapter(listAdapter);
|
||||
|
||||
//Initiating drop-down list for category filters
|
||||
shoplist_sort = (Spinner) v.findViewById(R.id.shoplist_sort_filters);
|
||||
ArrayAdapter<CharSequence> sortFilterAdapter = ArrayAdapter.createFromResource(getActivity(), R.array.shoplist_sort_filters, android.R.layout.simple_spinner_item);
|
||||
sortFilterAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||
shoplist_sort.setAdapter(sortFilterAdapter);
|
||||
shoplist_sort.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
|
||||
world.model.uiSelections.selectedShopSort = shoplist_sort.getSelectedItemPosition();
|
||||
reloadShownSort(isSelling ? player.inventory : shopInventory);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNothingSelected(AdapterView<?> arg0) {
|
||||
world.model.uiSelections.selectedShopSort = 0;
|
||||
}
|
||||
});
|
||||
shoplist_sort.setSelection(world.model.uiSelections.selectedShopSort);
|
||||
|
||||
return v;
|
||||
}
|
||||
|
||||
private void reloadShownSort(ItemContainer itemContainer) {
|
||||
listAdapter.reloadShownSort(world.model.uiSelections.selectedShopSort, itemContainer, player);
|
||||
listAdapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
update();
|
||||
}
|
||||
|
||||
private Toast lastToast = null;
|
||||
protected void displayStoreAction(final String msg) {
|
||||
if (lastToast != null) {
|
||||
lastToast.setText(msg);
|
||||
} else {
|
||||
lastToast = Toast.makeText(getActivity(), msg, Toast.LENGTH_SHORT);
|
||||
}
|
||||
lastToast.show();
|
||||
update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
lastToast = null;
|
||||
}
|
||||
|
||||
protected void update() {
|
||||
listAdapter.notifyDataSetChanged();
|
||||
String gc = getResources().getString(R.string.shop_yourgold, player.getGold());
|
||||
shop_gc.setText(gc);
|
||||
}
|
||||
}
|
||||
package com.gpl.rpg.AndorsTrail.activity.fragment;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
||||
import android.content.res.Resources;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.Button;
|
||||
import android.widget.ListView;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.gpl.rpg.AndorsTrail.AndorsTrailApplication;
|
||||
import com.gpl.rpg.AndorsTrail.Dialogs;
|
||||
import com.gpl.rpg.AndorsTrail.R;
|
||||
import com.gpl.rpg.AndorsTrail.context.WorldContext;
|
||||
import com.gpl.rpg.AndorsTrail.model.actor.Monster;
|
||||
import com.gpl.rpg.AndorsTrail.model.actor.Player;
|
||||
import com.gpl.rpg.AndorsTrail.model.item.ItemContainer;
|
||||
import com.gpl.rpg.AndorsTrail.resource.tiles.TileCollection;
|
||||
import com.gpl.rpg.AndorsTrail.view.ShopItemContainerAdapter;
|
||||
import com.gpl.rpg.AndorsTrail.view.SpinnerEmulator;
|
||||
import com.gpl.rpg.AndorsTrail.view.ShopItemContainerAdapter.OnContainerItemClickedListener;
|
||||
|
||||
public abstract class ShopActivityFragment extends Fragment implements OnContainerItemClickedListener {
|
||||
|
||||
protected static final int INTENTREQUEST_ITEMINFO = 3;
|
||||
protected static final int INTENTREQUEST_BULKSELECT = 9;
|
||||
|
||||
protected WorldContext world;
|
||||
protected Player player;
|
||||
|
||||
protected ItemContainer shopInventory;
|
||||
private TextView shop_gc;
|
||||
private ShopItemContainerAdapter listAdapter;
|
||||
private Button shoplist_sort;
|
||||
|
||||
protected abstract boolean isSellingInterface();
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
final AndorsTrailApplication app = AndorsTrailApplication.getApplicationFromActivity(getActivity());
|
||||
if (!app.isInitialized()) return;
|
||||
this.world = app.getWorld();
|
||||
this.player = world.model.player;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
View v = inflater.inflate(R.layout.shoplist, container, false);
|
||||
|
||||
final Monster npc = Dialogs.getMonsterFromIntent(getActivity().getIntent(), world);
|
||||
|
||||
final Resources res = getResources();
|
||||
|
||||
shop_gc = (TextView) v.findViewById(R.id.shop_gc);
|
||||
|
||||
ListView shoplist = (ListView) v.findViewById(R.id.shop_list);
|
||||
|
||||
shopInventory = npc.getShopItems(player);
|
||||
|
||||
HashSet<Integer> iconIDs = world.tileManager.getTileIDsFor(shopInventory);
|
||||
iconIDs.addAll(world.tileManager.getTileIDsFor(player.inventory));
|
||||
TileCollection tiles = world.tileManager.loadTilesFor(iconIDs, res);
|
||||
final boolean isSelling = isSellingInterface();
|
||||
listAdapter = new ShopItemContainerAdapter(getActivity(), tiles, world.tileManager, player, isSelling ? player.inventory : shopInventory, this, isSelling);
|
||||
shoplist.setAdapter(listAdapter);
|
||||
|
||||
//Initiating drop-down list for category filters
|
||||
shoplist_sort = (Button) v.findViewById(R.id.shoplist_sort_filters);
|
||||
new SpinnerEmulator(v, R.id.shoplist_sort_filters, R.array.shoplist_sort_filters, R.string.shop_item_sort) {
|
||||
@Override
|
||||
public void setValue(int value) {
|
||||
world.model.uiSelections.selectedShopSort = value;
|
||||
}
|
||||
@Override
|
||||
public void selectionChanged(int value) {
|
||||
reloadShownSort(isSelling ? player.inventory : shopInventory);
|
||||
}
|
||||
@Override
|
||||
public int getValue() {
|
||||
return world.model.uiSelections.selectedShopSort;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
return v;
|
||||
}
|
||||
|
||||
private void reloadShownSort(ItemContainer itemContainer) {
|
||||
listAdapter.reloadShownSort(world.model.uiSelections.selectedShopSort, itemContainer, player);
|
||||
listAdapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
update();
|
||||
}
|
||||
|
||||
private Toast lastToast = null;
|
||||
protected void displayStoreAction(final String msg) {
|
||||
if (lastToast != null) {
|
||||
lastToast.setText(msg);
|
||||
} else {
|
||||
lastToast = Toast.makeText(getActivity(), msg, Toast.LENGTH_SHORT);
|
||||
}
|
||||
lastToast.show();
|
||||
update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
lastToast = null;
|
||||
}
|
||||
|
||||
protected void update() {
|
||||
listAdapter.notifyDataSetChanged();
|
||||
String gc = getResources().getString(R.string.shop_yourgold, player.getGold());
|
||||
shop_gc.setText(gc);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,8 +47,8 @@ public class CustomDialogFactory {
|
||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
dialog.setContentView(R.layout.custom_dialog_title_icon);
|
||||
dialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent);
|
||||
dialog.getWindow().getAttributes().width=WindowManager.LayoutParams.MATCH_PARENT;
|
||||
dialog.getWindow().getAttributes().height=WindowManager.LayoutParams.MATCH_PARENT;
|
||||
// dialog.getWindow().getAttributes().width=WindowManager.LayoutParams.MATCH_PARENT;
|
||||
// dialog.getWindow().getAttributes().height=WindowManager.LayoutParams.MATCH_PARENT;
|
||||
if (((AndorsTrailApplication)context.getApplicationContext()).getPreferences().fullscreen) {
|
||||
dialog.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
||||
} else {
|
||||
|
||||
@@ -52,6 +52,7 @@ public class CustomListPreference extends ListPreference {
|
||||
private void createDialog() {
|
||||
final ListView choicesList = new ListView(getContext());
|
||||
choicesList.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
|
||||
choicesList.setBackgroundResource(android.R.color.transparent);
|
||||
ArrayAdapter<CharSequence> choicesAdapter = new ArrayAdapter<CharSequence>(getContext(), R.layout.custom_checkedlistitem_layout, getEntries());
|
||||
choicesList.setLayoutParams(new ListView.LayoutParams(ListView.LayoutParams.MATCH_PARENT, ListView.LayoutParams.WRAP_CONTENT));
|
||||
choicesList.setAdapter(choicesAdapter);
|
||||
|
||||
@@ -1,74 +1,75 @@
|
||||
package com.gpl.rpg.AndorsTrail.view;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.Button;
|
||||
import android.widget.ListView;
|
||||
|
||||
/**
|
||||
* Simply instantiate this class, implement abstract methods in an anonymous type, and tada, your Button is a Spinner!
|
||||
*/
|
||||
public abstract class SpinnerEmulator {
|
||||
|
||||
private Button spinnerButton;
|
||||
private Dialog spinnerDialog = null;
|
||||
private ListView choicesList;
|
||||
private Context context;
|
||||
|
||||
public SpinnerEmulator(Button b, int arrayResId, int promptResId) {
|
||||
spinnerButton = b;
|
||||
context=b.getContext();
|
||||
initializeSpinnerEmulation(arrayResId, promptResId);
|
||||
}
|
||||
|
||||
|
||||
public SpinnerEmulator(View v, int buttonId, int arrayResId, int promptResId) {
|
||||
spinnerButton = (Button) v.findViewById(buttonId);
|
||||
context=v.getContext();
|
||||
initializeSpinnerEmulation(arrayResId, promptResId);
|
||||
}
|
||||
|
||||
public void initializeSpinnerEmulation(final int arrayResId, final int promptResId) {
|
||||
choicesList = new ListView(context);//(Spinner) v.findViewById(R.id.inventorylist_category_filters);
|
||||
ArrayAdapter<CharSequence> skillCategoryFilterAdapter = ArrayAdapter.createFromResource(context, arrayResId, android.R.layout.simple_list_item_1);
|
||||
choicesList.setLayoutParams(new ListView.LayoutParams(ListView.LayoutParams.MATCH_PARENT, ListView.LayoutParams.WRAP_CONTENT));
|
||||
choicesList.setAdapter(skillCategoryFilterAdapter);
|
||||
choicesList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||
if (getValue() == position) {
|
||||
spinnerDialog.dismiss();
|
||||
return;
|
||||
}
|
||||
setValue(position);
|
||||
spinnerButton.setText(context.getResources().getStringArray(arrayResId)[position]);
|
||||
spinnerDialog.dismiss();
|
||||
selectionChanged(position);
|
||||
}
|
||||
});
|
||||
choicesList.setSelection(getValue());
|
||||
|
||||
spinnerButton.setText(context.getResources().getStringArray(arrayResId)[getValue()]);
|
||||
spinnerButton.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (spinnerDialog == null) {
|
||||
spinnerDialog = CustomDialogFactory.createDialog(context, context.getString(promptResId), null, null, choicesList, false);
|
||||
}
|
||||
CustomDialogFactory.show(spinnerDialog);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
public abstract int getValue();
|
||||
public abstract void setValue(int value);
|
||||
public abstract void selectionChanged(int value);
|
||||
|
||||
}
|
||||
package com.gpl.rpg.AndorsTrail.view;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.Button;
|
||||
import android.widget.ListView;
|
||||
|
||||
/**
|
||||
* Simply instantiate this class, implement abstract methods in an anonymous type, and tada, your Button is a Spinner!
|
||||
*/
|
||||
public abstract class SpinnerEmulator {
|
||||
|
||||
private Button spinnerButton;
|
||||
private Dialog spinnerDialog = null;
|
||||
private ListView choicesList;
|
||||
private Context context;
|
||||
|
||||
public SpinnerEmulator(Button b, int arrayResId, int promptResId) {
|
||||
spinnerButton = b;
|
||||
context=b.getContext();
|
||||
initializeSpinnerEmulation(arrayResId, promptResId);
|
||||
}
|
||||
|
||||
|
||||
public SpinnerEmulator(View v, int buttonId, int arrayResId, int promptResId) {
|
||||
spinnerButton = (Button) v.findViewById(buttonId);
|
||||
context=v.getContext();
|
||||
initializeSpinnerEmulation(arrayResId, promptResId);
|
||||
}
|
||||
|
||||
public void initializeSpinnerEmulation(final int arrayResId, final int promptResId) {
|
||||
choicesList = new ListView(context);//(Spinner) v.findViewById(R.id.inventorylist_category_filters);
|
||||
choicesList.setBackgroundResource(android.R.color.transparent);
|
||||
ArrayAdapter<CharSequence> skillCategoryFilterAdapter = ArrayAdapter.createFromResource(context, arrayResId, android.R.layout.simple_list_item_1);
|
||||
choicesList.setLayoutParams(new ListView.LayoutParams(ListView.LayoutParams.MATCH_PARENT, ListView.LayoutParams.WRAP_CONTENT));
|
||||
choicesList.setAdapter(skillCategoryFilterAdapter);
|
||||
choicesList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||
if (getValue() == position) {
|
||||
spinnerDialog.dismiss();
|
||||
return;
|
||||
}
|
||||
setValue(position);
|
||||
spinnerButton.setText(context.getResources().getStringArray(arrayResId)[position]);
|
||||
spinnerDialog.dismiss();
|
||||
selectionChanged(position);
|
||||
}
|
||||
});
|
||||
choicesList.setSelection(getValue());
|
||||
|
||||
spinnerButton.setText(context.getResources().getStringArray(arrayResId)[getValue()]);
|
||||
spinnerButton.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (spinnerDialog == null) {
|
||||
spinnerDialog = CustomDialogFactory.createDialog(context, context.getString(promptResId), null, null, choicesList, false);
|
||||
}
|
||||
CustomDialogFactory.show(spinnerDialog);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
public abstract int getValue();
|
||||
public abstract void setValue(int value);
|
||||
public abstract void selectionChanged(int value);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user