Commit 5a8b9882 authored by Fabius's avatar Fabius

Mensa Reiter durch Button ersetzt

parent 96afc101
package de.bps.asist.module.start;
import android.media.Image;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ExpandableListView;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.List;
import de.bps.asist.AbstractAsistActivity;
import de.bps.asist.R;
import de.bps.asist.gui.AbstractASiSTFragment;
import de.bps.asist.module.AbstractAsistModule;
import de.bps.asist.module.canteen.CanteenModule;
import de.bps.asist.module.start.tree.ASiSTTreeItem;
import de.bps.asist.module.start.tree.ExpandableListAdapter;
public class AsistStartFragment extends AbstractASiSTFragment {
private ExpandableListView listView;
private LinearLayout linearLayout;
@Override
public View onCreateView(final LayoutInflater inflater, final ViewGroup container, final Bundle savedInstanceState) {
......@@ -29,6 +37,24 @@ public class AsistStartFragment extends AbstractASiSTFragment {
ExpandableListAdapter adapter = new ExpandableListAdapter(getActivity(), treeItems);
listView.setAdapter(adapter);
linearLayout = (LinearLayout) view.findViewById(R.id.linearLayoutStartFragmentCanteenButton);
ImageView imageView = (ImageView) view.findViewById(R.id.imageViewStartFragmentCanteenButton);
TextView textView = (TextView) view.findViewById(R.id.textViewStartFragmentCanteenButton);
imageView.setImageResource(R.drawable.ic_menu_mensa);
textView.setText(R.string.module_canteen_name);
linearLayout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
AbstractAsistModule module = new CanteenModule();
AsistStartActivity asistStartActivity =(AsistStartActivity)getContext();
if(asistStartActivity instanceof AbstractAsistActivity && asistStartActivity != null) {
asistStartActivity.startModule(module);
}
}
});
return view;
}
......
......@@ -4,7 +4,9 @@
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center">
android:gravity="center"
android:background="#cccccc"
>
<!--
<RelativeLayout
android:layout_width="match_parent"
......@@ -79,6 +81,7 @@
android:layout_alignRight="@+id/startViewWeather"
android:layout_alignEnd="@+id/startViewWeather" />
</RelativeLayout> -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
......@@ -90,11 +93,46 @@
>
</ExpandableListView>
</LinearLayout>
<LinearLayout
android:id="@+id/linearLayoutStartFragmentCanteenButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="1dp"
android:background="@color/backgroundColor">
<android.support.v7.widget.AppCompatImageView
android:id="@+id/imageViewStartFragmentCanteenButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_menu_mensa"
android:scaleType="centerCrop"
android:layout_gravity="center"
/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<android.support.v7.widget.AppCompatTextView
android:id="@+id/textViewStartFragmentCanteenButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/descColor"
android:textSize="@dimen/descTextSize"
android:text="@string/module_canteen_description"/>
</LinearLayout>
</LinearLayout>
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:src="@drawable/background_university"
android:scaleType="centerCrop"
/>
</LinearLayout>
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment