Wait time for translations

This commit is contained in:
stom79 2017-11-01 13:36:25 +01:00
parent 9ffa5820b4
commit 49fb0eb630
2 changed files with 5 additions and 2 deletions

View File

@ -42,7 +42,7 @@
</value>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">

View File

@ -765,7 +765,7 @@ public class TootActivity extends AppCompatActivity implements OnRetrieveSearcAc
return true;
case R.id.action_translate:
final CountryPicker picker = CountryPicker.newInstance("Select Country"); // dialog title
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, android.content.Context.MODE_PRIVATE);
final SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, android.content.Context.MODE_PRIVATE);
final int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
if( theme == Helper.THEME_LIGHT){
picker.setStyle(R.style.AppTheme, R.style.AlertDialog);
@ -792,6 +792,9 @@ public class TootActivity extends AppCompatActivity implements OnRetrieveSearcAc
popup_trans = getLayoutInflater().inflate( R.layout.popup_translate, null );
transAlert.setView(popup_trans);
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putString(Helper.LAST_TRANSLATION_TIME, Helper.dateToString(getApplicationContext(), new Date()));
editor.apply();
new Translate(getApplicationContext(), Helper.targetField.CW, locale, TootActivity.this).privacy(toot_cw_content.getText().toString());
new Translate(getApplicationContext(), Helper.targetField.STATUS, locale, TootActivity.this).privacy(toot_content.getText().toString());
transAlert.setPositiveButton(R.string.close, new DialogInterface.OnClickListener() {