Skip to content

Commit

Permalink
Issue project-travel-mate#705 added changes in MyTripInfoActivity and…
Browse files Browse the repository at this point in the history
… content_my_trip_info.xml
  • Loading branch information
AminullahTajMuhammad committed Oct 15, 2019
1 parent 0f9a900 commit 7c7046f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ public class MyTripInfoActivity extends AppCompatActivity implements TravelmateS
TextView labelTripName;
@BindView(R.id.label_trip_date)
TextView labelTripDate;
@BindView(R.id.friend_whole_layout)
RelativeLayout wholeRelativeLayout;

private String mFriendId = null;
private String mFriendDeleteId = null;
Expand Down Expand Up @@ -287,6 +289,7 @@ public void onResponse(Call call, final Response response) {
cal.setTimeInMillis(Long.parseLong(start) * 1000);
final String timeString =
new SimpleDateFormat("dd MMM''yy", Locale.US).format(cal.getTime());
tripDate.setVisibility(VISIBLE);
tripDate.setText(timeString);
isTripPublic = isPublic;

Expand Down Expand Up @@ -633,12 +636,10 @@ public void onResponse(Call call, final Response response) throws IOException {
addNewFriend.setVisibility(GONE);
friendEmail.setVisibility(GONE);
noFriendTitle.setVisibility(VISIBLE);
// noFriendTitle.setTypeface(null, Typeface.BOLD);
String mystring = getString(R.string.friends_title);
SpannableString content = new SpannableString(mystring);
content.setSpan(new UnderlineSpan(), 0, mystring.length(), 0);
noFriendTitle.setText(content);
// noFriendTitle.setTextSize(TypedValue.COMPLEX_UNIT_SP, 15f);

addNewFriend.setVisibility(VISIBLE);
friendEmail.setVisibility(VISIBLE);
Expand All @@ -656,11 +657,10 @@ public void onResponse(Call call, final Response response) throws IOException {
}

} else {


friendTitle.setText(R.string.friends_show_title);
friendTitle.setVisibility(VISIBLE);
showIcon.setVisibility(VISIBLE);
wholeRelativeLayout.setVisibility(VISIBLE);

if (isUserPartofTrip) { //user is part of the trip
addNewFriend.setVisibility(VISIBLE);
Expand Down
49 changes: 19 additions & 30 deletions Android/app/src/main/res/layout/content_my_trip_info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@
<RelativeLayout
android:id="@+id/friend_whole_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:visibility="gone">

<TextView
android:id="@+id/friend_title"
Expand Down Expand Up @@ -209,49 +210,37 @@
android:id="@+id/public_trip_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="50dp">
android:layout_marginTop="50dp"
android:padding="5dp">

<TextView android:id="@+id/label_trip_type"
android:layout_width="wrap_content"
<TextView
android:id="@+id/public_trip_message"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Trip Type: "
app:layout_constraintStart_toStartOf="parent"
android:fontFamily="sans-serif-bold"
android:textColor="#000000"
android:textSize="16sp"
android:text="@string/trip_private_message"
app:layout_constraintTop_toTopOf="parent"
android:textColor="@color/black"
android:textStyle="bold"
android:textSize="20dp"
android:layout_marginStart="20dp"
android:layout_marginTop="10dp"
/>
app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="10dp"
android:layout_marginTop="5dp"
app:layout_constraintEnd_toStartOf="@+id/ispublic_toggleButton"/>

<ToggleButton
android:id="@+id/ispublic_toggleButton"
android:layout_width="0dp"
android:layout_width="90dp"
android:layout_height="wrap_content"
app:layout_constraintLeft_toRightOf="@+id/label_trip_type"
app:layout_constraintStart_toEndOf="@+id/public_trip_message"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toEndOf="@+id/label_trip_type"
android:layout_marginEnd="15dp"
android:layout_marginStart="10dp"
android:layout_marginEnd="5dp"
android:background="@drawable/my_trip_detail_button_shape"
android:textColor="@color/white"
android:textAllCaps="false"
android:textOn="@string/public_trip_toggle_on"
android:textOff="@string/public_trip_toggle_off" />

<TextView
android:id="@+id/public_trip_message"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-bold"
android:textColor="#000000"
android:textSize="18sp"
android:layout_marginTop="7dp"
android:text="@string/trip_private_message"
app:layout_constraintStart_toStartOf="@+id/label_trip_type"
app:layout_constraintEnd_toEndOf="@+id/ispublic_toggleButton"
app:layout_constraintTop_toBottomOf="@+id/ispublic_toggleButton"/>

</android.support.constraint.ConstraintLayout>


Expand Down

0 comments on commit 7c7046f

Please sign in to comment.