Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update theme name #323

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions android-json-form-wizard/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
android:clearTaskOnLaunch="true"
android:label="@string/app_name"
android:largeHeap="true"
android:supportsRtl="true"
android:theme="@style/NativeFormsAppTheme">
android:supportsRtl="true">

<activity
android:name=".activities.JsonFormBarcodeScanActivity"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,12 @@ public void onReceive(Context context, Intent intent) {
}
};

@Override
protected void onCreate(Bundle savedInstanceState) {
setTheme(R.style.AppTheme);
super.onCreate(savedInstanceState);
}

@Override
public synchronized JSONObject getStep(String name) {
synchronized (getmJSONObject()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:theme="@style/NativeFormsAppTheme">
android:theme="@style/AppTheme">

<android.support.v7.widget.Toolbar
android:id="@+id/tb_top"
Expand Down
1 change: 1 addition & 0 deletions android-json-form-wizard/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,5 @@
<!-- <item name="android:windowEnterAnimation">@anim/slide_up</item>
<item name="android:windowExitAnimation">@anim/slide_down</item>-->
</style>
<style name="AppTheme" parent="NativeFormsAppTheme"/>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import org.robolectric.annotation.Config;

@RunWith(RobolectricTestRunner.class)
@Config(sdk = {Build.VERSION_CODES.O_MR1}, application = TestApplication.class)
@Config(sdk = {Build.VERSION_CODES.P}, application = TestApplication.class)
public abstract class BaseActivityTest {
public static final String DUMMY_TEST_STRING = "DUMMY TEST STRING";
public static final String DUMMY_JSON_FORM_STRING = "{\r\n \"count\": \"1\",\r\n \"encounter_type\": \"Birth Registration\",\r\n \"mother\": {\r\n \"encounter_type\": \"New Woman Registration\"\r\n },\r\n \"entity_id\": \"\",\r\n \"relational_id\": \"\",\r\n \"metadata\": {\r\n \"start\": {\r\n \"openmrs_entity_parent\": \"\",\r\n \"openmrs_entity\": \"concept\",\r\n \"openmrs_data_type\": \"start\",\r\n \"openmrs_entity_id\": \"163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\"\r\n }\r\n },\r\n \"step1\": {\r\n \"title\": \"Birth Registration\",\r\n \"fields\": [\r\n {\r\n \"key\": \"Child_Photo\",\r\n \"openmrs_entity_parent\": \"\",\r\n \"openmrs_entity\": \"\",\r\n \"openmrs_entity_id\": \"\",\r\n \"type\": \"choose_image\",\r\n \"uploadButtonText\": \"Take a photo of the child\"\r\n },\r\n {\r\n \"key\": \"gps\",\r\n \"openmrs_entity_parent\": \"usual_residence\",\r\n \"openmrs_entity\": \"person_address\",\r\n \"openmrs_entity_id\": \"geopoint\",\r\n \"openmrs_data_type\": \"text\",\r\n \"type\": \"gps\"\r\n },\r\n {\r\n \"key\": \"Home_Facility\",\r\n \"openmrs_entity_parent\": \"\",\r\n \"openmrs_entity\": \"\",\r\n \"openmrs_entity_id\": \"\",\r\n \"openmrs_data_type\": \"text\",\r\n \"type\": \"tree\",\r\n \"hint\": \"Child's home health facility *\",\r\n \"tree\": [],\r\n \"v_required\": {\r\n \"value\": true,\r\n \"err\": \"Please enter the child's home facility\"\r\n }\r\n }\r\n ]\r\n }\r\n}";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import org.robolectric.android.controller.ActivityController;

public class JsonFormActivityTest extends BaseActivityTest {

private JsonFormActivity activity;
private ActivityController<JsonFormActivity> controller;

Expand All @@ -28,14 +27,11 @@ public void setUp() {
activity = controller.get();

Assert.assertNotNull(activity);


}

@Test
public void testSetConfirmationTitleUpdatesConfirmationTitleCorrectly() {
Assert.assertNotNull(activity.getConfirmCloseTitle());

//default message
Assert.assertEquals(RuntimeEnvironment.application.getString(R.string.confirm_form_close), activity.getConfirmCloseTitle());
activity.setConfirmCloseTitle(DUMMY_TEST_STRING);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
public class TestApplication extends Application {
@Override
public void onCreate() {
setTheme(R.style.NativeFormsAppTheme);
super.onCreate();
setTheme(R.style.Theme_AppCompat);
}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION_NAME=1.7.0-SNAPSHOT
VERSION_NAME=1.7.1000-SNAPSHOT
VERSION_CODE=1
GROUP=org.smartregister
POM_SETTING_DESCRIPTION=OpenSRP Client Native Form Json Wizard
Expand Down
3 changes: 1 addition & 2 deletions sample/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/NativeFormsAppTheme">
android:supportsRtl="true">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
Expand Down
20 changes: 10 additions & 10 deletions sample/src/main/res/layout/content_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
android:layout_gravity="center"
android:text="BIRTH REGISTER"
android:textColor="@android:color/white"
android:theme="@style/NativeFormsAppTheme" />
android:theme="@style/AppTheme" />

<Button
android:id="@+id/wizard_form"
Expand All @@ -33,7 +33,7 @@
android:layout_gravity="center"
android:text="WIZARD (MULTI-STEP FORM)"
android:textColor="@android:color/white"
android:theme="@style/NativeFormsAppTheme" />
android:theme="@style/AppTheme" />

<Button
android:id="@+id/rules_engine_skip_logic"
Expand All @@ -42,7 +42,7 @@
android:layout_gravity="center"
android:text="RULES ENGINE LOGIC"
android:textColor="@android:color/white"
android:theme="@style/NativeFormsAppTheme" />
android:theme="@style/AppTheme" />

<Button
android:id="@+id/numbers_selector_widget"
Expand All @@ -52,7 +52,7 @@
android:layout_gravity="center"
android:text="CONSTRAINTS"
android:textColor="@android:color/white"
android:theme="@style/NativeFormsAppTheme" />
android:theme="@style/AppTheme" />

<Button
android:id="@+id/generic_dialog_button"
Expand All @@ -61,7 +61,7 @@
android:layout_gravity="center"
android:text="GENERIC POPUP"
android:textColor="@android:color/white"
android:theme="@style/NativeFormsAppTheme" />
android:theme="@style/AppTheme" />

<Button
android:id="@+id/validation_form_button"
Expand All @@ -71,7 +71,7 @@
android:layout_gravity="center"
android:text="FORM VALIDATION"
android:textColor="@android:color/white"
android:theme="@style/NativeFormsAppTheme" />
android:theme="@style/AppTheme" />

<Button
android:id="@+id/native_form_basic"
Expand All @@ -80,7 +80,7 @@
android:layout_gravity="center"
android:text="Basic Form"
android:textColor="@android:color/white"
android:theme="@style/NativeFormsAppTheme" />
android:theme="@style/AppTheme" />

<Button
android:id="@+id/expansion_panel_button"
Expand All @@ -90,7 +90,7 @@
android:layout_gravity="center"
android:text="Expansion Panel"
android:textColor="@android:color/white"
android:theme="@style/NativeFormsAppTheme" />
android:theme="@style/AppTheme" />

<Button
android:id="@+id/repeating_group_button"
Expand All @@ -99,7 +99,7 @@
android:layout_gravity="center"
android:text="Repeating Group"
android:textColor="@android:color/white"
android:theme="@style/NativeFormsAppTheme" />
android:theme="@style/AppTheme" />

<Button
android:id="@+id/multiselect_list"
Expand All @@ -109,7 +109,7 @@
android:layout_gravity="center"
android:text="MultiSelect List"
android:textColor="@android:color/white"
android:theme="@style/NativeFormsAppTheme" />
android:theme="@style/AppTheme" />

</LinearLayout>
</RelativeLayout>
1 change: 1 addition & 0 deletions sample/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@
<style name="NativeFormsAppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="NativeFormsAppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />

<style name="AppTheme" parent="NativeFormsAppTheme"/>
</resources>