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
7ca652a5
Commit
7ca652a5
authored
Feb 25, 2015
by
Grigory Fedorov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
QuickContactBadge does not used for avatars displaying - they are not clickable anymore.
Avatar inflater helpers removed.
parent
eae1d6a8
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
30 additions
and
179 deletions
+30
-179
BaseContactInflater.java
...va/com/xabber/android/ui/adapter/BaseContactInflater.java
+0
-4
ChatListAdapter.java
...n/java/com/xabber/android/ui/adapter/ChatListAdapter.java
+0
-5
AbstractAvatarInflaterHelper.java
...abber/android/ui/helper/AbstractAvatarInflaterHelper.java
+0
-49
AvatarInflaterHelper.java
...va/com/xabber/android/ui/helper/AvatarInflaterHelper.java
+0
-39
DummyAvatarInflaterHelper.java
...m/xabber/android/ui/helper/DummyAvatarInflaterHelper.java
+0
-32
base_contact_avatar.xml
app/src/main/res/layout/base_contact_avatar.xml
+0
-22
base_contact_item.xml
app/src/main/res/layout/base_contact_item.xml
+10
-1
chat_list_item.xml
app/src/main/res/layout/chat_list_item.xml
+8
-1
contact_title.xml
app/src/main/res/layout/contact_title.xml
+12
-1
contact_title_avatar.xml
app/src/main/res/layout/contact_title_avatar.xml
+0
-25
No files found.
app/src/main/java/com/xabber/android/ui/adapter/BaseContactInflater.java
View file @
7ca652a5
...
...
@@ -32,7 +32,6 @@ import android.widget.TextView;
import
com.xabber.android.data.SettingsManager
;
import
com.xabber.android.data.roster.AbstractContact
;
import
com.xabber.android.ui.helper.AbstractAvatarInflaterHelper
;
import
com.xabber.androiddev.R
;
/**
...
...
@@ -46,7 +45,6 @@ public abstract class BaseContactInflater {
final
LayoutInflater
layoutInflater
;
final
AbstractAvatarInflaterHelper
avatarInflaterHelper
;
/**
* Repeated shadow for drawable.
...
...
@@ -62,7 +60,6 @@ public abstract class BaseContactInflater {
public
BaseContactInflater
(
Activity
activity
)
{
this
.
activity
=
activity
;
layoutInflater
=
(
LayoutInflater
)
activity
.
getSystemService
(
Context
.
LAYOUT_INFLATER_SERVICE
);
avatarInflaterHelper
=
AbstractAvatarInflaterHelper
.
createAbstractContactInflaterHelper
();
Bitmap
bitmap
=
BitmapFactory
.
decodeResource
(
activity
.
getResources
(),
R
.
drawable
.
shadow
);
shadowDrawable
=
new
BitmapDrawable
(
activity
.
getResources
(),
bitmap
);
...
...
@@ -128,7 +125,6 @@ public abstract class BaseContactInflater {
if
(
SettingsManager
.
contactsShowAvatars
())
{
viewHolder
.
avatar
.
setVisibility
(
View
.
VISIBLE
);
viewHolder
.
avatar
.
setImageDrawable
(
abstractContact
.
getAvatarForContactList
());
avatarInflaterHelper
.
updateAvatar
(
viewHolder
.
avatar
,
abstractContact
);
((
RelativeLayout
.
LayoutParams
)
viewHolder
.
panel
.
getLayoutParams
())
.
addRule
(
RelativeLayout
.
RIGHT_OF
,
R
.
id
.
avatar
);
}
else
{
...
...
app/src/main/java/com/xabber/android/ui/adapter/ChatListAdapter.java
View file @
7ca652a5
...
...
@@ -13,7 +13,6 @@ import com.xabber.android.data.message.MessageManager;
import
com.xabber.android.data.notification.NotificationManager
;
import
com.xabber.android.data.roster.AbstractContact
;
import
com.xabber.android.data.roster.RosterManager
;
import
com.xabber.android.ui.helper.AbstractAvatarInflaterHelper
;
import
com.xabber.androiddev.R
;
import
java.util.ArrayList
;
...
...
@@ -23,15 +22,12 @@ public class ChatListAdapter extends BaseAdapter {
private
List
<
AbstractChat
>
chats
;
private
final
AbstractAvatarInflaterHelper
avatarInflaterHelper
;
private
final
Context
context
;
public
ChatListAdapter
(
Context
context
)
{
this
.
context
=
context
;
chats
=
new
ArrayList
<>();
avatarInflaterHelper
=
AbstractAvatarInflaterHelper
.
createAbstractContactInflaterHelper
();
}
public
void
updateChats
(
List
<
AbstractChat
>
chats
)
{
...
...
@@ -73,7 +69,6 @@ public class ChatListAdapter extends BaseAdapter {
final
ImageView
avatarView
=
(
ImageView
)
view
.
findViewById
(
R
.
id
.
avatar
);
avatarView
.
setImageDrawable
(
abstractContact
.
getAvatar
());
avatarInflaterHelper
.
updateAvatar
(
avatarView
,
abstractContact
);
final
TextView
textView
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
text
);
...
...
app/src/main/java/com/xabber/android/ui/helper/AbstractAvatarInflaterHelper.java
deleted
100644 → 0
View file @
eae1d6a8
/**
* 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
.
helper
;
import
android.widget.ImageView
;
import
com.xabber.android.data.Application
;
import
com.xabber.android.data.roster.AbstractContact
;
/**
* Helper class to update avatar's contact item.
*
* @author alexander.ivanov
*/
public
abstract
class
AbstractAvatarInflaterHelper
{
/**
* Update avatar image view.
*
* @param avatar
* @param abstractContact
*/
public
abstract
void
updateAvatar
(
ImageView
avatar
,
AbstractContact
abstractContact
);
/**
* @return New instance depend on whether new system contact list is
* supported.
*/
public
static
AbstractAvatarInflaterHelper
createAbstractContactInflaterHelper
()
{
if
(
Application
.
getInstance
().
isContactsSupported
())
return
new
AvatarInflaterHelper
();
else
return
new
DummyAvatarInflaterHelper
();
}
}
app/src/main/java/com/xabber/android/ui/helper/AvatarInflaterHelper.java
deleted
100644 → 0
View file @
eae1d6a8
/**
* 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
.
helper
;
import
android.annotation.TargetApi
;
import
android.provider.ContactsContract
;
import
android.widget.ImageView
;
import
android.widget.QuickContactBadge
;
import
com.xabber.android.data.roster.AbstractContact
;
/**
* Helper class to add quick contact badge to the inflated contact item.
*
* @author alexander.ivanov
*/
@TargetApi
(
5
)
public
class
AvatarInflaterHelper
extends
AbstractAvatarInflaterHelper
{
@Override
public
void
updateAvatar
(
ImageView
avatar
,
AbstractContact
abstractContact
)
{
QuickContactBadge
badge
=
(
QuickContactBadge
)
avatar
;
badge
.
assignContactFromEmail
(
abstractContact
.
getUser
(),
true
);
badge
.
setMode
(
ContactsContract
.
QuickContact
.
MODE_SMALL
);
}
}
app/src/main/java/com/xabber/android/ui/helper/DummyAvatarInflaterHelper.java
deleted
100644 → 0
View file @
eae1d6a8
/**
* 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
.
helper
;
import
android.widget.ImageView
;
import
com.xabber.android.data.roster.AbstractContact
;
/**
* This dummy implementation do nothing.
*
* @author alexander.ivanov
*/
public
class
DummyAvatarInflaterHelper
extends
AbstractAvatarInflaterHelper
{
@Override
public
void
updateAvatar
(
ImageView
avatar
,
AbstractContact
abstractContact
)
{
}
}
app/src/main/res/layout/base_contact_avatar.xml
deleted
100644 → 0
View file @
eae1d6a8
<?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/.
-->
<QuickContactBadge
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:id=
"@+id/avatar"
android:layout_width=
"@dimen/avatar_size"
android:layout_height=
"@dimen/avatar_size"
android:layout_toRightOf=
"@id/color"
android:src=
"@drawable/avatar_1_1"
/>
app/src/main/res/layout/base_contact_item.xml
View file @
7ca652a5
...
...
@@ -29,7 +29,16 @@
android:layout_marginEnd=
"3dp"
/>
<include
layout=
"@layout/base_contact_avatar"
/>
<ImageView
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:id=
"@+id/avatar"
android:layout_width=
"@dimen/avatar_size"
android:layout_height=
"@dimen/avatar_size"
android:layout_toRightOf=
"@id/color"
android:src=
"@drawable/avatar_1_1"
/>
<RelativeLayout
android:id=
"@+id/panel"
android:layout_width=
"match_parent"
...
...
app/src/main/res/layout/chat_list_item.xml
View file @
7ca652a5
...
...
@@ -31,7 +31,14 @@
android:src=
"@android:color/transparent"
/>
<include
layout=
"@layout/base_contact_avatar"
/>
<ImageView
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:id=
"@+id/avatar"
android:layout_width=
"@dimen/avatar_size"
android:layout_height=
"@dimen/avatar_size"
android:layout_toRightOf=
"@id/color"
android:src=
"@drawable/avatar_1_1"
/>
<LinearLayout
android:layout_width=
"match_parent"
...
...
app/src/main/res/layout/contact_title.xml
View file @
7ca652a5
...
...
@@ -6,7 +6,18 @@
android:layout_height=
"?android:attr/actionBarSize"
android:orientation=
"horizontal"
>
<include
layout=
"@layout/contact_title_avatar"
/>
<ImageView
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:id=
"@+id/avatar"
android:layout_width=
"48dip"
android:layout_height=
"48dip"
android:src=
"@drawable/avatar_1_1"
android:layout_gravity=
"center_vertical"
android:layout_marginRight=
"4dp"
android:layout_marginEnd=
"4dp"
/>
<LinearLayout
android:id=
"@+id/name_holder"
...
...
app/src/main/res/layout/contact_title_avatar.xml
deleted
100644 → 0
View file @
eae1d6a8
<?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/.
-->
<QuickContactBadge
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:id=
"@+id/avatar"
android:layout_width=
"48dip"
android:layout_height=
"48dip"
android:src=
"@drawable/avatar_1_1"
android:layout_gravity=
"center_vertical"
android:layout_marginRight=
"4dp"
android:layout_marginEnd=
"4dp"
/>
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