1 /* ownCloud Android client application
2 * Copyright (C) 2011 Bartek Przybylski
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 package eu
.alefzero
.owncloud
.ui
.fragment
;
20 import eu
.alefzero
.owncloud
.R
;
21 import eu
.alefzero
.owncloud
.R
.id
;
22 import eu
.alefzero
.owncloud
.R
.layout
;
23 import android
.content
.Intent
;
24 import android
.os
.Bundle
;
25 import android
.support
.v4
.app
.Fragment
;
26 import android
.util
.Log
;
27 import android
.view
.LayoutInflater
;
28 import android
.view
.View
;
29 import android
.view
.ViewGroup
;
30 import android
.widget
.TextView
;
31 import android
.widget
.Toast
;
34 * This Fragment is used to display the details about a file.
35 * @author Bartek Przybylski
38 public class FileDetail
extends Fragment
{
40 public Intent mIntent
;
42 public void setStuff(Intent intent
) {
43 setStuff(intent
, getView());
46 private void setStuff(Intent intent
, View view
) {
47 String filename
= intent
.getStringExtra("FILE_NAME");
48 String filepath
= intent
.getStringExtra("FILE_PATH");
49 setFilename(filename
, view
);
53 public void onCreate(Bundle savedInstanceState
) {
54 // TODO Auto-generated method stub
55 super.onCreate(savedInstanceState
);
59 public void onActivityCreated(Bundle savedInstanceState
) {
60 // TODO Auto-generated method stub
61 super.onActivityCreated(savedInstanceState
);
65 public View
onCreateView(LayoutInflater inflater
, ViewGroup container
,
66 Bundle savedInstanceState
) {
67 View v
= inflater
.inflate(R
.layout
.file_details
, container
, false
);
69 if (getActivity().getIntent() != null
) setStuff(getActivity().getIntent(), v
);
73 private void setFilename(String filename
, View target_view
) {
74 TextView tv
= (TextView
) target_view
.findViewById(R
.id
.textView1
);
75 if (tv
!= null
) tv
.setText(filename
);
78 public void setFilename(String filename
) {
79 setFilename(filename
, getView());