1 package eu
.alefzero
.owncloud
.ui
.fragment
;
3 import android
.content
.Intent
;
4 import android
.os
.Bundle
;
5 import android
.support
.v4
.app
.Fragment
;
6 import android
.view
.LayoutInflater
;
7 import android
.view
.View
;
8 import android
.view
.ViewGroup
;
9 import android
.widget
.AdapterView
;
10 import android
.widget
.AdapterView
.OnItemClickListener
;
11 import android
.widget
.GridView
;
12 import android
.widget
.Toast
;
13 import eu
.alefzero
.owncloud
.R
;
14 import eu
.alefzero
.owncloud
.ui
.adapter
.LandingScreenAdapter
;
16 public class LandingPageFragment
extends Fragment
implements OnItemClickListener
{
19 public View
onCreateView(LayoutInflater inflater
, ViewGroup container
,
20 Bundle savedInstanceState
) {
21 View root
= inflater
.inflate(R
.layout
.landing_page_fragment
, container
);
27 public void onActivityCreated(Bundle savedInstanceState
) {
28 super.onActivityCreated(savedInstanceState
);
29 GridView grid
= (GridView
) getView().findViewById(R
.id
.gridview
);
30 grid
.setAdapter(new LandingScreenAdapter(getActivity()));
31 grid
.setOnItemClickListener(this);
35 public void onItemClick(AdapterView
<?
> parent
, View view
, int position
, long id
) {
37 * Start an activity based on the selection
41 intent
= (Intent
) parent
.getAdapter().getItem(position
);
43 startActivity(intent
);
45 Toast toast
= Toast
.makeText(getActivity(), "Not yet implemented!", Toast
.LENGTH_SHORT
);