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
5cb535fb
Commit
5cb535fb
authored
May 15, 2015
by
Grigory Fedorov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Chat "show background" preference option. #438 Disabling this option should avoid crash #417
parent
e98e36ec
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
92 additions
and
70 deletions
+92
-70
SettingsManager.java
...rc/main/java/com/xabber/android/data/SettingsManager.java
+4
-0
ChatViewer.java
app/src/main/java/com/xabber/android/ui/ChatViewer.java
+7
-2
ChatViewerFragment.java
...c/main/java/com/xabber/android/ui/ChatViewerFragment.java
+1
-1
chat_viewer.xml
app/src/main/res/layout/chat_viewer.xml
+2
-5
chat_viewer_fragment.xml
app/src/main/res/layout/chat_viewer_fragment.xml
+0
-0
chat_viewer_incoming_message.xml
app/src/main/res/layout/chat_viewer_incoming_message.xml
+23
-23
chat_viewer_message.xml
app/src/main/res/layout/chat_viewer_message.xml
+0
-0
chat_viewer_outgoing_message.xml
app/src/main/res/layout/chat_viewer_outgoing_message.xml
+14
-14
preference_editor.xml
app/src/main/res/values-ru/preference_editor.xml
+3
-0
preference_editor.xml
app/src/main/res/values/preference_editor.xml
+3
-0
preferences.xml
app/src/main/res/values/preferences.xml
+3
-0
preference_chat.xml
app/src/main/res/xml/preference_chat.xml
+32
-25
No files found.
app/src/main/java/com/xabber/android/data/SettingsManager.java
View file @
5cb535fb
...
...
@@ -323,6 +323,10 @@ public class SettingsManager implements OnInitializedListener,
throw
new
IllegalStateException
();
}
public
static
boolean
chatsShowBackground
()
{
return
getBoolean
(
R
.
string
.
chats_show_background_key
,
R
.
bool
.
chats_show_background_default
);
}
public
static
int
chatsAppearanceStyle
()
{
String
value
=
getString
(
R
.
string
.
chats_font_size_key
,
R
.
string
.
chats_font_size_default
);
...
...
app/src/main/java/com/xabber/android/ui/ChatViewer.java
View file @
5cb535fb
...
...
@@ -27,6 +27,7 @@ import android.widget.LinearLayout;
import
com.xabber.android.R
;
import
com.xabber.android.data.ActivityManager
;
import
com.xabber.android.data.Application
;
import
com.xabber.android.data.SettingsManager
;
import
com.xabber.android.data.account.OnAccountChangedListener
;
import
com.xabber.android.data.entity.BaseEntity
;
import
com.xabber.android.data.extension.archive.MessageArchiveManager
;
...
...
@@ -167,7 +168,7 @@ public class ChatViewer extends ManagedActivity implements OnChatChangedListener
return
;
}
setContentView
(
R
.
layout
.
activity_
chat_viewer
);
setContentView
(
R
.
layout
.
chat_viewer
);
statusBarPainter
=
new
StatusBarPainter
(
this
);
getWindow
().
setSoftInputMode
(
WindowManager
.
LayoutParams
.
SOFT_INPUT_STATE_HIDDEN
);
...
...
@@ -187,7 +188,11 @@ public class ChatViewer extends ManagedActivity implements OnChatChangedListener
viewPager
=
(
ViewPager
)
findViewById
(
R
.
id
.
pager
);
viewPager
.
setAdapter
(
chatViewerAdapter
);
viewPager
.
setOnPageChangeListener
(
this
);
viewPager
.
getBackground
().
setAlpha
(
30
);
if
(
SettingsManager
.
chatsShowBackground
())
{
viewPager
.
setBackgroundDrawable
(
getResources
().
getDrawable
(
R
.
drawable
.
chat_background_repeat
));
viewPager
.
getBackground
().
setAlpha
(
30
);
}
chatScrollIndicatorAdapter
=
new
ChatScrollIndicatorAdapter
(
this
,
(
LinearLayout
)
findViewById
(
R
.
id
.
chat_scroll_indicator
));
...
...
app/src/main/java/com/xabber/android/ui/ChatViewerFragment.java
View file @
5cb535fb
...
...
@@ -112,7 +112,7 @@ public class ChatViewerFragment extends Fragment implements PopupMenu.OnMenuItem
public
View
onCreateView
(
LayoutInflater
inflater
,
ViewGroup
container
,
Bundle
savedInstanceState
)
{
super
.
onCreateView
(
inflater
,
container
,
savedInstanceState
);
View
view
=
inflater
.
inflate
(
R
.
layout
.
chat_fragment
,
container
,
false
);
View
view
=
inflater
.
inflate
(
R
.
layout
.
chat_
viewer_
fragment
,
container
,
false
);
contactTitleView
=
view
.
findViewById
(
R
.
id
.
contact_title
);
...
...
app/src/main/res/layout/
activity_
chat_viewer.xml
→
app/src/main/res/layout/chat_viewer.xml
View file @
5cb535fb
...
...
@@ -5,22 +5,19 @@
android:layout_height=
"match_parent"
>
<android.support.v4.view.ViewPager
android:id=
"@+id/pager"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@drawable/chat_background_repeat"
/>
<LinearLayout
android:id=
"@+id/chat_scroll_indicator"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
android:layout_centerHorizontal=
"true"
android:layout_marginTop=
"62dp"
android:
id=
"@+id/chat_scroll_indicator
"
android:
orientation=
"horizontal
"
>
</LinearLayout>
...
...
app/src/main/res/layout/chat_fragment.xml
→
app/src/main/res/layout/chat_
viewer_
fragment.xml
View file @
5cb535fb
File moved
app/src/main/res/layout/chat_viewer_incoming_message.xml
View file @
5cb535fb
...
...
@@ -22,13 +22,13 @@
android:layout_width=
"32dip"
android:layout_height=
"32dip"
android:layout_marginTop=
"3dp"
android:layout_marginLeft=
"6dp"
android:layout_alignTop=
"@+id/message_text"
android:layout_alignParentLeft=
"true"
android:layout_alignParentStart=
"true"
android:layout_alignTop=
"@+id/message_text"
android:layout_marginLeft=
"6dp"
android:layout_marginTop=
"3dp"
android:src=
"@drawable/ic_avatar_1"
/>
...
...
@@ -37,29 +37,29 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_toRightOf=
"@id/avatar"
android:layout_toEndOf=
"@id/avatar"
android:minWidth=
"142dp"
android:layout_marginEnd=
"48dp"
android:layout_marginLeft=
"6dp"
android:paddingLeft=
"16dp"
android:paddingRight=
"10dp"
android:paddingEnd=
"6dp"
android:layout_marginRight=
"48dp"
android:paddingTop=
"8dp"
android:paddingBottom=
"8dp"
android:layout_marginStart=
"6dp"
android:layout_toEndOf=
"@id/avatar"
android:layout_toRightOf=
"@id/avatar"
android:autoLink=
"all"
android:background=
"@drawable/message_incoming"
android:layout_marginLeft=
"6dp"
android:layout_marginStart=
"6dp"
android:minWidth=
"142dp"
android:layout_marginRight=
"48dp"
android:layout_marginEnd=
"48dp"
android:paddingBottom=
"8dp"
android:paddingEnd=
"6dp"
android:paddingLeft=
"16dp"
android:paddingRight=
"10dp"
android:
background=
"@drawable/message_incoming
"
>
android:
paddingTop=
"8dp
"
>
<include
layout=
"@layout/chat_
message"
/>
<include
layout=
"@layout/chat_
viewer_message"
/>
</FrameLayout>
...
...
@@ -68,14 +68,14 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_toRightOf=
"@+id/avatar"
android:layout_toEndOf=
"@+id/avatar"
android:layout_below=
"@+id/message_balloon"
android:layout_toEndOf=
"@+id/avatar"
android:layout_toRightOf=
"@+id/avatar"
android:paddingLeft=
"16dp"
android:textSize=
"10sp"
android:text=
"Feb 19, 2015 4:39 PM"
android:textSize=
"10sp"
/>
</RelativeLayout>
app/src/main/res/layout/chat_message.xml
→
app/src/main/res/layout/chat_
viewer_
message.xml
View file @
5cb535fb
File moved
app/src/main/res/layout/chat_viewer_outgoing_message.xml
View file @
5cb535fb
...
...
@@ -24,26 +24,26 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentTop=
"true"
android:layout_alignParentRight=
"true"
android:layout_alignParentEnd=
"true"
android:layout_alignParentRight=
"true"
android:layout_alignParentTop=
"true"
android:layout_marginEnd=
"6dp"
android:layout_marginLeft=
"48dp"
android:layout_marginStart=
"48dp"
android:layout_marginRight=
"6dp"
android:layout_margin
End=
"6
dp"
android:layout_margin
Start=
"48
dp"
android:paddingLeft=
"12dp"
android:paddingTop=
"8dp"
android:background=
"@drawable/message_outgoing_states"
android:paddingBottom=
"8dp"
android:paddingRight=
"16dp"
android:paddingEnd=
"16dp"
android:paddingLeft=
"12dp"
android:paddingRight=
"16dp"
android:
background=
"@drawable/message_outgoing_states
"
android:
paddingTop=
"8dp
"
>
<include
layout=
"@layout/chat_
message"
/>
<include
layout=
"@layout/chat_
viewer_message"
/>
</FrameLayout>
...
...
@@ -51,16 +51,16 @@
android:id=
"@+id/message_time"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_below=
"@+id/message_balloon"
android:layout_alignParentRight=
"true"
android:layout_alignParentEnd=
"true"
android:layout_alignParentRight=
"true"
android:layout_below=
"@+id/message_balloon"
android:paddingRight=
"16dp"
android:paddingEnd=
"16dp"
android:textSize=
"10sp"
android:paddingRight=
"16dp"
android:text=
"Feb 19, 2015 4:39 PM"
android:textSize=
"10sp"
/>
<ImageView
...
...
app/src/main/res/values-ru/preference_editor.xml
View file @
5cb535fb
...
...
@@ -72,6 +72,9 @@
<string
name=
"chats_divide"
>
Сообщение с новой строки\nОтображать сообщение с новой строки
</string>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/preference_editor_chat_viewer_new_line.png -->
<string
name=
"chats_divide_portrait"
>
В портретном режиме
</string>
<string
name=
"chats_show_background"
>
Отображать фон\nОтключение может увеличить производительность
</string>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/preference_editor_chat_viewer.png -->
<string
name=
"chats_font_size"
>
Размер шрифта\nРазмер текста сообщения
</string>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/preference_editor_chat_viewer_font_size.png -->
...
...
app/src/main/res/values/preference_editor.xml
View file @
5cb535fb
...
...
@@ -72,6 +72,9 @@
<string
name=
"chats_divide"
>
Message on the new line\nDisplay a message on a new line
</string>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/preference_editor_chat_viewer_new_line.png -->
<string
name=
"chats_divide_portrait"
>
In portrait mode
</string>
<string
name=
"chats_show_background"
>
Show background\nDisabling may increase performance
</string>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/preference_editor_chat_viewer.png -->
<string
name=
"chats_font_size"
>
Font size\nSize of text in the message
</string>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/preference_editor_chat_viewer_font_size.png -->
...
...
app/src/main/res/values/preferences.xml
View file @
5cb535fb
...
...
@@ -246,6 +246,9 @@
</string-array>
<string
name=
"chats_hide_keyboard_default"
>
@string/chats_hide_keyboard_landscape_value
</string>
<string
name=
"chats_show_background_key"
>
chats_show_background
</string>
<bool
name=
"chats_show_background_default"
>
true
</bool>
<string
name=
"chats_font_size_key"
>
chats_font_size
</string>
<string
name=
"chats_font_size_small_value"
>
small
</string>
<string
name=
"chats_font_size_normal_value"
>
normal
</string>
...
...
app/src/main/res/xml/preference_chat.xml
View file @
5cb535fb
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<CheckBoxPreference
android:title=
"@string/chats_show_avatars"
android:key=
"@string/chats_show_avatars_key"
android:defaultValue=
"@bool/chats_show_avatars_default"
android:key=
"@string/chats_show_avatars_key"
android:title=
"@string/chats_show_avatars"
/>
<CheckBoxPreference
android:title=
"@string/chats_send_by_enter"
android:key=
"@string/chats_send_by_enter_key"
android:defaultValue=
"@bool/chats_send_by_enter_default"
android:key=
"@string/chats_send_by_enter_key"
android:title=
"@string/chats_send_by_enter"
/>
<ListPreference
android:title=
"@string/chats_show_status_change"
android:summary=
"@string/chats_show_status_change"
android:key=
"@string/chats_show_status_change_key"
android:defaultValue=
"@string/chats_show_status_change_default"
android:entries=
"@array/chats_show_status_change_entries"
android:entryValues=
"@array/chats_show_status_change_entryvalues"
android:defaultValue=
"@string/chats_show_status_change_default"
android:key=
"@string/chats_show_status_change_key"
android:summary=
"@string/chats_show_status_change"
android:title=
"@string/chats_show_status_change"
/>
<ListPreference
android:title=
"@string/chats_hide_keyboard"
android:key=
"@string/chats_hide_keyboard_key"
android:defaultValue=
"@string/chats_hide_keyboard_default"
android:entries=
"@array/chats_hide_keyboard_entries"
android:entryValues=
"@array/chats_hide_keyboard_entryvalues"
android:defaultValue=
"@string/chats_hide_keyboard_default"
android:key=
"@string/chats_hide_keyboard_key"
android:title=
"@string/chats_hide_keyboard"
/>
<CheckBoxPreference
android:defaultValue=
"@bool/chats_show_background_default"
android:key=
"@string/chats_show_background_key"
android:title=
"@string/chats_show_background"
/>
<ListPreference
android:title=
"@string/chats_font_size"
android:key=
"@string/chats_font_size_key"
android:defaultValue=
"@string/chats_font_size_default"
android:entries=
"@array/chats_font_size_entries"
android:entryValues=
"@array/chats_font_size_entryvalues"
android:defaultValue=
"@string/chats_font_size_default"
android:key=
"@string/chats_font_size_key"
android:title=
"@string/chats_font_size"
/>
<ListPreference
android:title=
"@string/chats_divide"
android:key=
"@string/chats_divide_key"
android:defaultValue=
"@string/chats_divide_default"
android:entries=
"@array/chats_divide_entries"
android:entryValues=
"@array/chats_divide_entryvalues"
android:defaultValue=
"@string/chats_divide_default"
android:key=
"@string/chats_divide_key"
android:title=
"@string/chats_divide"
/>
<CheckBoxPreference
android:title=
"@string/chats_state_notification"
android:key=
"@string/chats_state_notification_key"
android:defaultValue=
"@bool/chats_state_notification_default"
android:key=
"@string/chats_state_notification_key"
android:title=
"@string/chats_state_notification"
/>
<CheckBoxPreference
android:title=
"@string/chats_attention"
android:key=
"@string/chats_attention_key"
android:defaultValue=
"@bool/chats_attention_default"
android:key=
"@string/chats_attention_key"
android:title=
"@string/chats_attention"
/>
<RingtonePreference
android:title=
"@string/chats_attention_sound"
android:key=
"@string/chats_attention_sound_key"
android:defaultValue=
"@string/chats_attention_sound_default"
android:ringtoneType=
"ringtone"
android:dependency=
"@string/chats_attention_key"
android:showSilent=
"true"
android:key=
"@string/chats_attention_sound_key"
android:ringtoneType=
"ringtone"
android:showDefault=
"true"
android:showSilent=
"true"
android:title=
"@string/chats_attention_sound"
/>
</PreferenceScreen>
\ 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