Uses a hack to avoid the use of a new library + keeps new emoji in csv file of course.

This commit is contained in:
tom79 2017-09-06 18:53:58 +02:00
parent 366f85d7ad
commit 1cc9df1de1
3 changed files with 6 additions and 6 deletions

View File

@ -39,7 +39,6 @@ dependencies {
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
compile 'com.evernote:android-job:1.1.11'
compile 'com.github.chrisbanes:PhotoView:2.0.0'
compile 'com.vdurmont:emoji-java:3.3.0'
compile 'com.google.code.gson:gson:2.8.0'
compile 'org.jsoup:jsoup:1.10.3'
safetynetCompile 'com.google.android.gms:play-services-safetynet:11.0.4'

View File

@ -46,7 +46,7 @@
<activity
android:name="fr.gouv.etalab.mastodon.activities.MainActivity"
android:label="@string/app_name"
android:launchMode="singleTop"
android:launchMode="singleTask"
android:windowSoftInputMode = "adjustResize"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@style/AppThemeDark_NoActionBar">

View File

@ -55,8 +55,6 @@ import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;
import com.nostra13.universalimageloader.core.display.SimpleBitmapDisplayer;
import com.vdurmont.emoji.EmojiManager;
import com.vdurmont.emoji.EmojiParser;
import org.json.JSONArray;
import org.json.JSONException;
@ -386,8 +384,11 @@ public class StatusListAdapter extends BaseAdapter implements OnPostActionInterf
if (translator == Helper.TRANS_YANDEX)
new YandexQuery(StatusListAdapter.this).getYandexTextview(position, text, currentLocale);
else if( translator == Helper.TRANS_GOOGLE) {
text = EmojiParser.parseToAliases(text);
new GoogleTranslateQuery(StatusListAdapter.this).getGoogleTextview(position, text, currentLocale);
while( text.charAt(text.length() -1) == '\n' && text.length() > 0)
text = text.substring(0, text.length() -1);
text += ".";
new GoogleTranslateQuery(StatusListAdapter.this).getGoogleTextview(position, text.trim(), currentLocale);
}
}else {
status.setTranslationShown(!status.isTranslationShown());