Fix follow instance issue from peertube + picker for theme
This commit is contained in:
parent
8e43786def
commit
204e2fc69d
|
@ -325,10 +325,18 @@ public class ShowAccountActivity extends BaseActivity implements OnPostActionInt
|
|||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
if( !peertubeAccount)
|
||||
new HttpsConnection(ShowAccountActivity.this).get("https://" + finalInstanceName + "/api/v1/timelines/public?local=true", 10, null, null);
|
||||
if( !peertubeAccount) {
|
||||
//Here we can't know if the instance is a Mastodon one or not
|
||||
try { //Testing Mastodon
|
||||
new HttpsConnection(ShowAccountActivity.this).get("https://" + finalInstanceName + "/api/v1/timelines/public?local=true", 10, null, null);
|
||||
}catch (Exception ignored){
|
||||
new HttpsConnection(ShowAccountActivity.this).get("https://" + finalInstanceName + "/api/v1/videos/", 10, null, null);
|
||||
peertubeAccount = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
new HttpsConnection(ShowAccountActivity.this).get("https://" + finalInstanceName + "/api/v1/videos/", 10, null, null);
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
final SQLiteDatabase db = Sqlite.getInstance(getApplicationContext(), Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
|
||||
|
|
|
@ -87,6 +87,7 @@ import android.util.Log;
|
|||
import android.util.Patterns;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.SubMenu;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
@ -1416,6 +1417,16 @@ public class Helper {
|
|||
if( actionButton != null) {
|
||||
actionButton.setFocusableInTouchMode(true);
|
||||
actionButton.setFocusable(true);
|
||||
actionButton.setOnTouchListener(new View.OnTouchListener() {
|
||||
@Override
|
||||
public boolean onTouch(View v, MotionEvent event) {
|
||||
if(actionMenu.isOpen())
|
||||
actionMenu.close(true);
|
||||
else
|
||||
actionMenu.open(true);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
actionButton.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
||||
@Override
|
||||
public void onFocusChange(View v, boolean hasFocus) {
|
||||
|
|
Loading…
Reference in New Issue