Skip to content
Snippets Groups Projects
Commit 2b370f03 authored by Alexandre Savard's avatar Alexandre Savard
Browse files

#15273: Add Fragment for account management in preference

parent 150352e2
No related branches found
No related tags found
No related merge requests found
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2004-2012 Savoir-Faire Linux Inc.
Author: Adrien Beraud <adrien.beraud@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Additional permission under GNU GPL version 3 section 7:
If you modify this program, or any covered work, by linking or
combining it with the OpenSSL project's OpenSSL library (or a
modified version of that library), containing parts covered by the
terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
grants you additional permission to convey the resulting work.
Corresponding Source for a non-source form of such a combination
shall include the source code for the parts of OpenSSL used as well
as that of the covered work.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:orientation="vertical"
android:gravity="center_horizontal"
android:layout_below="@+id/editTo"
android:id="@+id/accountManagementLayout"
android:weightSum="1.0"
android:paddingLeft="8dp"
android:paddingRight="8dp" >
<Button
android:id="@+id/buttonAddAccount"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:onClick="onClick"
android:text="Add Account" />
<Button
android:id="@+id/buttonRemoveAccount"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:onClick="onClick"
android:text="Remove Account" />
</LinearLayout>
......@@ -172,4 +172,4 @@ as that of the covered work.
android:onClick="onClick"
android:text="GetDataString" />
</RelativeLayout>
\ No newline at end of file
</RelativeLayout>
/*
* Copyright (C) 2004-2012 Savoir-Faire Linux Inc.
*
* Author: Alexandre Savard <alexandre.savard@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* Additional permission under GNU GPL version 3 section 7:
*
* If you modify this program, or any covered work, by linking or
* combining it with the OpenSSL project's OpenSSL library (or a
* modified version of that library), containing parts covered by the
* terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
* grants you additional permission to convey the resulting work.
* Corresponding Source for a non-source form of such a combination
* shall include the source code for the parts of OpenSSL used as well
* as that of the covered work.
*/
package com.savoirfairelinux.sflphone.client;
import android.app.Fragment;
import android.os.Bundle;
import android.util.Log;
import android.widget.Button;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.savoirfairelinux.sflphone.R;
public class AccountManagementFragment extends Fragment
{
static final String TAG = "AccountManagementFragment";
Button buttonAddAccount, buttonRemoveAccount;
public AccountManagementFragment()
{
}
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
Log.i(TAG, "Create Account Management");
buttonAddAccount = (Button) getActivity().findViewById(R.id.buttonAddAccount);
buttonRemoveAccount = (Button) getActivity().findViewById(R.id.buttonRemoveAccount);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState)
{
Log.i(TAG, "Create Account Management View");
return inflater.inflate(R.layout.account_management_layout, parent, false);
}
}
......@@ -123,7 +123,21 @@ public class SFLPhonePreferenceActivity extends Activity implements ActionBar.Ta
@Override
public Fragment getItem(int position)
{
return ArrayListFragment.newInstance(position);
Fragment fragment;
switch (position) {
case 0:
fragment = new AccountManagementFragment();
break;
case 1:
fragment = ArrayListFragment.newInstance(position);
break;
default:
Log.i(TAG, "Get new fragment " + position + " is null");
return null;
}
return fragment;
}
@Override
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment