Added README.txt and GPL Header to Source Files
[DHBWCampusApp.git] / app / src / main / java / de / dhbwloe / campusapp / fragments / Impressum.java
1 /* Impressum.java
2  *
3  * This program is free software: you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License as published by
5  * the Free Software Foundation, either version 3 of the License, or
6  * (at your option) any later version.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  */
16 package de.dhbwloe.campusapp.fragments;
17 import android.os.Bundle;
18 import android.support.v4.app.Fragment;
19 import android.support.v4.app.FragmentActivity;
20 import android.view.LayoutInflater;
21 import android.view.View;
22 import android.view.ViewGroup;
23 import android.widget.TextView;
24
25 import de.dhbwloe.campusapp.CampusAppFragment;
26 import de.dhbwloe.campusapp.R;
27 import de.dhbwloe.campusapp.search.SearchIndices;
28
29 /**
30  * A simple {@link Fragment} subclass.
31  */
32 public class Impressum extends CampusAppFragment {
33     /* implement this for search results ;) */
34     public static SearchIndices[] GetSearchIndices() {
35         return new SearchIndices[] {
36                 new SearchIndices("Impressum", true) {{
37                     setUpdateTime(1);
38                     setTarget("#Impressum");
39                     setTitle(R.string.search_impressum_title);
40                     setDescription(R.string.search_impressum_description);
41                     addKeyWord(R.string.search_impressum_keywords);
42                 }},
43         };
44     }
45
46     @Override
47     public View onCreateView(LayoutInflater inflater, ViewGroup container,
48                              Bundle savedInstanceState) {
49         View view = inflater.inflate(R.layout.fragment_impressum, container, false);
50         AppContext.setTitle(AppContext.getResString(R.string.impressum_title));
51
52         TextView urlView = (TextView) view.findViewById(R.id.sourceUrl);
53         urlView.setOnClickListener(new View.OnClickListener() {
54             @Override
55             public void onClick(View v) {
56                 Bundle args = new Bundle();
57                 args.putString("url", "http://dev.pk910.de/DHBWCampusApp");
58                 AppContext.getNavigationManager().navigatePage("WebBrowser", args, false);
59             }
60         });
61
62         return view;
63     }
64 }