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
a78c21b6
Commit
a78c21b6
authored
May 25, 2015
by
Grigory Fedorov
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'release/1.0.12'
parents
1216bf06
c8cad1ca
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
63 additions
and
51 deletions
+63
-51
build.gradle
app/build.gradle
+2
-2
ChatViewerFragment.java
...c/main/java/com/xabber/android/ui/ChatViewerFragment.java
+4
-12
ContactEditor.java
app/src/main/java/com/xabber/android/ui/ContactEditor.java
+37
-2
ContactList.java
app/src/main/java/com/xabber/android/ui/ContactList.java
+12
-10
ContactViewer.java
app/src/main/java/com/xabber/android/ui/ContactViewer.java
+1
-2
StatusEditor.java
app/src/main/java/com/xabber/android/ui/StatusEditor.java
+2
-5
ContactTitleExpandableToolbarInflater.java
...roid/ui/helper/ContactTitleExpandableToolbarInflater.java
+5
-6
clear_status_history.xml
app/src/main/res/menu/clear_status_history.xml
+0
-9
theme.xml
app/src/main/res/values/theme.xml
+0
-3
No files found.
app/build.gradle
View file @
a78c21b6
...
...
@@ -7,8 +7,8 @@ android {
defaultConfig
{
minSdkVersion
14
targetSdkVersion
22
versionCode
18
3
versionName
'1.0.1
1
'
versionCode
18
4
versionName
'1.0.1
2
'
}
compileOptions
{
...
...
app/src/main/java/com/xabber/android/ui/ChatViewerFragment.java
View file @
a78c21b6
...
...
@@ -63,7 +63,7 @@ public class ChatViewerFragment extends Fragment implements PopupMenu.OnMenuItem
boolean
isInputEmpty
=
true
;
private
EditText
inputView
;
private
ChatMessageAdapter
chatMessageAdapter
;
private
boolean
skipOnTextChanges
;
private
boolean
skipOnTextChanges
=
false
;
private
String
account
;
private
String
user
;
private
ImageButton
sendButton
;
...
...
@@ -77,6 +77,7 @@ public class ChatViewerFragment extends Fragment implements PopupMenu.OnMenuItem
private
AbstractContact
abstractContact
;
private
LinearLayoutManager
layoutManager
;
private
MessageItem
clickedMessageItem
;
private
AccountPainter
accountPainter
;
public
static
ChatViewerFragment
newInstance
(
String
account
,
String
user
)
{
ChatViewerFragment
fragment
=
new
ChatViewerFragment
();
...
...
@@ -134,8 +135,7 @@ public class ChatViewerFragment extends Fragment implements PopupMenu.OnMenuItem
setHasOptionsMenu
(
true
);
AccountPainter
accountPainter
=
new
AccountPainter
(
getActivity
());
toolbar
.
setBackgroundColor
(
accountPainter
.
getAccountMainColor
(
account
));
accountPainter
=
new
AccountPainter
(
getActivity
());
sendButton
=
(
ImageButton
)
view
.
findViewById
(
R
.
id
.
button_send_message
);
sendButton
.
setImageResource
(
R
.
drawable
.
ic_button_send_inactive_24dp
);
...
...
@@ -188,15 +188,6 @@ public class ChatViewerFragment extends Fragment implements PopupMenu.OnMenuItem
}
});
inputView
.
setOnFocusChangeListener
(
new
View
.
OnFocusChangeListener
()
{
@Override
public
void
onFocusChange
(
View
v
,
boolean
hasFocus
)
{
if
(!
hasFocus
)
{
ChatStateManager
.
getInstance
().
onPaused
(
account
,
user
);
}
}
});
inputView
.
addTextChangedListener
(
new
TextWatcher
()
{
@Override
...
...
@@ -378,6 +369,7 @@ public class ChatViewerFragment extends Fragment implements PopupMenu.OnMenuItem
public
void
updateChat
()
{
ContactTitleInflater
.
updateTitle
(
contactTitleView
,
getActivity
(),
abstractContact
);
toolbar
.
setBackgroundColor
(
accountPainter
.
getAccountMainColor
(
account
));
int
itemCountBeforeUpdate
=
chatMessageAdapter
.
getItemCount
();
chatMessageAdapter
.
onChange
();
scrollChat
(
itemCountBeforeUpdate
);
...
...
app/src/main/java/com/xabber/android/ui/ContactEditor.java
View file @
a78c21b6
...
...
@@ -4,9 +4,13 @@ import android.app.AlertDialog;
import
android.content.Context
;
import
android.content.DialogInterface
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.support.v4.app.NavUtils
;
import
android.support.v7.widget.Toolbar
;
import
android.text.InputType
;
import
android.view.Menu
;
import
android.view.MenuItem
;
import
android.view.View
;
import
android.widget.EditText
;
import
com.xabber.android.R
;
...
...
@@ -17,19 +21,50 @@ import com.xabber.android.data.roster.RosterContact;
import
com.xabber.android.data.roster.RosterManager
;
import
com.xabber.android.ui.dialog.ContactDeleteDialogFragment
;
public
class
ContactEditor
extends
ContactViewer
{
public
class
ContactEditor
extends
ContactViewer
implements
Toolbar
.
OnMenuItemClickListener
{
public
static
Intent
createIntent
(
Context
context
,
String
account
,
String
user
)
{
return
new
EntityIntentBuilder
(
context
,
ContactEditor
.
class
)
.
setAccount
(
account
).
setUser
(
user
).
build
();
}
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
Toolbar
toolbar
=
contactTitleExpandableToolbarInflater
.
getToolbar
();
RosterContact
rosterContact
=
RosterManager
.
getInstance
().
getRosterContact
(
getAccount
(),
getBareAddress
());
if
(
rosterContact
!=
null
)
{
toolbar
.
inflateMenu
(
R
.
menu
.
contact_viewer
);
toolbar
.
setOnMenuItemClickListener
(
this
);
}
toolbar
.
setNavigationIcon
(
R
.
drawable
.
ic_arrow_left_white_24dp
);
toolbar
.
setNavigationOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
NavUtils
.
navigateUpFromSameTask
(
ContactEditor
.
this
);
}
});
}
@Override
public
boolean
onCreateOptionsMenu
(
Menu
menu
)
{
getMenuInflater
().
inflate
(
R
.
menu
.
contact_viewer
,
menu
);
RosterContact
rosterContact
=
RosterManager
.
getInstance
().
getRosterContact
(
getAccount
(),
getBareAddress
());
if
(
rosterContact
!=
null
)
{
getMenuInflater
().
inflate
(
R
.
menu
.
contact_viewer
,
menu
);
}
return
true
;
}
@Override
public
boolean
onMenuItemClick
(
MenuItem
item
)
{
return
onOptionsItemSelected
(
item
);
}
@Override
public
boolean
onOptionsItemSelected
(
MenuItem
item
)
{
switch
(
item
.
getItemId
())
{
...
...
app/src/main/java/com/xabber/android/ui/ContactList.java
View file @
a78c21b6
...
...
@@ -43,7 +43,6 @@ import android.widget.Toast;
import
com.xabber.android.R
;
import
com.xabber.android.data.ActivityManager
;
import
com.xabber.android.data.Application
;
import
com.xabber.android.data.LogManager
;
import
com.xabber.android.data.NetworkException
;
import
com.xabber.android.data.SettingsManager
;
import
com.xabber.android.data.account.AccountManager
;
...
...
@@ -80,7 +79,7 @@ import java.util.Collection;
* @author alexander.ivanov
*/
public
class
ContactList
extends
ManagedActivity
implements
OnAccountChangedListener
,
View
.
OnClickListener
,
OnChoosedListener
,
OnContactClickListener
,
ContactListDrawerFragment
.
ContactListDrawerListener
{
View
.
OnClickListener
,
OnChoosedListener
,
OnContactClickListener
,
ContactListDrawerFragment
.
ContactListDrawerListener
,
Toolbar
.
OnMenuItemClickListener
{
/**
* Select contact to be invited to the room was requested.
...
...
@@ -155,19 +154,19 @@ public class ContactList extends ManagedActivity implements OnAccountChangedList
setContentView
(
R
.
layout
.
contact_list
);
Toolbar
toolbar
=
(
Toolbar
)
findViewById
(
R
.
id
.
toolbar_default
);
toolbar
.
setOnClickListener
(
this
);
setSupportActionBar
(
toolbar
);
drawerLayout
=
(
DrawerLayout
)
findViewById
(
R
.
id
.
drawer_layout
);
drawerToggle
=
new
ActionBarDrawerToggle
(
this
,
drawerLayout
,
toolbar
,
R
.
string
.
application_title_short
,
R
.
string
.
application_title_short
);
drawerLayout
.
setDrawerListener
(
drawerToggle
);
getSupportActionBar
().
setHomeButtonEnabled
(
true
);
toolbar
.
inflateMenu
(
R
.
menu
.
contact_list
);
setUpSearchView
(
toolbar
.
getMenu
());
toolbar
.
setOnMenuItemClickListener
(
this
);
barPainter
=
new
BarPainter
(
this
,
toolbar
);
barPainter
.
setDefaultColor
();
setTitle
(
getString
(
R
.
string
.
application_title_full
)
);
toolbar
.
setTitle
(
R
.
string
.
application_title_full
);
if
(
savedInstanceState
!=
null
)
{
sendText
=
savedInstanceState
.
getString
(
SAVED_SEND_TEXT
);
...
...
@@ -344,13 +343,13 @@ public class ContactList extends ManagedActivity implements OnAccountChangedList
public
boolean
onCreateOptionsMenu
(
Menu
menu
)
{
super
.
onCreateOptionsMenu
(
menu
);
getMenuInflater
().
inflate
(
R
.
menu
.
contact_list
,
menu
);
setUpSearchView
(
menu
);
menu
.
findItem
(
R
.
id
.
action_search
).
setVisible
(
false
);
return
true
;
}
private
void
setUpSearchView
(
final
Menu
menu
)
{
searchView
=
(
SearchView
)
menu
.
findItem
(
R
.
id
.
action_search
).
getActionView
();
searchView
.
setQueryHint
(
"Search contact"
);
searchView
.
setQueryHint
(
getString
(
R
.
string
.
contact_search_hint
)
);
searchView
.
setOnCloseListener
(
new
SearchView
.
OnCloseListener
()
{
@Override
...
...
@@ -371,14 +370,12 @@ public class ContactList extends ManagedActivity implements OnAccountChangedList
@Override
public
boolean
onMenuItemActionCollapse
(
MenuItem
item
)
{
LogManager
.
i
(
this
,
"onMenuItemActionCollapse"
);
searchView
.
setQuery
(
""
,
true
);
searchView
.
clearFocus
();
return
true
;
}
});
searchView
.
setOnQueryTextListener
(
new
SearchView
.
OnQueryTextListener
()
{
@Override
public
boolean
onQueryTextSubmit
(
String
query
)
{
...
...
@@ -394,6 +391,11 @@ public class ContactList extends ManagedActivity implements OnAccountChangedList
});
}
@Override
public
boolean
onMenuItemClick
(
MenuItem
item
)
{
return
onOptionsItemSelected
(
item
);
}
@Override
public
boolean
onOptionsItemSelected
(
MenuItem
item
)
{
if
(
drawerToggle
.
onOptionsItemSelected
(
item
))
{
...
...
app/src/main/java/com/xabber/android/ui/ContactViewer.java
View file @
a78c21b6
...
...
@@ -43,10 +43,9 @@ import java.util.List;
public
class
ContactViewer
extends
ManagedActivity
implements
OnContactChangedListener
,
OnAccountChangedListener
{
protected
ContactTitleExpandableToolbarInflater
contactTitleExpandableToolbarInflater
;
private
String
account
;
private
String
bareAddress
;
private
ContactTitleExpandableToolbarInflater
contactTitleExpandableToolbarInflater
;
private
TextView
contactNameView
;
public
static
Intent
createIntent
(
Context
context
,
String
account
,
String
user
)
{
...
...
app/src/main/java/com/xabber/android/ui/StatusEditor.java
View file @
a78c21b6
...
...
@@ -101,12 +101,13 @@ public class StatusEditor extends ManagedListActivity implements OnItemClickList
listView
.
setOnItemClickListener
(
this
);
registerForContextMenu
(
listView
);
adapter
=
new
StatusEditorAdapter
(
this
);
setListAdapter
(
adapter
);
View
footerView
=
((
LayoutInflater
)
getSystemService
(
Context
.
LAYOUT_INFLATER_SERVICE
)).
inflate
(
R
.
layout
.
status_history_footer
,
null
,
false
);
footerView
.
findViewById
(
R
.
id
.
clear_status_history_button
).
setOnClickListener
(
this
);
listView
.
addFooterView
(
footerView
);
setListAdapter
(
adapter
);
statusTextView
=
(
EditText
)
findViewById
(
R
.
id
.
status_text
);
statusModeView
=
(
Spinner
)
findViewById
(
R
.
id
.
status_icon
);
statusModeView
.
setAdapter
(
new
StatusModeAdapter
(
this
));
...
...
@@ -191,10 +192,6 @@ public class StatusEditor extends ManagedListActivity implements OnItemClickList
case
R
.
id
.
action_change_status
:
changeStatus
();
return
true
;
case
R
.
id
.
action_clear_status_history
:
clearStatusHistory
();
return
true
;
}
return
false
;
}
...
...
app/src/main/java/com/xabber/android/ui/helper/ContactTitleExpandableToolbarInflater.java
View file @
a78c21b6
...
...
@@ -42,6 +42,7 @@ public class ContactTitleExpandableToolbarInflater implements ObservableScrollVi
private
int
avatarRadius
;
private
int
contactTitlePaddingBottomBig
;
private
int
contactTitlePaddingBottomSmall
;
private
Toolbar
toolbar
;
public
ContactTitleExpandableToolbarInflater
(
AppCompatActivity
activity
)
{
this
.
activity
=
activity
;
...
...
@@ -49,9 +50,7 @@ public class ContactTitleExpandableToolbarInflater implements ObservableScrollVi
public
void
onCreate
(
AbstractContact
abstractContact
)
{
activity
.
setContentView
(
R
.
layout
.
expandable_contact_title_activity
);
activity
.
setSupportActionBar
((
Toolbar
)
activity
.
findViewById
(
R
.
id
.
toolbar_overlay
));
activity
.
getSupportActionBar
().
setDisplayHomeAsUpEnabled
(
true
);
activity
.
getSupportActionBar
().
setDisplayShowTitleEnabled
(
false
);
toolbar
=
(
Toolbar
)
activity
.
findViewById
(
R
.
id
.
toolbar_overlay
);
avatarView
=
activity
.
findViewById
(
R
.
id
.
avatar
);
contactNamePanel
=
activity
.
findViewById
(
R
.
id
.
contact_name_panel
);
...
...
@@ -182,9 +181,9 @@ public class ContactTitleExpandableToolbarInflater implements ObservableScrollVi
}
titleView
.
setPadding
(
paddingLeft
,
0
,
paddingLeft
,
0
);
}
public
Toolbar
getToolbar
()
{
return
toolbar
;
}
}
app/src/main/res/menu/clear_status_history.xml
deleted
100644 → 0
View file @
1216bf06
<?xml version="1.0" encoding="utf-8"?>
<menu
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
>
<item
android:id=
"@+id/action_clear_status_history"
android:title=
"@string/clear_status_history"
app:showAsAction=
"always"
android:orderInCategory=
"90"
/>
</menu>
\ No newline at end of file
app/src/main/res/values/theme.xml
View file @
a78c21b6
...
...
@@ -19,9 +19,6 @@
<!--for text selection toolbar to be above usual toolbar -->
<item
name=
"windowActionModeOverlay"
>
true
</item>
<!-- for hardware button menu -->
<item
name=
"panelBackground"
>
?attr/colorPrimary
</item>
</style>
<style
name=
"ToolbarTitle"
parent=
"@style/TextAppearance.Widget.AppCompat.Toolbar.Title"
>
...
...
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