Browse Source

initial feature implentation

Alexander Brakowski 10 years ago
parent
commit
88f6cf518f

+ 9 - 0
res/drawable/panel_bg_selector.xml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+
+	<item android:drawable="@drawable/panel_bg_selector_pressed"
+	      android:state_pressed="true" />
+
+	<item android:drawable="@drawable/panel_bg" />
+</selector>

+ 26 - 0
res/drawable/panel_bg_selector_pressed.xml

@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+
+	<!-- Bottom 3dp Shadow -->
+	<item>
+		<shape android:shape="rectangle">
+
+			<solid android:color="#C7C6C5" />
+			<corners android:radius="4dp" />
+
+		</shape>
+	</item>
+
+	<!-- White Top color -->
+	<item android:bottom="4px">
+
+		<shape android:shape="rectangle">
+
+			<solid android:color="#fff9ecb8" />
+			<corners android:radius="4dp" />
+
+
+		</shape>
+	</item>
+
+</layer-list>

+ 1 - 1
res/layout/fragment_profile_manager.xml

@@ -14,6 +14,7 @@
         android:id="@+id/profile_manager_listview"
         android:choiceMode="singleChoice"
         android:background="#F2F2F2"
+        android:cacheColorHint="#F2F2F2"
         android:dividerHeight="10dp"
         android:divider="@android:color/transparent"
         android:padding="5dp"
@@ -21,7 +22,6 @@
         android:layout_marginLeft="0dp"
         android:layout_alignParentTop="true"
         android:layout_marginTop="0dp"
-        android:descendantFocusability="blocksDescendants"
         swipeFrontView="@+id/swipelist_frontview"
         swipeBackView="@+id/swipelist_backview"
         swipe:swipeFrontView="@+id/swipelist_frontview"

+ 4 - 39
res/layout/profile_manager_list_item.xml

@@ -9,15 +9,13 @@
         android:orientation="horizontal"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:background="@drawable/panel_white_bg"
-        android:focusable="false">
+        android:background="@drawable/panel_white_bg">
 
         <LinearLayout
             android:orientation="horizontal"
             android:layout_width="fill_parent"
             android:layout_height="fill_parent"
-            android:focusable="false"
-            android:layout_below="@+id/profile_manager_item_image_back">
+                >
 
             <ImageButton
                 android:layout_width="0dp"
@@ -26,7 +24,6 @@
                 android:id="@+id/profile_manager_item_button_edit"
                 android:layout_weight="1"
                 style="@android:style/DeviceDefault.Light.ButtonBar"
-                android:focusable="false"
                 android:layout_alignParentTop="true"
                 android:layout_alignParentLeft="true"
                 android:layout_alignParentStart="true"
@@ -53,47 +50,14 @@
                 android:src="@drawable/ic_discard"/>
         </LinearLayout>
 
-        <ImageView
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:id="@+id/profile_manager_item_image_back"
-            android:src="@drawable/ic_launcher"
-            android:layout_toLeftOf="@+id/profile_manager_item_label_back"
-            android:layout_alignBottom="@+id/profile_manager_item_label_back"
-            android:layout_alignParentTop="true"
-            android:paddingLeft="15dp"
-            android:paddingTop="15dp"
-            android:paddingBottom="15dp"
-            android:paddingRight="-10dp"/>
-
-        <TextView
-            android:id="@+id/profile_manager_item_label_back"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:gravity="center_vertical"
-            android:paddingLeft="0dp"
-            android:paddingRight="0dp"
-            android:textColor="?android:attr/colorForeground"
-            android:minHeight="?android:attr/listPreferredItemHeightSmall"
-            android:text="Sample title"
-            android:background="@android:color/transparent"
-            android:singleLine="true"
-            android:layout_alignParentLeft="false"
-            android:textAlignment="center"
-            android:layout_centerHorizontal="true"
-            android:textSize="8sp"
-            android:layout_alignParentTop="true"/>
-
     </RelativeLayout>
