adjusted modals for feedback/bug

This commit is contained in:
Marcin Jedynski 2018-11-13 23:59:39 +01:00
parent f89971d059
commit 8669e040b5
3 changed files with 47 additions and 33 deletions

View File

@ -134,9 +134,9 @@ public abstract class BaseActivity
startActivity(i);
finish();
} else if (itemName.equals(getResources().getString(R.string.navigation_item_feedback))) {
showNoteDialog(BaseActivity.this, "Feedback");
showNoteDialog(BaseActivity.this, "FEEDBACK");
} else if (itemName.equals(getResources().getString(R.string.navigation_item_bug))) {
showNoteDialog(BaseActivity.this, "Bug report");
showNoteDialog(BaseActivity.this, "BUG REPORT");
}
sideDrawer.closeDrawers();
@ -395,23 +395,26 @@ public abstract class BaseActivity
alertDialogBuilderUserInput.setView(view);
final AlertDialog alertDialog = alertDialogBuilderUserInput.create();
EditText userInput = view.findViewById(R.id.feedback_input);
CheckBox isAnonymous = view.findViewById(R.id.feedback_is_anonymous);
EditText modalUserInput = view.findViewById(R.id.feedback_input);
CheckBox modalIsAnonymous = view.findViewById(R.id.feedback_is_anonymous);
TextView modalTitle = view.findViewById(R.id.feedback_modal_title);
TextView modalSubtitle = view.findViewById(R.id.feedback_modal_subtitle);
modalTitle.setText(subject);
if( subject == "BUG REPORT"){
modalSubtitle.setText("Tell us what you noticed!(max 1000 characters)");
} else if (subject == "FEEDBACK")
{
modalSubtitle.setText("Tell us what you think!(max 1000 characters)");
}
alertDialog.setButton(AlertDialog.BUTTON_POSITIVE,"SEND", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
String body = userInput.getText().toString();
boolean mode = isAnonymous.isChecked();
String body = modalUserInput.getText().toString();
boolean mode = modalIsAnonymous.isChecked();
sendFeedback(context,subject,body,mode);
}
});
alertDialog.show();
}
/**
@ -428,7 +431,7 @@ public abstract class BaseActivity
metadata = "\n-----------------------------\n" +
"User ID: " + PrefUtils.getUserId(context) + "\n" +
"Device OS: Android\n" +
"Device OS version: " + Build.VERSION.RELEASE +
"Device OS version: " + Build.VERSION.RELEASE + "\n" +
"App Version: " + appVersion + "\n" +
"Device Brand: " + Build.BRAND + "\n" +
"Device Model: " + Build.MODEL + "\n" +
@ -446,17 +449,6 @@ public abstract class BaseActivity
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(this::handleResponse, this::handleError));
/* Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("message/rfc822");
intent.putExtra(Intent.EXTRA_EMAIL, new String[]{context.getString(R.string.fmt_email)});
intent.putExtra(Intent.EXTRA_SUBJECT, context.getString(subject));
intent.putExtra(Intent.EXTRA_TEXT, body);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(Intent.createChooser(intent, context.getString(R.string.choose_email_client)));*/
}
private void handleResponse(Response<Void> resp) {
Toast.makeText(getApplicationContext(), "Thank you for subbmiting your feedback", Toast.LENGTH_SHORT).show();

View File

@ -10,31 +10,42 @@
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin">
<TextView
android:id="@+id/feedback_modal_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_marginBottom="@dimen/dimen_10"
android:fontFamily="sans-serif-medium"
android:lineSpacingExtra="8sp"
android:text="placeholder"
android:textColor="@color/colorAccent"
android:textSize="@dimen/lbl_new_note_title"
android:textStyle="normal" />
<EditText
android:id="@+id/feedback_input"
android:layout_width="315dp"
android:layout_height="wrap_content"
android:layout_height="150dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="50dp"
android:ems="10"
android:maxLength="1000"
android:hint="@string/modal_feedback_hint"
android:inputType="textMultiLine"
android:maxLines="10"
android:scrollbars="vertical"
android:maxLength="1000"
android:maxLines="7"
android:requiresFadingEdge="vertical"
/>
android:scrollbars="vertical" />
<TextView
android:id="@+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/feedback_input"
android:layout_alignStart="@+id/feedback_input"
android:layout_marginStart="3dp"
android:layout_marginTop="23dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="4dp"
android:layout_toStartOf="@+id/feedback_is_anonymous"
android:text="@string/modal_feedback_question"
android:textSize="16sp" />
@ -45,4 +56,15 @@
android:layout_alignBaseline="@+id/textView5"
android:layout_alignEnd="@+id/feedback_input"
android:textSize="14sp" />
<TextView
android:id="@+id/feedback_modal_subtitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/feedback_input"
android:layout_alignEnd="@+id/feedback_input"
android:layout_marginEnd="0dp"
android:layout_marginBottom="-50dp"
android:text="Tell us what you think (max 1000 characters)"
android:textSize="14sp" />
</RelativeLayout>

View File

@ -22,7 +22,7 @@
<string name="email_subject_feedback">Find My Tutor - feedback</string>
<string name="email_subject_bug">Find My Tutor - bug report</string>
<string name="modal_feedback_hint">Please input your feedback.</string>
<string name="modal_feedback_question">Do you want to send it anonymously ?</string>
<string name="modal_feedback_question">Send anonymously</string>
<!-- Tutors list -->