Removes lib for Emoji

This commit is contained in:
tom79 2017-06-11 14:28:29 +02:00
parent 350e26d64f
commit cabdfcf915
14 changed files with 1952 additions and 83 deletions

View File

@ -26,7 +26,5 @@ dependencies {
compile 'com.loopj.android:android-async-http:1.4.9'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
compile 'com.evernote:android-job:1.1.10'
compile ('com.vdurmont:emoji-java:3.2.0') {
exclude group: 'org.json'
}
}

File diff suppressed because it is too large Load Diff

View File

@ -38,14 +38,14 @@ import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.emojione.Emojione;
import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.display.SimpleBitmapDisplayer;
import com.vdurmont.emoji.EmojiParser;
import java.util.ArrayList;
import java.util.List;
@ -283,7 +283,7 @@ public class ShowAccountActivity extends AppCompatActivity implements OnPostActi
if( account != null){
setTitle(account.getAcct());
account_dn.setText(EmojiParser.parseToUnicode(account.getDisplay_name()));
account_dn.setText(Emojione.shortnameToUnicode(account.getDisplay_name(), true));
account_un.setText(String.format("@%s", account.getUsername()));
if( account.getAcct() != null && account.getAcct().equals(account.getUsername()))
account_ac.setVisibility(View.GONE);

View File

@ -1,9 +1,20 @@
package fr.gouv.etalab.mastodon.client;
/* Copyright 2017 Thomas Schneider
*
* This file is a part of Mastodon Etalab for mastodon.etalab.gouv.fr
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* Mastodon Etalab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Thomas Schneider; if not,
* see <http://www.gnu.org/licenses>. */
import android.content.Context;
import java.util.List;
import fr.gouv.etalab.mastodon.client.Entities.*;
import fr.gouv.etalab.mastodon.client.Entities.Error;

View File

@ -1,42 +0,0 @@
/* Copyright 2017 Thomas Schneider
*
* This file is a part of Mastodon Etalab for mastodon.etalab.gouv.fr
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* Mastodon Etalab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Thomas Schneider; if not,
* see <http://www.gnu.org/licenses>. */
package fr.gouv.etalab.mastodon.client;
/**
* Created by Thomas on 23/04/2017.
*/
public class Error {
private int code;
private String message;
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
}

View File

@ -1,11 +1,27 @@
/* Copyright 2017 Thomas Schneider
*
* This file is a part of Mastodon Etalab for mastodon.etalab.gouv.fr
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* Mastodon Etalab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Thomas Schneider; if not,
* see <http://www.gnu.org/licenses>. */
package fr.gouv.etalab.mastodon.client;
/**
/*
* Created by Thomas on 20/05/2017.
* Custom MySSLSocketFactory
*/
import android.annotation.SuppressLint;
import java.io.IOException;
import java.net.Socket;
import java.security.KeyManagementException;
@ -42,9 +58,11 @@ public class MastalabSSLSocketFactory extends com.loopj.android.http.MySSLSocket
public MastalabSSLSocketFactory(KeyStore truststore) throws NoSuchAlgorithmException, KeyManagementException, KeyStoreException, UnrecoverableKeyException {
super(truststore);
X509TrustManager tm = new X509TrustManager() {
@SuppressLint("TrustAllX509TrustManager")
public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {
}
@SuppressLint("TrustAllX509TrustManager")
public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {
}

View File

@ -1,5 +1,19 @@
package fr.gouv.etalab.mastodon.client;
/* Copyright 2017 Thomas Schneider
*
* This file is a part of Mastodon Etalab for mastodon.etalab.gouv.fr
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* Mastodon Etalab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Thomas Schneider; if not,
* see <http://www.gnu.org/licenses>. */
import android.annotation.SuppressLint;
import android.content.Context;
import com.nostra13.universalimageloader.core.assist.ContentLengthInputStream;
@ -60,9 +74,11 @@ public class PatchBaseImageDownloader extends BaseImageDownloader {
MySSLSocketFactory() throws Exception {
super();
TrustManager tm = new X509TrustManager() {
@SuppressLint("TrustAllX509TrustManager")
public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {
}
@SuppressLint("TrustAllX509TrustManager")
public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {
}

View File

@ -34,10 +34,10 @@ import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.emojione.Emojione;
import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.display.SimpleBitmapDisplayer;
import com.vdurmont.emoji.EmojiParser;
import java.util.ArrayList;
import java.util.List;
@ -152,7 +152,7 @@ public class AccountsListAdapter extends BaseAdapter implements OnPostActionInte
holder.account_ds.setVisibility(View.VISIBLE);
}
});
holder.account_dn.setText(EmojiParser.parseToUnicode(account.getDisplay_name()));
holder.account_dn.setText(Emojione.shortnameToUnicode(account.getDisplay_name(), true));
holder.account_un.setText(String.format("@%s",account.getUsername()));
holder.account_ac.setText(account.getAcct());
if( account.getDisplay_name().equals(account.getAcct()))
@ -162,6 +162,7 @@ public class AccountsListAdapter extends BaseAdapter implements OnPostActionInte
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
holder.account_ds.setText(Html.fromHtml(account.getNote(), Html.FROM_HTML_MODE_COMPACT));
else
//noinspection deprecation
holder.account_ds.setText(Html.fromHtml(account.getNote()));
holder.account_ds.setAutoLinkMask(Linkify.WEB_URLS);
holder.account_sc.setText(String.valueOf(account.getStatuses_count()));

View File

@ -26,10 +26,10 @@ import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.emojione.Emojione;
import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.display.SimpleBitmapDisplayer;
import com.vdurmont.emoji.EmojiParser;
import java.util.List;
import fr.gouv.etalab.mastodon.client.Entities.Account;
@ -91,8 +91,7 @@ public class AccountsSearchAdapter extends BaseAdapter {
} else {
holder = (ViewHolder) convertView.getTag();
}
holder.account_dn.setText(EmojiParser.parseToUnicode(account.getDisplay_name()));
holder.account_dn.setText(Emojione.shortnameToUnicode(account.getDisplay_name(), true));
holder.account_un.setText(String.format("@%s",account.getUsername()));
//Profile picture
imageLoader.displayImage(account.getAvatar(), holder.account_pp, options);

View File

@ -14,13 +14,9 @@ package fr.gouv.etalab.mastodon.drawers;
* You should have received a copy of the GNU General Public License along with Thomas Schneider; if not,
* see <http://www.gnu.org/licenses>. */
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.support.v4.content.ContextCompat;
@ -29,29 +25,22 @@ import android.text.util.Linkify;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.VideoView;
import com.emojione.Emojione;
import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.assist.FailReason;
import com.nostra13.universalimageloader.core.display.SimpleBitmapDisplayer;
import com.nostra13.universalimageloader.core.listener.SimpleImageLoadingListener;
import com.vdurmont.emoji.EmojiParser;
import java.util.List;
import fr.gouv.etalab.mastodon.activities.ShowAccountActivity;
import fr.gouv.etalab.mastodon.activities.ShowConversationActivity;
import fr.gouv.etalab.mastodon.activities.TootActivity;
import fr.gouv.etalab.mastodon.asynctasks.RetrieveFeedsAsyncTask;
import mastodon.etalab.gouv.fr.mastodon.R;
import fr.gouv.etalab.mastodon.client.Entities.Attachment;
import fr.gouv.etalab.mastodon.client.Entities.Notification;
import fr.gouv.etalab.mastodon.client.Entities.Status;
import fr.gouv.etalab.mastodon.helper.Helper;
@ -162,6 +151,7 @@ public class NotificationsListAdapter extends BaseAdapter {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
holder.notification_status_content.setText(Html.fromHtml(status.getContent(), Html.FROM_HTML_MODE_COMPACT));
else
//noinspection deprecation
holder.notification_status_content.setText(Html.fromHtml(status.getContent()));
holder.notification_status_content.setAutoLinkMask(Linkify.WEB_URLS);
holder.status_favorite_count.setText(String.valueOf(status.getFavourites_count()));
@ -220,8 +210,7 @@ public class NotificationsListAdapter extends BaseAdapter {
}
});
holder.notification_account_displayname.setText(EmojiParser.parseToUnicode(notification.getAccount().getDisplay_name()));
holder.notification_account_displayname.setText(Emojione.shortnameToUnicode(notification.getAccount().getDisplay_name(), true));
holder.notification_account_username.setText( String.format("@%s",notification.getAccount().getUsername()));
//Profile picture
imageLoader.displayImage(notification.getAccount().getAvatar(), holder.notification_account_profile, options);

View File

@ -31,10 +31,10 @@ import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.emojione.Emojione;
import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.display.SimpleBitmapDisplayer;
import com.vdurmont.emoji.EmojiParser;
import java.util.ArrayList;
import java.util.List;
@ -168,7 +168,7 @@ public class SearchListAdapter extends BaseAdapter {
final String content, displayName, username, ppurl;
if( status.getReblog() != null){
content = status.getReblog().getContent();
displayName = EmojiParser.parseToUnicode(status.getReblog().getAccount().getDisplay_name());
displayName = Emojione.shortnameToUnicode(status.getReblog().getAccount().getDisplay_name(), true);
username = status.getReblog().getAccount().getUsername();
holder.status_reblog_user.setText(displayName + " " +String.format("@%s",username));
ppurl = status.getReblog().getAccount().getAvatar();
@ -178,7 +178,7 @@ public class SearchListAdapter extends BaseAdapter {
}else {
ppurl = status.getAccount().getAvatar();
content = status.getContent();
displayName = EmojiParser.parseToUnicode(status.getAccount().getDisplay_name());
displayName = Emojione.shortnameToUnicode(status.getAccount().getDisplay_name(), true);
username = status.getAccount().getUsername();
holder.status_reblog_user.setVisibility(View.GONE);
holder.status_account_displayname.setText(displayName);

View File

@ -34,7 +34,6 @@ import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.text.Html;
import android.text.util.Linkify;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@ -50,12 +49,12 @@ import android.widget.TextView;
import android.widget.Toast;
import android.widget.VideoView;
import com.emojione.Emojione;
import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.assist.FailReason;
import com.nostra13.universalimageloader.core.display.SimpleBitmapDisplayer;
import com.nostra13.universalimageloader.core.listener.SimpleImageLoadingListener;
import com.vdurmont.emoji.EmojiParser;
import java.util.ArrayList;
import java.util.List;
@ -233,7 +232,7 @@ public class StatusListAdapter extends BaseAdapter implements OnPostActionInterf
}else {
ppurl = status.getAccount().getAvatar();
content = status.getContent();
displayName = EmojiParser.parseToUnicode(status.getAccount().getDisplay_name());
displayName = Emojione.shortnameToUnicode(status.getAccount().getDisplay_name(), true);
username = status.getAccount().getUsername();
holder.status_reblog_user.setVisibility(View.GONE);
holder.status_account_displayname.setText(displayName);

View File

@ -23,7 +23,6 @@ import android.widget.BaseAdapter;;
import android.widget.TextView;
import java.util.List;
import fr.gouv.etalab.mastodon.client.Entities.Tag;
import mastodon.etalab.gouv.fr.mastodon.R;
@ -35,12 +34,10 @@ public class TagsListAdapter extends BaseAdapter {
private List<String> tags;
private LayoutInflater layoutInflater;
private Context context;
public TagsListAdapter(Context context, List<String> tags){
this.tags = tags;
layoutInflater = LayoutInflater.from(context);
this.context = context;
}
@Override

View File

@ -287,7 +287,6 @@
L\'utilisation de bibliothèques est réduite au strict minimum :\n
- <b>Android Asynchronous Http Client</b> : Pour la gestion des requêtes\n
- <b>Universal Image Loader</b> : Pour la gestion des médias\n
- <b>Android-Job</b> : Pour la gestion des services\n
- <b>Emoji-java</b> : Pour l\'affichage des emoji
- <b>Android-Job</b> : Pour la gestion des services
</string>
</resources>