Skip to content

Commit

Permalink
updated CSO directory cards alignment, added working hours
Browse files Browse the repository at this point in the history
  • Loading branch information
codephillip committed May 19, 2020
1 parent 87d3615 commit 4dbabe9
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ public OrganizationAdapter(FragmentActivity activity, OrganizationtableCursor cu
}

public static class ViewHolder extends RecyclerView.ViewHolder {
public TextView name;
public TextView address;
public TextView workingHours;
public TextView website;
public ImageView callButton;
public TextView phoneNumber;
TextView name;
TextView address;
TextView workingHours;
TextView website;
ImageView callButton;
TextView phoneNumber;

public ViewHolder(View v) {
super(v);
Expand All @@ -74,7 +74,9 @@ public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
holder.name.setText(cursor.getFacilityName());
holder.phoneNumber.setText(cursor.getPhoneNumber());
holder.address.setText(cursor.getAddress());
holder.workingHours.setText(cursor.getOpenHour());
holder.workingHours.setText(String.format(activity.getString(R.string.working_hours),
cursor.getOpenHour(),
cursor.getCloseHour()));
holder.name.setText(cursor.getFacilityName());
holder.website.setText(cursor.getLink());

Expand Down
6 changes: 3 additions & 3 deletions Safepal/app/src/main/res/drawable/ic_call_48px.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:width="30dp"
android:height="30dp"
android:viewportWidth="48"
android:viewportHeight="48">
<path
android:fillColor="#FF000000"
android:fillColor="@color/colorAccent"
android:pathData="M13.25,21.59c2.88,5.66 7.51,10.29 13.18,13.17l4.4,-4.41c0.55,-0.55 1.34,-0.71 2.03,-0.49C35.1,30.6 37.51,31 40,31c1.11,0 2,0.89 2,2v7c0,1.11 -0.89,2 -2,2C21.22,42 6,26.78 6,8c0,-1.11 0.9,-2 2,-2h7c1.11,0 2,0.89 2,2 0,2.49 0.4,4.9 1.14,7.14 0.22,0.69 0.06,1.48 -0.49,2.03l-4.4,4.42z"/>
</vector>
21 changes: 13 additions & 8 deletions Safepal/app/src/main/res/layout/cso_directory_list_row.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
xmlns:cardview="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
cardview:cardCornerRadius="2dp"
android:layout_marginRight="7dp"
android:layout_marginLeft="13dp"
cardview:cardCornerRadius="10dp"
cardview:cardElevation="3dp"
cardview:cardUseCompatPadding="true">

Expand All @@ -16,7 +17,7 @@
android:id="@+id/call"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="21dp"
android:layout_marginTop="18dp"
android:layout_marginEnd="26dp"
cardview:layout_constraintEnd_toEndOf="parent"
cardview:layout_constraintTop_toTopOf="parent"
Expand All @@ -26,12 +27,12 @@
android:id="@+id/cso_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_marginTop="6dp"
android:layout_marginStart="16dp"
android:layout_marginTop="12dp"
android:maxLines="2"
android:text="Action Aid"
android:textAppearance="@style/TextAppearance.AppCompat.Headline"
android:textColor="@color/colorPrimaryDark"
android:textColor="@color/colorAccent"
android:textSize="18sp"
android:textStyle="bold"
cardview:layout_constraintStart_toStartOf="parent"
Expand All @@ -43,6 +44,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Bukoto"
android:textColor="@android:color/black"
cardview:layout_constraintStart_toStartOf="@+id/cso_name"
cardview:layout_constraintTop_toBottomOf="@+id/cso_name" />

Expand All @@ -51,6 +53,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="9am - 9pm"
android:textColor="@android:color/black"
cardview:layout_constraintStart_toStartOf="@+id/address"
cardview:layout_constraintTop_toBottomOf="@+id/address" />

Expand All @@ -59,6 +62,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0756878460"
android:textColor="@android:color/black"
cardview:layout_constraintStart_toStartOf="@+id/working_hours"
cardview:layout_constraintTop_toBottomOf="@+id/working_hours" />

Expand All @@ -67,9 +71,10 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginBottom="8dp"
android:text="www.reproductivehealth.ug"
android:layout_marginBottom="16dp"
android:autoLink="web"
android:text="www.reproductivehealth.ug"
android:textColorLink="@android:color/black"
android:textStyle="bold"
cardview:layout_constraintBottom_toBottomOf="parent"
cardview:layout_constraintStart_toStartOf="@+id/phone_number"
Expand Down
5 changes: 4 additions & 1 deletion Safepal/app/src/main/res/layout/fragment_cso_directory.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="64dp"
android:layout_margin="@dimen/activity_horizontal_margin"
android:layout_marginTop="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginBottom="@dimen/margin_medium"
android:layout_alignParentTop="true"
android:orientation="horizontal"
android:weightSum="8"
Expand Down
1 change: 1 addition & 0 deletions Safepal/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@
<string name="question_count_string">%d/%d</string>
<string name="send">Send</string>
<string name="chat_with_us">Chat with us</string>
<string name="working_hours">%sam - %spm</string>
<string-array name="not_your_fault_messages">
<item>Whatever happened was not your fault. No one has the right to sexually violate you. The rapist is solely to blame.
What a person wears, what a person says, or how a person acts cannot justify sexual violence.</item>
Expand Down

0 comments on commit 4dbabe9

Please sign in to comment.