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
bc458cf9
Commit
bc458cf9
authored
Apr 13, 2015
by
Grigory Fedorov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Status editor layout changed. Footer clear status button added. Bottom toolbar removed.
parent
9ee523db
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
58 additions
and
34 deletions
+58
-34
StatusEditor.java
app/src/main/java/com/xabber/android/ui/StatusEditor.java
+22
-11
status_editor.xml
app/src/main/res/layout/status_editor.xml
+22
-23
status_history_footer.xml
app/src/main/res/layout/status_history_footer.xml
+12
-0
status_editor.xml
app/src/main/res/values-ru/status_editor.xml
+1
-0
status_editor.xml
app/src/main/res/values/status_editor.xml
+1
-0
No files found.
app/src/main/java/com/xabber/android/ui/StatusEditor.java
View file @
bc458cf9
...
...
@@ -20,6 +20,7 @@ import android.os.Bundle;
import
android.support.v7.widget.Toolbar
;
import
android.view.ContextMenu
;
import
android.view.ContextMenu.ContextMenuInfo
;
import
android.view.LayoutInflater
;
import
android.view.Menu
;
import
android.view.MenuInflater
;
import
android.view.MenuItem
;
...
...
@@ -44,7 +45,7 @@ import com.xabber.android.ui.helper.ActionBarPainter;
import
com.xabber.android.ui.helper.ManagedListActivity
;
import
com.xabber.androiddev.R
;
public
class
StatusEditor
extends
ManagedListActivity
implements
OnItemClickListener
,
Toolbar
.
OnMenuItemClickListener
{
public
class
StatusEditor
extends
ManagedListActivity
implements
OnItemClickListener
,
Toolbar
.
OnMenuItemClickListener
,
View
.
OnClickListener
{
private
static
final
String
SAVED_TEXT
=
"com.xabber.android.ui.StatusEditor.SAVED_TEXT"
;
private
static
final
String
SAVED_MODE
=
"com.xabber.android.ui.StatusEditor.SAVED_MODE"
;
...
...
@@ -56,7 +57,6 @@ public class StatusEditor extends ManagedListActivity implements OnItemClickList
private
SavedStatus
actionWithItem
;
private
StatusEditorAdapter
adapter
;
private
View
savedStatusesTextView
;
private
Toolbar
bottomToolbar
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
...
...
@@ -74,16 +74,11 @@ public class StatusEditor extends ManagedListActivity implements OnItemClickList
getSupportActionBar
().
setHomeAsUpIndicator
(
R
.
drawable
.
ic_clear_white_24dp
);
getSupportActionBar
().
setTitle
(
null
);
bottomToolbar
=
(
Toolbar
)
findViewById
(
R
.
id
.
bottom_toolbar
);
bottomToolbar
.
inflateMenu
(
R
.
menu
.
clear_status_history
);
bottomToolbar
.
setOnMenuItemClickListener
(
this
);
Intent
intent
=
getIntent
();
account
=
StatusEditor
.
getAccount
(
intent
);
if
(
account
!=
null
)
{
ActionBarPainter
actionBarPainter
=
new
ActionBarPainter
(
this
);
actionBarPainter
.
updateWithAccountName
(
account
);
bottomToolbar
.
setBackgroundColor
(
actionBarPainter
.
getAccountColor
(
account
));
}
ListView
listView
=
getListView
();
...
...
@@ -92,6 +87,10 @@ public class StatusEditor extends ManagedListActivity implements OnItemClickList
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
);
statusTextView
=
(
EditText
)
findViewById
(
R
.
id
.
status_text
);
statusModeView
=
(
Spinner
)
findViewById
(
R
.
id
.
status_icon
);
statusModeView
.
setAdapter
(
new
StatusModeAdapter
(
this
));
...
...
@@ -160,7 +159,6 @@ public class StatusEditor extends ManagedListActivity implements OnItemClickList
getListView
().
setVisibility
(
visibility
);
savedStatusesTextView
.
setVisibility
(
visibility
);
bottomToolbar
.
setVisibility
(
visibility
);
}
@Override
...
...
@@ -179,14 +177,18 @@ public class StatusEditor extends ManagedListActivity implements OnItemClickList
return
true
;
case
R
.
id
.
action_clear_status_history
:
AccountManager
.
getInstance
().
clearSavedStatuses
();
adapter
.
onChange
();
setStatusHistoryVisibility
();
clearStatusHistory
();
return
true
;
}
return
false
;
}
private
void
clearStatusHistory
()
{
AccountManager
.
getInstance
().
clearSavedStatuses
();
adapter
.
onChange
();
setStatusHistoryVisibility
();
}
@Override
public
void
onCreateContextMenu
(
ContextMenu
menu
,
View
v
,
ContextMenuInfo
menuInfo
)
{
super
.
onCreateContextMenu
(
menu
,
v
,
menuInfo
);
...
...
@@ -247,4 +249,13 @@ public class StatusEditor extends ManagedListActivity implements OnItemClickList
public
boolean
onMenuItemClick
(
MenuItem
menuItem
)
{
return
onOptionsItemSelected
(
menuItem
);
}
@Override
public
void
onClick
(
View
v
)
{
switch
(
v
.
getId
())
{
case
R
.
id
.
clear_status_history_button
:
clearStatusHistory
();
default
:
}
}
}
app/src/main/res/layout/status_editor.xml
View file @
bc458cf9
...
...
@@ -12,12 +12,11 @@
You should have received a copy of the GNU General Public License,
along with this program. If not, see http://www.gnu.org/licenses/.
-->
<RelativeLayout
xmlns:
android=
"http://schemas.android.com/apk/res/android
"
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:
tools=
"http://schemas.android.com/tools
"
android:orientation=
"vertical"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
android:layout_height=
"match_parent"
>
<include
layout=
"@layout/toolbar_default"
android:layout_height=
"wrap_content"
...
...
@@ -26,19 +25,10 @@
android:id=
"@+id/top_toolbar"
/>
<include
layout=
"@layout/toolbar_default"
android:layout_height=
"wrap_content"
android:layout_width=
"match_parent"
android:layout_alignParentBottom=
"true"
android:id=
"@+id/bottom_toolbar"
/>
<RelativeLayout
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:layout_below=
"@id/top_toolbar"
android:layout_above=
"@id/bottom_toolbar"
android:padding=
"8dp"
>
...
...
@@ -56,14 +46,23 @@
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/new_status"
android:textAppearance=
"?android:attr/textAppearanceMedium"
/>
android:textAppearance=
"?android:attr/textAppearanceSmall"
android:textColor=
"?attr/colorPrimary"
android:paddingLeft=
"8dp"
android:textStyle=
"bold"
/>
<Spinner
android:id=
"@+id/status_icon"
android:prompt=
"@string/status_editor"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
<TextView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/status_message"
android:layout_marginLeft=
"34dp"
android:textAppearance=
"?android:attr/textAppearanceSmall"
/>
<EditText
...
...
@@ -71,7 +70,7 @@
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:hint=
"@string/status_text_hint"
android:
paddingLeft=
"34
dp"
android:
layout_marginLeft=
"32
dp"
android:singleLine=
"true"
/>
...
...
@@ -79,23 +78,23 @@
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/saved_statuses"
android:textAppearance=
"?android:attr/textAppearanceMedium"
android:layout_marginTop=
"16dp"
android:layout_marginBottom=
"8dp"
android:textAppearance=
"?android:attr/textAppearanceSmall"
android:id=
"@+id/saved_statuses_textview"
/>
android:textColor=
"?attr/colorPrimary"
android:paddingLeft=
"8dp"
android:layout_marginTop=
"16dp"
android:textStyle=
"bold"
/>
</LinearLayout>
<ListView
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:id=
"@android:id/list"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_below=
"@id/top_panel"
/>
tools:listitem=
"@layout/status_editor_item"
tools:listfooter=
"@layout/status_history_footer"
/>
</RelativeLayout>
...
...
app/src/main/res/layout/status_history_footer.xml
0 → 100644
View file @
bc458cf9
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:orientation=
"vertical"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<Button
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/clear_status_history"
android:id=
"@+id/clear_status_history_button"
/>
</LinearLayout>
\ No newline at end of file
app/src/main/res/values-ru/status_editor.xml
View file @
bc458cf9
...
...
@@ -36,4 +36,5 @@
<string
name=
"new_status"
>
Новый статус
</string>
<string
name=
"saved_statuses"
>
Сохранённые статусы
</string>
<string
name=
"clear_status_history"
>
Очистить историю статусов
</string>
<string
name=
"status_message"
>
Статус-сообщение
</string>
</resources>
\ No newline at end of file
app/src/main/res/values/status_editor.xml
View file @
bc458cf9
...
...
@@ -36,5 +36,6 @@
<string
name=
"new_status"
>
New status
</string>
<string
name=
"saved_statuses"
>
Saved statuses
</string>
<string
name=
"clear_status_history"
>
Clear status history
</string>
<string
name=
"status_message"
>
Status message
</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