Two new fragments added to the main activity. One of which is the puzzle list on view grid.

This commit is contained in:
2013-05-21 19:25:09 +04:00
parent 1df94e2013
commit 704bc3c646
15 changed files with 570 additions and 155 deletions

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
** Copyright 2011, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:interpolator="@android:anim/accelerate_interpolator"
android:fromXDelta="100%"
android:toXDelta="0%"
android:fromYDelta="0"
android:toYDelta="0"
android:duration="@android:integer/config_mediumAnimTime" />
</set>

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
** Copyright 2011, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:interpolator="@android:anim/accelerate_interpolator"
android:fromXDelta="0%"
android:toXDelta="-100%"
android:fromYDelta="0"
android:toYDelta="0"
android:duration="@android:integer/config_mediumAnimTime" />
</set>

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
** Copyright 2011, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:interpolator="@android:anim/accelerate_interpolator"
android:fromXDelta="-100%"
android:toXDelta="0"
android:fromYDelta="0"
android:toYDelta="0"
android:duration="@android:integer/config_mediumAnimTime" />
</set>

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
** Copyright 2011, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:interpolator="@android:anim/accelerate_interpolator"
android:fromXDelta="0%"
android:toXDelta="100%"
android:fromYDelta="0"
android:toYDelta="0"
android:duration="@android:integer/config_mediumAnimTime" />
</set>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/fragment_container"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
</LinearLayout>

View File

@@ -0,0 +1,61 @@
<?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"
android:background="@drawable/splash"
android:gravity="center_vertical">
<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_gravity="top"
android:layout_weight="1"
android:gravity="center" />
<Button
android:id="@+id/btn_start"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/main_menu_btn_vmargin"
android:layout_marginBottom="@dimen/main_menu_btn_vmargin"
android:layout_marginLeft="@dimen/main_menu_btn_hmargin"
android:layout_marginRight="@dimen/main_menu_btn_hmargin"
android:layout_gravity="center"
android:layout_weight="0"
android:padding="@dimen/main_menu_btn_padding"
android:background="@color/main_menu_btn_bg"
android:textColor="@color/main_menu_btn_text"
android:textSize="@dimen/main_menu_text_size"
android:text="@string/btn_start_continue"
android:onClick="onStartCurrentPuzzle" />
<Button
android:id="@+id/btn_puzzles"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/main_menu_btn_vmargin"
android:layout_marginBottom="@dimen/main_menu_btn_vmargin"
android:layout_marginLeft="@dimen/main_menu_btn_hmargin"
android:layout_marginRight="@dimen/main_menu_btn_hmargin"
android:layout_gravity="center"
android:layout_weight="0"
android:padding="@dimen/main_menu_btn_padding"
android:background="@color/main_menu_btn_bg"
android:textColor="@color/main_menu_btn_text"
android:textSize="@dimen/main_menu_text_size"
android:text="@string/btn_puzzles"
android:onClick="onPuzzleListShow" />
<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_gravity="bottom"
android:layout_weight="1"
android:gravity="center" />
<TextView
android:id="@+id/footer_txt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/git_version"
android:layout_gravity="bottom"
android:layout_weight="0"
android:gravity="center" />
</LinearLayout>

View File

@@ -3,7 +3,6 @@
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<GridView
android:id="@+id/puzzle_grid"
android:layout_width="match_parent"
@@ -14,14 +13,5 @@
android:numColumns="auto_fit"
android:stretchMode="columnWidth"
android:gravity="center" />
<Button
android:id="@+id/btn_start"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="onStartCurrentPuzzle"
android:text="Start" />
</LinearLayout>

23
res/values/colors.xml Normal file
View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2008, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<resources>
<color name="main_menu_btn_bg">#80404040</color>
<color name="main_menu_btn_text">#C0C0C0C0</color>
</resources>

26
res/values/dimens.xml Normal file
View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2008, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<resources>
<dimen name="main_menu_text_size">18pt</dimen>
<dimen name="main_menu_btn_hmargin">10pt</dimen>
<dimen name="main_menu_btn_vmargin">2pt</dimen>
<dimen name="main_menu_btn_padding">10pt</dimen>
</resources>

View File

@@ -3,4 +3,9 @@
<string name="app_name">Free Sokoban</string>
<string name="menu">Menu</string>
<string name="play_activity">play_activity</string>
<string name="btn_start_begin">Begin</string>
<string name="btn_start_continue">Continue</string>
<string name="btn_puzzles">Puzzles</string>
<string name="version_tag">Version:</string>
<string name="copyright">(c) 2013 Vahagn Khachatryan</string>
</resources>

35
res/values/styles.xml Normal file
View File

@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!--style name="WindowTitle">
<item name="android:singleLine">true</item-->
<!--item name="android:textAppearance">@style/TextAppearance.WindowTitle</item-->
<!-- item name="android:shadowColor">#BB000000</item>
<item name="android:shadowRadius">2.75</item>
</style-->
<!-- Base application theme is the default theme. -->
<!--style name="Theme.puzzle_view_title" parent="android:Theme"-->
<!--style name="puzzle_view_title_layout">
<item name="android:windowTitleStyle">@style/title_bar</item>
<item name="android:windowTitleSize">10mm</item-->
<!--item name="android:windowTitleBackgroundStyle">@style/title_background</item-->
<!--/style-->
<!--style name="title_bar">
<item name="android:singleLine">false</item>
<item name="android:textAppearance">@android:style/TextAppearance.WindowTitle</item>
<item name="android:shadowColor">#BB0000FF</item>
<item name="android:shadowRadius">2.75</item>
</style-->
<!--style name="title_background">
<item name="android:background">@drawable/background_square</item>
</style-->
<!--style name="PlainText">
<item name="android:textAppearance">@style/TextAppearance.Theme.PlainText</item>
</style-->
<!--style name="ImageView240dpi">
<item name="android:src">@drawable/stylogo240dpi</item>
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
</style-->
</resources>