mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-10-31 06:43:56 +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! | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Neslihan
						Neslihan