Add logs
This commit is contained in:
parent
861ab653b7
commit
8c67af896e
|
@ -10,6 +10,9 @@ import com.google.android.material.snackbar.Snackbar;
|
||||||
import androidx.core.app.ActivityCompat;
|
import androidx.core.app.ActivityCompat;
|
||||||
import androidx.core.content.ContextCompat;
|
import androidx.core.content.ContextCompat;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.StrictMode;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
@ -17,6 +20,7 @@ import com.franmontiel.localechanger.LocaleChanger;
|
||||||
import com.vanniktech.emoji.EmojiManager;
|
import com.vanniktech.emoji.EmojiManager;
|
||||||
import com.vanniktech.emoji.one.EmojiOneProvider;
|
import com.vanniktech.emoji.one.EmojiOneProvider;
|
||||||
|
|
||||||
|
import app.fedilab.android.BuildConfig;
|
||||||
import app.fedilab.android.helper.Helper;
|
import app.fedilab.android.helper.Helper;
|
||||||
import es.dmoral.toasty.Toasty;
|
import es.dmoral.toasty.Toasty;
|
||||||
|
|
||||||
|
@ -37,6 +41,29 @@ public class BaseActivity extends AppCompatActivity {
|
||||||
EmojiManager.install(new EmojiOneProvider());
|
EmojiManager.install(new EmojiOneProvider());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
|
||||||
|
if (BuildConfig.DEBUG) {
|
||||||
|
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
|
||||||
|
.detectDiskReads()
|
||||||
|
.detectDiskWrites()
|
||||||
|
.detectAll()
|
||||||
|
.penaltyLog()
|
||||||
|
.build());
|
||||||
|
StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()
|
||||||
|
.detectLeakedSqlLiteObjects()
|
||||||
|
.detectLeakedClosableObjects()
|
||||||
|
.penaltyLog()
|
||||||
|
.penaltyDeath()
|
||||||
|
.build());
|
||||||
|
}
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onConfigurationChanged(Configuration newConfig) {
|
public void onConfigurationChanged(Configuration newConfig) {
|
||||||
super.onConfigurationChanged(newConfig);
|
super.onConfigurationChanged(newConfig);
|
||||||
|
|
|
@ -65,6 +65,8 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
|
import java.util.concurrent.ScheduledExecutorService;
|
||||||
|
import java.util.concurrent.ScheduledFuture;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import app.fedilab.android.client.API;
|
import app.fedilab.android.client.API;
|
||||||
|
@ -142,6 +144,7 @@ public class ShowAccountActivity extends BaseActivity implements OnPostActionInt
|
||||||
private ImageView pp_actionBar;
|
private ImageView pp_actionBar;
|
||||||
private String accountId;
|
private String accountId;
|
||||||
private boolean ischannel;
|
private boolean ischannel;
|
||||||
|
private ScheduledExecutorService scheduledExecutorService;
|
||||||
|
|
||||||
public enum action{
|
public enum action{
|
||||||
FOLLOW,
|
FOLLOW,
|
||||||
|
@ -356,16 +359,6 @@ public class ShowAccountActivity extends BaseActivity implements OnPostActionInt
|
||||||
}else{
|
}else{
|
||||||
account_un.setCompoundDrawables( null, null, null, null);
|
account_un.setCompoundDrawables( null, null, null, null);
|
||||||
}
|
}
|
||||||
boolean disableAnimatedEmoji = sharedpreferences.getBoolean(Helper.SET_DISABLE_ANIMATED_EMOJI, false);
|
|
||||||
/*if( !disableAnimatedEmoji) {
|
|
||||||
Executors.newSingleThreadScheduledExecutor().scheduleAtFixedRate(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
account_dn.invalidate();
|
|
||||||
}
|
|
||||||
}, 0, 130, TimeUnit.MILLISECONDS);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
//Peertube account watched by a Mastodon account
|
//Peertube account watched by a Mastodon account
|
||||||
/*if( peertubeAccount && (MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON || MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.PLEROMA)) {
|
/*if( peertubeAccount && (MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON || MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.PLEROMA)) {
|
||||||
account_type.setVisibility(View.VISIBLE);
|
account_type.setVisibility(View.VISIBLE);
|
||||||
|
@ -1060,6 +1053,19 @@ public class ShowAccountActivity extends BaseActivity implements OnPostActionInt
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if( account.getEmojis() != null && account.getEmojis().size() > 0 ){
|
||||||
|
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
|
||||||
|
boolean disableAnimatedEmoji = sharedpreferences.getBoolean(Helper.SET_DISABLE_ANIMATED_EMOJI, false);
|
||||||
|
if( !disableAnimatedEmoji) {
|
||||||
|
scheduledExecutorService = Executors.newSingleThreadScheduledExecutor();
|
||||||
|
scheduledExecutorService.scheduleAtFixedRate(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
account_dn.invalidate();
|
||||||
|
}
|
||||||
|
}, 0, 130, TimeUnit.MILLISECONDS);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showMenu(View account_menu){
|
private void showMenu(View account_menu){
|
||||||
|
@ -1348,6 +1354,16 @@ public class ShowAccountActivity extends BaseActivity implements OnPostActionInt
|
||||||
});
|
});
|
||||||
popup.show();
|
popup.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStop(){
|
||||||
|
super.onStop();
|
||||||
|
if( scheduledExecutorService != null) {
|
||||||
|
scheduledExecutorService.shutdownNow();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPostAction(int statusCode,API.StatusAction statusAction, String targetedId, Error error) {
|
public void onPostAction(int statusCode,API.StatusAction statusAction, String targetedId, Error error) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue