-
Notifications
You must be signed in to change notification settings - Fork 24
Ionic_Contact Screen
In the previous post we created the My Profile page. Now, we'll create another page called Contact, that will have the same layout as My Profile page, but it won't be editable, since it's showing information of other users.
Again, we'll start by creating the contactPage folder and adding the required 3 documents.
Controller is almost exact to the one we defined for My Profile page so I won't be pasting code snippets here. You can find the source code for the controller here
The view is pretty straightforward as well. The main difference between this view and the one for My Profile page is that this one uses paragraphs <p>
instead of input
components. This is because this page doesn't take any input.
<!-- code omitted for brevity -->
<ion-content padding class="contactPage">
<profile-header #header></profile-header>
<ion-list no-lines style="margin-top:10px">
<ion-item>
<p>{{employment}}</p>
</ion-item>
<ion-item>
<p>{{education}}</p>
</ion-item>
<ion-item>
<p class='section-name'>Interests</p>
<p>{{interests}}</p>
</ion-item>
<ion-item>
<p class='section-name'>Knowledgeable In</p>
<p>{{knowledgeable}}</p>
</ion-item>
<ion-item>
<p class='section-name'>Goals</p>
<p>{{currentGoals}}</p>
</ion-item>
</ion-list>
</ion-content>
I'm also using the no-line
attribute on my ion-list
component, so that no lines are drawn between the list elements.
.contactPage {
.section-name {
font-weight: bold;
font-size: medium;
color: map-get($colors, secondary-text);
}
p {
font-size: large;
color: map-get($colors, primary-text);
}
}
This will adjust the font size and the colors of the paragraphs that I'm using within the contactPage.html view.
p {
word-wrap: break-word;
white-space: normal;
}
The above style makes the paragraph elements properly wrap the text inside it in multiple lines, and it also breaks the word that is too long to fit the width of the paragraph. I want this to apply to all <p>
elements inside my application, so that's why I'm defining this style in app.core.scss.
As you've seen, creating the Contact page was pretty straightforward. Below you can see a screenshot of the My Profile page (left), and the Contact page (right).
- Android
- Getting Started
- Project Structure
- Gradle
- Menu
- Theming
- Login Screen
- Menu & Navigation
- Importing Library From GitHub
- Creating Reusable Layouts
- Adding New Icons
- Profile Screen
- Chat Screen
- Contacts Screen
- Pending Invites Screen
- Settings Screen
- Add Library Dependency
- Discover Users Screen
- Splash Screen
- Auth0
- Authentication Logic
- Profile Screen Logic
- Send Feedback
- Authenticated to Firebase via Auth0
- Saving User Info to Firebase
- Storing User Connection Info to Firebase
- Calculating Distance Between Users
- Chat Logic
- Handling Device Rotation
- Android Other
- Ionic
- Getting Started
- Project Structure
- Menu
- Theming
- Login Screen
- Adding Images
- Creating Reusable Layouts
- Adding New Icons
- Profile Screen
- Contact Screen
- Elastic Textarea
- Chat Bubble
- Chat Screen
- Contacts Screen
- Pending Invites Screen
- Settings Screen
- Discover Users Screen
- Splash Screen
- Animations
- Auth0
- Storing User Data
- Profile Screen Logic
- Send Feedback
- Update to Ionic RC0
- Reimplemented Auth0 with Ionic RC0
- Authenticated to Firebase via Auth0
- Saving User Info to Firebase
- Storing User Connection Info to Firebase
- Calculating Distance Between Users
- Chat Logic
- Handling Device Rotation
- Ionic Other
- Version Updating
- Cordova
- Other
- Messaging