messy rename file
[pub/Android/ownCloud.git] / src / eu / alefzero / owncloud / ui / fragment / LandingPageFragment.java
index dd7ca31..f5649a0 100644 (file)
  */\r
 package eu.alefzero.owncloud.ui.fragment;\r
 \r
-import android.content.Intent;\r
+import com.actionbarsherlock.app.SherlockFragment;\r
+\r
 import android.os.Bundle;\r
-import android.support.v4.app.Fragment;\r
 import android.view.LayoutInflater;\r
 import android.view.View;\r
 import android.view.ViewGroup;\r
-import android.widget.AdapterView;\r
-import android.widget.AdapterView.OnItemClickListener;\r
-import android.widget.GridView;\r
-import android.widget.Toast;\r
+import android.widget.ListView;\r
 import eu.alefzero.owncloud.R;\r
+import eu.alefzero.owncloud.ui.activity.LandingActivity;\r
 import eu.alefzero.owncloud.ui.adapter.LandingScreenAdapter;\r
 \r
 /**\r
- * Used on the Landing page to display what Components of \r
- * the ownCloud there are. Like Files, Music, Contacts, etc.\r
+ * Used on the Landing page to display what Components of the ownCloud there\r
+ * are. Like Files, Music, Contacts, etc.\r
  * \r
  * @author Lennart Rosam\r
- *\r
+ * \r
  */\r
-public class LandingPageFragment extends Fragment implements OnItemClickListener {\r
+public class LandingPageFragment extends SherlockFragment {\r
 \r
-       @Override\r
-       public View onCreateView(LayoutInflater inflater, ViewGroup container,\r
-                       Bundle savedInstanceState) {\r
-               View root = inflater.inflate(R.layout.landing_page_fragment, container);\r
-               return root;\r
-       }\r
+    @Override\r
+    public View onCreateView(LayoutInflater inflater, ViewGroup container,\r
+            Bundle savedInstanceState) {\r
+        View root = inflater.inflate(R.layout.landing_page_fragment, container);\r
+        return root;\r
+    }\r
 \r
+    @Override\r
+    public void onActivityCreated(Bundle savedInstanceState) {\r
+        super.onActivityCreated(savedInstanceState);\r
 \r
-       @Override\r
-       public void onActivityCreated(Bundle savedInstanceState) {\r
-               super.onActivityCreated(savedInstanceState);\r
-               GridView grid = (GridView) getView().findViewById(R.id.gridview);\r
-               grid.setAdapter(new LandingScreenAdapter(getActivity()));\r
-               grid.setOnItemClickListener(this);\r
-       }\r
-       \r
-       @Override\r
-       public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\r
-               /*\r
-                * Start an activity based on the selection\r
-                * the user made\r
-                */\r
-               Intent intent;\r
-               intent = (Intent) parent.getAdapter().getItem(position);\r
-               if(intent != null ){\r
-                       startActivity(intent);\r
-               } else {\r
-                       Toast toast = Toast.makeText(getActivity(), "Not yet implemented!", Toast.LENGTH_SHORT);\r
-                       toast.show();\r
-               }\r
-       }\r
+        ListView landingScreenItems = (ListView) getView().findViewById(\r
+                R.id.homeScreenList);\r
+        landingScreenItems.setAdapter(new LandingScreenAdapter(getActivity()));\r
+        landingScreenItems\r
+                .setOnItemClickListener((LandingActivity) getActivity());\r
+    }\r
 \r
-       \r
-       \r
 }\r