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
cf537c65
Commit
cf537c65
authored
Mar 26, 2015
by
Grigory Fedorov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ContactAddFragment: part of views are not shown until account selected.
parent
d2aef422
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
39 deletions
+54
-39
ContactAddFragment.java
...c/main/java/com/xabber/android/ui/ContactAddFragment.java
+16
-9
contact_add_header.xml
app/src/main/res/layout/contact_add_header.xml
+38
-30
No files found.
app/src/main/java/com/xabber/android/ui/ContactAddFragment.java
View file @
cf537c65
...
...
@@ -31,7 +31,7 @@ public class ContactAddFragment extends GroupEditorFragment implements AdapterVi
private
Spinner
accountView
;
private
EditText
userView
;
private
EditText
nameView
;
private
View
selectGroupsView
;
private
View
accountSpecificPanel
;
Listener
listenerActivity
;
...
...
@@ -66,10 +66,9 @@ public class ContactAddFragment extends GroupEditorFragment implements AdapterVi
userView
=
(
EditText
)
headerView
.
findViewById
(
R
.
id
.
contact_user
);
nameView
=
(
EditText
)
headerView
.
findViewById
(
R
.
id
.
contact_name
);
selectGroupsView
=
headerView
.
findViewById
(
R
.
id
.
select_groups_text_view
);
accountSpecificPanel
=
headerView
.
findViewById
(
R
.
id
.
account_specific_panel
);
selectGroupsView
.
setVisibility
(
View
.
GONE
);
getFooterView
().
setVisibility
(
View
.
GONE
);
hideAdditionalInputs
();
String
name
;
...
...
@@ -110,6 +109,11 @@ public class ContactAddFragment extends GroupEditorFragment implements AdapterVi
}
private
void
hideAdditionalInputs
()
{
accountSpecificPanel
.
setVisibility
(
View
.
GONE
);
getFooterView
().
setVisibility
(
View
.
GONE
);
}
@Override
public
void
onSaveInstanceState
(
Bundle
outState
)
{
super
.
onSaveInstanceState
(
outState
);
...
...
@@ -140,15 +144,18 @@ public class ContactAddFragment extends GroupEditorFragment implements AdapterVi
setAccountGroups
();
updateGroups
();
}
getFooterView
().
setVisibility
(
View
.
VISIBLE
);
selectGroupsView
.
setVisibility
(
View
.
VISIBLE
);
setAdditionalPanelVisibility
(
View
.
VISIBLE
);
}
}
private
void
setAdditionalPanelVisibility
(
int
visible
)
{
getFooterView
().
setVisibility
(
visible
);
accountSpecificPanel
.
setVisibility
(
visible
);
}
@Override
public
void
onNothingSelected
(
AdapterView
<?>
parent
)
{
getFooterView
().
setVisibility
(
View
.
GONE
);
selectGroupsView
.
setVisibility
(
View
.
GONE
);
setAdditionalPanelVisibility
(
View
.
GONE
);
}
public
void
addContact
()
{
...
...
@@ -178,6 +185,6 @@ public class ContactAddFragment extends GroupEditorFragment implements AdapterVi
}
public
interface
Listener
{
public
void
onAccountSelected
(
String
account
);
void
onAccountSelected
(
String
account
);
}
}
app/src/main/res/layout/contact_add_header.xml
View file @
cf537c65
...
...
@@ -27,6 +27,7 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
<com.xabber.android.ui.widget.NoDefaultSpinner
android:id=
"@+id/contact_account"
android:layout_width=
"match_parent"
...
...
@@ -34,39 +35,46 @@
android:prompt=
"@string/choose_account"
/>
<TextView
android:text=
"@string/contact_user"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
<EditText
android:text=
""
android:id=
"@+id/contact_user"
<LinearLayout
android:id=
"@+id/account_specific_panel"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:hint=
"user@domain.name"
android:singleLine=
"true"
android:inputType=
"textEmailAddress"
/>
android:orientation=
"vertical"
>
<TextView
android:text=
"@string/contact_user"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
<EditText
android:text=
""
android:id=
"@+id/contact_user"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:hint=
"user@domain.name"
android:singleLine=
"true"
android:inputType=
"textEmailAddress"
/>
<TextView
android:text=
"@string/contact_name"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
<EditText
android:text=
""
android:id=
"@+id/contact_name"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:singleLine=
"true"
/>
<TextView
android:text=
"@string/contact_name"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
<EditText
android:text=
""
android:id=
"@+id/contact_name"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:singleLine=
"true"
/>
<TextView
android:id=
"@+id/select_groups_text_view"
android:text=
"@string/contact_group"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
<TextView
android:id=
"@+id/select_groups_text_view"
android:text=
"@string/contact_group"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
</LinearLayout>
</LinearLayout>
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