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
3296aa30
Commit
3296aa30
authored
May 19, 2015
by
Grigory Fedorov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Navigation drawer UI changed. #449
parent
d6387788
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
94 additions
and
40 deletions
+94
-40
ContactListDrawerFragment.java
...java/com/xabber/android/ui/ContactListDrawerFragment.java
+5
-3
NavigationDrawerAccountAdapter.java
...er/android/ui/adapter/NavigationDrawerAccountAdapter.java
+12
-8
contact_list_drawer.xml
app/src/main/res/layout/contact_list_drawer.xml
+48
-17
contact_list_drawer_account_item.xml
app/src/main/res/layout/contact_list_drawer_account_item.xml
+25
-12
about_viewer.xml
app/src/main/res/values-ru/about_viewer.xml
+2
-0
about_viewer.xml
app/src/main/res/values/about_viewer.xml
+2
-0
No files found.
app/src/main/java/com/xabber/android/ui/ContactListDrawerFragment.java
View file @
3296aa30
...
...
@@ -10,6 +10,7 @@ import android.view.LayoutInflater;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.widget.AdapterView
;
import
android.widget.ImageView
;
import
android.widget.ListView
;
import
com.xabber.android.R
;
...
...
@@ -27,7 +28,7 @@ public class ContactListDrawerFragment extends Fragment implements View.OnClickL
private
ListView
listView
;
private
View
divider
;
private
View
headerTitle
;
private
View
drawerHeader
;
private
ImageView
drawerHeaderImage
;
@Override
public
void
onAttach
(
Activity
activity
)
{
...
...
@@ -40,7 +41,8 @@ public class ContactListDrawerFragment extends Fragment implements View.OnClickL
public
View
onCreateView
(
LayoutInflater
inflater
,
ViewGroup
container
,
Bundle
savedInstanceState
)
{
View
view
=
inflater
.
inflate
(
R
.
layout
.
contact_list_drawer
,
container
,
false
);
drawerHeader
=
view
.
findViewById
(
R
.
id
.
drawer_header
);
View
drawerHeader
=
view
.
findViewById
(
R
.
id
.
drawer_header
);
drawerHeaderImage
=
(
ImageView
)
drawerHeader
.
findViewById
(
R
.
id
.
drawer_header_image
);
listView
=
(
ListView
)
view
.
findViewById
(
R
.
id
.
drawer_account_list
);
...
...
@@ -99,7 +101,7 @@ public class ContactListDrawerFragment extends Fragment implements View.OnClickL
private
void
update
()
{
adapter
.
onChange
();
drawerHeader
.
getBackground
().
set
Level
(
AccountPainter
.
getDefaultAccountColorLevel
());
drawerHeader
Image
.
setImage
Level
(
AccountPainter
.
getDefaultAccountColorLevel
());
if
(
adapter
.
getCount
()
==
0
)
{
headerTitle
.
setVisibility
(
View
.
GONE
);
...
...
app/src/main/java/com/xabber/android/ui/adapter/NavigationDrawerAccountAdapter.java
View file @
3296aa30
...
...
@@ -12,6 +12,8 @@ import com.xabber.android.data.account.AccountItem;
import
com.xabber.android.data.account.AccountManager
;
import
com.xabber.android.data.connection.ConnectionState
;
import
com.xabber.android.data.extension.avatar.AvatarManager
;
import
com.xabber.android.data.roster.RosterManager
;
import
com.xabber.android.ui.helper.AccountPainter
;
import
java.util.ArrayList
;
import
java.util.Collection
;
...
...
@@ -20,12 +22,11 @@ import java.util.List;
public
class
NavigationDrawerAccountAdapter
extends
BaseListEditorAdapter
<
String
>
{
private
final
int
[]
accountColors
;
private
final
AccountPainter
accountPainter
;
public
NavigationDrawerAccountAdapter
(
Activity
activity
)
{
super
(
activity
);
accountColors
=
activity
.
getResources
().
getIntArray
(
R
.
array
.
account_action_bar
);
accountPainter
=
new
AccountPainter
(
activity
);
}
@Override
...
...
@@ -39,13 +40,16 @@ public class NavigationDrawerAccountAdapter extends BaseListEditorAdapter<String
}
String
account
=
getItem
(
position
);
int
accountColor
=
accountColors
[
accountManager
.
getColorLevel
(
account
)];
((
ImageView
)
view
.
findViewById
(
R
.
id
.
color
)).
setImageDrawable
(
new
ColorDrawable
((
accountPainter
.
getAccountMainColor
(
account
))));
((
ImageView
)
view
.
findViewById
(
R
.
id
.
avatar
)).
setImageDrawable
(
AvatarManager
.
getInstance
().
getAccountAvatar
(
account
));
TextView
accountName
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
name
);
accountName
.
setText
(
RosterManager
.
getInstance
().
getBestContact
(
account
,
accountManager
.
getVerboseName
(
account
)).
getName
());
accountName
.
setTextColor
(
accountPainter
.
getAccountDarkColor
(
account
));
((
ImageView
)
view
.
findViewById
(
R
.
id
.
color
)).
setImageDrawable
(
new
ColorDrawable
(
accountColor
));
((
ImageView
)
view
.
findViewById
(
R
.
id
.
avatar
))
.
setImageDrawable
(
AvatarManager
.
getInstance
().
getAccountAvatar
(
account
));
((
TextView
)
view
.
findViewById
(
R
.
id
.
account_jid
)).
setText
(
accountManager
.
getVerboseName
(
account
));
((
TextView
)
view
.
findViewById
(
R
.
id
.
name
)).
setText
(
accountManager
.
getVerboseName
(
account
));
AccountItem
accountItem
=
accountManager
.
getAccount
(
account
);
ConnectionState
state
;
if
(
accountItem
==
null
)
{
...
...
app/src/main/res/layout/contact_list_drawer.xml
View file @
3296aa30
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@android:color/background_light"
android:clickable=
"true"
android:orientation=
"vertical"
>
<
Relativ
eLayout
<
Fram
eLayout
android:id=
"@+id/drawer_header"
android:layout_width=
"match_parent"
android:layout_height=
"170dp"
android:background=
"@drawable/drawer_image"
>
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
>
<ImageView
android:id=
"@+id/drawer_header_image"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@drawable/drawer_image"
/>
<LinearLayout
android:layout_width=
"match_parent"
...
...
@@ -19,26 +25,49 @@
<ImageView
android:id=
"@+id/imageView"
android:layout_width=
"
wrap_content
"
android:layout_height=
"
wrap_content
"
android:layout_width=
"
64dp
"
android:layout_height=
"
64dp
"
android:layout_marginLeft=
"8dp"
android:src=
"@drawable/ic_connect"
/>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
android:paddingTop=
"8dp"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:layout_margin=
"0dp"
android:shadowColor=
"@color/grey_700"
android:shadowDx=
"1"
android:shadowDy=
"1"
android:shadowRadius=
"2"
android:text=
"@string/application_title_short"
android:textColor=
"@color/grey_50"
android:textSize=
"40sp"
/>
android:textSize=
"24sp"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:layout_marginTop=
"-8dp"
android:shadowColor=
"@color/grey_700"
android:shadowDx=
"1"
android:shadowDy=
"1"
android:shadowRadius=
"2"
android:text=
"@string/about_open_source_xmpp_client"
android:textColor=
"@color/grey_300"
android:textSize=
"12sp"
/>
</LinearLayout>
</LinearLayout>
</
Relativ
eLayout>
</
Fram
eLayout>
<ListView
android:id=
"@+id/drawer_account_list"
...
...
@@ -46,5 +75,7 @@
android:layout_height=
"wrap_content"
android:divider=
"@null"
android:dividerHeight=
"0dp"
/>
tools:listfooter=
"@layout/contact_list_drawer_footer"
tools:listheader=
"@layout/contact_list_drawer_header"
tools:listitem=
"@layout/contact_list_drawer_account_item"
/>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/contact_list_drawer_account_item.xml
View file @
3296aa30
...
...
@@ -13,7 +13,7 @@
-->
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"
48
dp"
android:layout_height=
"
64
dp"
android:paddingLeft=
"10dp"
android:paddingRight=
"16dp"
>
...
...
@@ -24,14 +24,14 @@
<de.hdodenhof.circleimageview.CircleImageView
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:id=
"@+id/color"
android:layout_width=
"
36
dp"
android:layout_height=
"
36
dp"
android:layout_width=
"
40
dp"
android:layout_height=
"
40
dp"
android:src=
"@color/green_500"
/>
<de.hdodenhof.circleimageview.CircleImageView
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:id=
"@+id/avatar"
android:layout_width=
"
36
dp"
android:layout_height=
"
36
dp"
android:layout_width=
"
40
dp"
android:layout_height=
"
40
dp"
android:src=
"@drawable/ic_avatar_1"
app:border_color=
"@android:color/transparent"
app:border_width=
"3dp"
/>
...
...
@@ -40,10 +40,11 @@
<LinearLayout
android:layout_width=
"0dp"
android:layout_height=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:layout_weight=
"1"
android:orientation=
"vertical"
android:paddingLeft=
"2
6
dp"
>
android:paddingLeft=
"2
2
dp"
>
<TextView
android:id=
"@+id/name"
...
...
@@ -51,11 +52,23 @@
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:ellipsize=
"marquee"
android:gravity=
"bottom"
android:singleLine=
"true"
android:text=
"test"
android:textColor=
"?android:attr/textColorPrimary"
android:textStyle=
"bold"
/>
android:text=
"Some Name"
android:textColor=
"@color/green_700"
android:textSize=
"18sp"
/>
<TextView
android:id=
"@+id/account_jid"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"-2dp"
android:layout_marginTop=
"-4dp"
android:layout_weight=
"1"
android:ellipsize=
"marquee"
android:singleLine=
"true"
android:text=
"example@example.com"
android:textColor=
"@color/grey_500"
android:textSize=
"14sp"
/>
<TextView
android:id=
"@+id/status"
...
...
@@ -65,7 +78,7 @@
android:ellipsize=
"marquee"
android:gravity=
"top"
android:singleLine=
"true"
android:text=
"
@android:string/cancel
"
android:text=
"
Online
"
android:textColor=
"?android:attr/textColorSecondary"
/>
</LinearLayout>
</LinearLayout>
app/src/main/res/values-ru/about_viewer.xml
View file @
3296aa30
...
...
@@ -9,4 +9,6 @@
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/about_viewer.png -->
<string
name=
"about_version"
>
Версия: %s
</string>
<string
name=
"about_license"
>
Лицензия: GNU GPLv3\n
<a
href=
"https://github.com/redsolution/xabber-android"
>
Программное обеспечение с открытым исходным кодом
</a></string>
<string
name=
"about_open_source_xmpp_client"
>
open source XMPP client
</string>
</resources>
\ No newline at end of file
app/src/main/res/values/about_viewer.xml
View file @
3296aa30
...
...
@@ -9,4 +9,6 @@
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/about_viewer.png -->
<string
name=
"about_version"
>
Version: %s
</string>
<string
name=
"about_license"
>
License: GNU GPLv3\n
<a
href=
"https://github.com/redsolution/xabber-android"
>
Open source software
</a></string>
<string
name=
"about_open_source_xmpp_client"
>
open source XMPP client
</string>
</resources>
\ 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