fix_reports
Thomas 2 years ago
parent a866f5524a
commit 575329586f

@ -1,9 +1,9 @@
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<shortcut
android:shortcutId="compose"
android:enabled="true"
android:icon="@drawable/ic_baseline_add_comment_24"
android:shortcutId="compose"
android:shortcutShortLabel="@string/compose_shortcut_short_label1"
tools:targetApi="n_mr1">
<intent

@ -1,9 +1,9 @@
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<shortcut
android:shortcutId="compose"
android:enabled="true"
android:icon="@drawable/ic_baseline_add_comment_24"
android:shortcutId="compose"
android:shortcutShortLabel="@string/compose_shortcut_short_label1"
tools:targetApi="n_mr1">
<intent

@ -82,7 +82,6 @@
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data

File diff suppressed because it is too large Load Diff

@ -248,12 +248,16 @@ public class MastodonHelper {
String targetedUrl = disableGif ? (type == MediaAccountType.AVATAR ? account.avatar_static : account.header_static) : (type == MediaAccountType.AVATAR ? account.avatar : account.header);
if (targetedUrl != null) {
if (disableGif || (!targetedUrl.endsWith(".gif"))) {
Glide.with(activity != null ? activity : context)
.asDrawable()
.load(targetedUrl)
.thumbnail(0.1f)
.placeholder(placeholder)
.into(view);
try {
Glide.with(activity != null ? activity : context)
.asDrawable()
.load(targetedUrl)
.thumbnail(0.1f)
.placeholder(placeholder)
.into(view);
} catch (IllegalArgumentException e) {
e.printStackTrace();
}
} else {
Glide.with(activity != null ? activity : context)
.asGif()

@ -17,9 +17,11 @@ package app.fedilab.android.peertube.activities;
import static app.fedilab.android.BaseMainActivity.currentAccount;
import static app.fedilab.android.BaseMainActivity.currentInstance;
import static app.fedilab.android.BaseMainActivity.currentToken;
import static app.fedilab.android.BaseMainActivity.currentUserID;
import static app.fedilab.android.BaseMainActivity.fetchRecentAccounts;
import static app.fedilab.android.BaseMainActivity.headerMenuOpen;
import static app.fedilab.android.BaseMainActivity.headerOptionInfoClick;
import static app.fedilab.android.BaseMainActivity.mamageNewIntent;
import static app.fedilab.android.BaseMainActivity.manageDrawerMenu;
import static app.fedilab.android.mastodon.helper.Helper.PREF_USER_ID;
import static app.fedilab.android.mastodon.helper.Helper.PREF_USER_INSTANCE;
@ -201,6 +203,15 @@ public class PeertubeMainActivity extends PeertubeBaseMainActivity {
currentToken = sharedpreferences.getString(app.fedilab.android.mastodon.helper.Helper.PREF_USER_TOKEN, null);
}
currentAccount = new Account(PeertubeMainActivity.this).getConnectedAccount();
if (currentAccount == null) {
if (currentUserID == null) {
currentUserID = sharedpreferences.getString(PREF_USER_ID, null);
}
if (currentInstance == null) {
currentInstance = sharedpreferences.getString(PREF_USER_INSTANCE, null);
}
currentAccount = new Account(PeertubeMainActivity.this).getUniqAccount(currentUserID, currentInstance);
}
} catch (DBException e) {
e.printStackTrace();
}
@ -211,7 +222,6 @@ public class PeertubeMainActivity extends PeertubeBaseMainActivity {
finish();
return;
}
//If the attached account is null, the app will fetch remote instance to get up-to-date values
if (currentAccount != null && currentAccount.peertube_account == null) {
try {
@ -221,7 +231,6 @@ public class PeertubeMainActivity extends PeertubeBaseMainActivity {
e.printStackTrace();
}
}
Handler mainHandler = new Handler(Looper.getMainLooper());
Runnable myRunnable = () -> {
headerMainBinding.accountAcc.setText(String.format("%s@%s", currentAccount.peertube_account.getUsername(), currentAccount.instance));
@ -240,6 +249,13 @@ public class PeertubeMainActivity extends PeertubeBaseMainActivity {
headerMenuOpen = !headerMenuOpen;
manageDrawerMenu(PeertubeMainActivity.this, binding.drawerNavView, headerMainBinding);
});
if (Helper.isLoggedIn()) {
binding.navView.inflateMenu(R.menu.bottom_nav_menu_connected_peertube);
refreshToken();
} else {
binding.navView.inflateMenu(R.menu.bottom_nav_menu);
}
};
mainHandler.post(myRunnable);
}).start();
@ -353,13 +369,7 @@ public class PeertubeMainActivity extends PeertubeBaseMainActivity {
setTitleCustom(R.string.title_home);
if (Helper.isLoggedIn()) {
binding.navView.inflateMenu(R.menu.bottom_nav_menu_connected_peertube);
refreshToken();
} else {
binding.navView.inflateMenu(R.menu.bottom_nav_menu);
}
peertubeInformation = new PeertubeInformation();
peertubeInformation.setCategories(new LinkedHashMap<>());
peertubeInformation.setLanguages(new LinkedHashMap<>());
@ -396,8 +406,9 @@ public class PeertubeMainActivity extends PeertubeBaseMainActivity {
getSupportFragmentManager(), android.R.id.content, new FragmentLoginPickInstancePeertube(),
null, null, FragmentLoginPickInstancePeertube.class.getName());
}
mamageNewIntent(PeertubeMainActivity.this, getIntent());
fetchRecentAccounts(PeertubeMainActivity.this, headerMainBinding);
}
public DisplayVideosFragment getSubscriptionFragment() {
@ -656,8 +667,18 @@ public class PeertubeMainActivity extends PeertubeBaseMainActivity {
recreate();
}
}
mamageNewIntent(PeertubeMainActivity.this, intent);
}
/*public static void mamageNewIntent(Activity activity,
Intent intent) {
if (intent == null)
return;
String action = intent.getAction();
if (action != null && action.equalsIgnoreCase("app.fedilab.android.shorcut.compose")) {
CrossActionHelper.doCrossAction(activity, CrossActionHelper.TypeOfCrossAction.COMPOSE, null, null);
}
}*/
@SuppressLint("ApplySharedPref")
private void showRadioButtonDialog() {

@ -1,10 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="?attr/colorControlNormal"
android:fillColor="@android:color/black"
android:pathData="M21.99,4c0,-1.1 -0.89,-2 -1.99,-2H4c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h14l4,4 -0.01,-18zM17,11h-4v4h-2v-4H7V9h4V5h2v4h4v2z" />
</vector>

@ -1,9 +1,9 @@
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<shortcut
android:shortcutId="compose"
android:enabled="true"
android:icon="@drawable/ic_baseline_add_comment_24"
android:shortcutId="compose"
android:shortcutShortLabel="@string/compose_shortcut_short_label1"
tools:targetApi="n_mr1">
<intent

Loading…
Cancel
Save