made error message be displayed inside erroractivity

This commit is contained in:
Christian Schabesberger 2016-02-29 19:23:01 +01:00
parent 1829dc79c8
commit 18493a578d
4 changed files with 23 additions and 5 deletions

View File

@ -92,6 +92,7 @@ public class ErrorActivity extends AppCompatActivity {
private EditText userCommentBox;
private Button reportButton;
private TextView infoView;
private TextView errorMessageView;
public static void reportError(final Context context, final List<Exception> el,
final Class returnAcitivty, View rootView, final ErrorInfo errorInfo) {
@ -159,6 +160,7 @@ public class ErrorActivity extends AppCompatActivity {
userCommentBox = (EditText) findViewById(R.id.errorCommentBox);
errorView = (TextView) findViewById(R.id.errorView);
infoView = (TextView) findViewById(R.id.errorInfosView);
errorMessageView = (TextView) findViewById(R.id.errorMessageView);
errorView.setText(formErrorText(errorList));
@ -184,8 +186,7 @@ public class ErrorActivity extends AppCompatActivity {
globIpRangeThread = new Thread(new IpRagneRequester());
globIpRangeThread.start();
Toast.makeText(this,
errorInfo.message, Toast.LENGTH_LONG).show();
errorMessageView.setText(errorInfo.message);
}
@Override

View File

@ -129,7 +129,7 @@ public class VideoItemListFragment extends ListFragment {
View rootView = a.findViewById(R.id.videoitem_list);
ErrorActivity.reportError(h, getActivity(), result.errors, null, rootView,
ErrorActivity.ErrorInfo.make(ErrorActivity.SEARCHED,
/* todo: this shoudl not be assigned static */ "Youtube", query, R.string.general_error));
/* todo: this shoudl not be assigned static */ "Youtube", query, R.string.light_parsing_error));
}
// hard errors:

View File

@ -30,6 +30,21 @@
android:text="@string/sorry_string"
android:textStyle="bold" />
<TextView
android:id="@+id/messageWhatHappenedView"
android:paddingTop="@dimen/activity_vertical_margin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/what_happened_headline"/>
<TextView
android:id="@+id/errorMessageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/black"
android:text="@string/info_labels"/>
<TextView
android:id="@+id/errorDeviceHeadlineView"
android:paddingTop="@dimen/activity_vertical_margin"
@ -66,12 +81,12 @@
</LinearLayout>
<TextView
android:id="@+id/errorWhatHappenedView"
android:id="@+id/errorDetailView"
android:paddingTop="@dimen/activity_vertical_margin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/what_happened_headline"/>
android:text="@string/error_details_headline"/>
<HorizontalScrollView
android:layout_width="match_parent"

View File

@ -84,6 +84,7 @@
<string name="could_not_load_thumbnails">Could not load all Thumbnails</string>
<string name="youtube_signature_decryption_error">Could not decrypt video url signature.</string>
<string name="parsing_error">Could not parse website.</string>
<string name="light_parsing_error">Could not parse website complete.</string>
<string name="content_not_available">Content not available.</string>
<string name="blocked_by_gema">Blocked by GEMA.</string>
<string name="could_not_setup_download_menu">Could not setup download menu.</string>
@ -101,6 +102,7 @@
<string name="info_searched_lbl">Searched for:</string>
<string name="info_requested_stream_lbl">Requested stream:</string>
<string name="your_comment">Your comment (in English):</string>
<string name="error_details_headline">Details:</string>
<!-- Content descriptions (for better accessibility) -->