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
c1b15137
Commit
c1b15137
authored
Apr 07, 2015
by
Grigory Fedorov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Contact item layout changed, png offline shadow removed (transparent view used).
parent
2f5fb2d2
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
96 additions
and
104 deletions
+96
-104
BaseContactInflater.java
...va/com/xabber/android/ui/adapter/BaseContactInflater.java
+4
-28
contact_shadow.png
app/src/main/res/drawable/contact_shadow.png
+0
-0
base_contact_item.xml
app/src/main/res/layout/base_contact_item.xml
+91
-75
styles.xml
app/src/main/res/values/styles.xml
+1
-1
No files found.
app/src/main/java/com/xabber/android/ui/adapter/BaseContactInflater.java
View file @
c1b15137
...
@@ -16,10 +16,6 @@ package com.xabber.android.ui.adapter;
...
@@ -16,10 +16,6 @@ package com.xabber.android.ui.adapter;
import
android.app.Activity
;
import
android.app.Activity
;
import
android.content.Context
;
import
android.content.Context
;
import
android.graphics.Bitmap
;
import
android.graphics.BitmapFactory
;
import
android.graphics.Shader.TileMode
;
import
android.graphics.drawable.BitmapDrawable
;
import
android.graphics.drawable.ColorDrawable
;
import
android.graphics.drawable.ColorDrawable
;
import
android.view.Gravity
;
import
android.view.Gravity
;
import
android.view.LayoutInflater
;
import
android.view.LayoutInflater
;
...
@@ -27,7 +23,6 @@ import android.view.View;
...
@@ -27,7 +23,6 @@ import android.view.View;
import
android.view.ViewGroup
;
import
android.view.ViewGroup
;
import
android.widget.BaseAdapter
;
import
android.widget.BaseAdapter
;
import
android.widget.ImageView
;
import
android.widget.ImageView
;
import
android.widget.RelativeLayout
;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
com.xabber.android.data.SettingsManager
;
import
com.xabber.android.data.SettingsManager
;
...
@@ -45,12 +40,6 @@ public abstract class BaseContactInflater {
...
@@ -45,12 +40,6 @@ public abstract class BaseContactInflater {
final
LayoutInflater
layoutInflater
;
final
LayoutInflater
layoutInflater
;
/**
* Repeated shadow for drawable.
*/
final
BitmapDrawable
shadowDrawable
;
/**
/**
* Managed adapter.
* Managed adapter.
*/
*/
...
@@ -61,10 +50,6 @@ public abstract class BaseContactInflater {
...
@@ -61,10 +50,6 @@ public abstract class BaseContactInflater {
this
.
activity
=
activity
;
this
.
activity
=
activity
;
layoutInflater
=
(
LayoutInflater
)
activity
.
getSystemService
(
Context
.
LAYOUT_INFLATER_SERVICE
);
layoutInflater
=
(
LayoutInflater
)
activity
.
getSystemService
(
Context
.
LAYOUT_INFLATER_SERVICE
);
Bitmap
bitmap
=
BitmapFactory
.
decodeResource
(
activity
.
getResources
(),
R
.
drawable
.
contact_shadow
);
shadowDrawable
=
new
BitmapDrawable
(
activity
.
getResources
(),
bitmap
);
shadowDrawable
.
setTileModeXY
(
TileMode
.
REPEAT
,
TileMode
.
REPEAT
);
accountColors
=
activity
.
getResources
().
getIntArray
(
R
.
array
.
account_action_bar
);
accountColors
=
activity
.
getResources
().
getIntArray
(
R
.
array
.
account_action_bar
);
}
}
...
@@ -114,9 +99,9 @@ public abstract class BaseContactInflater {
...
@@ -114,9 +99,9 @@ public abstract class BaseContactInflater {
public
void
getView
(
View
view
,
AbstractContact
abstractContact
)
{
public
void
getView
(
View
view
,
AbstractContact
abstractContact
)
{
final
ViewHolder
viewHolder
=
(
ViewHolder
)
view
.
getTag
();
final
ViewHolder
viewHolder
=
(
ViewHolder
)
view
.
getTag
();
if
(
abstractContact
.
isConnected
())
{
if
(
abstractContact
.
isConnected
())
{
viewHolder
.
s
hadow
.
setVisibility
(
View
.
GONE
);
viewHolder
.
offlineS
hadow
.
setVisibility
(
View
.
GONE
);
}
else
{
}
else
{
viewHolder
.
s
hadow
.
setVisibility
(
View
.
VISIBLE
);
viewHolder
.
offlineS
hadow
.
setVisibility
(
View
.
VISIBLE
);
}
}
int
colorLevel
=
abstractContact
.
getColorLevel
();
int
colorLevel
=
abstractContact
.
getColorLevel
();
...
@@ -125,12 +110,8 @@ public abstract class BaseContactInflater {
...
@@ -125,12 +110,8 @@ public abstract class BaseContactInflater {
if
(
SettingsManager
.
contactsShowAvatars
())
{
if
(
SettingsManager
.
contactsShowAvatars
())
{
viewHolder
.
avatar
.
setVisibility
(
View
.
VISIBLE
);
viewHolder
.
avatar
.
setVisibility
(
View
.
VISIBLE
);
viewHolder
.
avatar
.
setImageDrawable
(
abstractContact
.
getAvatarForContactList
());
viewHolder
.
avatar
.
setImageDrawable
(
abstractContact
.
getAvatarForContactList
());
((
RelativeLayout
.
LayoutParams
)
viewHolder
.
panel
.
getLayoutParams
())
.
addRule
(
RelativeLayout
.
RIGHT_OF
,
R
.
id
.
avatar
);
}
else
{
}
else
{
viewHolder
.
avatar
.
setVisibility
(
View
.
GONE
);
viewHolder
.
avatar
.
setVisibility
(
View
.
GONE
);
((
RelativeLayout
.
LayoutParams
)
viewHolder
.
panel
.
getLayoutParams
())
.
addRule
(
RelativeLayout
.
RIGHT_OF
,
R
.
id
.
color
);
}
}
viewHolder
.
name
.
setText
(
abstractContact
.
getName
());
viewHolder
.
name
.
setText
(
abstractContact
.
getName
());
...
@@ -147,8 +128,6 @@ public abstract class BaseContactInflater {
...
@@ -147,8 +128,6 @@ public abstract class BaseContactInflater {
viewHolder
.
status
.
setText
(
statusText
);
viewHolder
.
status
.
setText
(
statusText
);
viewHolder
.
status
.
setVisibility
(
View
.
VISIBLE
);
viewHolder
.
status
.
setVisibility
(
View
.
VISIBLE
);
}
}
viewHolder
.
shadow
.
setBackgroundDrawable
(
shadowDrawable
);
}
}
/**
/**
...
@@ -158,20 +137,17 @@ public abstract class BaseContactInflater {
...
@@ -158,20 +137,17 @@ public abstract class BaseContactInflater {
final
ImageView
color
;
final
ImageView
color
;
final
ImageView
avatar
;
final
ImageView
avatar
;
final
RelativeLayout
panel
;
final
TextView
name
;
final
TextView
name
;
final
TextView
status
;
final
TextView
status
;
final
ImageView
s
hadow
;
final
ImageView
offlineS
hadow
;
public
ViewHolder
(
View
view
)
{
public
ViewHolder
(
View
view
)
{
color
=
(
ImageView
)
view
.
findViewById
(
R
.
id
.
color
);
color
=
(
ImageView
)
view
.
findViewById
(
R
.
id
.
color
);
avatar
=
(
ImageView
)
view
.
findViewById
(
R
.
id
.
avatar
);
avatar
=
(
ImageView
)
view
.
findViewById
(
R
.
id
.
avatar
);
panel
=
(
RelativeLayout
)
view
.
findViewById
(
R
.
id
.
panel
);
name
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
name
);
name
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
name
);
status
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
status
);
status
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
status
);
shadow
=
(
ImageView
)
view
.
findViewById
(
R
.
id
.
shadow
);
offlineShadow
=
(
ImageView
)
view
.
findViewById
(
R
.
id
.
offline_
shadow
);
}
}
}
}
}
}
app/src/main/res/drawable/contact_shadow.png
deleted
100644 → 0
View file @
2f5fb2d2
175 Bytes
app/src/main/res/layout/base_contact_item.xml
View file @
c1b15137
...
@@ -12,14 +12,21 @@
...
@@ -12,14 +12,21 @@
You should have received a copy of the GNU General Public License,
You should have received a copy of the GNU General Public License,
along with this program. If not, see http://www.gnu.org/licenses/.
along with this program. If not, see http://www.gnu.org/licenses/.
-->
-->
<RelativeLayout
<FrameLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/contact_list_item_height"
android:layout_height=
"@dimen/contact_list_item_height"
android:paddingTop=
"@dimen/contact_list_item_padding_top"
android:paddingBottom=
"@dimen/contact_list_item_padding_bottom"
android:elevation=
"1dp"
android:elevation=
"1dp"
android:background=
"@color/grey_300"
android:background=
"@color/grey_300"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"horizontal"
android:gravity=
"center_vertical"
android:paddingRight=
"@dimen/active_chat_padding_right"
>
>
<ImageView
<ImageView
android:id=
"@+id/color"
android:id=
"@+id/color"
...
@@ -45,13 +52,10 @@
...
@@ -45,13 +52,10 @@
<RelativeLayout
<RelativeLayout
android:id=
"@+id/panel"
android:id=
"@+id/panel"
android:layout_width=
"match_parent
"
android:layout_width=
"0dp
"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
android:paddingLeft=
"@dimen/active_chat_padding_left"
android:paddingLeft=
"@dimen/active_chat_padding_left"
android:paddingTop=
"@dimen/active_chat_padding_top"
android:paddingRight=
"@dimen/active_chat_padding_right"
android:paddingBottom=
"@dimen/active_chat_padding_bottom"
android:layout_toRightOf=
"@id/avatar"
>
>
<ImageView
<ImageView
android:id=
"@+id/client_software"
android:id=
"@+id/client_software"
...
@@ -59,15 +63,24 @@
...
@@ -59,15 +63,24 @@
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentBottom=
"true"
android:layout_alignParentBottom=
"true"
android:layout_alignParentRight=
"true"
android:layout_alignParentRight=
"true"
android:paddingRight=
"@dimen/client_software_margin_left"
android:layout_alignParentEnd=
"true"
android:paddingRight=
"16dp"
android:paddingEnd=
"16dp"
android:src=
"@drawable/ic_client"
android:src=
"@drawable/ic_client"
android:alpha=
"0.05"
android:alpha=
"0.05"
/>
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
android:gravity=
"center_vertical"
>
<TextView
<TextView
android:id=
"@+id/name"
android:id=
"@+id/name"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/contact_name_height_show_status"
android:layout_height=
"wrap_content"
android:layout_marginRight=
"@dimen/status_icon_width"
android:gravity=
"bottom"
android:gravity=
"bottom"
android:singleLine=
"true"
android:singleLine=
"true"
android:ellipsize=
"marquee"
android:ellipsize=
"marquee"
...
@@ -79,30 +92,33 @@
...
@@ -79,30 +92,33 @@
<TextView
<TextView
android:id=
"@+id/status"
android:id=
"@+id/status"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/contact_name_height_show_status"
android:layout_height=
"wrap_content"
android:layout_marginRight=
"@dimen/status_icon_width"
android:gravity=
"top"
android:gravity=
"top"
android:singleLine=
"true"
android:singleLine=
"true"
android:ellipsize=
"marquee"
android:ellipsize=
"marquee"
android:text=
"status"
android:text=
"status"
android:visibility=
"visible"
android:visibility=
"visible"
android:layout_below=
"@id/name"
android:textColor=
"?android:attr/textColorSecondary"
android:textColor=
"?android:attr/textColorSecondary"
/>
/>
</LinearLayout>
</RelativeLayout>
<ImageView
<ImageView
android:id=
"@+id/status_icon"
android:id=
"@+id/status_icon"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:layout_alignParentRight=
"true"
android:src=
"@drawable/ic_status"
android:src=
"@drawable/ic_status"
/>
/>
</RelativeLayout>
</LinearLayout>
<ImageView
android:id=
"@+id/shadow"
<ImageView
android:id=
"@+id/offline_shadow"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/contact_list_item_height"
android:layout_height=
"match_parent"
android:background=
"@drawable/contact_shadow"
android:src=
"@color/black"
android:alpha=
"0.7"
android:visibility=
"gone"
android:visibility=
"gone"
/>
/>
</RelativeLayout>
</FrameLayout>
\ No newline at end of file
app/src/main/res/values/styles.xml
View file @
c1b15137
...
@@ -109,7 +109,7 @@
...
@@ -109,7 +109,7 @@
<dimen
name=
"contact_list_item_padding_top"
>
2dip
</dimen>
<dimen
name=
"contact_list_item_padding_top"
>
2dip
</dimen>
<dimen
name=
"contact_list_item_padding_bottom"
>
2dip
</dimen>
<dimen
name=
"contact_list_item_padding_bottom"
>
2dip
</dimen>
<dimen
name=
"contact_list_item_height"
>
5
2
dip
</dimen>
<dimen
name=
"contact_list_item_height"
>
5
6
dip
</dimen>
<!-- = avatar_size + contact_list_item_padding_top + contact_list_item_padding_bottom -->
<!-- = avatar_size + contact_list_item_padding_top + contact_list_item_padding_bottom -->
<dimen
name=
"contact_list_status_mode_width"
>
44dip
</dimen>
<dimen
name=
"contact_list_status_mode_width"
>
44dip
</dimen>
...
...
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