Skip to content
Snippets Groups Projects
Commit e3247b12 authored by Xavier Gibert's avatar Xavier Gibert
Browse files

icons added

parent dd3bf141
No related branches found
No related tags found
No related merge requests found
res/drawable-xhdpi/indicators.png

488 B

res/drawable-xhdpi/preferences.png

853 B

res/drawable-xhdpi/simulator.png

582 B

res/drawable-xhdpi/test.png

457 B

res/drawable-xhdpi/visualization.png

1.4 KiB

......@@ -17,7 +17,7 @@
android:textColor="@color/white" />
<ImageView
android:id="@+id/imageView1"
android:id="@+id/nav_item_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
......@@ -31,7 +31,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/imageView1"
android:layout_below="@+id/nav_item_icon"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_marginTop="15dp"
......
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android1="http://schemas.android.com/apk/res/android"
android1:id="@+id/nav_item_text"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/navigation_section"
android1:textAppearance="?android:attr/textAppearanceLarge" >
android1:id="@+id/RelLayout001"
android1:layout_width="match_parent"
android1:layout_height="wrap_content" >
</TextView>
<ImageView
android1:id="@+id/nav_item_icon"
android1:layout_width="45dp"
android1:layout_height="45dp"
android1:layout_alignParentLeft="true"
android1:layout_alignParentTop="true"
android1:background="@drawable/navigation_section"
android1:scaleType="fitCenter"
android1:src="@drawable/simulator" />
<TextView
android1:id="@+id/nav_item_text"
android1:layout_width="wrap_content"
android1:layout_height="match_parent"
android1:layout_alignBottom="@+id/nav_item_icon"
android1:layout_alignParentRight="true"
android1:layout_alignParentTop="true"
android1:layout_toRightOf="@+id/nav_item_icon"
android1:background="@drawable/navigation_section"
android1:textAppearance="?android:attr/textAppearanceLarge" />
</RelativeLayout>
......@@ -15,14 +15,14 @@
android:layout_alignParentTop="true"
android:layout_marginLeft="8dp"
android:layout_marginTop="8dp"
android:layout_toLeftOf="@+id/imageView1"
android:layout_toLeftOf="@+id/nav_item_icon"
android:paddingBottom="32dp"
android:text="@string/powered_by"
android:textColor="@color/white"
android:textSize="20sp" />
<ImageView
android:id="@+id/imageView1"
android:id="@+id/nav_item_icon"
android:layout_width="90dp"
android:layout_height="60dp"
android:layout_alignParentRight="true"
......@@ -36,7 +36,7 @@
android:id="@+id/switch1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/imageView1"
android:layout_alignBottom="@+id/nav_item_icon"
android:layout_alignParentLeft="true"
android:layout_marginLeft="10dp"
android:textOff="@string/title_sim_local"
......@@ -48,7 +48,7 @@
android:layout_height="wrap_content"
android:layout_above="@+id/buttonConnect"
android:layout_alignParentLeft="true"
android:layout_below="@+id/imageView1"
android:layout_below="@+id/nav_item_icon"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="@color/grey5"
......
......@@ -24,6 +24,7 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
......@@ -140,6 +141,7 @@ public class NavigationDrawerFragment extends Fragment {
LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View rowView = inflater.inflate(R.layout.nav_item, parent, false);
TextView textView = (TextView) rowView.findViewById(R.id.nav_item_text);
ImageView iconView = (ImageView) rowView.findViewById(R.id.nav_item_icon);
String[] values = new String[]{
getString(R.string.title_section1),
getString(R.string.title_section2),
......@@ -150,7 +152,29 @@ public class NavigationDrawerFragment extends Fragment {
getString(R.string.title_section7),
};
textView.setText(values[position]);
switch(position){
case 0:
iconView.setImageResource(R.drawable.simulator);
break;
case 1:
iconView.setImageResource(R.drawable.visualization);
break;
case 2:
iconView.setImageResource(R.drawable.indicators);
break;
case 3:
iconView.setImageResource(R.drawable.indicators);
break;
case 4:
iconView.setImageResource(R.drawable.preferences);
break;
case 5:
iconView.setImageResource(R.drawable.preferences);
break;
case 6:
iconView.setImageResource(R.drawable.test);
break;
}
if (position == mCurrentSelectedPosition)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment