Add meaningluf strings

This commit is contained in:
neslihanturan 2018-05-20 13:52:11 +03:00 committed by maskara
parent 77c28f646f
commit 76e9708025
5 changed files with 50 additions and 16 deletions

View file

@ -9,9 +9,11 @@ import android.support.v4.view.ViewPager;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.widget.Toolbar;
import android.util.AttributeSet;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
import android.widget.ProgressBar;
@ -48,7 +50,7 @@ public class ReviewActivity extends AuthenticatedActivity {
DrawerLayout drawerLayout;
@BindView(R.id.reviewPager)
ViewPager reviewPager;
ReviewViewPager reviewPager;
@Inject MediaWikiApi mwApi;
@ -167,15 +169,4 @@ public class ReviewActivity extends AuthenticatedActivity {
Intent reviewActivity = new Intent(context, ReviewActivity.class);
context.startActivity(reviewActivity);
}
/*interface ReviewCallback {
void onImageRefreshed(String itemTitle);
void onQuestionChanged();
void onSurveyFinished();
void onImproperImageReported();
void onLicenceViolationReported();
void onWrongCategoryReported();
void onThankSent();
}*/
}

View file

@ -87,16 +87,18 @@ public class ReviewImageFragment extends CommonsDaggerSupportFragment {
textViewQuestionContext = layoutView.findViewById(R.id.reviewQuestionContext);
yesButton = layoutView.findViewById(R.id.yesButton);
noButton = layoutView.findViewById(R.id.noButton);
String question;
String question, explanation;
switch(position) {
case COPYRIGHT:
question = getString(R.string.review_copyright);
explanation = getString(R.string.review_copyright_explanation);
yesButton.setOnClickListener(view -> {
((ReviewActivity)getActivity()).reviewController.reportPossibleCopyRightViolation();
});
break;
case CATEGORY:
question = getString(R.string.review_category);
explanation = getString(R.string.review_no_category);
updateCategories(ReviewController.categories);
yesButton.setOnClickListener(view -> {
((ReviewActivity)getActivity()).reviewController.reportWrongCategory();
@ -104,18 +106,21 @@ public class ReviewImageFragment extends CommonsDaggerSupportFragment {
break;
case SPAM:
question = getString(R.string.review_spam);
explanation = getString(R.string.review_spam_explanation);
yesButton.setOnClickListener(view -> {
((ReviewActivity)getActivity()).reviewController.reportSpam();
});
break;
case THANKS:
question = getString(R.string.review_thanks);
explanation = getString(R.string.review_thanks_explanation);
yesButton.setOnClickListener(view -> {
((ReviewActivity)getActivity()).reviewController.sendThanks();
});
break;
default:
question = "How did we get here?";
explanation = "No idea.";
}
noButton.setOnClickListener(view -> {
@ -123,6 +128,8 @@ public class ReviewImageFragment extends CommonsDaggerSupportFragment {
});
((TextView) textViewQuestion).setText(question);
((TextView) textViewQuestionContext).setText(explanation);
simpleDraweeView = layoutView.findViewById(R.id.imageView);
if (fileName != null) {

View file

@ -0,0 +1,33 @@
package fr.free.nrw.commons.review;
import android.content.Context;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.view.MotionEvent;
/**
* Created by root on 20.05.2018.
*/
public class ReviewViewPager extends ViewPager {
public ReviewViewPager(Context context) {
super(context);
}
public ReviewViewPager(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
public boolean onInterceptTouchEvent(MotionEvent event) {
// Never allow swiping to switch between pages
return false;
}
@Override
public boolean onTouchEvent(MotionEvent event) {
// Never allow swiping to switch between pages
return false;
}
}

View file

@ -28,7 +28,7 @@
android:layout_height="match_parent"
android:layout_below="@id/toolbar">
<android.support.v4.view.ViewPager
<fr.free.nrw.commons.review.ReviewViewPager
android:id="@+id/reviewPager"
android:layout_width="match_parent"
android:layout_height="wrap_content"

View file

@ -479,9 +479,12 @@ Upload your first media by touching the camera or gallery icon above.</string>
<string name="review_copyright">Is this a copyright violation?</string>
<string name="review_category">Is this mis-categorized?</string>
<string name="review_spam">Is this spam?</string>
<string name="review_spam">Is this out of scope?</string>
<string name="review_thanks">Would you like to thank to contributor?</string>
<string name="review_no_category">Oh, this is not evet categorized!</string>
<string name="review_spam_explanation">Please report if doesn\'t look useful.</string>
<string name="review_copyright_explanation">A random photo from internet, a famous brand logo etc.</string>
<string name="review_thanks_explanation">%1$s will be happy with your thanks</string>
<string name="review_no_category">Oh, this is not evet categorized! Do you want to set some?</string>
<string name="review_category_explanation">This image is under %1$s categories.</string>
<string name="review_spam_report_question">Why do you think this is out of scope?</string>
<string name="review_spam_report_default_answer">Because it is a selfie, very blurry or has nonsense etc.</string>