-
     <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                     android:id="@+id/swipelist_frontview"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
                     android:padding="5dp"
                     android:baselineAligned="false"
-                    android:background="@drawable/panel_bg"
-                    android:focusable="false">
+                    android:background="@drawable/panel_bg_selector">
 
         <TextView
             android:id="@+id/profile_manager_item_label"
@@ -148,4 +112,5 @@
             android:layout_alignParentStart="true" />
 
     </RelativeLayout>
+
 </FrameLayout>

+ 13 - 0
res/xml/profile_preferences.xml

@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
+	<PreferenceCategory android:title="General"
+	                    android:key="pref_profile_general_settings">
+		<EditTextPreference android:key="pref_profile_general_name"
+		                    android:title="Name"
+		                    android:summary="Change the name of this profile"
+		                    android:defaultValue=""/>
+
+
+	</PreferenceCategory>
+</PreferenceScreen>

+ 6 - 6
src/de/tudarmstadt/informatik/hostage/ui2/adapter/DrawerListAdapter.java

@@ -18,25 +18,25 @@ import de.tudarmstadt.informatik.hostage.ui2.model.DrawerListItem;
  * @created 13.01.14 16:35
  */
 public class DrawerListAdapter extends ArrayAdapter<DrawerListItem> {
-    private final Context context;
-    private final List<DrawerListItem> values;
+    private final Context mContext;
+    private final List<DrawerListItem> mValues;
 
     public DrawerListAdapter(Context context, List<DrawerListItem> objects) {
         super(context, R.layout.drawer_list_item, objects);
-        this.context = context;
-        this.values  = objects;
+        this.mContext = context;
+        this.mValues  = objects;
     }
 
     @Override
     public View getView(int position, View convertView, ViewGroup parent) {
-        LayoutInflater inflater = (LayoutInflater) context
+        LayoutInflater inflater = (LayoutInflater) mContext
                 .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
 
         View rowView = inflater.inflate(R.layout.drawer_list_item, parent, false);
         TextView textView = (TextView) rowView.findViewById(R.id.drawer_listitem_text);
         ImageView imageView = (ImageView) rowView.findViewById(R.id.drawer_listitem_icon);
 
-        DrawerListItem item = values.get(position);
+        DrawerListItem item = mValues.get(position);
         textView.setText(item.text);
         imageView.setImageResource(item.icon);
 

+ 4 - 4
src/de/tudarmstadt/informatik/hostage/ui2/adapter/ProfileManagerListAdapter.java

@@ -84,8 +84,8 @@ public class ProfileManagerListAdapter extends ArrayAdapter<ProfileListItem> {
 		    holder.buttonEdit = (ImageButton) rowView.findViewById(R.id.profile_manager_item_button_edit);
 		    holder.buttonDelete = (ImageButton) rowView.findViewById(R.id.profile_manager_item_button_delete);
 			//holder.switcher = (ViewSwitcher) rowView.findViewById(R.id.profile_manager_viewswitcher);
-			holder.itemIconBack = (ImageView) rowView.findViewById(R.id.profile_manager_item_image_back);
-		    holder.labelViewBack = (TextView) rowView.findViewById(R.id.profile_manager_item_label_back);
+			//holder.itemIconBack = (ImageView) rowView.findViewById(R.id.profile_manager_item_image_back);
+		    //holder.labelViewBack = (TextView) rowView.findViewById(R.id.profile_manager_item_label_back);
 
 		    rowView.setTag(holder);
 	    } else {
@@ -124,8 +124,8 @@ public class ProfileManagerListAdapter extends ArrayAdapter<ProfileListItem> {
 
 	    holder.textView.setText(item.label);
 	    holder.labelView.setText(item.text);
-	    holder.labelViewBack.setText(item.text);
-	    holder.itemIconBack.setImageBitmap(item.icon);
+	   // holder.labelViewBack.setText(item.text);
+	   // holder.itemIconBack.setImageBitmap(item.icon);
 	    holder.itemIcon.setImageBitmap(item.icon);
 
 		/*holder.switcher.setInAnimation(null);