Skip to content

Commit fff0a18

Browse files
authored
AC-763 Updated UI for splash screen (#744)
1 parent d9c3f5c commit fff0a18

5 files changed

Lines changed: 57 additions & 22 deletions

File tree

236 KB
Binary file not shown.

openmrs-client/src/main/java/org/openmrs/mobile/activities/introduction/SplashActivity.java

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
package org.openmrs.mobile.activities.introduction;
1616

1717
import android.content.Intent;
18+
import android.graphics.Typeface;
1819
import android.os.Bundle;
1920
import android.os.Handler;
2021
import android.view.WindowManager;
@@ -23,34 +24,42 @@
2324
import android.view.animation.Animation;
2425
import android.view.animation.AnimationSet;
2526
import android.view.animation.AnimationUtils;
26-
import android.widget.ImageView;
27-
import android.widget.TextView;
2827

2928
import org.openmrs.mobile.R;
3029
import org.openmrs.mobile.activities.ACBaseActivity;
30+
import org.openmrs.mobile.databinding.ActivitySplashBinding;
3131

3232
import static org.openmrs.mobile.utilities.ApplicationConstants.SPLASH_TIMER;
3333

3434
public class SplashActivity extends ACBaseActivity {
3535
private Handler mHandler = new Handler();
3636
private Runnable mRunnable;
37+
private ActivitySplashBinding binding;
3738

3839
@Override
3940
protected void onCreate(Bundle savedInstanceState) {
4041
super.onCreate(savedInstanceState);
41-
setContentView(R.layout.activity_splash);
42-
TextView name = findViewById(R.id.organization_name);
43-
name.setText(R.string.app_name);
42+
binding = ActivitySplashBinding.inflate(getLayoutInflater());
43+
setContentView(binding.getRoot());
44+
45+
Typeface typeface = Typeface.createFromAsset(getAssets(), "fonts/Roboto/Montserrat.ttf");
46+
47+
binding.organizationName.setTypeface(typeface);
48+
binding.organizationName.setText(R.string.organization_name);
49+
50+
binding.clientName.setTypeface(typeface);
51+
binding.clientName.setText(R.string.client_name);
52+
4453
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
4554
Animation move = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.splash_screen_logo_anim);
46-
ImageView logo = findViewById(R.id.logo);
55+
4756
AnimationSet set = new AnimationSet(true);
4857
Animation fadeIn = new AlphaAnimation(0, 1);
4958
fadeIn.setInterpolator(new AccelerateInterpolator());
5059
fadeIn.setDuration(1000);
5160
set.addAnimation(fadeIn);
5261
set.addAnimation(move);
53-
logo.startAnimation(set);
62+
binding.logo.startAnimation(set);
5463

5564
mRunnable = () -> {
5665
Intent intent = new Intent(SplashActivity.this, IntroActivity.class);

openmrs-client/src/main/res/layout/activity_splash.xml

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,42 @@
1111
~
1212
~ Copyright (C) OpenMRS, LLC. All Rights Reserved.
1313
-->
14-
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
14+
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
15+
xmlns:app="http://schemas.android.com/apk/res-auto"
1516
xmlns:tools="http://schemas.android.com/tools"
1617
android:layout_width="match_parent"
1718
android:layout_height="match_parent"
1819
tools:context=".activities.introduction.SplashActivity">
20+
1921
<ImageView
22+
android:id="@+id/logo"
2023
android:layout_width="150dp"
2124
android:layout_height="150dp"
22-
android:src="@drawable/ic_openmrs"
2325
android:layout_centerInParent="true"
24-
android:id="@+id/logo"/>
26+
android:contentDescription="@string/openmrs_logo"
27+
android:src="@drawable/ic_openmrs"
28+
app:layout_constraintBottom_toBottomOf="parent"
29+
app:layout_constraintLeft_toLeftOf="parent"
30+
app:layout_constraintRight_toRightOf="parent"
31+
app:layout_constraintTop_toTopOf="parent" />
2532

2633
<TextView
2734
android:id="@+id/organization_name"
2835
android:layout_width="match_parent"
2936
android:layout_height="wrap_content"
30-
android:layout_below="@id/logo"
37+
android:layout_marginTop="20dp"
3138
android:gravity="center"
32-
android:textSize="22sp"
33-
android:layout_marginTop="20dp"/>
34-
</RelativeLayout>
39+
android:textColor="@android:color/black"
40+
android:textSize="30sp"
41+
app:layout_constraintTop_toBottomOf="@id/logo" />
42+
43+
<TextView
44+
android:id="@+id/client_name"
45+
android:layout_width="match_parent"
46+
android:layout_height="wrap_content"
47+
android:gravity="center"
48+
android:textColor="@color/dark_grey_8x"
49+
android:textSize="21sp"
50+
app:layout_constraintTop_toBottomOf="@id/organization_name" />
51+
52+
</androidx.constraintlayout.widget.ConstraintLayout>

openmrs-client/src/main/res/values/color.xml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<color name="dark_teal">#00463f</color>
2727
<color name="primary">#00463f</color>
2828
<color name="primary_dark">#01302b</color>
29-
<color name="color_accent">#FF4081</color>
29+
<color name="color_accent">#F8793B</color>
3030
<color name="dark_purple">#363463</color>
3131
<color name="dark_grey">#231F20</color>
3232
<color name="light_green">#a1d030</color>
@@ -41,6 +41,12 @@
4141
<color name="light_grey">#D3D3D3</color>
4242
<color name="selected_card">#249627</color>
4343

44+
<!-- Colors for New UI -->
45+
<color name="dark_grey_for_stroke">#909090</color>
46+
<color name="light_grey_for_solid">#EFEFEF</color>
47+
<color name="dark_grey_8x">#616161</color>
48+
<color name="dark_grey_10x">#454545</color>
49+
4450
<!-- neutral colors that look pleasing on both white and black background -->
4551
<color name="neutral_green">#249627</color>
46-
</resources>
52+
</resources>

openmrs-client/src/main/res/values/strings.xml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
<resources>
1616
<string name="app_name">OpenMRS Android Client</string>
17+
<string name="organization_name" translatable="false">OpenMRS</string>
18+
<string name="client_name" translatable="false">Client</string>
1719
<string name="action_settings">Settings</string>
1820
<string name="action_logout">Logout</string>
1921
<string name="action_location">Location</string>
@@ -283,7 +285,7 @@
283285
<string name="connected_to_server_message">You are now connected!</string>
284286

285287
<string name="dialog_title_are_you_sure">Are you sure?</string>
286-
<string name="dialog_title_reset_patient">Reset patient data?</string>
288+
<string name="dialog_title_reset_patient">Reset patient data?</string>
287289
<string name="dialog_message_data_lost">All patient information entered will be lost.</string>
288290
<string name="dialog_button_stay">Stay</string>
289291
<string name="dialog_button_leave">Leave</string>
@@ -455,11 +457,11 @@
455457

456458

457459
<!-- Chart Activity -->
458-
<string name="data_not_available_for_this_field">No data available to display chart</string>
459-
<string name="data_type_not_available_for_this_field">Chart not available for this field</string>
460-
<string name="dialog_take_photo">Take a photo</string>
461-
<string name="dialog_choose_photo">Choose photo</string>
462-
<string name="dialog_remove_photo">Remove photo</string>
460+
<string name="data_not_available_for_this_field">No data available to display chart</string>
461+
<string name="data_type_not_available_for_this_field">Chart not available for this field</string>
462+
<string name="dialog_take_photo">Take a photo</string>
463+
<string name="dialog_choose_photo">Choose photo</string>
464+
<string name="dialog_remove_photo">Remove photo</string>
463465

464466
<string name="unidentified_patient">Unidentified Patient</string>
465467
<string name="dob_error_for_unidentified">Please give a rough estimate of patient age</string>

0 commit comments

Comments
 (0)