Commit c66910c1 by Kunj Gupta

UOFLMA-70: UI related changes.

parent 5a7d3502
......@@ -53,7 +53,7 @@ public class SelectReferenceDialog extends DialogFragment {
private ReferenceListener mListener;
private Unbinder mUnbinder;
private List<Reference> mReferenceList;
private String mReferenceTableName;
private String mReferenceTableName, mReferenceTitle;
private CatalogueApplication mApplication;
public SelectReferenceDialog() {
......@@ -64,11 +64,12 @@ public class SelectReferenceDialog extends DialogFragment {
mListener = listener;
}
public static SelectReferenceDialog newInstance(String tableName) {
public static SelectReferenceDialog newInstance(String tableName, String title) {
SelectReferenceDialog selectReferenceDialog = new SelectReferenceDialog();
Bundle bundle = new Bundle();
bundle.putString(Constants.DATA_KEY_REFERENCE_TABLE_NAME, tableName);
bundle.putString(Constants.DATA_KEY_REFERENCE_TITLE, title);
selectReferenceDialog.setArguments(bundle);
return selectReferenceDialog;
......@@ -81,6 +82,7 @@ public class SelectReferenceDialog extends DialogFragment {
mApplication = (CatalogueApplication) getActivity().getApplication();
mReferenceTableName = getArguments().getString(Constants.DATA_KEY_REFERENCE_TABLE_NAME);
mReferenceTitle = getArguments().getString(Constants.DATA_KEY_REFERENCE_TITLE);
}
@Override
......@@ -99,6 +101,9 @@ public class SelectReferenceDialog extends DialogFragment {
View rootView = inflater.inflate(R.layout.custom_dialog, container, false);
mUnbinder = ButterKnife.bind(this, rootView);
mTitleTextView.setText(String.format(getString(R.string.variable_form_reference_dialog_title_string), mReferenceTitle));
mEditText.setHint(mReferenceTitle);
return rootView;
}
......
......@@ -137,6 +137,7 @@ public class CatalogueItemScreen extends AppCompatActivity {
Intent intent = new Intent(CatalogueItemScreen.this, CatalogueVariableScreen.class);
intent.putExtra(Constants.DATA_KEY_SYS_ID, mCatalogueItemList.get(position).getSysId());
intent.putExtra(Constants.DATA_KEY_CATALOGUE_ITEM_DESCRIPTION, mCatalogueItemList.get(position).getDescription());
intent.putExtra(Constants.DATA_KEY_CATALOGUE_ITEM_SHORT_DESCRIPTION, mCatalogueItemList.get(position).getShortDescription());
intent.putExtra(Constants.DATA_KEY_CATALOGUE_TITLE, mCatalogueItemList.get(position).getName());
startActivity(intent);
}
......
......@@ -25,7 +25,9 @@ public class Constants {
public static final String DATA_KEY_SYS_ID = "sys_id";
public static final String DATA_KEY_CATALOGUE_TITLE = "catalogue_title";
public static final String DATA_KEY_CATALOGUE_ITEM_DESCRIPTION = "catalogue_item_des";
public static final String DATA_KEY_CATALOGUE_ITEM_SHORT_DESCRIPTION = "catalogue_item_short_des";
public static final String DATA_KEY_REFERENCE_TABLE_NAME = "table_name";
public static final String DATA_KEY_REFERENCE_TITLE = "title";
/**
* Catalogue services post parameters
......
package com.vsoft.uoflservicenow.utils;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.graphics.Typeface;
import android.support.v4.content.ContextCompat;
import android.text.InputType;
import android.text.method.PasswordTransformationMethod;
......@@ -111,9 +110,21 @@ public class Util {
referenceEditText.setCompoundDrawablesWithIntrinsicBounds(0, 0, android.R.drawable.ic_menu_search, 0);
return referenceEditText;
case LABEL:
LinearLayout labelLayout = new LinearLayout(context);
labelLayout.setOrientation(LinearLayout.VERTICAL);
TextView labelTextView = new TextView(context);
labelTextView.setText(catalogueVariable.getQuestionText());
return labelTextView;
labelTextView.setTypeface(null, Typeface.BOLD);
labelLayout.addView(labelTextView);
View view = new View(context);
view.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, 1));
view.setBackgroundColor(ContextCompat.getColor(context, android.R.color.black));
labelLayout.addView(view);
labelLayout.setPadding(0, 0, 0, (int)context.getResources().getDimension(R.dimen.small_margin));
return labelLayout;
case MASKED:
EditText maskedEditText = new EditText(context);
maskedEditText.setInputType(InputType.TYPE_TEXT_VARIATION_PASSWORD);
......@@ -154,10 +165,10 @@ public class Util {
selectBoxSpinner.setAdapter(selectBoxSpinnerArrayAdapter);
return selectBoxSpinner;
case BREAK:
View view = new View(context);
view.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, 1));
view.setBackgroundColor(ContextCompat.getColor(context, android.R.color.black));
return view;
View breakView = new View(context);
breakView.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, 1));
breakView.setBackgroundColor(ContextCompat.getColor(context, android.R.color.black));
return breakView;
}
return null;
}
......
......@@ -19,82 +19,68 @@
app:contentInsetRight="0dp"
app:contentInsetStart="0dp" />
<FrameLayout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:background="@color/screen_bg_color"
android:orientation="vertical"
android:padding="@dimen/normal_margin">
<TextView
android:id="@+id/variable_screen_empty_text_view"
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="@string/no_variables_string"
android:textSize="@dimen/extra_normal_text_size" />
android:background="@android:color/white"
android:requiresFadingEdge="vertical">
<LinearLayout
android:id="@+id/variable_screen_main_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/screen_bg_color"
android:orientation="vertical"
android:padding="@dimen/normal_margin"
android:visibility="gone">
<ScrollView
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/white"
android:requiresFadingEdge="vertical">
android:orientation="vertical"
android:padding="@dimen/normal_margin">
<LinearLayout
android:id="@+id/variable_screen_container_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/white"
android:orientation="vertical"
android:padding="@dimen/normal_margin">
android:orientation="vertical" />
<LinearLayout
android:id="@+id/variable_screen_container_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" />
<RelativeLayout
android:id="@+id/variable_screen_bottom_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:visibility="gone">
<RelativeLayout
android:id="@+id/variable_screen_bottom_layout"
android:layout_width="match_parent"
<TextView
android:id="@+id/variable_screen_submit_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical">
android:layout_alignParentRight="true"
android:layout_marginRight="@dimen/normal_margin"
android:background="@drawable/submit_button_bg_with_border"
android:paddingBottom="@dimen/normal_margin"
android:paddingLeft="@dimen/large_margin"
android:paddingRight="@dimen/large_margin"
android:paddingTop="@dimen/normal_margin"
android:text="@string/submit_string"
android:textColor="@android:color/white" />
<TextView
android:id="@+id/variable_screen_submit_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginRight="@dimen/normal_margin"
android:background="@drawable/submit_button_bg_with_border"
android:paddingBottom="@dimen/normal_margin"
android:paddingLeft="@dimen/large_margin"
android:paddingRight="@dimen/large_margin"
android:paddingTop="@dimen/normal_margin"
android:text="@string/submit_string"
android:textColor="@android:color/white" />
<TextView
android:id="@+id/variable_screen_back_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/normal_margin"
android:layout_toLeftOf="@id/variable_screen_submit_text_view"
android:background="@drawable/back_button_bg_with_border"
android:paddingBottom="@dimen/normal_margin"
android:paddingLeft="@dimen/large_margin"
android:paddingRight="@dimen/large_margin"
android:paddingTop="@dimen/normal_margin"
android:text="@string/back_string"
android:textColor="@android:color/white" />
</RelativeLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
</FrameLayout>
<TextView
android:id="@+id/variable_screen_back_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/normal_margin"
android:layout_toLeftOf="@id/variable_screen_submit_text_view"
android:background="@drawable/back_button_bg_with_border"
android:paddingBottom="@dimen/normal_margin"
android:paddingLeft="@dimen/large_margin"
android:paddingRight="@dimen/large_margin"
android:paddingTop="@dimen/normal_margin"
android:text="@string/back_string"
android:textColor="@android:color/white" />
</RelativeLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
......@@ -13,7 +13,6 @@
android:layout_gravity="center"
android:paddingBottom="@dimen/normal_margin"
android:paddingTop="@dimen/normal_margin"
android:text="@string/search_for_reference_string"
android:textSize="@dimen/large_text_size"/>
<View
......
......@@ -44,7 +44,9 @@
<string name="login_screen_password_string">Password</string>
<string name="login_screen_login_string">Login</string>
<string name="variable_form_misc_info_string">%1$s [add %2$s]</string>
<!--Variable Screen-->
<string name="variable_form_misc_info_string">%1$s [add %2$s]</string>
<string name="variable_form_reference_dialog_title_string">Search \'%s\'</string>
<!--Catalogue Item Screen-->
<string name="no_catalogue_item_string">No Catalogue Items&#8230;</string>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment