adjusted modals for feedback/bug
This commit is contained in:
parent
f89971d059
commit
8669e040b5
@ -134,9 +134,9 @@ public abstract class BaseActivity
|
|||||||
startActivity(i);
|
startActivity(i);
|
||||||
finish();
|
finish();
|
||||||
} else if (itemName.equals(getResources().getString(R.string.navigation_item_feedback))) {
|
} 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))) {
|
} else if (itemName.equals(getResources().getString(R.string.navigation_item_bug))) {
|
||||||
showNoteDialog(BaseActivity.this, "Bug report");
|
showNoteDialog(BaseActivity.this, "BUG REPORT");
|
||||||
}
|
}
|
||||||
|
|
||||||
sideDrawer.closeDrawers();
|
sideDrawer.closeDrawers();
|
||||||
@ -395,23 +395,26 @@ public abstract class BaseActivity
|
|||||||
alertDialogBuilderUserInput.setView(view);
|
alertDialogBuilderUserInput.setView(view);
|
||||||
final AlertDialog alertDialog = alertDialogBuilderUserInput.create();
|
final AlertDialog alertDialog = alertDialogBuilderUserInput.create();
|
||||||
|
|
||||||
EditText userInput = view.findViewById(R.id.feedback_input);
|
EditText modalUserInput = view.findViewById(R.id.feedback_input);
|
||||||
CheckBox isAnonymous = view.findViewById(R.id.feedback_is_anonymous);
|
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() {
|
alertDialog.setButton(AlertDialog.BUTTON_POSITIVE,"SEND", new DialogInterface.OnClickListener() {
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
String body = userInput.getText().toString();
|
String body = modalUserInput.getText().toString();
|
||||||
boolean mode = isAnonymous.isChecked();
|
boolean mode = modalIsAnonymous.isChecked();
|
||||||
sendFeedback(context,subject,body,mode);
|
sendFeedback(context,subject,body,mode);
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
alertDialog.show();
|
alertDialog.show();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -428,7 +431,7 @@ public abstract class BaseActivity
|
|||||||
metadata = "\n-----------------------------\n" +
|
metadata = "\n-----------------------------\n" +
|
||||||
"User ID: " + PrefUtils.getUserId(context) + "\n" +
|
"User ID: " + PrefUtils.getUserId(context) + "\n" +
|
||||||
"Device OS: Android\n" +
|
"Device OS: Android\n" +
|
||||||
"Device OS version: " + Build.VERSION.RELEASE +
|
"Device OS version: " + Build.VERSION.RELEASE + "\n" +
|
||||||
"App Version: " + appVersion + "\n" +
|
"App Version: " + appVersion + "\n" +
|
||||||
"Device Brand: " + Build.BRAND + "\n" +
|
"Device Brand: " + Build.BRAND + "\n" +
|
||||||
"Device Model: " + Build.MODEL + "\n" +
|
"Device Model: " + Build.MODEL + "\n" +
|
||||||
@ -446,17 +449,6 @@ public abstract class BaseActivity
|
|||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(this::handleResponse, this::handleError));
|
.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) {
|
private void handleResponse(Response<Void> resp) {
|
||||||
Toast.makeText(getApplicationContext(), "Thank you for subbmiting your feedback", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getApplicationContext(), "Thank you for subbmiting your feedback", Toast.LENGTH_SHORT).show();
|
||||||
|
@ -10,31 +10,42 @@
|
|||||||
android:paddingRight="@dimen/activity_horizontal_margin"
|
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||||
android:paddingTop="@dimen/activity_vertical_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
|
<EditText
|
||||||
android:id="@+id/feedback_input"
|
android:id="@+id/feedback_input"
|
||||||
android:layout_width="315dp"
|
android:layout_width="315dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="150dp"
|
||||||
android:layout_alignParentTop="true"
|
android:layout_alignParentTop="true"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:layout_marginTop="50dp"
|
android:layout_marginTop="50dp"
|
||||||
android:ems="10"
|
android:ems="10"
|
||||||
android:maxLength="1000"
|
|
||||||
android:hint="@string/modal_feedback_hint"
|
android:hint="@string/modal_feedback_hint"
|
||||||
android:inputType="textMultiLine"
|
android:inputType="textMultiLine"
|
||||||
android:maxLines="10"
|
android:maxLength="1000"
|
||||||
android:scrollbars="vertical"
|
android:maxLines="7"
|
||||||
android:requiresFadingEdge="vertical"
|
android:requiresFadingEdge="vertical"
|
||||||
/>
|
android:scrollbars="vertical" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/textView5"
|
android:id="@+id/textView5"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@+id/feedback_input"
|
android:layout_below="@+id/feedback_input"
|
||||||
android:layout_alignStart="@+id/feedback_input"
|
android:layout_marginTop="20dp"
|
||||||
android:layout_marginStart="3dp"
|
android:layout_marginEnd="4dp"
|
||||||
android:layout_marginTop="23dp"
|
android:layout_toStartOf="@+id/feedback_is_anonymous"
|
||||||
android:text="@string/modal_feedback_question"
|
android:text="@string/modal_feedback_question"
|
||||||
android:textSize="16sp" />
|
android:textSize="16sp" />
|
||||||
|
|
||||||
@ -45,4 +56,15 @@
|
|||||||
android:layout_alignBaseline="@+id/textView5"
|
android:layout_alignBaseline="@+id/textView5"
|
||||||
android:layout_alignEnd="@+id/feedback_input"
|
android:layout_alignEnd="@+id/feedback_input"
|
||||||
android:textSize="14sp" />
|
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>
|
</RelativeLayout>
|
@ -22,7 +22,7 @@
|
|||||||
<string name="email_subject_feedback">Find My Tutor - feedback</string>
|
<string name="email_subject_feedback">Find My Tutor - feedback</string>
|
||||||
<string name="email_subject_bug">Find My Tutor - bug report</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_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 -->
|
<!-- Tutors list -->
|
||||||
|
Loading…
Reference in New Issue
Block a user