diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml
index f1cf86c..45989a8 100644
--- a/android/AndroidManifest.xml
+++ b/android/AndroidManifest.xml
@@ -14,23 +14,11 @@
android:label="@string/app_name"
android:theme="@style/AppTheme"
android:hardwareAccelerated="true" >
-
-
-
-
-
-
-
-
+ android:label="@string/app_name"
+ android:configChanges="orientation"
+ android:screenOrientation="portrait" >
diff --git a/android/res/drawable/agro_teaser.png b/android/res/drawable/agro_teaser.png
new file mode 100644
index 0000000..0d76ae0
Binary files /dev/null and b/android/res/drawable/agro_teaser.png differ
diff --git a/android/res/drawable/agro_teaser_button.xml b/android/res/drawable/agro_teaser_button.xml
new file mode 100644
index 0000000..5eab3fe
--- /dev/null
+++ b/android/res/drawable/agro_teaser_button.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/android/res/drawable/agro_teaser_darken.png b/android/res/drawable/agro_teaser_darken.png
new file mode 100644
index 0000000..5255c08
Binary files /dev/null and b/android/res/drawable/agro_teaser_darken.png differ
diff --git a/android/res/drawable/background.png b/android/res/drawable/background.png
index 7d139e6..524a705 100644
Binary files a/android/res/drawable/background.png and b/android/res/drawable/background.png differ
diff --git a/android/res/drawable/china_icon.png b/android/res/drawable/china_icon.png
index 5050f54..e0163f3 100644
Binary files a/android/res/drawable/china_icon.png and b/android/res/drawable/china_icon.png differ
diff --git a/android/res/drawable/china_icon_darken.png b/android/res/drawable/china_icon_darken.png
index 143483e..05aeca1 100644
Binary files a/android/res/drawable/china_icon_darken.png and b/android/res/drawable/china_icon_darken.png differ
diff --git a/android/res/drawable/culture_teaser.png b/android/res/drawable/culture_teaser.png
new file mode 100644
index 0000000..3023ad9
Binary files /dev/null and b/android/res/drawable/culture_teaser.png differ
diff --git a/android/res/drawable/culture_teaser_button.xml b/android/res/drawable/culture_teaser_button.xml
new file mode 100644
index 0000000..761e6c5
--- /dev/null
+++ b/android/res/drawable/culture_teaser_button.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/android/res/drawable/culture_teaser_darken.png b/android/res/drawable/culture_teaser_darken.png
new file mode 100644
index 0000000..4eef4c8
Binary files /dev/null and b/android/res/drawable/culture_teaser_darken.png differ
diff --git a/android/res/drawable/economics_teaser.png b/android/res/drawable/economics_teaser.png
new file mode 100644
index 0000000..1f7185c
Binary files /dev/null and b/android/res/drawable/economics_teaser.png differ
diff --git a/android/res/drawable/economics_teaser_button.xml b/android/res/drawable/economics_teaser_button.xml
new file mode 100644
index 0000000..778a0cc
--- /dev/null
+++ b/android/res/drawable/economics_teaser_button.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/android/res/drawable/economics_teaser_darken.png b/android/res/drawable/economics_teaser_darken.png
new file mode 100644
index 0000000..43bb7e9
Binary files /dev/null and b/android/res/drawable/economics_teaser_darken.png differ
diff --git a/android/res/drawable/education_teaser.png b/android/res/drawable/education_teaser.png
new file mode 100644
index 0000000..fd3455c
Binary files /dev/null and b/android/res/drawable/education_teaser.png differ
diff --git a/android/res/drawable/education_teaser_button.xml b/android/res/drawable/education_teaser_button.xml
new file mode 100644
index 0000000..226210c
--- /dev/null
+++ b/android/res/drawable/education_teaser_button.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/android/res/drawable/education_teaser_darken.png b/android/res/drawable/education_teaser_darken.png
new file mode 100644
index 0000000..c947085
Binary files /dev/null and b/android/res/drawable/education_teaser_darken.png differ
diff --git a/android/res/drawable/medicine_teaser.png b/android/res/drawable/medicine_teaser.png
new file mode 100644
index 0000000..218014c
Binary files /dev/null and b/android/res/drawable/medicine_teaser.png differ
diff --git a/android/res/drawable/medicine_teaser_button.xml b/android/res/drawable/medicine_teaser_button.xml
new file mode 100644
index 0000000..f90acb1
--- /dev/null
+++ b/android/res/drawable/medicine_teaser_button.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/android/res/drawable/medicine_teaser_darken.png b/android/res/drawable/medicine_teaser_darken.png
new file mode 100644
index 0000000..dffa9a6
Binary files /dev/null and b/android/res/drawable/medicine_teaser_darken.png differ
diff --git a/android/res/drawable/russia_icon.png b/android/res/drawable/russia_icon.png
index c3747f7..568822f 100644
Binary files a/android/res/drawable/russia_icon.png and b/android/res/drawable/russia_icon.png differ
diff --git a/android/res/drawable/russia_icon_darken.png b/android/res/drawable/russia_icon_darken.png
index 3ce3362..0a0f8d1 100644
Binary files a/android/res/drawable/russia_icon_darken.png and b/android/res/drawable/russia_icon_darken.png differ
diff --git a/android/res/drawable/sport_teaser.png b/android/res/drawable/sport_teaser.png
new file mode 100644
index 0000000..ec18d8c
Binary files /dev/null and b/android/res/drawable/sport_teaser.png differ
diff --git a/android/res/drawable/sport_teaser_button.xml b/android/res/drawable/sport_teaser_button.xml
new file mode 100644
index 0000000..6917bd4
--- /dev/null
+++ b/android/res/drawable/sport_teaser_button.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/android/res/drawable/sport_teaser_darken.png b/android/res/drawable/sport_teaser_darken.png
new file mode 100644
index 0000000..050aaca
Binary files /dev/null and b/android/res/drawable/sport_teaser_darken.png differ
diff --git a/android/res/drawable/test_drawer_icon.png b/android/res/drawable/test_drawer_icon.png
new file mode 100644
index 0000000..f17c614
Binary files /dev/null and b/android/res/drawable/test_drawer_icon.png differ
diff --git a/android/res/drawable/test_promstruct_rb.png b/android/res/drawable/test_promstruct_rb.png
new file mode 100644
index 0000000..bbaa506
Binary files /dev/null and b/android/res/drawable/test_promstruct_rb.png differ
diff --git a/android/res/drawable/test_teaser_bkg.png b/android/res/drawable/test_teaser_bkg.png
new file mode 100644
index 0000000..adc305f
Binary files /dev/null and b/android/res/drawable/test_teaser_bkg.png differ
diff --git a/android/res/drawable/test_teaser_bkg_button.xml b/android/res/drawable/test_teaser_bkg_button.xml
new file mode 100644
index 0000000..c76f008
--- /dev/null
+++ b/android/res/drawable/test_teaser_bkg_button.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/android/res/drawable/test_teaser_bkg_darken.png b/android/res/drawable/test_teaser_bkg_darken.png
new file mode 100644
index 0000000..58f036a
Binary files /dev/null and b/android/res/drawable/test_teaser_bkg_darken.png differ
diff --git a/android/res/drawable/test_umpo.png b/android/res/drawable/test_umpo.png
new file mode 100644
index 0000000..f29529e
Binary files /dev/null and b/android/res/drawable/test_umpo.png differ
diff --git a/android/res/drawable/tourism_teaser.png b/android/res/drawable/tourism_teaser.png
new file mode 100644
index 0000000..f38c438
Binary files /dev/null and b/android/res/drawable/tourism_teaser.png differ
diff --git a/android/res/drawable/tourism_teaser_button.xml b/android/res/drawable/tourism_teaser_button.xml
new file mode 100644
index 0000000..e8fbf92
--- /dev/null
+++ b/android/res/drawable/tourism_teaser_button.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/android/res/drawable/tourism_teaser_darken.png b/android/res/drawable/tourism_teaser_darken.png
new file mode 100644
index 0000000..50f068b
Binary files /dev/null and b/android/res/drawable/tourism_teaser_darken.png differ
diff --git a/android/res/drawable/transport_teaser.png b/android/res/drawable/transport_teaser.png
new file mode 100644
index 0000000..1f9b7c3
Binary files /dev/null and b/android/res/drawable/transport_teaser.png differ
diff --git a/android/res/drawable/transport_teaser_button.xml b/android/res/drawable/transport_teaser_button.xml
new file mode 100644
index 0000000..f8ff3a1
--- /dev/null
+++ b/android/res/drawable/transport_teaser_button.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/android/res/drawable/transport_teaser_darken.png b/android/res/drawable/transport_teaser_darken.png
new file mode 100644
index 0000000..f8de95f
Binary files /dev/null and b/android/res/drawable/transport_teaser_darken.png differ
diff --git a/android/res/drawable/united_states_icon.png b/android/res/drawable/united_states_icon.png
index 9506482..bba70d8 100644
Binary files a/android/res/drawable/united_states_icon.png and b/android/res/drawable/united_states_icon.png differ
diff --git a/android/res/drawable/united_states_icon_darken.png b/android/res/drawable/united_states_icon_darken.png
index d478e78..2c5411d 100644
Binary files a/android/res/drawable/united_states_icon_darken.png and b/android/res/drawable/united_states_icon_darken.png differ
diff --git a/android/res/layout/activity_main_fast.xml b/android/res/layout/activity_main_fast.xml
new file mode 100644
index 0000000..3e04c95
--- /dev/null
+++ b/android/res/layout/activity_main_fast.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/android/res/layout/drawer_list_element.xml b/android/res/layout/drawer_list_element.xml
new file mode 100644
index 0000000..61d9f5d
--- /dev/null
+++ b/android/res/layout/drawer_list_element.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
diff --git a/android/res/layout/fragment_main_page.xml b/android/res/layout/fragment_main_page.xml
index 2903e99..37531eb 100644
--- a/android/res/layout/fragment_main_page.xml
+++ b/android/res/layout/fragment_main_page.xml
@@ -2,6 +2,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
+ android:layout_margin="0dp"
android:background="@drawable/background"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
@@ -10,10 +11,19 @@
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="fishrungames.bashgid.MainPageFragment" >
-
-
+
+
+
diff --git a/android/res/layout/fragment_semidetails_page.xml b/android/res/layout/fragment_semidetails_page.xml
new file mode 100644
index 0000000..325ea40
--- /dev/null
+++ b/android/res/layout/fragment_semidetails_page.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
diff --git a/android/res/layout/semidetails_element.xml b/android/res/layout/semidetails_element.xml
new file mode 100644
index 0000000..2933794
--- /dev/null
+++ b/android/res/layout/semidetails_element.xml
@@ -0,0 +1,57 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/android/res/layout/teaser_list_element.xml b/android/res/layout/teaser_list_element.xml
index 7998428..8da0d0d 100644
--- a/android/res/layout/teaser_list_element.xml
+++ b/android/res/layout/teaser_list_element.xml
@@ -7,101 +7,14 @@
android:orientation="vertical"
android:showDividers="middle" >
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ android:layout_height="120dp"
+ android:background="@drawable/test_teaser_bkg_button"
+ android:text="Промышленность"
+ android:textColor="@color/text_white"
+ android:textSize="18sp"
+ android:textStyle="bold" />
diff --git a/android/res/values/colors.xml b/android/res/values/colors.xml
index 9983ad5..5da3e01 100644
--- a/android/res/values/colors.xml
+++ b/android/res/values/colors.xml
@@ -4,10 +4,13 @@
Bashgid
-#60E0E0E0
+#E0E0E0
#60d0d0d0
+
+#F0F0F0
-
+#2B517F
+
diff --git a/android/res/values/strings.xml b/android/res/values/strings.xml
index 679d4cd..1ce40bc 100644
--- a/android/res/values/strings.xml
+++ b/android/res/values/strings.xml
@@ -1,7 +1,7 @@
- Bashgid
+ Гид РБ
Section 1
Section 2
Section 3
diff --git a/android/src/fishrungames/bashgid/MainActivity.java b/android/src/fishrungames/bashgid/MainActivity.java
index 345ed96..14af836 100644
--- a/android/src/fishrungames/bashgid/MainActivity.java
+++ b/android/src/fishrungames/bashgid/MainActivity.java
@@ -22,21 +22,28 @@ import android.widget.TextView;
public class MainActivity extends ActionBarActivity {
+
+ static MainActivity instance = null;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
-
- setContentView(R.layout.activity_main);
-
-
+
+ setContentView(R.layout.activity_main);
+
getSupportActionBar().hide();
getSupportFragmentManager().beginTransaction().add(R.id.fragment_proto_container, new WelcomeFragment()).commit();
-
+ instance = this;
+
}
+ public static MainActivity getInstance()
+ {
+ return instance;
+
+ }
public void OnSelectEnglish(View view)
@@ -54,10 +61,15 @@ public class MainActivity extends ActionBarActivity {
OpenMainScreen();
}
+ public void OnSelectSemiDetails(Integer pos)
+ {
+ getSupportFragmentManager().beginTransaction().add(R.id.fragment_container, new SemiDetailsFragment()).addToBackStack(null).commit();
+ }
+
public void OpenMainScreen()
{
- getSupportActionBar().show();
+ //getSupportActionBar().show();
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_proto_container, new MainFragment()).commit();
diff --git a/android/src/fishrungames/bashgid/MainFragment.java b/android/src/fishrungames/bashgid/MainFragment.java
index 3f784c0..8e94fce 100644
--- a/android/src/fishrungames/bashgid/MainFragment.java
+++ b/android/src/fishrungames/bashgid/MainFragment.java
@@ -1,17 +1,83 @@
package fishrungames.bashgid;
+import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
+import android.view.ViewGroup.LayoutParams;
+import android.widget.BaseAdapter;
+import android.widget.ImageView;
+import android.widget.ListView;
+import android.widget.TextView;
public class MainFragment extends Fragment {
+ ListView left_drawer;
+
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_main, container, false);
+ left_drawer = (ListView) rootView.findViewById(R.id.left_drawer);
+
+ left_drawer.setAdapter(new DrawerAdapter(getActivity()));
+
return rootView;
}
+
+
+ public class DrawerAdapter extends BaseAdapter {
+ private Context mContext;
+
+ public DrawerAdapter(Context c) {
+ mContext = c;
+ }
+
+ public int getCount() {
+ return 3;
+ }
+
+ public Object getItem(int position) {
+ return null;
+ }
+
+ public long getItemId(int position) {
+ return 0;
+ }
+
+ // create a new ImageView for each item referenced by the Adapter
+ public View getView(int position, View convertView, ViewGroup parent) {
+
+
+ View view;
+ if (convertView == null) { // if it's not recycled, initialize some attributes
+ LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ view = inflater.inflate(R.layout.drawer_list_element, null);
+
+
+ } else {
+ view = convertView;
+ }
+
+ TextView textView = (TextView) view.findViewById(R.id.textView);
+
+ if (position == 0)
+ {
+ textView.setText("Справочник");
+ }
+ else if (position == 1)
+ {
+ textView.setText("Новости");
+ }
+ else
+ {
+ textView.setText("Карта");
+ }
+
+
+ return view;
+ }
+ }
}
diff --git a/android/src/fishrungames/bashgid/MainPageFragment.java b/android/src/fishrungames/bashgid/MainPageFragment.java
index 46553bd..79e1c03 100644
--- a/android/src/fishrungames/bashgid/MainPageFragment.java
+++ b/android/src/fishrungames/bashgid/MainPageFragment.java
@@ -7,20 +7,47 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
+import android.widget.Button;
+import android.widget.GridView;
import android.widget.ListView;
public class MainPageFragment extends Fragment {
- ListView teaserListView;
+
+ final Integer[] teaserIcons = {
+ R.drawable.economics_teaser_button,
+ R.drawable.test_teaser_bkg_button,
+ R.drawable.agro_teaser_button,
+ R.drawable.transport_teaser_button,
+ R.drawable.education_teaser_button,
+ R.drawable.tourism_teaser_button,
+ R.drawable.medicine_teaser_button,
+ R.drawable.sport_teaser_button,
+ };
+
+ final String[] teaserText = {
+ "Экономика",
+ "Промышленность",
+ "Сельское хозяйство ",
+ "Транспорт",
+ "Образование",
+ "Туризм",
+ "Медицина",
+ "Спорт",
+
+ };
+
+ GridView teaserGridView;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_main_page, container, false);
- teaserListView = (ListView) rootView.findViewById(R.id.teaserListView);
+ teaserGridView = (GridView) rootView.findViewById(R.id.teaserGridView);
+
+ teaserGridView.setAdapter(new SlideListAdapter(getActivity()));
- teaserListView.setAdapter(new SlideListAdapter(getActivity()));
return rootView;
}
@@ -34,7 +61,7 @@ public class MainPageFragment extends Fragment {
}
public int getCount() {
- return 7;
+ return teaserIcons.length;
}
public Object getItem(int position) {
@@ -53,11 +80,27 @@ public class MainPageFragment extends Fragment {
if (convertView == null) { // if it's not recycled, initialize some attributes
LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
view = inflater.inflate(R.layout.teaser_list_element, null);
+
+
} else {
view = convertView;
}
+ Button button = (Button) view.findViewById(R.id.teaserElement);
+
+ button.setOnClickListener(new View.OnClickListener()
+ {
+ @Override
+ public void onClick(View v) {
+ MainActivity.getInstance().OnSelectSemiDetails(0);
+ }
+ }
+ );
+
+ //button.setBackground(mContext.getResources().getDrawable(teaserIcons[position]));
+ button.setBackgroundResource(teaserIcons[position]);
+ button.setText(teaserText[position]);
return view;
}
diff --git a/android/src/fishrungames/bashgid/SemiDetailsFragment.java b/android/src/fishrungames/bashgid/SemiDetailsFragment.java
new file mode 100644
index 0000000..5e8f6b6
--- /dev/null
+++ b/android/src/fishrungames/bashgid/SemiDetailsFragment.java
@@ -0,0 +1,130 @@
+package fishrungames.bashgid;
+
+import android.content.Context;
+import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.ViewGroup.LayoutParams;
+import android.widget.BaseAdapter;
+import android.widget.Button;
+import android.widget.GridView;
+import android.widget.ImageView;
+import android.widget.ListView;
+import android.widget.TextView;
+
+public class SemiDetailsFragment extends Fragment {
+
+
+ ListView semidetailsGridView;
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+ View rootView = inflater.inflate(R.layout.fragment_semidetails_page, container, false);
+
+ semidetailsGridView = (ListView) rootView.findViewById(R.id.listView);
+
+ semidetailsGridView.setAdapter(new SemidetailsAdapter(getActivity()));
+
+ return rootView;
+ }
+
+
+
+
+ public class SemidetailsAdapter extends BaseAdapter {
+ private Context mContext;
+
+ public SemidetailsAdapter(Context c) {
+ mContext = c;
+ }
+
+ public int getCount() {
+ return 2;
+ }
+
+ public Object getItem(int position) {
+ return null;
+ }
+
+ public long getItemId(int position) {
+ return 0;
+ }
+
+ // create a new ImageView for each item referenced by the Adapter
+ public View getView(int position, View convertView, ViewGroup parent) {
+
+
+ View view;
+ if (convertView == null) { // if it's not recycled, initialize some attributes
+ LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ view = inflater.inflate(R.layout.semidetails_element, null);
+
+
+ } else {
+ view = convertView;
+ }
+
+ TextView headerTextView = (TextView)view.findViewById(R.id.headerTextView);
+ TextView subHeaderTextView = (TextView)view.findViewById(R.id.subHeaderTextView);
+
+ ImageView imageView = (ImageView)view.findViewById(R.id.imageView);
+
+ TextView imageTextView = (TextView)view.findViewById(R.id.imageTextView);
+
+ TextView footerTextView = (TextView)view.findViewById(R.id.footerTextView);
+
+ if (position == 0)
+ {
+ headerTextView.setVisibility(View.VISIBLE);
+ headerTextView.setText("Структура промышленности Башкортостана");
+
+ subHeaderTextView.setText("Важнейшие отрасли промышленности Башкортостана — нефтедобыча, нефтепереработка, химия и нефтехимия.");
+ subHeaderTextView.setVisibility(View.VISIBLE);
+
+ imageView.setImageResource(R.drawable.test_promstruct_rb);
+
+ LayoutParams params = imageView.getLayoutParams();
+ params.width = LayoutParams.MATCH_PARENT;
+ imageView.setLayoutParams(params);
+
+
+
+ imageTextView.setVisibility(View.GONE);
+
+ footerTextView.setText("");
+
+ }
+ else
+ {
+ headerTextView.setVisibility(View.VISIBLE);
+ headerTextView.setText("УМПО");
+
+ subHeaderTextView.setVisibility(View.VISIBLE);
+ subHeaderTextView.setText("Стремимся к вершинам!");
+
+ imageView.setImageResource(R.drawable.test_umpo);
+
+ LayoutParams params = imageView.getLayoutParams();
+ params.width = 200;
+ imageView.setLayoutParams(params);
+
+
+ imageTextView.setVisibility(View.VISIBLE);
+ imageTextView.setText("УМПО - российское предприятие, производитель авиационных двигателей. Основано в 1925 году. В объединении работают более 15 тысяч человек.");
+
+ footerTextView.setText("Нажмите сюда для подробностей");
+ }
+
+ //Button button = (Button) view.findViewById(R.id.teaserElement);
+
+ //button.setBackground(mContext.getResources().getDrawable(teaserIcons[position]));
+
+ //button.setBackgroundResource(teaserIcons[position]);
+ //button.setText(teaserText[position]);
+ return view;
+ }
+
+ }
+}