Merge branch 'develop' into loggingtool
[pub/Android/ownCloud.git] / src / com / owncloud / android / extensions / ExtensionsAvailableDialog.java
1 /* ownCloud Android client application
2 * Copyright (C) 2012 Bartek Przybylski
3 * Copyright (C) 2012-2013 ownCloud Inc.
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 *
18 */
19
20 package com.owncloud.android.extensions;
21
22 import com.owncloud.android.Log_OC;
23 import com.owncloud.android.R;
24 import android.content.Intent;
25 import android.os.Bundle;
26 import android.support.v4.app.DialogFragment;
27 import android.util.Log;
28 import android.view.LayoutInflater;
29 import android.view.View;
30 import android.view.ViewGroup;
31 import android.view.View.OnClickListener;
32 import android.widget.Button;
33
34 public class ExtensionsAvailableDialog extends DialogFragment implements
35 OnClickListener {
36
37 public ExtensionsAvailableDialog() {
38 }
39
40 @Override
41 public View onCreateView(LayoutInflater inflater, ViewGroup container,
42 Bundle savedInstanceState) {
43 View view = inflater.inflate(R.layout.extensions_available_dialog,
44 container);
45 Button btnYes = (Button) view.findViewById(R.id.buttonYes);
46 Button btnNo = (Button) view.findViewById(R.id.buttonNo);
47 btnYes.setOnClickListener(this);
48 btnNo.setOnClickListener(this);
49 getDialog().setTitle(R.string.extensions_avail_title);
50 return view;
51 }
52
53 @Override
54 public void onClick(View v) {
55 switch (v.getId()) {
56 case R.id.buttonYes: {
57 Intent i = new Intent(getActivity(), ExtensionsListActivity.class);
58 startActivity(i);
59 getActivity().finish();
60 }
61 break;
62 case R.id.buttonNo:
63 getActivity().finish();
64 break;
65 default:
66 Log_OC.e("EAD", "Button with unknown id clicked " + v.getId());
67 }
68 }
69
70 }