Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xabber-android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
xabber-android
Commits
392f4a5d
Commit
392f4a5d
authored
Feb 12, 2015
by
Grigory Fedorov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Contact list: accounts panel inflated into action bar.
parent
5841f896
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
94 deletions
+45
-94
ContactList.java
app/src/main/java/com/xabber/android/ui/ContactList.java
+19
-31
contact_list.xml
app/src/main/res/layout/contact_list.xml
+0
-63
contact_list_action_bar.xml
app/src/main/res/layout/contact_list_action_bar.xml
+26
-0
No files found.
app/src/main/java/com/xabber/android/ui/ContactList.java
View file @
392f4a5d
...
...
@@ -26,16 +26,16 @@ import android.os.Bundle;
import
android.os.Handler
;
import
android.support.v4.app.Fragment
;
import
android.support.v4.view.MenuItemCompat
;
import
android.support.v7.app.ActionBar
;
import
android.view.ContextMenu
;
import
android.view.ContextMenu.ContextMenuInfo
;
import
android.view.LayoutInflater
;
import
android.view.Menu
;
import
android.view.MenuItem
;
import
android.view.View
;
import
android.view.inputmethod.InputMethodManager
;
import
android.widget.ImageView
;
import
android.widget.LinearLayout
;
import
android.widget.SearchView
;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
com.xabber.android.data.ActivityManager
;
...
...
@@ -77,7 +77,7 @@ import java.util.Collection;
* @author alexander.ivanov
*/
public
class
ContactList
extends
ManagedActivity
implements
OnAccountChangedListener
,
View
.
OnClickListener
,
View
.
OnLongClickListener
,
OnAccountChangedListener
,
View
.
OnClickListener
,
OnChoosedListener
,
OnContactClickListener
{
/**
...
...
@@ -110,7 +110,7 @@ public class ContactList extends ManagedActivity implements
private
String
sendText
;
private
SearchView
searchView
;
private
View
title
View
;
private
View
actionBar
View
;
@Override
public
void
onCreate
(
Bundle
savedInstanceState
)
{
...
...
@@ -126,17 +126,21 @@ public class ContactList extends ManagedActivity implements
}
setContentView
(
R
.
layout
.
contact_list
);
titleView
=
findViewById
(
android
.
R
.
id
.
title
);
accountToggleAdapter
=
new
AccountToggleAdapter
(
this
,
this
,
(
LinearLayout
)
findViewById
(
R
.
id
.
account_list
));
View
commonStatusText
=
findViewById
(
R
.
id
.
common_status_text
);
View
commonStatusMode
=
findViewById
(
R
.
id
.
common_status_mode
);
ActionBar
actionBar
=
getSupportActionBar
();
actionBar
.
setDisplayShowTitleEnabled
(
false
);
actionBar
.
setDisplayShowHomeEnabled
(
false
);
actionBar
.
setDisplayHomeAsUpEnabled
(
false
);
actionBar
.
setDisplayShowCustomEnabled
(
true
);
actionBarView
=
LayoutInflater
.
from
(
this
).
inflate
(
R
.
layout
.
contact_list_action_bar
,
null
);
actionBarView
.
setOnClickListener
(
this
);
commonStatusText
.
setOnLongClickListener
(
this
);
commonStatusMode
.
setOnClickListener
(
this
);
commonStatusText
.
setOnClickListener
(
this
);
titleView
.
setOnClickListener
(
this
);
actionBar
.
setCustomView
(
actionBarView
,
new
ActionBar
.
LayoutParams
(
ActionBar
.
LayoutParams
.
MATCH_PARENT
,
ActionBar
.
LayoutParams
.
MATCH_PARENT
));
accountToggleAdapter
=
new
AccountToggleAdapter
(
this
,
this
,
(
LinearLayout
)
actionBarView
.
findViewById
(
R
.
id
.
account_list
));
if
(
savedInstanceState
!=
null
)
{
sendText
=
savedInstanceState
.
getString
(
SAVED_SEND_TEXT
);
...
...
@@ -448,10 +452,6 @@ public class ContactList extends ManagedActivity implements
@Override
public
void
onClick
(
View
view
)
{
switch
(
view
.
getId
())
{
case
R
.
id
.
common_status_mode
:
startActivity
(
StatusEditor
.
createIntent
(
this
));
break
;
case
R
.
id
.
common_status_text
:
case
android
.
R
.
id
.
title
:
getContactListFragment
().
scrollUp
();
break
;
...
...
@@ -473,16 +473,6 @@ public class ContactList extends ManagedActivity implements
}
}
@Override
public
boolean
onLongClick
(
View
view
)
{
switch
(
view
.
getId
())
{
case
R
.
id
.
common_status_text
:
startActivity
(
StatusEditor
.
createIntent
(
this
));
return
true
;
}
return
false
;
}
@Override
public
void
onContactClick
(
AbstractContact
abstractContact
)
{
switch
(
action
)
{
...
...
@@ -550,9 +540,9 @@ public class ContactList extends ManagedActivity implements
updateStatusBar
();
accountToggleAdapter
.
rebuild
();
if
(
SettingsManager
.
contactsShowPanel
()
&&
accountToggleAdapter
.
getCount
()
>
0
)
{
title
View
.
setVisibility
(
View
.
VISIBLE
);
actionBar
View
.
setVisibility
(
View
.
VISIBLE
);
}
else
{
title
View
.
setVisibility
(
View
.
GONE
);
actionBar
View
.
setVisibility
(
View
.
GONE
);
}
}
...
...
@@ -562,8 +552,6 @@ public class ContactList extends ManagedActivity implements
if
(
""
.
equals
(
statusText
))
{
statusText
=
getString
(
statusMode
.
getStringID
());
}
((
TextView
)
findViewById
(
R
.
id
.
common_status_text
)).
setText
(
statusText
);
((
ImageView
)
findViewById
(
R
.
id
.
common_status_mode
)).
setImageLevel
(
statusMode
.
getStatusLevel
());
}
public
static
Intent
createPersistentIntent
(
Context
context
)
{
...
...
app/src/main/res/layout/contact_list.xml
View file @
392f4a5d
...
...
@@ -17,69 +17,6 @@
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<RelativeLayout
android:id=
"@android:id/title"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/title_height"
android:layout_alignParentTop=
"true"
>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:layout_alignParentStart=
"true"
android:layout_alignParentLeft=
"true"
android:layout_alignParentRight=
"true"
android:layout_alignParentEnd=
"true"
android:layout_marginRight=
"@dimen/contact_list_status_mode_width"
android:layout_marginEnd=
"@dimen/contact_list_status_mode_width"
android:orientation=
"horizontal"
>
<HorizontalScrollView
android:id=
"@+id/account_bar"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginRight=
"72dip"
android:layout_marginEnd=
"72dip"
>
<LinearLayout
android:id=
"@+id/account_list"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
</LinearLayout>
</HorizontalScrollView>
<TextView
android:id=
"@+id/common_status_text"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_gravity=
"start"
android:layout_marginLeft=
"-72dip"
android:layout_marginStart=
"-72dip"
android:gravity=
"start|center_vertical"
android:padding=
"2dip"
android:singleLine=
"true"
android:text=
"online"
android:textColor=
"?android:attr/textColorPrimary"
/>
</LinearLayout>
<ImageButton
android:id=
"@+id/common_status_mode"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:layout_alignParentRight=
"true"
android:layout_alignParentEnd=
"true"
android:background=
"@drawable/btn_status_mode"
android:paddingLeft=
"@dimen/active_chat_padding_right"
android:paddingRight=
"@dimen/active_chat_padding_right"
android:src=
"@drawable/ic_status"
/>
</RelativeLayout>
<RelativeLayout
android:id=
"@+id/container"
android:layout_width=
"match_parent"
...
...
app/src/main/res/layout/contact_list_action_bar.xml
0 → 100644
View file @
392f4a5d
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:id=
"@android:id/title"
android:layout_width=
"match_parent"
android:layout_height=
"?android:attr/actionBarSize"
android:layout_gravity=
"fill_horizontal"
android:gravity=
"center_vertical"
>
<HorizontalScrollView
android:id=
"@+id/account_bar"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
>
<LinearLayout
android:id=
"@+id/account_list"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
</LinearLayout>
</HorizontalScrollView>
</RelativeLayout>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment