Merge remote-tracking branch 'remotes/tom-repo/develop' into PhotonQyv-Baseline

This commit is contained in:
PhotonQyv 2017-09-12 16:34:46 +01:00
commit 6796e09fee
4 changed files with 10 additions and 8 deletions

View File

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

View File

@ -23,7 +23,6 @@ import android.os.AsyncTask;
import android.os.Bundle; import android.os.Bundle;
import android.support.v4.content.ContextCompat; import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity; import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.widget.Button; import android.widget.Button;
@ -58,8 +57,9 @@ public class AboutActivity extends AppCompatActivity implements OnRetrieveRemote
private List<Account> contributors = new ArrayList<>(); private List<Account> contributors = new ArrayList<>();
private AccountSearchDevAdapter accountSearchWebAdapterDeveloper; private AccountSearchDevAdapter accountSearchWebAdapterDeveloper;
private AccountSearchDevAdapter accountSearchWebAdapterContributors; private AccountSearchDevAdapter accountSearchWebAdapterContributors;
@SuppressWarnings("FieldCanBeLocal")
private int DEV_COUNT = 1, CONTRIBUTOR_COUNT = 2;
@SuppressWarnings("deprecation")
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
@ -226,12 +226,12 @@ public class AboutActivity extends AppCompatActivity implements OnRetrieveRemote
@Override @Override
public void onResume(){ public void onResume(){
super.onResume(); super.onResume();
if( developers != null && developers.size() > 0){ if( developers != null && developers.size() == DEV_COUNT){
for(Account account: developers){ for(Account account: developers){
new RetrieveRelationshipAsyncTask(getApplicationContext(), account.getId(),AboutActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); new RetrieveRelationshipAsyncTask(getApplicationContext(), account.getId(),AboutActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
} }
} }
if( contributors != null && contributors.size() > 0){ if( contributors != null && contributors.size() == CONTRIBUTOR_COUNT){
for(Account account: contributors){ for(Account account: contributors){
new RetrieveRelationshipAsyncTask(getApplicationContext(), account.getId(),AboutActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); new RetrieveRelationshipAsyncTask(getApplicationContext(), account.getId(),AboutActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
} }

View File

@ -465,7 +465,7 @@ public class StatusListAdapter extends BaseAdapter implements OnPostActionInterf
//Redraws top icons (boost/reply) //Redraws top icons (boost/reply)
final float scale = context.getResources().getDisplayMetrics().density; final float scale = context.getResources().getDisplayMetrics().density;
if( !status.getIn_reply_to_account_id().equals("null") || !status.getIn_reply_to_id().equals("null") ){ if( (status.getIn_reply_to_account_id()!= null && !status.getIn_reply_to_account_id().equals("null")) || (status.getIn_reply_to_id() != null && !status.getIn_reply_to_id().equals("null")) ){
Drawable img = ContextCompat.getDrawable(context, R.drawable.ic_reply); Drawable img = ContextCompat.getDrawable(context, R.drawable.ic_reply);
img.setBounds(0,0,(int) (20 * iconSizePercent/100 * scale + 0.5f),(int) (15 * iconSizePercent/100 * scale + 0.5f)); img.setBounds(0,0,(int) (20 * iconSizePercent/100 * scale + 0.5f),(int) (15 * iconSizePercent/100 * scale + 0.5f));
holder.status_account_displayname.setCompoundDrawables( img, null, null, null); holder.status_account_displayname.setCompoundDrawables( img, null, null, null);

View File

@ -1665,7 +1665,8 @@ public class Helper {
Gson gson = new Gson(); Gson gson = new Gson();
String json = sharedpreferences.getString(Helper.SET_TEMP_STATUS + userId, null); String json = sharedpreferences.getString(Helper.SET_TEMP_STATUS + userId, null);
Type type = new TypeToken<ArrayList<Status>>() {}.getType(); Type type = new TypeToken<ArrayList<Status>>() {}.getType();
return gson.fromJson(json, type); ArrayList<Status> statuses = gson.fromJson(json, type);
return (statuses != null)?statuses:new ArrayList<Status>();
} }
@ -1713,7 +1714,8 @@ public class Helper {
Gson gson = new Gson(); Gson gson = new Gson();
String json = sharedpreferences.getString(Helper.SET_TEMP_NOTIFICATIONS + userId, null); String json = sharedpreferences.getString(Helper.SET_TEMP_NOTIFICATIONS + userId, null);
Type type = new TypeToken<ArrayList<Notification>>() {}.getType(); Type type = new TypeToken<ArrayList<Notification>>() {}.getType();
return gson.fromJson(json, type); ArrayList<Notification> notifications = gson.fromJson(json, type);
return (notifications != null)?notifications:new ArrayList<Notification>();
} }
} }