Commit f275952b authored by Grigory Fedorov's avatar Grigory Fedorov

ContactAddFragment: new fragment, derived from GroupEditorFragment to select...

ContactAddFragment: new fragment, derived from GroupEditorFragment to select groups while adding contact.
parent a32185d7
......@@ -18,7 +18,11 @@ import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.EditText;
import android.widget.Spinner;
import android.widget.Toast;
......@@ -31,27 +35,14 @@ import com.xabber.android.data.message.MessageManager;
import com.xabber.android.data.roster.PresenceManager;
import com.xabber.android.data.roster.RosterManager;
import com.xabber.android.ui.adapter.AccountChooseAdapter;
import com.xabber.android.ui.dialog.ContactDeleteDialogFragment;
import com.xabber.android.ui.helper.ManagedActivity;
import com.xabber.androiddev.R;
import java.util.Collection;
import java.util.HashSet;
public class ContactAdd extends ManagedActivity implements View.OnClickListener {
private static final String SAVED_ACCOUNT = "com.xabber.android.ui.ContactAdd.SAVED_ACCOUNT";
private static final String SAVED_USER = "com.xabber.android.ui.ContactAdd.SAVED_USER";
private static final String SAVED_NAME = "com.xabber.android.ui.ContactAdd.SAVED_NAME";
private String account;
private String user;
/**
* Views
*/
private Spinner accountView;
private EditText userView;
private EditText nameView;
public class ContactAdd extends ManagedActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
......@@ -60,88 +51,41 @@ public class ContactAdd extends ManagedActivity implements View.OnClickListener
setContentView(R.layout.contact_add);
setSupportActionBar((Toolbar) findViewById(R.id.toolbar_default));
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeAsUpIndicator(R.drawable.ic_clear_white_24dp);
getSupportActionBar().setTitle(null);
accountView = (Spinner) findViewById(R.id.contact_account);
accountView.setAdapter(new AccountChooseAdapter(this));
userView = (EditText) findViewById(R.id.contact_user);
nameView = (EditText) findViewById(R.id.contact_name);
findViewById(R.id.ok).setOnClickListener(this);
String name;
Intent intent = getIntent();
if (savedInstanceState != null) {
account = savedInstanceState.getString(SAVED_ACCOUNT);
user = savedInstanceState.getString(SAVED_USER);
name = savedInstanceState.getString(SAVED_NAME);
} else {
account = getAccount(intent);
user = getUser(intent);
if (account == null || user == null)
name = null;
else {
name = RosterManager.getInstance().getName(account, user);
if (user.equals(name))
name = null;
}
}
if (account == null) {
Collection<String> accounts = AccountManager.getInstance()
.getAccounts();
if (accounts.size() == 1)
account = accounts.iterator().next();
}
if (account != null) {
for (int position = 0; position < accountView.getCount(); position++)
if (account.equals(accountView.getItemAtPosition(position))) {
accountView.setSelection(position);
break;
}
if (savedInstanceState == null) {
getSupportFragmentManager()
.beginTransaction()
.add(R.id.container, ContactAddFragment.newInstance(getAccount(intent), getUser(intent)))
.commit();
}
if (user != null)
userView.setText(user);
if (name != null)
nameView.setText(name);
}
private void addContact() {
((ContactAddFragment)getSupportFragmentManager().findFragmentById(R.id.container)).addContact();
}
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putString(SAVED_ACCOUNT, (String) accountView.getSelectedItem());
outState.putString(SAVED_USER, userView.getText().toString());
outState.putString(SAVED_NAME, nameView.getText().toString());
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater=getMenuInflater();
inflater.inflate(R.menu.add_contact, menu);
return true;
}
@Override
public void onClick(View view) {
switch (view.getId()) {
case R.id.ok:
String user = userView.getText().toString();
if ("".equals(user)) {
Toast.makeText(this, getString(R.string.EMPTY_USER_NAME),
Toast.LENGTH_LONG).show();
return;
}
String account = (String) accountView.getSelectedItem();
if (account == null) {
Toast.makeText(this, getString(R.string.EMPTY_ACCOUNT),
Toast.LENGTH_LONG).show();
return;
}
try {
RosterManager.getInstance().createContact(account, user,
nameView.getText().toString(), new HashSet<String>());
PresenceManager.getInstance().requestSubscription(account, user);
} catch (NetworkException e) {
Application.getInstance().onError(e);
finish();
return;
}
MessageManager.getInstance().openChat(account, user);
finish();
break;
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.action_add_contact:
addContact();
return true;
default:
break;
return super.onOptionsItemSelected(item);
}
}
......
package com.xabber.android.ui;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.AdapterView;
import android.widget.EditText;
import android.widget.Spinner;
import android.widget.Toast;
import com.xabber.android.data.Application;
import com.xabber.android.data.NetworkException;
import com.xabber.android.data.account.AccountManager;
import com.xabber.android.data.message.MessageManager;
import com.xabber.android.data.roster.PresenceManager;
import com.xabber.android.data.roster.RosterManager;
import com.xabber.android.ui.adapter.AccountChooseAdapter;
import com.xabber.androiddev.R;
import java.util.Collection;
public class ContactAddFragment extends GroupEditorFragment implements AdapterView.OnItemSelectedListener {
private static final String SAVED_NAME = "com.xabber.android.ui.ContactAdd.SAVED_NAME";
private static final String SAVED_ACCOUNT = "com.xabber.android.ui.ContactAdd.SAVED_ACCOUNT";
private static final String SAVED_USER = "com.xabber.android.ui.ContactAdd.SAVED_USER";
private Spinner accountView;
private EditText userView;
private EditText nameView;
private View selectGroupsView;
public static ContactAddFragment newInstance(String account, String user) {
ContactAddFragment fragment = new ContactAddFragment();
Bundle args = new Bundle();
args.putString(ARG_ACCOUNT, account);
args.putString(ARG_USER, user);
fragment.setArguments(args);
return fragment;
}
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
View headerView = ((LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE))
.inflate(R.layout.contact_add_header, null, false);
getListView().addHeaderView(headerView);
accountView = (Spinner) headerView.findViewById(R.id.contact_account);
accountView.setAdapter(new AccountChooseAdapter(getActivity()));
accountView.setOnItemSelectedListener(this);
userView = (EditText) headerView.findViewById(R.id.contact_user);
nameView = (EditText) headerView.findViewById(R.id.contact_name);
selectGroupsView = headerView.findViewById(R.id.select_groups_text_view);
selectGroupsView.setVisibility(View.GONE);
getFooterView().setVisibility(View.GONE);
String name;
if (savedInstanceState != null) {
name = savedInstanceState.getString(SAVED_NAME);
setAccount(savedInstanceState.getString(SAVED_ACCOUNT));
setUser(savedInstanceState.getString(SAVED_USER));
} else {
if (getAccount() == null || getUser() == null) {
name = null;
} else {
name = RosterManager.getInstance().getName(getAccount(), getUser());
if (getUser().equals(name)) {
name = null;
}
}
}
if (getAccount() == null) {
Collection<String> accounts = AccountManager.getInstance().getAccounts();
if (accounts.size() == 1) {
setAccount(accounts.iterator().next());
}
}
if (getAccount() != null) {
for (int position = 0; position < accountView.getCount(); position++) {
if (getAccount().equals(accountView.getItemAtPosition(position))) {
accountView.setSelection(position);
break;
}
}
}
if (getUser() != null) {
userView.setText(getUser());
}
if (name != null) {
nameView.setText(name);
}
}
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putString(SAVED_ACCOUNT, getAccount());
outState.putString(SAVED_USER, userView.getText().toString());
outState.putString(SAVED_NAME, nameView.getText().toString());
}
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
String selectedAccount = (String) accountView.getSelectedItem();
if (selectedAccount == null) {
onNothingSelected(parent);
setAccount(selectedAccount);
} else {
if (!selectedAccount.equals(getAccount())) {
setAccount(selectedAccount);
setAccountGroups();
updateGroups();
}
getFooterView().setVisibility(View.VISIBLE);
selectGroupsView.setVisibility(View.VISIBLE);
}
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
getFooterView().setVisibility(View.GONE);
selectGroupsView.setVisibility(View.GONE);
}
public void addContact() {
String user = userView.getText().toString();
if ("".equals(user)) {
Toast.makeText(getActivity(), getString(R.string.EMPTY_USER_NAME),
Toast.LENGTH_LONG).show();
return;
}
String account = (String) accountView.getSelectedItem();
if (account == null) {
Toast.makeText(getActivity(), getString(R.string.EMPTY_ACCOUNT),
Toast.LENGTH_LONG).show();
return;
}
try {
RosterManager.getInstance().createContact(account, user,
nameView.getText().toString(), getSelected());
PresenceManager.getInstance().requestSubscription(account, user);
} catch (NetworkException e) {
Application.getInstance().onError(e);
getActivity().finish();
return;
}
MessageManager.getInstance().openChat(account, user);
getActivity().finish();
}
}
......@@ -28,6 +28,7 @@ import com.xabber.android.data.roster.AbstractContact;
import com.xabber.android.data.roster.OnContactChangedListener;
import com.xabber.android.data.roster.RosterManager;
import com.xabber.android.ui.helper.ContactTitleActionBarInflater;
import com.xabber.android.ui.helper.ContactTitleExpandableToolbarInflater;
import com.xabber.android.ui.helper.ManagedActivity;
import com.xabber.androiddev.R;
import com.xabber.xmpp.address.Jid;
......@@ -45,7 +46,7 @@ public class GroupEditor extends ManagedActivity implements OnContactChangedList
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.contact_editor);
setContentView(R.layout.group_editor);
setSupportActionBar((Toolbar) findViewById(R.id.toolbar_default));
contactTitleActionBarInflater = new ContactTitleActionBarInflater(this);
......
......@@ -22,14 +22,16 @@ import com.xabber.androiddev.R;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
public class GroupEditorFragment extends ListFragment implements TextWatcher, View.OnClickListener {
private static final String ARG_ACCOUNT = "com.xabber.android.ui.GroupEditorFragment.ARG_ACCOUNT";
private static final String ARG_USER = "com.xabber.android.ui.GroupEditorFragment.ARG_USER";
protected static final String ARG_ACCOUNT = "com.xabber.android.ui.GroupEditorFragment.ARG_ACCOUNT";
protected static final String ARG_USER = "com.xabber.android.ui.GroupEditorFragment.ARG_USER";
private static final String SAVED_GROUPS = "com.xabber.android.ui.GroupEditorFragment.SAVED_GROUPS";
private static final String SAVED_SELECTED = "com.xabber.android.ui.GroupEditorFragment.SAVED_SELECTED";
private static final String SAVED_ADD_GROUP_NAME = "com.xabber.android.ui.GroupEditorFragment.SAVED_ADD_GROUP_NAME";
private String account;
private String user;
......@@ -37,10 +39,11 @@ public class GroupEditorFragment extends ListFragment implements TextWatcher, Vi
private GroupEditorAdapter groupEditorAdapter;
private Collection<String> groups;
private Collection<String> selected;
private Collection<String> selected = new HashSet<>();
private EditText groupAddInput;
private CheckBox groupAddCheckBox;
private View footerView;
public static GroupEditorFragment newInstance(String account, String user) {
GroupEditorFragment fragment = new GroupEditorFragment();
......@@ -84,15 +87,22 @@ public class GroupEditorFragment extends ListFragment implements TextWatcher, Vi
if (savedInstanceState != null) {
groups = savedInstanceState.getStringArrayList(SAVED_GROUPS);
selected = savedInstanceState.getStringArrayList(SAVED_SELECTED);
groupAddInput.setText(savedInstanceState.getString(SAVED_ADD_GROUP_NAME));
} else {
groups = RosterManager.getInstance().getGroups(account);
selected = RosterManager.getInstance().getGroups(account, user);
setAccountGroups();
if (user != null) {
selected = RosterManager.getInstance().getGroups(account, user);
}
}
}
protected void setAccountGroups() {
groups = RosterManager.getInstance().getGroups(account);
}
private void setUpFooter() {
View footerView = ((LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.group_add_footer, null, false);
footerView = ((LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.group_add_footer, null, false);
getListView().addFooterView(footerView);
groupAddInput = (EditText) footerView.findViewById(R.id.group_add_input);
......@@ -107,10 +117,10 @@ public class GroupEditorFragment extends ListFragment implements TextWatcher, Vi
public void onResume() {
super.onResume();
setGroups(groups, selected);
updateGroups();
}
void setGroups(Collection<String> groups, Collection<String> selected) {
protected void updateGroups() {
ArrayList<String> list = new ArrayList<>(groups);
Collections.sort(list);
groupEditorAdapter.clear();
......@@ -121,8 +131,6 @@ public class GroupEditorFragment extends ListFragment implements TextWatcher, Vi
GroupEditorAdapter.Group group = new GroupEditorAdapter.Group(groupName, selected.contains(groupName));
groupEditorAdapter.add(group);
getListView().setItemChecked(position + getListView().getHeaderViewsCount(),
selected.contains(groupName));
}
}
......@@ -136,6 +144,7 @@ public class GroupEditorFragment extends ListFragment implements TextWatcher, Vi
outState.putStringArrayList(SAVED_GROUPS, getGroups());
outState.putStringArrayList(SAVED_SELECTED, new ArrayList<>(selected));
outState.putString(SAVED_ADD_GROUP_NAME, groupAddInput.getText().toString());
}
@Override
......@@ -144,10 +153,12 @@ public class GroupEditorFragment extends ListFragment implements TextWatcher, Vi
selected = getSelected();
try {
RosterManager.getInstance().setGroups(account, user, selected);
} catch (NetworkException e) {
Application.getInstance().onError(e);
if (account != null && !"".equals(user)) {
try {
RosterManager.getInstance().setGroups(account, user, selected);
} catch (NetworkException e) {
Application.getInstance().onError(e);
}
}
}
......@@ -156,9 +167,12 @@ public class GroupEditorFragment extends ListFragment implements TextWatcher, Vi
public void onListItemClick(ListView l, View v, int position, long id) {
super.onListItemClick(l, v, position, id);
CheckBox checkBox = (CheckBox) v.findViewById(R.id.group_add_checkbox);
CheckBox checkBox = (CheckBox) v.findViewById(R.id.group_item_selected_checkbox);
checkBox.toggle();
groupEditorAdapter.getItem(position).setIsSelected(checkBox.isChecked());
GroupEditorAdapter.Group group = groupEditorAdapter.getItem(position - getListView().getHeaderViewsCount());
group.setIsSelected(checkBox.isChecked());
}
protected ArrayList<String> getGroups() {
......@@ -222,4 +236,24 @@ public class GroupEditorFragment extends ListFragment implements TextWatcher, Vi
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
protected String getAccount() {
return account;
}
protected String getUser() {
return user;
}
protected void setAccount(String account) {
this.account = account;
}
protected void setUser(String user) {
this.user = user;
}
protected View getFooterView() {
return footerView;
}
}
......@@ -36,7 +36,7 @@ public class GroupEditorAdapter extends ArrayAdapter<GroupEditorAdapter.Group> {
row = inflater.inflate(layoutResourceId, parent, false);
holder = new GroupHolder();
holder.groupCheckbox = (CheckBox) row.findViewById(R.id.group_add_checkbox);
holder.groupCheckbox = (CheckBox) row.findViewById(R.id.group_item_selected_checkbox);
holder.groupName = (TextView) row.findViewById(R.id.group_item_name);
row.setTag(holder);
......
......@@ -12,6 +12,7 @@ import android.view.Window;
import android.view.WindowManager;
import android.widget.RelativeLayout;
import com.github.ksoichiro.android.observablescrollview.ObservableListView;
import com.github.ksoichiro.android.observablescrollview.ObservableScrollView;
import com.github.ksoichiro.android.observablescrollview.ObservableScrollViewCallbacks;
import com.github.ksoichiro.android.observablescrollview.ScrollState;
......
......@@ -12,15 +12,24 @@
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
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<include layout="@layout/toolbar_default" />
<include layout="@layout/toolbar_default"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_alignParentTop="true"
android:id="@+id/toolbar_default"
/>
<include layout="@layout/contact_add_header" />
</LinearLayout>
\ No newline at end of file
<FrameLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/toolbar_default"
>
</FrameLayout>
</RelativeLayout>
\ No newline at end of file
......@@ -16,8 +16,10 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingRight="4dip"
android:layout_height="wrap_content"
android:paddingRight="16dp"
android:paddingLeft="16dp"
android:paddingTop="16dp"
>
<TextView
......@@ -60,21 +62,8 @@
android:singleLine="true"
/>
<LinearLayout
android:orientation="horizontal"
android:gravity="center_horizontal|bottom"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<Button
android:text="@string/contact_add"
android:id="@+id/ok"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
</LinearLayout>
<TextView
android:id="@+id/select_groups_text_view"
android:text="@string/contact_group"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.Toolbar xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/contact_viewer_toolbar"
android:layout_height="100dp"
android:layout_width="match_parent"
android:minHeight="?attr/actionBarSize"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
android:background="@color/background_material_dark"
android:elevation="8dp"
/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/preferences_activity_container"
/>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
<com.github.ksoichiro.android.observablescrollview.ObservableScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scroll"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:layout_height="match_parent"
android:fillViewport="true"
android:scrollbars="vertical"
>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/xmpp_items"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
/>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/contact_info_items"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
/>
android:paddingTop="@dimen/toolbar_height"
android:paddingBottom="8dp"
>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/xmpp_items"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
/>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/contact_info_items"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
/>
</LinearLayout>
\ No newline at end of file
</LinearLayout>
</com.github.ksoichiro.android.observablescrollview.ObservableScrollView>
......@@ -6,95 +6,12 @@
android:descendantFocusability="beforeDescendants"
android:focusableInTouchMode="true" >
<com.github.ksoichiro.android.observablescrollview.ObservableScrollView
android:id="@+id/scroll"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:scrollbars="vertical">
<FrameLayout
android:id="@+id/scrollable_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/toolbar_height">
</FrameLayout>
</com.github.ksoichiro.android.observablescrollview.ObservableScrollView>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/expandable_contact_title"
android:id="@+id/scrollable_container"
android:layout_width="match_parent"
android:layout_height="@dimen/toolbar_height"
android:background="@color/green_500"
android:elevation="8dp"
>
<LinearLayout
android:id="@+id/contact_name_panel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?android:attr/actionBarSize"
android:orientation="horizontal"
android:layout_gravity="bottom"
android:paddingBottom="10dp"
>
<ImageView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/avatar"
android:layout_width="@dimen/avatar_large_size"
android:layout_height="@dimen/avatar_large_size"
android:src="@drawable/ic_avatar_1"
android:layout_gravity="center_vertical"
/>
<LinearLayout
android:id="@+id/name_holder"
android:layout_width="0dp"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:gravity="center_vertical"
>
<TextView
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:singleLine="true"
android:textColor="@color/primary_text_default_material_dark"
android:text="Lorem Ipsum"
android:layout_marginLeft="6dp"
android:textSize="18sp"
android:textStyle="bold" />
<TextView
android:id="@+id/status_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:singleLine="true"
android:textColor="@color/grey_200"
android:text="Lorem ipsum dolor sit amet"
android:layout_marginTop="3dp"
android:layout_marginLeft="6dp"
/>
</LinearLayout>
<ImageView
android:id="@+id/status_icon"
android:src="@drawable/ic_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
/>
android:layout_height="wrap_content"/>
</LinearLayout>
</FrameLayout>
<include layout="@layout/expandable_fake_toolbar" />
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar_overlay"
......@@ -102,7 +19,6 @@
android:layout_height="?attr/actionBarSize"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
android:background="@null"
android:elevation="8dp"
/>
......
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/expandable_contact_title"
android:layout_width="match_parent"
android:layout_height="@dimen/toolbar_height"
android:background="@color/green_500"
android:elevation="8dp"
tools:showIn="@layout/expandable_contact_title_activity">
<LinearLayout
android:id="@+id/contact_name_panel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?android:attr/actionBarSize"
android:orientation="horizontal"
android:layout_gravity="bottom"
android:paddingBottom="10dp">
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/avatar"
android:layout_width="@dimen/avatar_large_size"
android:layout_height="@dimen/avatar_large_size"
android:src="@drawable/ic_avatar_1"
android:layout_gravity="center_vertical" />
<LinearLayout
android:id="@+id/name_holder"
android:layout_width="0dp"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:gravity="center_vertical">
<TextView
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:singleLine="true"
android:textColor="@color/primary_text_default_material_dark"
android:text="Lorem Ipsum"
android:layout_marginLeft="6dp"
android:textSize="18sp"
android:textStyle="bold" />
<TextView
android:id="@+id/status_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:singleLine="true"
android:textColor="@color/grey_200"
android:text="Lorem ipsum dolor sit amet"
android:layout_marginTop="3dp"
android:layout_marginLeft="6dp" />
</LinearLayout>
<ImageView
android:id="@+id/status_icon"
android:src="@drawable/ic_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical" />
</LinearLayout>
</FrameLayout>
\ No newline at end of file
......@@ -17,7 +17,8 @@
android:textAppearance="?android:attr/textAppearanceMedium"
android:id="@+id/group_add_input"
android:layout_weight="1"
android:hint="Add new group..."
android:hint="@string/add_new_group"
android:textColorHint="@color/grey_400"
android:singleLine="true" />
<CheckBox
......
......@@ -21,7 +21,7 @@
/>
<CheckBox
android:id="@+id/group_add_checkbox"
android:id="@+id/group_item_selected_checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="false"
......
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item android:id="@+id/action_add_contact"
android:title="@string/contact_add"
app:showAsAction="always"
/>
</menu>
\ No newline at end of file
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