mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 12:53:55 +01:00
Prepare alert window and strings
This commit is contained in:
parent
e3c5d497d3
commit
d88fb3b0de
2 changed files with 50 additions and 1 deletions
|
|
@ -3,11 +3,13 @@ package fr.free.nrw.commons.contributions;
|
|||
import android.content.ComponentName;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.ServiceConnection;
|
||||
import android.content.SharedPreferences;
|
||||
import android.database.Cursor;
|
||||
import android.database.DataSetObserver;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.IBinder;
|
||||
import android.preference.PreferenceManager;
|
||||
|
|
@ -17,6 +19,7 @@ import android.support.v4.app.LoaderManager;
|
|||
import android.support.v4.content.CursorLoader;
|
||||
import android.support.v4.content.Loader;
|
||||
import android.support.v4.widget.CursorAdapter;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
|
|
@ -110,6 +113,46 @@ public class ContributionsActivity
|
|||
super.onPause();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStart() {
|
||||
super.onStart();
|
||||
if (true) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
builder.setTitle(getResources().getString(R.string.feedback_popup_title));
|
||||
builder.setMessage(getResources().getString(R.string.feedback_popup_description));
|
||||
builder.setPositiveButton(getResources().getString(R.string.feedback_popup_accept)
|
||||
, new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
// Go to the page
|
||||
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(getResources()
|
||||
.getString(R.string.feedback_page_url)));
|
||||
startActivity(browserIntent);
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
builder.setNeutralButton(getResources().getString(R.string.feedback_popup_remind)
|
||||
,new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
// Dismiss the dialog to show it later
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
builder.setNegativeButton(getResources().getString(R.string.feedback_popup_decline)
|
||||
, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
// Dismiss the dialog and not to show it later
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
AlertDialog alert = builder.create();
|
||||
alert.show();
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onAuthCookieAcquired(String authCookie) {
|
||||
// Do a sync everytime we get here!
|
||||
|
|
|
|||
|
|
@ -203,5 +203,11 @@ Tap this message (or hit back) to skip this step.</string>
|
|||
<string name="nearby_info_menu_commons_article">Commons file page</string>
|
||||
<string name="nearby_info_menu_wikidata_article">Wikidata item</string>
|
||||
<string name="error_while_cache">Error while caching pictures</string>
|
||||
<string name="feedback_popup_title">We need your feedbacks</string>
|
||||
<string name="feedback_popup_description">We are planning several new features and improvements for the app! Have your say.</string>
|
||||
<string name="feedback_popup_decline">Decline</string>
|
||||
<string name="feedback_popup_remind">Remind me later</string>
|
||||
<string name="feedback_popup_accept">Join to discussion</string>
|
||||
<string name="feedback_page_url">https://meta.wikimedia.org/wiki/Grants:Project/Improve_\'Upload_to_Commons\'_Android_App/Renewal/User_feedback</string>
|
||||
|
||||
</resources>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue