Added teasers
@ -14,23 +14,11 @@
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/AppTheme"
|
||||
android:hardwareAccelerated="true" >
|
||||
<activity
|
||||
android:name=".LoadingActivity"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@android:style/Theme.NoTitleBar" >
|
||||
<intent-filter>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".WelcomeActivity"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@android:style/Theme.NoTitleBar" >
|
||||
<intent-filter>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:label="@string/app_name" >
|
||||
android:label="@string/app_name"
|
||||
android:configChanges="orientation"
|
||||
android:screenOrientation="portrait" >
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
|
BIN
android/res/drawable/agro_teaser.png
Normal file
After Width: | Height: | Size: 90 KiB |
9
android/res/drawable/agro_teaser_button.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
|
||||
<item android:state_focused="true" android:state_pressed="false" android:drawable="@drawable/agro_teaser" />
|
||||
<item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/agro_teaser_darken" />
|
||||
<item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/agro_teaser_darken" />
|
||||
<item android:drawable="@drawable/agro_teaser" />
|
||||
|
||||
</selector>
|
BIN
android/res/drawable/agro_teaser_darken.png
Normal file
After Width: | Height: | Size: 87 KiB |
Before Width: | Height: | Size: 3.9 MiB After Width: | Height: | Size: 192 KiB |
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 10 KiB |
BIN
android/res/drawable/culture_teaser.png
Normal file
After Width: | Height: | Size: 74 KiB |
9
android/res/drawable/culture_teaser_button.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
|
||||
<item android:state_focused="true" android:state_pressed="false" android:drawable="@drawable/culture_teaser" />
|
||||
<item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/culture_teaser_darken" />
|
||||
<item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/culture_teaser_darken" />
|
||||
<item android:drawable="@drawable/culture_teaser" />
|
||||
|
||||
</selector>
|
BIN
android/res/drawable/culture_teaser_darken.png
Normal file
After Width: | Height: | Size: 48 KiB |
BIN
android/res/drawable/economics_teaser.png
Normal file
After Width: | Height: | Size: 91 KiB |
9
android/res/drawable/economics_teaser_button.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
|
||||
<item android:state_focused="true" android:state_pressed="false" android:drawable="@drawable/economics_teaser" />
|
||||
<item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/economics_teaser_darken" />
|
||||
<item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/economics_teaser_darken" />
|
||||
<item android:drawable="@drawable/economics_teaser" />
|
||||
|
||||
</selector>
|
BIN
android/res/drawable/economics_teaser_darken.png
Normal file
After Width: | Height: | Size: 71 KiB |
BIN
android/res/drawable/education_teaser.png
Normal file
After Width: | Height: | Size: 85 KiB |
9
android/res/drawable/education_teaser_button.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
|
||||
<item android:state_focused="true" android:state_pressed="false" android:drawable="@drawable/education_teaser" />
|
||||
<item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/education_teaser_darken" />
|
||||
<item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/education_teaser_darken" />
|
||||
<item android:drawable="@drawable/education_teaser" />
|
||||
|
||||
</selector>
|
BIN
android/res/drawable/education_teaser_darken.png
Normal file
After Width: | Height: | Size: 56 KiB |
BIN
android/res/drawable/medicine_teaser.png
Normal file
After Width: | Height: | Size: 72 KiB |
9
android/res/drawable/medicine_teaser_button.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
|
||||
<item android:state_focused="true" android:state_pressed="false" android:drawable="@drawable/medicine_teaser" />
|
||||
<item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/medicine_teaser_darken" />
|
||||
<item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/medicine_teaser_darken" />
|
||||
<item android:drawable="@drawable/medicine_teaser" />
|
||||
|
||||
</selector>
|
BIN
android/res/drawable/medicine_teaser_darken.png
Normal file
After Width: | Height: | Size: 57 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 9.6 KiB |
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 9.0 KiB |
BIN
android/res/drawable/sport_teaser.png
Normal file
After Width: | Height: | Size: 87 KiB |
9
android/res/drawable/sport_teaser_button.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
|
||||
<item android:state_focused="true" android:state_pressed="false" android:drawable="@drawable/sport_teaser" />
|
||||
<item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/sport_teaser_darken" />
|
||||
<item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/sport_teaser_darken" />
|
||||
<item android:drawable="@drawable/sport_teaser" />
|
||||
|
||||
</selector>
|
BIN
android/res/drawable/sport_teaser_darken.png
Normal file
After Width: | Height: | Size: 67 KiB |
BIN
android/res/drawable/test_drawer_icon.png
Normal file
After Width: | Height: | Size: 328 B |
BIN
android/res/drawable/test_promstruct_rb.png
Normal file
After Width: | Height: | Size: 6.2 KiB |
BIN
android/res/drawable/test_teaser_bkg.png
Normal file
After Width: | Height: | Size: 91 KiB |
9
android/res/drawable/test_teaser_bkg_button.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
|
||||
<item android:state_focused="true" android:state_pressed="false" android:drawable="@drawable/test_teaser_bkg" />
|
||||
<item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/test_teaser_bkg_darken" />
|
||||
<item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/test_teaser_bkg_darken" />
|
||||
<item android:drawable="@drawable/test_teaser_bkg" />
|
||||
|
||||
</selector>
|
BIN
android/res/drawable/test_teaser_bkg_darken.png
Normal file
After Width: | Height: | Size: 80 KiB |
BIN
android/res/drawable/test_umpo.png
Normal file
After Width: | Height: | Size: 121 KiB |
BIN
android/res/drawable/tourism_teaser.png
Normal file
After Width: | Height: | Size: 71 KiB |
9
android/res/drawable/tourism_teaser_button.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
|
||||
<item android:state_focused="true" android:state_pressed="false" android:drawable="@drawable/tourism_teaser" />
|
||||
<item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/tourism_teaser_darken" />
|
||||
<item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/tourism_teaser_darken" />
|
||||
<item android:drawable="@drawable/tourism_teaser" />
|
||||
|
||||
</selector>
|
BIN
android/res/drawable/tourism_teaser_darken.png
Normal file
After Width: | Height: | Size: 54 KiB |
BIN
android/res/drawable/transport_teaser.png
Normal file
After Width: | Height: | Size: 78 KiB |
9
android/res/drawable/transport_teaser_button.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
|
||||
<item android:state_focused="true" android:state_pressed="false" android:drawable="@drawable/transport_teaser" />
|
||||
<item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/transport_teaser_darken" />
|
||||
<item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/transport_teaser_darken" />
|
||||
<item android:drawable="@drawable/transport_teaser" />
|
||||
|
||||
</selector>
|
BIN
android/res/drawable/transport_teaser_darken.png
Normal file
After Width: | Height: | Size: 65 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 15 KiB |
12
android/res/layout/activity_main_fast.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/fragment_proto_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" >
|
||||
|
||||
<fragment android:name="fishrungames.bashgid.MainPageFragment"
|
||||
android:id="@+id/list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</FrameLayout>
|
||||
|
26
android/res/layout/drawer_list_element.xml
Normal file
@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/LinearLayout2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:orientation="horizontal" >
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="4dp"
|
||||
android:src="@drawable/test_drawer_icon" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_margin="4dp"
|
||||
android:text="TextView"
|
||||
android:textColor="@color/text_white"
|
||||
android:textSize="24sp" />
|
||||
|
||||
</LinearLayout>
|
@ -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" >
|
||||
|
||||
<ListView
|
||||
android:id="@+id/teaserListView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
</ListView>
|
||||
<GridView
|
||||
android:id="@+id/teaserGridView"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:alwaysDrawnWithCache="true"
|
||||
android:gravity="center_horizontal"
|
||||
android:horizontalSpacing="10dp"
|
||||
android:numColumns="2"
|
||||
android:scrollingCache="true"
|
||||
android:smoothScrollbar="true"
|
||||
android:stretchMode="columnWidth"
|
||||
android:verticalSpacing="10dp" >
|
||||
|
||||
</GridView>
|
||||
|
||||
</LinearLayout>
|
||||
|
14
android/res/layout/fragment_semidetails_page.xml
Normal file
@ -0,0 +1,14 @@
|
||||
<?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:background="@color/light_grey"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<ListView
|
||||
android:id="@+id/listView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
</ListView>
|
||||
|
||||
</LinearLayout>
|
57
android/res/layout/semidetails_element.xml
Normal file
@ -0,0 +1,57 @@
|
||||
<?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="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/headerTextView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
android:text="TextView"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/subHeaderTextView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
android:text="TextView" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_margin="5dp" >
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView"
|
||||
android:layout_width="204dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_margin="5dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/economics_teaser" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/imageTextView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
android:text="TextView"
|
||||
android:visibility="gone" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/footerTextView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
android:text="TextView" />
|
||||
|
||||
</LinearLayout>
|
@ -7,101 +7,14 @@
|
||||
android:orientation="vertical"
|
||||
android:showDividers="middle" >
|
||||
|
||||
<LinearLayout
|
||||
<Button
|
||||
android:id="@+id/teaserElement"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="4dp"
|
||||
android:background="@color/light_grey" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textTeaserHeader"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Заголовок" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_margin="4dp"
|
||||
android:background="@color/light_grey" >
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageTeaser1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/russia_icon" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textTeaser1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="6dp"
|
||||
android:text="TextView" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_margin="4dp"
|
||||
android:background="@color/light_grey" >
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageTeaser2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/russia_icon" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textTeaser2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="6dp"
|
||||
android:text="TextView" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_margin="4dp"
|
||||
android:background="@color/light_grey" >
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageTeaser3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/russia_icon" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textTeaser3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="6dp"
|
||||
android:text="TextView" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="4dp"
|
||||
android:background="@color/light_grey" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="TextView" />
|
||||
|
||||
</LinearLayout>
|
||||
android:layout_height="120dp"
|
||||
android:background="@drawable/test_teaser_bkg_button"
|
||||
android:text="Промышленность"
|
||||
android:textColor="@color/text_white"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -4,10 +4,13 @@
|
||||
<string name="app_name">Bashgid</string>
|
||||
|
||||
|
||||
<color name="light_grey">#60E0E0E0</color>
|
||||
<color name="light_grey">#E0E0E0</color>
|
||||
|
||||
<color name="light_grey_1">#60d0d0d0</color>
|
||||
|
||||
<color name="text_white">#F0F0F0</color>
|
||||
|
||||
<color name="teaser_color">#2B517F</color>
|
||||
|
||||
|
||||
</resources>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<string name="app_name">Bashgid</string>
|
||||
<string name="app_name">Гид РБ</string>
|
||||
<string name="title_section1">Section 1</string>
|
||||
<string name="title_section2">Section 2</string>
|
||||
<string name="title_section3">Section 3</string>
|
||||
|
@ -23,20 +23,27 @@ 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);
|
||||
|
||||
|
||||
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();
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
130
android/src/fishrungames/bashgid/SemiDetailsFragment.java
Normal file
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|