mirror of
https://github.com/pierre42100/ComunicAndroid
synced 2024-11-27 15:59:29 +00:00
Display user tag on user page.
This commit is contained in:
parent
0f60453c97
commit
2a266aaa7a
@ -432,6 +432,7 @@ public class GetUsersHelper {
|
|||||||
userInfos.setFirstName(userObject.getString("firstName"));
|
userInfos.setFirstName(userObject.getString("firstName"));
|
||||||
userInfos.setLastName(userObject.getString("lastName"));
|
userInfos.setLastName(userObject.getString("lastName"));
|
||||||
userInfos.setAccountImageURL(userObject.getString("accountImage"));
|
userInfos.setAccountImageURL(userObject.getString("accountImage"));
|
||||||
|
userInfos.setVirtualDirectory(userObject.getString("virtualDirectory"));
|
||||||
|
|
||||||
} catch (JSONException e){
|
} catch (JSONException e){
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
@ -12,12 +12,13 @@ import org.communiquons.android.comunic.client.ui.utils.UiUtils;
|
|||||||
public class UserInfo {
|
public class UserInfo {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Informations about the user
|
* Information about the user
|
||||||
*/
|
*/
|
||||||
private int id;
|
private int id;
|
||||||
private String firstName;
|
private String firstName;
|
||||||
private String lastName;
|
private String lastName;
|
||||||
private String accountImageURL;
|
private String accountImageURL;
|
||||||
|
private String virtualDirectory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the ID of the user
|
* Set the ID of the user
|
||||||
@ -108,4 +109,20 @@ public class UserInfo {
|
|||||||
public String getAcountImageURL() {
|
public String getAcountImageURL() {
|
||||||
return accountImageURL;
|
return accountImageURL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getVirtualDirectory() {
|
||||||
|
return virtualDirectory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean hasVirtualDirectory(){
|
||||||
|
return virtualDirectory != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVirtualDirectory(String virtualDirectory) {
|
||||||
|
this.virtualDirectory = virtualDirectory;
|
||||||
|
|
||||||
|
if(virtualDirectory.equals(""))
|
||||||
|
this.virtualDirectory = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,23 +31,12 @@ public class AdvancedUserInfoFragment extends Fragment {
|
|||||||
private AdvancedUserInfo mAdvancedUserInfo;
|
private AdvancedUserInfo mAdvancedUserInfo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* User account image
|
* Views
|
||||||
*/
|
*/
|
||||||
private WebUserAccountImage mUserAccountImage;
|
private WebUserAccountImage mUserAccountImage;
|
||||||
|
|
||||||
/**
|
|
||||||
* The name of the user
|
|
||||||
*/
|
|
||||||
private TextView mUserName;
|
private TextView mUserName;
|
||||||
|
private TextView mUserTag;
|
||||||
/**
|
|
||||||
* Target for the time the user has been a member of the group
|
|
||||||
*/
|
|
||||||
private TextView mMemberSinceTarget;
|
private TextView mMemberSinceTarget;
|
||||||
|
|
||||||
/**
|
|
||||||
* Friendship status
|
|
||||||
*/
|
|
||||||
private FriendshipStatusButton mFriendshipStatus;
|
private FriendshipStatusButton mFriendshipStatus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -82,6 +71,7 @@ public class AdvancedUserInfoFragment extends Fragment {
|
|||||||
//Get the views
|
//Get the views
|
||||||
mUserAccountImage = view.findViewById(R.id.user_account_image);
|
mUserAccountImage = view.findViewById(R.id.user_account_image);
|
||||||
mUserName = view.findViewById(R.id.user_name);
|
mUserName = view.findViewById(R.id.user_name);
|
||||||
|
mUserTag = view.findViewById(R.id.userTag);
|
||||||
mMemberSinceTarget = view.findViewById(R.id.member_since_value);
|
mMemberSinceTarget = view.findViewById(R.id.member_since_value);
|
||||||
mFriendshipStatus = view.findViewById(R.id.friendship_status);
|
mFriendshipStatus = view.findViewById(R.id.friendship_status);
|
||||||
}
|
}
|
||||||
@ -95,6 +85,8 @@ public class AdvancedUserInfoFragment extends Fragment {
|
|||||||
mUserName.setText(mAdvancedUserInfo.getDisplayFullName());
|
mUserName.setText(mAdvancedUserInfo.getDisplayFullName());
|
||||||
mMemberSinceTarget.setText(TimeUtils.TimeToString(getActivity(),
|
mMemberSinceTarget.setText(TimeUtils.TimeToString(getActivity(),
|
||||||
TimeUtils.time() - mAdvancedUserInfo.getAccount_creation_time()));
|
TimeUtils.time() - mAdvancedUserInfo.getAccount_creation_time()));
|
||||||
|
mUserTag.setText(mAdvancedUserInfo.hasVirtualDirectory() ?
|
||||||
|
"@" + mAdvancedUserInfo.getVirtualDirectory() : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -14,11 +14,12 @@
|
|||||||
android:paddingStart="16dp"
|
android:paddingStart="16dp"
|
||||||
android:paddingTop="16dp">
|
android:paddingTop="16dp">
|
||||||
|
|
||||||
|
<!-- Head layout -->
|
||||||
<android.support.constraint.ConstraintLayout
|
<android.support.constraint.ConstraintLayout
|
||||||
android:id="@+id/constraintLayout"
|
android:id="@+id/constraintLayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="83dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="32dp"
|
android:layout_marginBottom="64dp"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
app:layout_constraintBottom_toTopOf="@+id/scrollView2"
|
app:layout_constraintBottom_toTopOf="@+id/scrollView2"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
@ -29,9 +30,11 @@
|
|||||||
android:id="@+id/user_account_image"
|
android:id="@+id/user_account_image"
|
||||||
android:layout_width="@dimen/account_image_default_width"
|
android:layout_width="@dimen/account_image_default_width"
|
||||||
android:layout_height="@dimen/account_image_default_height"
|
android:layout_height="@dimen/account_image_default_height"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
android:layout_marginStart="8dp"
|
android:layout_marginStart="8dp"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:src="@drawable/default_account_image"
|
android:src="@drawable/default_account_image"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
@ -39,54 +42,71 @@
|
|||||||
android:id="@+id/user_name"
|
android:id="@+id/user_name"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="8dp"
|
android:layout_marginEnd="8dp"
|
||||||
android:layout_marginStart="16dp"
|
android:layout_marginStart="8dp"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Display1"
|
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/user_account_image"
|
|
||||||
app:layout_constraintStart_toEndOf="@+id/user_account_image"
|
|
||||||
app:layout_constraintTop_toTopOf="@+id/user_account_image"
|
|
||||||
tools:text="User name" />
|
|
||||||
</android.support.constraint.ConstraintLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
tools:layout_editor_absoluteX="134dp"
|
|
||||||
tools:layout_editor_absoluteY="96dp">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/textView3"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:text="@string/member_for"
|
|
||||||
android:textAlignment="center" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/member_since_value"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
tools:layout_editor_absoluteX="88dp"
|
android:textAppearance="@style/TextAppearance.AppCompat.Display1"
|
||||||
tools:layout_editor_absoluteY="167dp"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
tools:text="6 Months" />
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
</LinearLayout>
|
app:layout_constraintTop_toBottomOf="@+id/user_account_image"
|
||||||
</LinearLayout>
|
tools:text="User name" />
|
||||||
|
|
||||||
<org.communiquons.android.comunic.client.ui.views.FriendshipStatusButton
|
<org.communiquons.android.comunic.client.ui.views.FriendshipStatusButton
|
||||||
android:id="@+id/friendship_status"
|
android:id="@+id/friendship_status"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_gravity="center_horizontal"
|
||||||
android:layout_marginTop="30dp"/>
|
android:layout_marginEnd="8dp"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:layout_marginTop="24dp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/userTag" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/userTag"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
app:layout_constraintEnd_toEndOf="@+id/user_name"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/user_name"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/user_name"
|
||||||
|
tools:text="\@user" />
|
||||||
|
</android.support.constraint.ConstraintLayout>
|
||||||
|
|
||||||
|
<!-- User info layout -->
|
||||||
|
<android.support.constraint.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView3"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="@string/member_for"
|
||||||
|
android:textAlignment="center"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/member_since_value"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:textAlignment="center"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:text="6 Months" />
|
||||||
|
|
||||||
|
</android.support.constraint.ConstraintLayout>
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</ScrollView>
|
</ScrollView>
|
Loading…
Reference in New Issue
Block a user