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;
import android.text.Html;
import android.text.TextUtils;
import android.text.method.LinkMovementMethod;
import android.util.TypedValue;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
......@@ -134,7 +135,7 @@ public class CatalogueVariableScreen extends AppCompatActivity {
if(actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setElevation(0);
actionBar.setTitle(mCatalogueItemTitle);
actionBar.setTitle(R.string.variable_form_header_string);
actionBar.setDisplayShowHomeEnabled(false);
actionBar.setDisplayShowTitleEnabled(true);
}
......@@ -194,7 +195,7 @@ public class CatalogueVariableScreen extends AppCompatActivity {
createView();
}
} 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 {
LinearLayout.LayoutParams childLabelViewLayoutParams = new LinearLayout.LayoutParams(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*/
if(mCatalogueItemShortDescription != null && !mCatalogueItemShortDescription.isEmpty()) {
TextView shortDescriptionView = new TextView(CatalogueVariableScreen.this);
......@@ -596,7 +607,7 @@ public class CatalogueVariableScreen extends AppCompatActivity {
if(syncStatus == SyncStatus.SUCCESS) {
showSubmissionDialog();
} 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 {
alert.show();
}
private void showErrorDialog(int message) {
private void showFetchVariableErrorDialog(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();
finish();
}
});
......@@ -632,6 +644,19 @@ public class CatalogueVariableScreen extends AppCompatActivity {
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) {
return Constants.month[month];
}
......
......@@ -29,8 +29,7 @@
android:layout_height="wrap_content"
android:ellipsize="end"
android:textSize="@dimen/normal_text_size"
android:textStyle="bold"
android:lines="1" />
android:textStyle="bold"/>
<TextView
android:id="@+id/catalogue_category_adapter_des_tv"
......
......@@ -29,8 +29,7 @@
android:layout_height="wrap_content"
android:ellipsize="end"
android:textSize="@dimen/normal_text_size"
android:textStyle="bold"
android:lines="1" />
android:textStyle="bold"/>
<TextView
android:id="@+id/catalogue_category_item_adapter_des_tv"
......
......@@ -51,6 +51,7 @@
<!--Variable Screen-->
<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_radio_text_string">%d</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