Commit 07db7c83 authored by Grigory Fedorov's avatar Grigory Fedorov

Account add: account type selection removed, add to system contacts removed. Xmpp only.

Account type icons removed, AccountTypeAdapter removed.
parent 754348a0
......@@ -138,7 +138,7 @@ public class AccountManager implements OnLoadListener, OnWipeListener {
servers.add(values.getString(i));
}
accountTypes.add(new AccountType(id, protocol, values.getString(1),
values.getString(2), values.getString(3), values.getDrawable(4),
values.getString(2), values.getString(3), null,
values.getBoolean(5, false), values.getString(6), values.getInt(7, 5222),
values.getBoolean(8, false), servers));
values.recycle();
......
/**
* Copyright (c) 2013, Redsolution LTD. All rights reserved.
*
* This file is part of Xabber project; you can redistribute it and/or
* modify it under the terms of the GNU General Public License, Version 3.
*
* Xabber 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, see http://www.gnu.org/licenses/.
*/
package com.xabber.android.ui.adapter;
import java.util.List;
import android.app.Activity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.xabber.android.data.account.AccountManager;
import com.xabber.android.data.account.AccountType;
import com.xabber.androiddev.R;
/**
* Adapter for drop down list of account's types.
*
* @author alexander.ivanov
*/
public class AccountTypeAdapter extends BaseAdapter {
private final Activity activity;
private final List<AccountType> accountTypes;
public AccountTypeAdapter(Activity activity) {
super();
this.activity = activity;
accountTypes = AccountManager.getInstance().getAccountTypes();
}
@Override
public int getCount() {
return accountTypes.size();
}
@Override
public Object getItem(int position) {
return accountTypes.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
final View view;
if (convertView == null) {
view = activity.getLayoutInflater().inflate(
R.layout.account_type_item, parent, false);
} else {
view = convertView;
}
final AccountType type = (AccountType) getItem(position);
((ImageView) view.findViewById(R.id.avatar)).setImageDrawable(type
.getIcon());
((TextView) view.findViewById(R.id.name)).setText(type.getName());
return view;
}
@Override
public View getDropDownView(int position, View convertView, ViewGroup parent) {
final View view;
if (convertView == null) {
view = activity.getLayoutInflater().inflate(
R.layout.account_type_dropdown, parent, false);
} else {
view = convertView;
}
final AccountType type = (AccountType) getItem(position);
((ImageView) view.findViewById(R.id.avatar)).setImageDrawable(type
.getIcon());
((TextView) view.findViewById(R.id.name)).setText(type.getName());
return view;
}
}
......@@ -24,16 +24,6 @@
<include layout="@layout/toolbar_default"/>
<TextView android:text="@string/account_type" android:layout_width="match_parent" android:layout_height="wrap_content" />
<Spinner
android:id="@+id/account_type"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="4dip"
android:paddingBottom="8dip"
android:prompt="@string/account_type"
/>
<LinearLayout
android:id="@+id/auth_panel"
android:layout_width="match_parent"
......@@ -71,13 +61,6 @@
</LinearLayout>
<CheckBox
android:id="@+id/syncable"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:checked="true"
android:text="@string/account_syncable" />
<CheckBox
android:id="@+id/use_orbot"
android:layout_width="fill_parent"
......
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2013, Redsolution LTD. All rights reserved.
This file is part of Xabber project; you can redistribute it and/or
modify it under the terms of the GNU General Public License, Version 3.
Xabber 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, see http://www.gnu.org/licenses/.
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="4dip">
<ImageView
android:id="@+id/avatar"
android:layout_width="32dip"
android:layout_height="32dip"
android:src="@drawable/ic_type_gtalk"
/>
<TextView
android:id="@+id/name"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="6dip"
android:singleLine="true"
android:ellipsize="marquee"
android:gravity="center_vertical"
android:text="GTalk"
/>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2013, Redsolution LTD. All rights reserved.
This file is part of Xabber project; you can redistribute it and/or
modify it under the terms of the GNU General Public License, Version 3.
Xabber 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, see http://www.gnu.org/licenses/.
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="2dip">
<ImageView
android:id="@+id/avatar"
android:layout_width="32dip"
android:layout_height="32dip"
android:src="@drawable/ic_type_gtalk"
/>
<TextView
android:id="@+id/name"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="6dip"
android:singleLine="true"
android:ellipsize="marquee"
android:gravity="center_vertical"
android:text="GTalk"
/>
</LinearLayout>
\ No newline at end of file
......@@ -14,8 +14,6 @@
-->
<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="MissingTranslation">
<string name="account_protocol_xmpp">xmpp</string>
<string name="account_protocol_gtalk">gtalk</string>
<string name="account_protocol_wlm">wlm</string>
<!--
<array name="account_type_name">
......@@ -39,7 +37,7 @@
<item>@string/account_type_names_xmpp</item>
<item>@string/account_type_hints_xmpp</item>
<item>@string/account_type_helps_xmpp</item>
<item>@drawable/ic_type_xmpp</item>
<item></item>
<item>True</item>
<item></item>
<item>5222</item>
......@@ -47,108 +45,8 @@
<item></item>
</array>
<array name="account_type_gtalk">
<item>@string/account_protocol_gtalk</item>
<item>@string/account_type_names_gtalk</item>
<item>@string/account_type_hints_gtalk</item>
<item>@string/account_type_helps_gtalk</item>
<item>@drawable/ic_type_gtalk</item>
<item>True</item>
<item>talk.google.com</item>
<item>5222</item>
<item>True</item>
<item>gmail.com</item>
<item>googlemail.com</item>
</array>
<array name="account_type_wlm">
<item>@string/account_protocol_wlm</item>
<item>@string/account_type_names_wlm</item>
<item>@string/account_type_hints_wlm</item>
<item>@string/account_type_helps_wlm</item>
<item>@drawable/ic_type_wlm</item>
<item>True</item>
<item>xmpp.messenger.live.com</item>
<item>5222</item>
<item>True</item>
<item>messenger.live.com</item>
</array>
<array name="account_type_facebook">
<item>@string/account_protocol_xmpp</item>
<item>@string/account_type_names_facebook</item>
<item>@string/account_type_hints_facebook</item>
<item>@string/account_type_helps_facebook</item>
<item>@drawable/ic_type_facebook</item>
<item>False</item>
<item>chat.facebook.com</item>
<item>5222</item>
<item>True</item>
<item>chat.facebook.com</item>
</array>
<array name="account_type_qip">
<item>@string/account_protocol_xmpp</item>
<item>@string/account_type_names_qip</item>
<item>@string/account_type_hints_qip</item>
<item>@string/account_type_helps_qip</item>
<item>@drawable/ic_type_qip</item>
<item>True</item>
<item>webim.qip.ru</item>
<item>5222</item>
<item>True</item>
<item>qip.ru</item>
</array>
<array name="account_type_ya">
<item>@string/account_protocol_xmpp</item>
<item>@string/account_type_names_ya</item>
<item>@string/account_type_hints_ya</item>
<item>@string/account_type_helps_ya</item>
<item>@drawable/ic_type_yandex</item>
<item>True</item>
<item>xmpp.yandex.ru</item>
<item>5222</item>
<item>True</item>
<item>yandex.ru</item>
<item>ya.ru</item>
</array>
<array name="account_type_livejournal">
<item>@string/account_protocol_xmpp</item>
<item>@string/account_type_names_livejournal</item>
<item>@string/account_type_hints_livejournal</item>
<item>@string/account_type_helps_livejournal</item>
<item>@drawable/ic_type_livejournal</item>
<item>False</item>
<item>livejournal.com</item>
<item>5222</item>
<item>True</item>
<item>livejournal.com</item>
</array>
<array name="account_type_odnoklassniki">
<item>@string/account_protocol_xmpp</item>
<item>@string/account_type_names_odnoklassniki</item>
<item>@string/account_type_hints_odnoklassniki</item>
<item>@string/account_type_helps_odnoklassniki</item>
<item>@drawable/ic_type_odnoklassniki</item>
<item>False</item>
<item>xmpp.odnoklassniki.ru</item>
<item>5222</item>
<item>True</item>
<item>odnoklassniki.ru</item>
</array>
<array name="account_types">
<item>@array/account_type_xmpp</item>
<item>@array/account_type_gtalk</item>
<item>@array/account_type_wlm</item>
<item>@array/account_type_facebook</item>
<item>@array/account_type_qip</item>
<item>@array/account_type_ya</item>
<item>@array/account_type_livejournal</item>
<item>@array/account_type_odnoklassniki</item>
</array>
</resources>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment