Commit 7062c7e8 by Kunj Gupta

UOFLMA-111: Fixed - Need to show full names of catalog items.

parent f288a9f7
...@@ -30,6 +30,7 @@ import android.support.v7.widget.Toolbar; ...@@ -30,6 +30,7 @@ import android.support.v7.widget.Toolbar;
import android.text.Html; import android.text.Html;
import android.text.TextUtils; import android.text.TextUtils;
import android.text.method.LinkMovementMethod; import android.text.method.LinkMovementMethod;
import android.util.TypedValue;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.MotionEvent; import android.view.MotionEvent;
import android.view.View; import android.view.View;
...@@ -134,7 +135,7 @@ public class CatalogueVariableScreen extends AppCompatActivity { ...@@ -134,7 +135,7 @@ public class CatalogueVariableScreen extends AppCompatActivity {
if(actionBar != null) { if(actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setElevation(0); actionBar.setElevation(0);
actionBar.setTitle(mCatalogueItemTitle); actionBar.setTitle(R.string.variable_form_header_string);
actionBar.setDisplayShowHomeEnabled(false); actionBar.setDisplayShowHomeEnabled(false);
actionBar.setDisplayShowTitleEnabled(true); actionBar.setDisplayShowTitleEnabled(true);
} }
...@@ -194,7 +195,7 @@ public class CatalogueVariableScreen extends AppCompatActivity { ...@@ -194,7 +195,7 @@ public class CatalogueVariableScreen extends AppCompatActivity {
createView(); createView();
} }
} else { } else {
showErrorDialog(R.string.failed_to_fetch_catalogue_form_string); showFetchVariableErrorDialog(R.string.failed_to_fetch_catalogue_form_string);
} }
} }
} }
...@@ -243,6 +244,16 @@ public class CatalogueVariableScreen extends AppCompatActivity { ...@@ -243,6 +244,16 @@ public class CatalogueVariableScreen extends AppCompatActivity {
LinearLayout.LayoutParams childLabelViewLayoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams childLabelViewLayoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,
LinearLayout.LayoutParams.WRAP_CONTENT); LinearLayout.LayoutParams.WRAP_CONTENT);
if(mCatalogueItemTitle != null && !mCatalogueItemTitle.isEmpty()) {
TextView headerView = new TextView(CatalogueVariableScreen.this);
headerView.setPadding(0, 0, 0, (int)getResources().getDimension(R.dimen.normal_margin));
headerView.setTypeface(null, Typeface.BOLD);
headerView.setTextSize(TypedValue.COMPLEX_UNIT_PX, getResources().getDimension(R.dimen.normal_text_size));
headerView.setTextColor(ContextCompat.getColor(CatalogueVariableScreen.this, android.R.color.black));
headerView.setText(mCatalogueItemTitle);
mContainerLayout.addView(headerView, childControlViewLayoutParams);
}
/*Added item Description in form*/ /*Added item Description in form*/
if(mCatalogueItemShortDescription != null && !mCatalogueItemShortDescription.isEmpty()) { if(mCatalogueItemShortDescription != null && !mCatalogueItemShortDescription.isEmpty()) {
TextView shortDescriptionView = new TextView(CatalogueVariableScreen.this); TextView shortDescriptionView = new TextView(CatalogueVariableScreen.this);
...@@ -596,7 +607,7 @@ public class CatalogueVariableScreen extends AppCompatActivity { ...@@ -596,7 +607,7 @@ public class CatalogueVariableScreen extends AppCompatActivity {
if(syncStatus == SyncStatus.SUCCESS) { if(syncStatus == SyncStatus.SUCCESS) {
showSubmissionDialog(); showSubmissionDialog();
} else { } else {
showErrorDialog(R.string.failed_to_submit_form_string); showSubmitErrorDialog(R.string.failed_to_submit_form_string);
} }
} }
} }
...@@ -619,12 +630,13 @@ public class CatalogueVariableScreen extends AppCompatActivity { ...@@ -619,12 +630,13 @@ public class CatalogueVariableScreen extends AppCompatActivity {
alert.show(); alert.show();
} }
private void showErrorDialog(int message) { private void showFetchVariableErrorDialog(int message) {
AlertDialog.Builder builder = new AlertDialog.Builder(this); AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage(message) builder.setMessage(message)
.setCancelable(false) .setCancelable(false)
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) { public void onClick(DialogInterface dialog, int id) {
dialog.dismiss();
finish(); finish();
} }
}); });
...@@ -632,6 +644,19 @@ public class CatalogueVariableScreen extends AppCompatActivity { ...@@ -632,6 +644,19 @@ public class CatalogueVariableScreen extends AppCompatActivity {
alert.show(); alert.show();
} }
private void showSubmitErrorDialog(int message) {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage(message)
.setCancelable(false)
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.dismiss();
}
});
AlertDialog alert = builder.create();
alert.show();
}
private String getMonth(int month) { private String getMonth(int month) {
return Constants.month[month]; return Constants.month[month];
} }
......
...@@ -29,8 +29,7 @@ ...@@ -29,8 +29,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:ellipsize="end" android:ellipsize="end"
android:textSize="@dimen/normal_text_size" android:textSize="@dimen/normal_text_size"
android:textStyle="bold" android:textStyle="bold"/>
android:lines="1" />
<TextView <TextView
android:id="@+id/catalogue_category_adapter_des_tv" android:id="@+id/catalogue_category_adapter_des_tv"
......
...@@ -29,8 +29,7 @@ ...@@ -29,8 +29,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:ellipsize="end" android:ellipsize="end"
android:textSize="@dimen/normal_text_size" android:textSize="@dimen/normal_text_size"
android:textStyle="bold" android:textStyle="bold"/>
android:lines="1" />
<TextView <TextView
android:id="@+id/catalogue_category_item_adapter_des_tv" android:id="@+id/catalogue_category_item_adapter_des_tv"
......
...@@ -51,6 +51,7 @@ ...@@ -51,6 +51,7 @@
<!--Variable Screen--> <!--Variable Screen-->
<string name="variable_form_misc_info_string">%1$s [add %2$s]</string> <string name="variable_form_misc_info_string">%1$s [add %2$s]</string>
<string name="variable_form_header_string">Submit Order</string>
<string name="variable_form_reference_dialog_title_string">Search \'%s\'</string> <string name="variable_form_reference_dialog_title_string">Search \'%s\'</string>
<string name="variable_form_radio_text_string">%d</string> <string name="variable_form_radio_text_string">%d</string>
<string name="variable_form_ui_page_button_label_string">Add Attachment</string> <string name="variable_form_ui_page_button_label_string">Add Attachment</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