mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
parent
fe7a2f2a8c
commit
bf6e4884b2
3 changed files with 19 additions and 0 deletions
|
|
@ -3,6 +3,9 @@ package fr.free.nrw.commons.feedback;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.text.Html;
|
||||||
|
import android.text.Spanned;
|
||||||
|
import android.text.method.LinkMovementMethod;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.WindowManager.LayoutParams;
|
import android.view.WindowManager.LayoutParams;
|
||||||
import fr.free.nrw.commons.R;
|
import fr.free.nrw.commons.R;
|
||||||
|
|
@ -21,15 +24,20 @@ public class FeedbackDialog extends Dialog {
|
||||||
|
|
||||||
private OnFeedbackSubmitCallback onFeedbackSubmitCallback;
|
private OnFeedbackSubmitCallback onFeedbackSubmitCallback;
|
||||||
|
|
||||||
|
private Spanned feedbackDestinationHtml;
|
||||||
|
|
||||||
public FeedbackDialog(Context context, OnFeedbackSubmitCallback onFeedbackSubmitCallback) {
|
public FeedbackDialog(Context context, OnFeedbackSubmitCallback onFeedbackSubmitCallback) {
|
||||||
super(context);
|
super(context);
|
||||||
this.onFeedbackSubmitCallback = onFeedbackSubmitCallback;
|
this.onFeedbackSubmitCallback = onFeedbackSubmitCallback;
|
||||||
|
feedbackDestinationHtml = Html.fromHtml(context.getString(R.string.feedback_destination_note));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(final Bundle savedInstanceState) {
|
protected void onCreate(final Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
dialogFeedbackBinding = DialogFeedbackBinding.inflate(getLayoutInflater());
|
dialogFeedbackBinding = DialogFeedbackBinding.inflate(getLayoutInflater());
|
||||||
|
dialogFeedbackBinding.feedbackDestination.setText(feedbackDestinationHtml);
|
||||||
|
dialogFeedbackBinding.feedbackDestination.setMovementMethod(LinkMovementMethod.getInstance());
|
||||||
Objects.requireNonNull(getWindow()).setSoftInputMode(LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
|
Objects.requireNonNull(getWindow()).setSoftInputMode(LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
|
||||||
final View view = dialogFeedbackBinding.getRoot();
|
final View view = dialogFeedbackBinding.getRoot();
|
||||||
setContentView(view);
|
setContentView(view);
|
||||||
|
|
|
||||||
|
|
@ -122,6 +122,16 @@
|
||||||
android:layout_margin="@dimen/dimen_6"
|
android:layout_margin="@dimen/dimen_6"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/feedback_destination"
|
||||||
|
android:layout_margin="@dimen/dimen_6"
|
||||||
|
android:padding="4dp"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textColor="?android:attr/textColorPrimary"
|
||||||
|
android:text="@string/feedback_destination_note"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/btn_submit_feedback"
|
android:id="@+id/btn_submit_feedback"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
|
|
|
||||||
|
|
@ -818,4 +818,5 @@ Upload your first media by tapping on the add button.</string>
|
||||||
</plurals>
|
</plurals>
|
||||||
<string name="multiple_files_depiction">Please remember that all images in a multi-upload get the same categories and depictions. If the images do not share depictions and categories, please perform several separate uploads.</string>
|
<string name="multiple_files_depiction">Please remember that all images in a multi-upload get the same categories and depictions. If the images do not share depictions and categories, please perform several separate uploads.</string>
|
||||||
<string name="multiple_files_depiction_header">Note about multi-uploads</string>
|
<string name="multiple_files_depiction_header">Note about multi-uploads</string>
|
||||||
|
<string name="feedback_destination_note">Your feedback gets posted on the following wiki page: <![CDATA[ <a href="https://commons.wikimedia.org/wiki/Commons:Mobile_app/Feedback">Commons:Mobile_app/Feedback</a> ]]></string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue